Browse Source

- Added blurEdge and hoverEdge events.

flowchartTest
Alex de Mulder 8 years ago
parent
commit
c28051b1a8
4 changed files with 19706 additions and 19685 deletions
  1. +1
    -0
      HISTORY.md
  2. +19686
    -19680
      dist/vis.js
  3. +10
    -0
      docs/network/index.html
  4. +9
    -5
      lib/network/modules/SelectionHandler.js

+ 1
- 0
HISTORY.md View File

@ -25,6 +25,7 @@ http://visjs.org
- Fixed #1036, bug in lockedRedraw. Thanks @vges!
- Added getDataset to all manipulation functions. Thanks @ericvandever!
- Fixed #1039, icon now returns correct distance to border
- Added blurEdge and hoverEdge events.
### Graph2d

+ 19686
- 19680
dist/vis.js
File diff suppressed because it is too large
View File


+ 10
- 0
docs/network/index.html View File

@ -1308,6 +1308,16 @@ var options = {
<td><code>{node: nodeId}</code></td>
<td>Fired interaction:{hover:true} and the mouse moved away from a node it was hovering over before.</td>
</tr>
<tr>
<td>hoverEdge</td>
<td><code>{edge: edgeId}</code></td>
<td>Fired interaction:{hover:true} and the mouse hovers over an edge.</td>
</tr>
<tr>
<td>blurEdge</td>
<td><code>{edge: edgeId}</code></td>
<td>Fired interaction:{hover:true} and the mouse moved away from an edge it was hovering over before.</td>
</tr>
<tr>
<td>zoom</td>
<td><code>{direction:'+'/'-', scale: Number}</code></td>

+ 9
- 5
lib/network/modules/SelectionHandler.js View File

@ -471,10 +471,6 @@ class SelectionHandler {
}
/**
* This is called when someone clicks on a node. either select or deselect it.
* If there is an existing selection and we don't want to append to it, clear the existing selection
@ -485,7 +481,12 @@ class SelectionHandler {
blurObject(object) {
if (object.hover === true) {
object.hover = false;
this.body.emitter.emit("blurNode",{node:object.id});
if (object instanceof Node) {
this.body.emitter.emit("blurNode", {node: object.id});
}
else {
this.body.emitter.emit("blurEdge", {edge: object.id});
}
}
}
@ -529,6 +530,9 @@ class SelectionHandler {
if (object instanceof Node) {
this.body.emitter.emit("hoverNode", {node: object.id});
}
else {
this.body.emitter.emit("hoverEdge", {edge: object.id});
}
}
if (object instanceof Node && this.options.hoverConnectedEdges === true) {
this._hoverConnectedEdges(object);

Loading…
Cancel
Save