vis.js - VisJS Stabilization -


i have visjs chart , want "fit" add content it. have 200 nodes , 2000 edges.

i have defined these options, note have said "fit:true" in stabilization options.

however, if stabilization iterations less 100, chart not fit @ all.

i want keep number of stabilizations low chart loads - want keep fitted.

i not able chart fitted till call fit function many times over, , assuming there should simple way this. can please let me know.

var options = {     nodes: {         shape: 'dot',         scaling: {             label: {                 min: 20,                 max: 40             },                      }     },      edges: {         smooth: {             enabled: true,             type: "dynamic",         //   roundness: 0.5         },},      interaction: {          multiselect: false,         navigationbuttons: true,         selectable: true,         selectconnectededges: true,         tooltipdelay: 100,         zoomview: true     },     physics: {         stabilization: {             enabled: true,             iterations: 180, // maximum number of iteration stabilize             updateinterval: 10,             onlydynamicedges: false,             fit: true         },     }  }; 

i'm developer of network module of vis, seems found bug :).

the network should fit after stabilization iterations have been completed. in stabilization process asynchronous should listen stabilizationiterationsdone event , call fit function there quick fix.

you mention want keep network fitted, if mean want keep fitting in each render iteration, suppose best way call fit function in initredraw event. may little expensive though.

we try collect of these questions, bug reports , feature requests on our github page. if encounter else or have question, please ask there.

http://www.github.com/almende/vis

cheers

edit answer questions: turns out in v4,3 there bug doesn't clean support nodes of dynamic static edges, causing fit not in case. fixed on next release.

as click events of navigation buttons you'll have bind them yourself. basic idea: document.getelementbyid on container. children , iterate on them. way dom elements buttons. addeventlistener add listener them , use trigger click.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -