Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enabled Syntax Highlighting #29

Open
wants to merge 2 commits into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 23 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,34 @@ The library you need is `graph-diagram.js`. It depends on D3, so you'll need tha

Markup looks like this, enclosed in a `<figure>` tag:

<figure class="graph-diagram">
<ul class="graph-diagram-markup">
<li class="node" data-node-id="0" data-x="0" data-y="0">
<span class="caption">A</span>
</li>
<li class="node" data-node-id="1" data-x="50" data-y="0">
<span class="caption">B</span>
</li>
<li class="relationship" data-from="0" data-to="1">
<span class="type">R</span>
</li>
</ul>
</figure>
```html
<figure class="graph-diagram">
<ul class="graph-diagram-markup">
<li class="node" data-node-id="0" data-x="0" data-y="0">
<span class="caption">A</span>
</li>
<li class="node" data-node-id="1" data-x="50" data-y="0">
<span class="caption">B</span>
</li>
<li class="relationship" data-from="0" data-to="1">
<span class="type">R</span>
</li>
</ul>
</figure>
```


See [tests.html](http://www.apcjones.com/arrows/tests.html) for examples of what you can do
with markup and styling.

At the end of your page, or in a suitable event handler, call a bit of framework code:

<script type="text/javascript">
d3.selectAll( "figure.graph-diagram" )
.call( gd.figure() );
</script>
```html
<script type="text/javascript">
d3.selectAll( "figure.graph-diagram" )
.call( gd.figure() );
</script>
```

There's also a complete working example in [example.html](http://www.apcjones.com/arrows/example.html).

Expand All @@ -49,4 +54,4 @@ This whole repository is hosted by GitHub Pages, so you'll find the editor hoste

Yes, lots. Consider the current version experimental at best.
There hasn't been any work on browser compatibility,
so I'd be surprised if it works properly outside WebKit.
so I'd be surprised if it works properly outside WebKit.