diff options
| author | Alon Levy <alon@pobox.com> | 2014-11-11 19:51:29 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-11-11 19:54:00 +0200 |
| commit | 57f8d3a8af3461c63a6e6b71cbd330b4a6905882 (patch) | |
| tree | f64f30f1265061b5a8617521b894d670a7059fd1 /scripts/model/graph.js | |
| parent | 2235488d90b7b2537d804307835cf2c1881d4100 (diff) | |
add ghostlink for easier edge selection (Fixes #131)
This changes our current svg. We already had a <g id="link-group">
and under it <path class="link graph"> elements (class changes for
selection).
Now we have <g class="link graph"> elements containing two paths:
one for display, one for selection.
the display has stroke-width of 2 (defined in res/css/style.css) and the
selection has stroke-width of 5 and stroke not defined to make it
invisible plus a higher z-index to catch the click.
Diffstat (limited to 'scripts/model/graph.js')
| -rw-r--r-- | scripts/model/graph.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/model/graph.js b/scripts/model/graph.js index b41c6bb6..33167552 100644 --- a/scripts/model/graph.js +++ b/scripts/model/graph.js @@ -273,12 +273,13 @@ function Graph(el) { return; } if (!found) { - var link = { + var id = id_generator(), + link = { source: sourceNode, target: targetNode, name: name, state: state, - id: id_generator(), + id: id, }; links.push(link); signal.signal(consts.APPLIED_GRAPH_DIFF, [{links: {add: [link]}}]); |
