Browse Source

added configChange event

flowchartTest
Alex de Mulder 9 years ago
parent
commit
f7d1b46753
4 changed files with 22 additions and 0 deletions
  1. +1
    -0
      HISTORY.md
  2. +5
    -0
      dist/vis.js
  3. +11
    -0
      docs/network/index.html
  4. +5
    -0
      lib/shared/Configurator.js

+ 1
- 0
HISTORY.md View File

@ -14,6 +14,7 @@ http://visjs.org
- Added shapeProperties, thanks @zukomgwili! - Added shapeProperties, thanks @zukomgwili!
- Fixed missing edges during clustering. - Fixed missing edges during clustering.
- Fixed missing refresh of node data when changing hierarchical layout on the fly. - Fixed missing refresh of node data when changing hierarchical layout on the fly.
- Added configChange event.
### Graph3d ### Graph3d

+ 5
- 0
dist/vis.js View File

@ -21696,6 +21696,11 @@ return /******/ (function(modules) { // webpackBootstrap
*/ */
value: function _update(value, path) { value: function _update(value, path) {
var options = this._constructOptions(value, path); var options = this._constructOptions(value, path);
if (this.parent.body && this.parent.body.emitter && this.parent.body.emitter.emit) {
this.parent.body.emitter.emit('configChange', options);
}
this.parent.setOptions(options); this.parent.setOptions(options);
} }
}, { }, {

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

@ -1398,6 +1398,17 @@ var options = {
<tr><td id="event_animationFinished">animationFinished</td> <tr><td id="event_animationFinished">animationFinished</td>
<td>none</td> <td>none</td>
<td>Fired when an animation is finished.</td> <td>Fired when an animation is finished.</td>
</tr>
<tr class="subHeader">
<td colspan="3">Event triggered by the configuration module.</td>
</tr>
<tr><td id="event_configChange">configChange</td>
<td>Object</td>
<td>Fired when a user changes any option in the configurator. The options object can be used with the setOptions method or stringified using JSON.stringify().
You do not have to manually put the options into the network: this is done automatically. You can use the event
to store user options in the database.
</td>
</tr>
</table> </table>
</div> </div>

+ 5
- 0
lib/shared/Configurator.js View File

@ -572,6 +572,11 @@ class Configurator {
*/ */
_update(value, path) { _update(value, path) {
let options = this._constructOptions(value,path); let options = this._constructOptions(value,path);
if (this.parent.body && this.parent.body.emitter && this.parent.body.emitter.emit) {
this.parent.body.emitter.emit("configChange", options);
}
this.parent.setOptions(options); this.parent.setOptions(options);
} }

Loading…
Cancel
Save