mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-13 08:02:43 +02:00
23cdf440ab
58f0da39 Released v4.5.0 c507a59 made all search go buttons a live search instead of submit b377194 fixed hover and blur events for edges. f7d1b46 added configChange event 4ef684a Fixed #1087, updated history 5c411a9 polising the network docs a little 5f46591 unfolded tabs 3f3509f Merge remote-tracking branch 'origin/develop' into develop b0ca320 bit more hacking to make search blazingly fast :) dfd9114 Merge pull request #1091 from ChenMachluf/develop e1f7c1a remove subgroup from subgroups list if there is no more items in the subgroup. ba4f282 Merge remote-tracking branch 'origin/develop' into develop 2ce1f12 Fixed #1076: hiding remainder grid line at the end of a month a85d046 added live update for search 38cba4c Updated history afe0305 Merge pull request #1082 from hansmaulwurf23/zoom_key d881052 added zoomKey option to Graph2d, added missing docs adb5bce fixed missing validation of available zoomKey option values c0f0ab9 Merge pull request #1084 from felixhayashi/develop be603b01 yay! new search for visjs.org 5d5f589 Merge remote-tracking branch 'origin/develop' into develop 1bc9ea4 fixed clustering bug #1083 1a3fa5b typo 11c820a added zoomKey to apply zooming only when a specific key is down b175068 Fixed #1076: Fixed possible overlap of minor labels text on the TimeAxis 25706fb Updated history 58986aa Merged #996 89660a3 Added missing method getEventProperties in Core 20af47e Fixed #239: Do not zoom/move the window when the mouse is on the left panel with group labels 5f2e3c1 Merge remote-tracking branch 'origin/develop' into develop 4fd843e Fixed #1033: Moved item data not updated in DataSet when using an asynchronous `onMove` handler 8d23446 rebuilt and updated git ignore 6cf71b3 Merge pull request #1072 from zukomgwili/develop 27a875a Corrected the shapeProperties.borderDashes property type description 8543123 Fixed #1071: HTML contents of a group not cleared when the contents is updated 77df99c Fixed #1001: First element of group style being cut faddd15 Updated history 57be317 Merge pull request #1004 from ozydingo/develop 6c502fb Added a shapeProperties object allowing configuration of shapes. 7053fda Merge pull request #1073 from sc8696/master c2b00d0 Added feature that allows the border for a circularImage shape to be dashed 789c591 Update Network.js 53446b4 Merge pull request #1069 from Rikkitp/develop ce7daf2 Udpated groupsPerformance.html 3ab17e2 Fixed node resizing on dragging. 0bbeb93 properly fixed the _lockedRedraw method dad2453 updated to 4.4.1-SNAPSHOT cae9d43 Release 4.4 113fc47 preperations for v4.4 release 296a457 fixed clustering issue #1050 34d8534 Merge pull request #1059 from felixhayashi/contrib/breadcrumbs fe9086b added breadcrumbs to all pages 23b8dfb Merge pull request #1045 from bliksemlabs/develop 76b27b5 Merge pull request #1049 from ChenMachluf/develop ec4798b Merge pull request #1046 from Tooa/improve-scaling-doc 947b2aa Remove item from subgroups in Group remove method 57237ac * Improved documentation for node and edge scaling properties. df3e876 Add the missing group reference identification to exception. ace45e6 - Added getOptionsFromConfigurator method. 78c5f38 - Added labelHighlightBold option to edges and nodes. c28051b - Added blurEdge and hoverEdge events. 1a3f63f fixed vertical dragging issue from hammer (which was found in network) in the timeline 4ad5ffa updated readme 6553b39 updated history 47d5282 Fixed #1039, icon now returns correct distance to border 103b5b1 Fixed #1044, gave navigation buttons their own handler for release. d49c27d rebuilt, fixed small bug in points 560c0f4 rebuilt, updated ignore, updated history f2092fd Merge pull request #1014 from ericvandever/develop 9d3157a Merge pull request #1030 from mschallar/mschallar/develop 11b22d3 - Fixed #1036, bug in lockedRedraw. Thanks @vges! 51e2135 Fixed multiple paths to examples 35e8e15 Updated graph2d docs for drawPoints & drawPoints.onRender 06b78a0 Updated example 19_labels.html f39c246 Updated Points.draw method to support onRender 71f875f added onRender as a drawPoints property and as a function on the object itself d51be3b Delegate the onRender function to the correct property f732674 - Fixed bug where 0 axis was always in the automatically fitted range. 0cf8c4a - Fixed updating bounding box of nodes without drawing. dc77069 added getDataSet to network manipulation edge add and edit functions to match existing remove and node equivalents f0c18f7 exposed keycharm as vis.keycharm 378c2e4 removed clear() from graph2d docs 94d63c2 updated history 04aea9e Made graph2d robust against strings for y values. b75ccba Fixed static smooth edges not being handled correctly in all angles 729ee12 Only set backgroundColor if specified in setOptions 6cf5191 added templating for groups e7bfa9c - Fixed #987 proper cleaning of support nodes. af39649 - Improved handling of empty image field. f699061 - Fixed #974 connecting static smooth and straight edges. also bug introduced in the layout 3d09e62 - No longer start stabilization with an empty node set. 4d8ade5 Fixed #953 - Added zoom events from keyboard and navigation buttons. 3507d26 Fixed #949 delete callbacks with null argument not showing toolbar afterwards. f7eee47 fixed accidental redrawing during stabilization. Fixed infinite recursion when fixing node without coordinates e23e235 fixed hammerjs direction issue 302f2f6 placed dragEnd event after restoration of fixed state of node aeba17b Fixed default value of option backgroundColor 7b31382 Ordered the options alphabetically 01a351f Fixed #970: Implemented options `dataColor`, `axisColor`, and `gridColor`. bf49a30 Bumped version number to 4.3.1-SNAPSHOT dae3c3d Released version 4.3.0 b750d2e Added css class `vis-editable`, created an example demonstrating individually editable items (see #980) 07fd970 Merge pull request #980 from danbertolini/develop 7c22bd3 Configurator is now lazy loaded in Timeline, Graph2d, and Network (see #964) 96afb72 Fixed #964: `Timeline`, `Graph2d`, and `Network` not working on IE9 79e35e3 Throw an error from abstract method `Core.prototype.getDataRange` (see #966) 2f23c2f Merge remote-tracking branch 'upstream/develop' into develop f43e935 Issues #275, #363 - individual Timeline items editable or readonly dd575ad Removed redundant code from `Core.prototype.getDataRange` (see #966) c5c221d Merge pull request #966 from mschallar/master 8fe6408 fixed #974, requesting a redraw on update in case of physics being disabled. d894d0e changing the properties from getDataRange d1e01bc returning meaningful values in getDataRange 38cdcf2 accessing the correct properties in dataRange ecb525c Improved locales validation again 8ab51a7 proper fix for validator locales 4178e4c Fixed #950: option `locales` broken in `Timeline`, `Graph2d`, and `Network` 4ddf0fe Merge remote-tracking branch 'origin/develop' into develop eef6931 Fixed #942: bug when data is empty 3c34a7d fixed dragStart, dragging and dragEnd events when nodes are selected but the viewport is dragged e2b3d2d added --SNAPSHOT to dev 0242a35 release 4.2.0 9d8ac59 rebuilt 356d5b2 Merge remote-tracking branch 'origin/develop' into develop 0987a84 - Fixed #927, dragStart event didnt contain node that was being dragged 805efd3 Fixed #925: Event `timechanged` did not fire when mouse has been moved outside the timeline. 7a41733 Fixed #923: Added a property `event` to the properties emitted with the `select` event 42596ab added physics:enabled field. Updated docs 1302a6b Fixed bug where the network could flicker when the pixelRatio is not integer. 68d432f updated build 760c3e9 changed autoResize to only draw when change is detected. 40141de added from and to to docs, fixed hoverConnectedEdges in docs a58f4e2 Added axis orientation option `'none'` 7d5ec02 Removed some redundant css files from the docs 6530614 Merge pull request #906 from btmills/master 92bf2c3 Fix broken links to docs assets 856348d Ignore lib folder in Bower package 263f21b Merge remote-tracking branch 'origin/develop' into develop 7ca06bc Removed left over console.log statement a2fd26e fixed small bug 801a71d Merge remote-tracking branch 'origin/develop' into develop 3e9cceb Fixed #897: Timeline option `{snap: null}` did give a validation error f17401c expanded docs, added buttons, fixed titles 4f17eb4 expanded docs ba5cf07 Fixed #893, #911: the `clickToUse` option of Network, Graph2d, and Network was blocking click events in the web page. 85765f9 parseFloat of edges e96d228 Added releaseFunction to openCluster. 9111c23 Fixed #908, unselecting nodes and edges now only when clicking in void. f1f6989 make sure an stabilized event is always fired atleast once. ad13323 updated history e44bc8f reverted example ab112d8 added stochastic option check to the testing. Fixed few bugs 633e689 updated docs 5ab8195 - Fixed dataView support for storePositions 5b1aecf - Fixed dataView support for storePositions a1d4b27 - fixed minor bugs 8732bee - Fixed #904, correctly parsing global font options now. d1b0c59 fixed #899, self referencing edges do not use orientation other than horizontal 0150255 - Fixed few functions including storePositions(). - Added beginnings of unit testing for network. 629e596 - Improved robustness against people molesting the Function.prototype.bind() 23c6db6 Merge remote-tracking branch 'origin/develop' into develop 34be08f - Improved robustness against people molesting the Function.prototype.bind() 80f7ac7 Updated /dist fef525b Merge remote-tracking branch 'origin/develop' into develop cedae98 Updated /dist ba5a6d2 Improved function `fit()` to take into account the actual width of items (see #847) 7771406 Reorganized `Timeline.fit()` a bit bc1d174 updated history ee24fdb Merge remote-tracking branch 'origin/develop' into develop 1cf66f6 fixed #892, added case for any format ac0563e Fit working (still needs simplification) 3970ccc Added a usage example for `getEventPropeties(event)` (see #901) 654cec3 Merge branch 'develop' into develop_fit 7d8f0a6 Merge remote-tracking branch 'origin/develop' into develop 14a5752 Replaced spdx license expression with array with identifiers for bower (see #876) 1648604 Halfway implementing improved Timeline.fit() c3ac96d Merge branch 'develop' into develop_fit d27ce7f Merge pull request #890 from Gillingham/patch-1 3e18569 Tell browserify to apply babelify transform d6a2fab Bumped version number to 4.1.1-SNAPSHOT 62a844d Released version 4.1.0 bbfe7d3 Halfway improving Timeline.fit() f70982d Renamed example 6b0a55b Deleted old docs 6ef9d20 Fixed two links a1b987b Replaced underscores in example names with camel case 7060bea Merge remote-tracking branch 'origin/develop' into develop 07c7970 Renamed an example a2de04b rebuilt, updated history facdc0b Merge remote-tracking branch 'origin/develop' into develop 50e916e removed random from physics. fixed setting hidden and physics dynamically, fixed manipulation system bug 37f93c8 Disable `yAxisOrientation` in configurator. (isn't stable) 0e915c1 Removed a broken link 1c8e8db Moved the code blocks describing event properties to the 3rd column e987f9c Put docs on importing from Gephi and DOT language under one tab 626d4b9 Fixed #877: Added support for metaKey to select multiple items. ebfb7f5 Removed accidentally committed tooltips example cb4c33a Removed promt and confirm in example with fancy looking (non-blocking) prompt/confirm 786765c Merge remote-tracking branch 'origin/develop' into develop 09bc7d0 Call event.stopPropagation() before adding or removing items (see #577) ab04dfd Merge remote-tracking branch 'origin/develop' into develop 1a741c2 code cleanup fab3215 made deselect and select nodes and edges fire more consistently 375c157 Merge remote-tracking branch 'origin/develop' into develop c3d5452 Changed license information to a spdx composite license expression 4d81920 Merge remote-tracking branch 'origin/develop' into develop e8bef2f - Fixed #884, selectNode event. 1a8a738 Added license information to package.json too (see #876) da909a8 Fixed #876: added license information to bower.json 883f924 Fixed browserify command in custom bundle example 3 4c8416d Merge pull request #880 from yetanalytics/develop 2c7473e fixed typo in clusterByHubsize 2fd1f4f - Fixed hoverNode and blurNode events and added them to the docs. 043f198 fixed getNodeAt and getEdgeAt functions 7e05e40 removed theta from docs cf36140 removed log, rebuilt db5782c - Fixed #861, brokenImage only working for one node if nodes have the same image. 9f74b3f removed log, rebuilt 5dffc93 Merge remote-tracking branch 'origin/develop' into develop 09d7d4b - Fixed bug with the moveTo and getViewPosition methods. d77275e Fixed #869: add className with id to custom time bars 520971d Merge remote-tracking branch 'origin/develop' into develop 03d0e25 Fixed #872: error about deprecated function `unsubscribe` ba6ba69 tweaked function naming 229c22b Removed depricated dynamic entree, allow any smooth curve style for hierarchical layout. 62a8f60 #870, added multiselect to the docs 9c7eba9 fixed little bug in configurator 719a16a fixed little bug in configurator b2eaf58 - Fixed clustering bug e294594 - Fixed click to use 67bda4f - Fixed #866, manipulation can now be set to false without crashing. aa12cea Fixed #860, edit node mode now works as it should. 87277e5 fixed #859. images now resize again when they are loaded. c2b07f0 fixed #858 547fb05 fixed dynamic edges not correctly handling non-existent nodes. a69269c revert example 0219c43 changed popup css to pass all mouse events. All pageX and pageY changed to clientX and clientY because the correction is done with getBoundingClientRect b6085eb Merge pull request #856 from killerDJO/develop a53bcd8 fixed colors for selected and hover states 54f99f7 fixed little bug in layoutengine and it's brother d61dd8d fixed little bug in layoutengine b6cd712 Bumped version number to 4.0.1-SNAPSHOT d6216bb Removed menu item Documentation 43b2fb5 Released version 4.0.0 c139062 Merge remote-tracking branch 'origin/v4' into v4 a3211bf Fixed description about `babel` in history 112c975 updated docs, examples, history dcc2eaf fixed path 3f6b206 fixed bug in circular images, moved examples a2236b2 Merge remote-tracking branch 'origin/v4' into v4 7099dd1 renamed getEdges to getConnectedEdges, made getConnectedNodes also work for edges c5badc2 Reorganized the Timeline examples f685d62 Renamed folder `rest` to `other` b3fe008 Fixed a bug in DataView still using the deprecated `unsubscribe` 970204b Removed index.html files from examples 1d2e92f Merge remote-tracking branch 'origin/v4' into v4 041c2c0 updated css d404798 fixed alot of bugs, expanded configurator, added more examples, updated docs, updated update interval 50f6dbc fixed bug in clustering! woohoo! added event on off once to docs. more examples 1d47ca4 Added shortcut key ctrl+enter b8502f2 fixed cluster bug ea66036 Merge remote-tracking branch 'origin/v4' into v4 ad2d70e fixed numerous clustering bugs, added more examples, numerous other bug fixes a1d9310 Some minor fixed in dotparser 23b9a91 Implemented attribute mapping for DOT language attributes f0bc4b1 Some tweaks of the DOT playground 0f35f54 Merge remote-tracking branch 'origin/v4' into v4 7ec9c91 Some tweaks of the DOT playground d829737 Reworked the dot language playground and merged with the graphviz gallery 29e0cdd Merge remote-tracking branch 'origin/v4' into v4 0b0785f more examples, more tweaks, small expansion of the validator to check locally for matches. c817962 Merge remote-tracking branch 'origin/v4' into v4 69f2e51 Added docs/data/index.html 40c11a9 more buxfixes n doc updates and default value tweaks and example tweaks 7c6979c Merge remote-tracking branch 'origin/v4' into v4 cbc4c8d fixed bugs, set all groups to reload if globally changed f51c364 DataSet and DataView now have new styling bca61e3 Fixed losing selection when changing configuration option `type` on the fly ab4e93c Minor tweak 2c8c26f Deprecated functions `DataSet.subscribe` and `DataSet.unsubscribe` c131c08 Refactored table columns "mid" 146ba57 Documented `configure` for Timeline and Graph2d. Some minor fixes in the options. 1e03f99 Merge remote-tracking branch 'origin/v4' into v4 176742b Implemented configurator for Graph2d. Fixed Configurator displaying nothing when `filter: true`. 9921fe7 worked with examples 21b76a5 Merge remote-tracking branch 'origin/v4' into v4 350f050 Doc styling tweaks df03211 rebuilt f22a096 Merge remote-tracking branch 'origin/v4' into v4 c388397 numerous bugfixes, partial progress with examples 4b47dc5 Created a folder docs/old where we will move all old docs (will remove this folder when docs are done) 7f01183 Fixed #831: items losing selection when their type changed. c5d46c1 Prefixed css classes of the TimeAxis grid (Fixed #836) f26c4ea Fixed #841: messing up clientY and pageY in event handling 14ed1bb bugfixes, added examples 0d32566 bugfixes, start of reorganisation of examples d4e7130 enabled bar style in legend 67cf954 enabled bar style in legend cb4e58e removed log e5d2692 made style work with barcharts ccbdd46 fixed bounding box bug, added function filter to configuration system 7aecbec added new solver to docs cc3e12a added another solver based on barnesHut but with some of the forceAtlas2 equations b9ff0eb added validator to graph2d, maybe also put it in groups? 20ef9a1 made new graph2d docs, fixed graph2d examples, updated graph2d options 41d51c2 added fields to docs 14c4a10 added dot and gephi parser to docs, need to include examples in the docs everywhere. Added working example code at the top of the docs and link to example 1 d9a6b41 Output error.toString() in gulpfile 88ab094 Moved validator and ConfigurationSystem to ./lib/shared, and continue with options on error 5b12f55 fixed validator (for real now) b9796e6 rebuilt b01e3d2 rebuilt 672bbd8 Merge remote-tracking branch 'origin/v4' into v4 f81b41c fixed docs (added tabs) fixed gephiparser, fixed edges, labels on selfreferenced edges, fixed dotlanguage 5b76f06 Merge remote-tracking branch 'origin/v4' into v4 d96bbe5 Some fixes in the validator fd13122 Merge remote-tracking branch 'origin/v4' into v4 85350c0 restructured networks docs again, collapsible methods f79449e Implemented option validator for Timeline f30a3a4 Integrated an option configurator 36a0822 collapsible methods, experiment... b075115 changed docs, collected methods and events d4c20ed Replaced `|` with `or` 79127d4 Added text input to ConfigurationSystem, added support for moment data type 5c0f6da rebuilt! af46198 Merge remote-tracking branch 'origin/v4' into v4 5b7a90f added multiselect, reworked options ce29f50 Implemented option `multiselect`, which is false by default a75b8e7 Fixed #716: Height of graph `2px` too large when configuring a fixed height. 5b7f264 Fixed consistently falling back to "bottom" orientation in case of invalid values 9a793f7 Fixed styling of Graph2d lines/points 6ed263b Merge remote-tracking branch 'origin/v4' into v4 dfb25f9 Collapsable sub-options 5b3f19a fixed viewable area check as per #812 f07d21f Halfway refactoring the Timeline docs b9b1974 Removed "example*" name prefix from the graph3d examples 3d4213f Added an example about orientation of axis and items, and fixed a bug in orientation of items 8effbd7 Use DataSet in example 01 9105832 Clean up test code from example 01 0c97030 Reviewed/updated all timeline examples 4fc9ffb Removed redundant file layout.html cc574a4 Fixed transparency of background items b8206c5 Removed example 21 and renamed 31 4f4fa3f Merge remote-tracking branch 'origin/v4' into v4 7e0961a - Dropped support for Google DataTable. - Dropped support for appending data returned by `DataSet.get()` to an existing Array or DataTable. - Fixed a `window` issue in uuid.js. bbb317b Merge remote-tracking branch 'origin/v4' into v4 04fb1ae added a setSize to the redraw function aee5c1e Renamed option `animate` to `animation`, and changed it to be either a boolean or an object `{duration: number, easingFunction: string}` 7f8bedf Added convenience method `setData({groups: groups, items: items})` c28e4b9 Deprecated event `finishedRedraw` as it's redundant 97de69a Fixed broken method `getEventProperties` 2929faf Deprecated option `showCustomTime`. Use method `addCustomTime()` instead. df4c200 Fixed vertical scroll shadows becoming visible when dragging an item c9a1a88 fixed all trello issues and added snazzy option lookup to validator 54c9efb Updated examples 34-39 d01112f Updated examples 32, 33 f676845 Updated some more examples e02e8e9 reverted emit 0d03373 Merge remote-tracking branch 'origin/v4' into v4 b413dd5 render issue with hierarchical layout b144a0e Some configuration fixes in example 27 a60db8c Merge remote-tracking branch 'origin/v4' into v4 6aebfcf Some updates in example 29 30 315ad7c Merge remote-tracking branch 'origin/v4' into v4 a03d926 fix manipulation bar hiding 233b5f2 Merge remote-tracking branch 'origin/v4' into v4 415fb2f Moved the worldcup data into a separate file bdf1132 fixed buttons e6480b1 Merge remote-tracking branch 'origin/v4' into v4 034d63c Updated exampled up to 24 e4b64da reverted fix, avoidance is better 3dc963c disable the 'deleting' of fixed option de5a9a7 fixed physics bug 8e91192 Merge remote-tracking branch 'origin/v4' into v4 e0a59ba fixed dashes fd29906 Merge remote-tracking branch 'origin/v4' into v4 ad088cd Updated examples 1 to 13 0d9e6b0 added docs for null and undefined. Reduced levenshtein distance threshold from 10 to 8 in validator 357853e allowed deleting values with null and undefined. Fix for global variables, fix for edge color strings 050e2da fix for sad labelless nodes 415a27a updated docs, fixed setsize message 4bc0d62 rebuilt eded5ec Merge remote-tracking branch 'origin/v4' into v4 676250f made config system fully independent of the network. b523d7e Fixed background styling issue with Graph2d 7261294 Merge remote-tracking branch 'origin/v4' into v4 7012eeb Removed option clear 0ed1bc1 new build 7d3315b Merge remote-tracking branch 'origin/v4' into v4 4d57a6d unified options with timeline, updated docs and configurator 61108f3 Renamed class `.vis-item-frame` to `.vis-item-overflow` cf8c299 Removed the option `padding` for Timeline, is now redundant (can be done purely with css now) 491e40c Merge remote-tracking branch 'origin/v4' into v4 d4ba655 Changed the 'auto' alignment of range item contents such that it always displays the left side of the conents (see #785) 7fc617f reformatted options for graph2d dataAxis, docs to follow. New docs have statically linked menu bars, switched to uuid library for uuid v4 rfc4122 UUIDs (#432) 8d48a9d fixed stacking of positive and negative bars. #616 c6171b3 rebuilt af448ca Merge remote-tracking branch 'origin/v4' into v4 99ed2be fixed align zero by rewriting that part. #728 1d3ec56 Added extra div to background items too 0585fc4 Fixed delete button not being visible 91f053c minor style fixes b825e3f unified the docs a bit 85931ba gave docs googleanalytics.js 6b770a3 fixed destroy! 2ea3b2e created shorthand for all methods 6f5bc44 docs, bugfixes efd876d debugging a bit fbf9439 moved options to network bf274fd added a pretty amazing option checker to network :) 3fbab7c updated docs partially d4d928d finalized all methods and adde3d more docs 9ecefa9 updated config ee33873 added folding to manipulation docs 7e30d2f added manipulation documentation and numerous bugfixes 5734676 added groups docs 7919d58 added clustering documentation, updated clustering to 4.0, bug fixing 0a53a4e very advanced table collapse technology introduced. 2256516 fixed bugs in hierarchical layout. Fixed bugs in configuration, added wrapper to configuration divs,, made label optional for nodes, if no label, id will be shown. Support for value arrays in deepextend. 5287b3d Merge remote-tracking branch 'origin/v4' into v4 a150b7c fixed a number of bugs in manipulation 08b6f7b Fixed vertical scroll not working in Timeline and Graph2d c48a48a added docs to branch 3d4983d Merge remote-tracking branch 'origin/v4' into v4 9218044 consistency in physics c9da1b1 Fixed clickToUse 69dbe80 Merge remote-tracking branch 'origin/v4' into v4 7ec6715 Upgraded dependencies to the latest version (including a fix in propagating-hammerjs) d600bf7 implemented error notification when not giving an unicode for the icon 2d8604b Some fixes in Timeline after merging develop 33a76d8 Merge branch 'develop' into v4 af1579b Updated test file f88863e changed the dashes options, fixed event bugs in drag ec5f644 Merge remote-tracking branch 'origin/v4' into v4 867f033 changed the dashes options, fixed bug 4eff172 Merge remote-tracking branch 'origin/v4' into v4 28f8367 Fixed the touch and release events being fired twice each time. Fixed a bug with dragging in the InteractionHandler 68b75d5 fixed css 28e4882 tweaked options, simplified edge:color:inherit option bc3e4a2 Fixed #782: Contents of items created from a template being unnecessary recreated on click, causing mouse events to get lost. 41cdb2f Merge remote-tracking branch 'origin/v4' into v4 670c8a0 Fixed issues with preventDefault and with clicking achors/buttons in items on mobile devices 6d8974b Merge remote-tracking branch 'origin/v4' into v4 06ce63e removed duplicate code cc12969 bug fixes, methods added and options changed to clean up code and to adhere to docs 48278b9 Merge remote-tracking branch 'origin/v4' into v4 3ddd43a Fixed outputting errors from webpack/babel-loader de93344 renamed option showNavigationIcons to navigationButtons 8fe1b70 fixed bug in navigation 3292c02 rebuilt 8a57330 Merge remote-tracking branch 'origin/v4' into v4 6393f3e added shadow option to nodes and edges 29ea22b Merge remote-tracking branch 'origin/v4' into v4 1e98740 Refactored css of manipulation menu 31599b9 Refactored css of network navigation 9b5fb0c rebuilt again after merge 8c1a470 Merge remote-tracking branch 'origin/v4' into v4 8d509ed rebuilt cdaf668 Renamed `unified` to `shared` 0d2cd48 Refactored css of ColorPicker and Popup 3c8d01e Merge remote-tracking branch 'origin/v4' into v4 0469a7c reworked some of the options 7c83653 Merge remote-tracking branch 'origin/v4' into v4 b3e3dcc Refactored the css of Timeline and Graph2d to have a `vis-` prefix everywhere. (Still a small issue in Graph2d) 6e7553b Merge remote-tracking branch 'origin/v4' into v4 b120443 updated option stucture to use static methods to avoid duplicate definitions ef470ff Beep on error e6dd671 Merge remote-tracking branch 'origin/v4' into v4 8613f79 Updated dependencies e881a78 replaced `6to5` with `babel`, letting webpack output errors, minor fix 517263a minor changes, adhere to ES6 in bezier edge dynamic 2d7a1b2 Merge remote-tracking branch 'origin/v4' into v4 7248587 Removed spam 88a9149 Fixed preventDefault issue with hammer.js (a brute force solution but lets see how it goes...) 45862bd Do not have the function name and argument name ef9dd9c added comments to canvas 6c61e7b Renamed Network modules to capital first letter 54c5498 improved (circular) images size handling and label positions 5f4ebd0 patched redraw requests with image load callbacks during stabilization. Fixed size option correctly working for images and circular images. 4f47608 Partly fixed issue with updating an item's subgroup (see #745) 3d29ba5 restored default width and height to 100% c8fe42e Fixed titles not working when any of the nodes has id `0`. b358087 moved the entire network to triple ===. Bugs arise in scaling 61b9513 More descriptive warning on missing locale (see #761) 5db59a9 Fixed #761: Timeline and Graph2d throwing an error when locale is not found. Gives a warning message instead. 4514e8f Released version 3.12.0 fbfe6ad Fixed offset issue with dragging items vertically when the page is scrolled (this regression was introduced a few commits back) 34a5767 The event handlers `onMove` and `onMoving` are now invoked with all item properties as argument, and can be used to update all properties (like content, className, etc) and add new properties as well 0129127 added HTML color codes c68f6d7 fixed more bugs in options, we now have a generate options button! 6bdad7e fixed bugs, restyled colorPicker f8be61d removed certain options from the interactive config. 75f5d48 bridged label object options, fixed bug with self referencing circles eec31b0 more bugfixes, setOptions now propagates shapes, smooth and font options when set globally. 9471166 bugfixes, setOptions really needs thorough testing! a30c994 finalized a very fancy option configurator with a fancy color picker for color fields! 9c32469 added color picker 681f48e basic outline for system settings exists 81ea2b1 added google analytics b954d9c start of configuration system 83a0cf1 updated option handling for manipulation system 77be45d all of the manipulation has been moved to 4.0, redone and nicely commented and cleaned up :) 39eb2e5 most of the manipulation is now in 4.0 3e3a407 Fixed issue with Dutch locale (see #736) 0975223 Fixed #736: broken script url in example 13_localization.html f7a257c Fixed #733: background items being selected on shift+click. 3180235 Merge remote-tracking branch 'origin/develop' into develop 88695a6 Removed typo in className cd3da3c fixed bugs, options, tooltip options b62d536 updated group options, icon api change b9c97e1 moved groups to v4.0, fixed some bugs in edges dc5564a moved the popup system to 4.0. Fixed #731. 5c54f27 renamed all node and edge files, added diamond shape, tweaked shapes to always align and center all shapes. this improves the labelling 4b2cc60 cleaned up code a little 26357c2 cleaned up hierarchical view to work with multiple unconnected sets 5b7c301 added edge arrow shorthand b28af6f hierarchical system is now working and original x or y values are retained 9cd6c4a fixed images, groups, circular images, repeating events cf057e7 simplified fixed for nodes, removed duplicate datachanged events with support nodes in edges a903ec4 moved arrows to baseEdge, gave the straight edge a + 50% length in the physics. 14de6f2 arrows working! 2152bd6 clustering now using new visibility model, ripped edges apart, arrows not yet functional ef39ec1 icons also working. b2178ff seperated all node styles from the main node object 3fda539 made labels seperate. Needs cleaning up and comments 53795c9 added this.options.selfReferenceSize to edge ec6a474 unified pointOnLine and pointOnBezier to pointOnEdge 4a1ae62 edges are now accepting arrows back and forth using unified code baf4cd0 altered edge option structure ca11929 put all nodes and edges into one container. keep track of indices for visible and physics activated nodes 1fbdf3b network works again! 0f850c6 Merge pull request #707 from m4r71n/labels-on-bargraph 0b90860 Fixed #708: wrong group detected when page is scrolled. e0cc8d3 Merge branch 'master' into develop 1aca8e6 Show labels on Bargraph 1c536c3 Fixed #654: removed unnecessary minimum height for groups, takes the height of the group label as minimum height now. 2cf7d10 Call `event.stopPropagation()` before callback functions like onAdd, onRemove, etc. (see #577) b9bb040 Fixed #691: Orientation can now be configured separately for axis and items. 4c6d331 Fixed support for DataSet with custom id fields (option `fieldId`). See #701. fd15b36 Added missing docs on `hiddenDates` for Graph2d (see #695) 91ff934 Updated version number to 3.11.1-SNAPSHOT 333ec38 started creation of the edges handler and the nodes handler. currently broken. cf19c22 started work on the layout engine that will handle hierarchical layouts and the initial layout 208da97 tweaks. NagivationMixin has now been ported along with keyboard bindings using keycharm. 084c194 interaction tweaks a294f98 working events like zoom and drag, testing on mobile still to be done. 165ab9a Halfway updating Network to hammer2 dcaa7ef Fixed test/timeline.html 15d0ae8 Merge branch 'v4' into hammerjs2 6c01a14 Merge branch 'develop' into hammerjs2 3541260 work in progress of porting the event handlres 57d15b6 removed event. events are used for messaging between modules. fd06e8e reasonably success in decoupling the rendering and the network by segmenting a canvas, view (for camera controls) and renderer. 714f4af physics detached from nodes and network. adacb9c migrated all of the physics to the modules 2edd8b8 removed sectors, physics is almost stand-alone. Edges need better options for physics. b91757f first step to modularize the physics engine 093cb73 first modularizing experiment. Made body object containing data nodes, emitter, support functions. ClusterEngine is the first module. 1ed569c Merge branch 'develop' into v4 978b7b6 Merge branch 'develop' into v4 dc977a7 Merge branch 'clusterRewrite' into v4 0521284 setup for modularization, move to v4 branch 2689fd3 added comments fd93236 asynchrome stabilization a9b7485 fantastic clustering in network woohoo, added point labels for bargraphs in graph2d 63be7f8 Fixed #631: invalid css names for time axis grid. Renamed hours class names from `4-8h` to `h4-h8`. a716e3f Updated /dist 261ea43 Merge branch 'develop' into v4 d07eb69 Updated history d24d45c Merge branch 'v4' into es6 e0e1de7 Upgraded to the latest version of 6to5 783af7a Changed unit tests to use the compiled vis.js 81dc764 Fixed #621: item ranges being displayed with a minimum of 10px (twice the padding). 5892bd6 Added `6to5ify` transform to the dependencies and docs on custom builds with browserify 7b55f66 Merge branch 'develop' into es6 5a8789b Added propagating-hammerjs to package.json 7e6261a Merged develop into hammer2 branch e65c8b0 Merge branch 'master' into es6 cfe3de2 Merge branch 'develop' into es6 7114d5c Added es5 to es6 transpilation step to the build script, so now we can use ES6 :) 1b75021 Network mostly working with Hammer2 bf9684d Merge branch 'develop' into hammerjs2 6818d68 Neatly using hammer2 for the delete button a56f8eb Hammer2 mostly working in the Timeline 8013a68 Merge branch 'develop' into hammerjs2 e19502e Moving Timeline working with hammer2 (stop event propagation still an issue) 3b08676 Halfway implementing hammerjs2 for Timeline git-subtree-dir: lib/vis git-subtree-split: 58f0da3921bfe60ec1b63ed833ba97573e2f6331
1554 lines
75 KiB
HTML
1554 lines
75 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="description" content="">
|
|
<meta name="author" content="">
|
|
<title>vis.js - Network documentation.</title>
|
|
|
|
<!-- Bootstrap core CSS -->
|
|
<link href="../css/bootstrap.css" rel="stylesheet">
|
|
<!-- Tipue vendor css -->
|
|
<link href="../css/tipuesearch.css" rel="stylesheet">
|
|
|
|
<link href="../css/style.css" rel="stylesheet">
|
|
|
|
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
|
<!--[if lt IE 9]>
|
|
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
|
|
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
|
<![endif]-->
|
|
|
|
|
|
<link href="../css/prettify.css" type="text/css" rel="stylesheet"/>
|
|
<script type="text/javascript" src="../js/googleAnalytics.js"></script>
|
|
<script type="text/javascript" src="../js/prettify/prettify.js"></script>
|
|
|
|
<script src="../js/smooth-scroll.min.js"></script>
|
|
<script language="JavaScript">
|
|
smoothScroll.init();
|
|
</script>
|
|
|
|
<style>
|
|
tr.subHeader {
|
|
font-weight: bold;
|
|
font-style: italic;
|
|
}
|
|
|
|
tr.subHeader td {
|
|
padding-top: 30px;
|
|
}
|
|
|
|
td.midMethods {
|
|
width: 150px;
|
|
background-color: #ffffff;
|
|
border: 1px solid #dddddd;
|
|
}
|
|
|
|
tr.visible td {
|
|
padding: 10px;
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
function toggleGettingStarted(aThis) {
|
|
var gettingStartedDiv = document.getElementById('gettingStarted');
|
|
if (aThis.innerHTML.indexOf("Show") !== -1) {
|
|
gettingStartedDiv.className = '';
|
|
aThis.innerHTML = 'Hide the getting started again.';
|
|
}
|
|
else {
|
|
gettingStartedDiv.className = 'hidden';
|
|
aThis.innerHTML = 'Show the getting started!';
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<script type="text/javascript" src="../js/toggleTable.js"></script>
|
|
</head>
|
|
<body onload="prettyPrint();">
|
|
|
|
<div class="navbar-wrapper">
|
|
<div class="container">
|
|
<nav class="navbar navbar-inverse navbar-static-top" role="navigation">
|
|
<div class="container">
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
|
|
aria-expanded="false" aria-controls="navbar">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
<a class="navbar-brand hidden-sm" href="./index.html">vis.js</a>
|
|
</div>
|
|
<div id="navbar" class="navbar-collapse collapse">
|
|
<ul class="nav navbar-nav">
|
|
<li><a href="http://www.visjs.org/index.html#modules">Modules</a></li>
|
|
<li><a href="http://www.visjs.org/blog.html">Blog</a></li>
|
|
<li><a href="http://www.visjs.org/index.html#download_install">Download</a></li>
|
|
<li><a href="http://www.visjs.org/showcase/index.html">Showcase</a></li>
|
|
<li><a href="http://www.visjs.org/index.html#contribute">Contribute</a></li>
|
|
<li><a href="http://www.visjs.org/featureRequests.html">Feature requests</a></li>
|
|
<li><a href="http://www.visjs.org/index.html#licenses">License</a></li>
|
|
</ul>
|
|
<form class="navbar-form navbar-right" role="search">
|
|
<input name="q" id="tipue_search_input" autocomplete="off" type="text" class="form-control" placeholder="Enter keywords">
|
|
<button type="button" class="btn btn-default" onclick="vis.initSiteSearch(true);">Go!</button>
|
|
</form>
|
|
<div id="search-results-wrapper" class="panel panel-default">
|
|
<div class="panel-body">
|
|
<div id="tipue_search_content"></div>
|
|
</div>
|
|
</div>
|
|
<div id="keyword-info" class="panel panel-success">
|
|
<div class="panel-body">
|
|
Found <span id="keyword-count"></span> results. Click <a id="keyword-jumper-button" href="">here</a> to jump to the first keyword occurence!
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
|
|
<a href="https://github.com/almende/vis" class="hidden-xs hidden-sm hidden-md"><img
|
|
style="position: absolute; top: 0; right: 0; border: 0;"
|
|
src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67"
|
|
alt="Fork me on GitHub"
|
|
data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
|
|
|
|
<div class="container full">
|
|
<h1>Network</h1>
|
|
|
|
<p>Network is a visualization to display networks and networks consisting of nodes and edges. The visualization
|
|
is easy to use and supports custom shapes, styles, colors, sizes, images, and more.
|
|
|
|
The network visualization works smooth on any modern browser for up to a few thousand nodes and edges. To
|
|
handle a larger amount of nodes, Network has clustering support. Network uses HTML canvas for rendering.</p>
|
|
|
|
<p>As of 4.0, the network consists of individual modules which handle specific parts of the network. These modules
|
|
have their own docs, options, methods and events which you can access
|
|
by clicking on the modules in the list below.</p>
|
|
|
|
<a class="btn btn-primary" role="button" onclick="toggleGettingStarted(this)">Show the getting started!</a>
|
|
<div id="gettingStarted" class="hidden">
|
|
<h3>Creating a Network</h3>
|
|
|
|
<p>
|
|
Creating a vis network is easy. <a href="http://visjs.org/#download_install" target="_blank">It requires you to
|
|
include the vis.js and css files which you can get here</a>. If you have these
|
|
added to your application, you will need to specify your nodes and edges. You can use DOT language or export
|
|
nodes and edges from Gephi if you'd like but we will do it without these for now.
|
|
For more information on this click the tabs below. You can also use the vis.DataSets for dynamic data binding,
|
|
for instance, changing the color, label or any option after you have initialized the network.
|
|
<br><br>
|
|
Once you have the data, all you need is a container div to tell vis where to put your network. Additionally you
|
|
can use an options object to customize many aspects of the network. In code this
|
|
looks like this:</p>
|
|
|
|
<pre class="prettyprint lang-html options">
|
|
<html>
|
|
<head>
|
|
<script type="text/javascript" src="../../dist/vis.js"></script>
|
|
<link href="../../dist/vis.css" rel="stylesheet" type="text/css" />
|
|
|
|
<style type="text/css">
|
|
#mynetwork {
|
|
width: 600px;
|
|
height: 400px;
|
|
border: 1px solid lightgray;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="mynetwork"></div>
|
|
|
|
<script type="text/javascript">
|
|
// create an array with nodes
|
|
var nodes = new vis.DataSet([
|
|
{id: 1, label: 'Node 1'},
|
|
{id: 2, label: 'Node 2'},
|
|
{id: 3, label: 'Node 3'},
|
|
{id: 4, label: 'Node 4'},
|
|
{id: 5, label: 'Node 5'}
|
|
]);
|
|
|
|
// create an array with edges
|
|
var edges = new vis.DataSet([
|
|
{from: 1, to: 3},
|
|
{from: 1, to: 2},
|
|
{from: 2, to: 4},
|
|
{from: 2, to: 5}
|
|
]);
|
|
|
|
// create a network
|
|
var container = document.getElementById('mynetwork');
|
|
|
|
// provide the data in the vis format
|
|
var data = {
|
|
nodes: nodes,
|
|
edges: edges
|
|
};
|
|
var options = {};
|
|
|
|
// initialize your network!
|
|
var network = new vis.Network(container, data, options);
|
|
</script>
|
|
</body>
|
|
</html>
|
|
</pre>
|
|
<p><a href="http://visjs.org/examples/network/basicUsage.html" target="_blank">The result of the code above will be the basic example which is shown here.</a></p>
|
|
|
|
<br>
|
|
</div>
|
|
|
|
<h2 id="Contents">Contents</h2>
|
|
<ul>
|
|
<li><a href="#modules">Modules</a></li>
|
|
<li><a href="#options">Options</a></li>
|
|
<li><a href="#methods">Methods</a></li>
|
|
<li><a href="#Events">Events</a></li>
|
|
<li><a href="#importing_data">Importing Data</a>
|
|
<ul>
|
|
<li><a href="#importGephi">from Gephi</a></li>
|
|
<li><a href="#importDot">from DOT language</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<h2 id="modules">Modules</h2>
|
|
<table class="modules">
|
|
<tr>
|
|
<td width="120px"><a href="./configure.html">configure</a></td>
|
|
<td>Generates an interactive option editor with filtering.</td>
|
|
</tr>
|
|
<tr>
|
|
<td href="./edges.html">edges</a></td>
|
|
<td>Handles the creation and deletion of edges and contains the global edge options and styles.</td>
|
|
</tr>
|
|
<tr>
|
|
<td href="./groups.html">groups</a></td>
|
|
<td>Contains the groups and some options on how to handle nodes with non-existing groups.</td>
|
|
</tr>
|
|
<tr>
|
|
<td href="./interaction.html">interaction</a></td>
|
|
<td>Used for all user interaction with the network. Handles mouse and touch events and selection as well as
|
|
the navigation buttons and the popups.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td href="./layout.html">layout</a></td>
|
|
<td>Governs the initial and hierarchical positioning.</td>
|
|
</tr>
|
|
<tr>
|
|
<td href="./manipulation.html">manipulation</a></td>
|
|
<td>Supplies an API and optional GUI to alter the data in the network.</td>
|
|
</tr>
|
|
<tr>
|
|
<td href="./nodes.html">nodes</a></td>
|
|
<td>Handles the creation and deletion of nodes and contains the global node options and styles.</td>
|
|
</tr>
|
|
<tr>
|
|
<td href="./physics.html">physics</a></td>
|
|
<td>Does all the simulation moving the nodes and edges to their final positions, also governs
|
|
stabilization.
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<br>
|
|
|
|
<div id="optionsDiv">
|
|
<h2 id="options">Options</h2>
|
|
<pre class="prettyprint lang-js options">
|
|
var options = {
|
|
autoResize: true,
|
|
height: '100%',
|
|
width: '100%'
|
|
locale: 'en',
|
|
locales: locales,
|
|
clickToUse: false,
|
|
configure: {...}, // defined in the configure module.
|
|
edges: {...}, // defined in the edges module.
|
|
nodes: {...}, // defined in the nodes module.
|
|
groups: {...}, // defined in the groups module.
|
|
layout: {...}, // defined in the layout module.
|
|
interaction: {...}, // defined in the interaction module.
|
|
manipulation: {...}, // defined in the manipulation module.
|
|
physics: {...}, // defined in the physics module.
|
|
}
|
|
|
|
network.setOptions(options);
|
|
</pre>
|
|
<p>The individual options are explained below. The ones referring to modules are explained in the corresponding
|
|
module.</p>
|
|
<table class="options">
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Default</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
<tr><td id="event_autoResize">autoResize</td>
|
|
<td>Boolean</td>
|
|
<td><code>true</code></td>
|
|
<td>If true, the Network will automatically detect when its container is resized, and redraw itself
|
|
accordingly. If false, the Network can be forced to repaint after its container has been resized
|
|
using the function redraw() and setSize().
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_width">width</td>
|
|
<td>String</td>
|
|
<td><code>'100%'</code></td>
|
|
<td>the width of the canvas. Can be in percentages or pixels (ie. <code>'400px'</code>).</td>
|
|
</tr>
|
|
<tr><td id="event_height">height</td>
|
|
<td>String</td>
|
|
<td><code>'100%'</code></td>
|
|
<td>the height of the canvas. Can be in percentages or pixels (ie. <code>'400px'</code>).</td>
|
|
</tr>
|
|
<tr><td id="event_locale">locale</td>
|
|
<td>String</td>
|
|
<td><code>'en'</code></td>
|
|
<td>Select the locale. By default, the language is English. If you want to use another language, you
|
|
will
|
|
need to define your own locale and refer to it here.
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_locales">locales</td>
|
|
<td>Object</td>
|
|
<td>defaultLocales</td>
|
|
<td>Locales object. By default only <code>'en'</code> and <code>'nl'</code> are supported. Take a look
|
|
at
|
|
the <a href="#locales" data-scroll=""
|
|
data-options="{ "easing": "easeInCubic" }">locales
|
|
section below</a> for more explaination on how to customize this.
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_clickToUse">clickToUse</td>
|
|
<td>Boolean</td>
|
|
<td>false</td>
|
|
<td>Locales object. By default only <code>'en'</code> and <code>'nl'</code> are supported. Take a look
|
|
at
|
|
the <a href="#locales" data-scroll=""
|
|
data-options="{ "easing": "easeInCubic" }">locales
|
|
section below</a> for more explaination on how to customize this.
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_configure">configure</td>
|
|
<td>Object</td>
|
|
<td>Object</td>
|
|
<td href="./configure.html">All options in this object are explained in the configure module.</a>
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_edges">edges</td>
|
|
<td>Object</td>
|
|
<td>Object</td>
|
|
<td href="./edges.html">All options in this object are explained in the edges module.</a>
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_nodes">nodes</td>
|
|
<td>Object</td>
|
|
<td>Object</td>
|
|
<td href="./nodes.html">All options in this object are explained in the nodes module.</a>
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_groups">groups</td>
|
|
<td>Object</td>
|
|
<td>Object</td>
|
|
<td href="./groups.html">All options in this object are explained in the groups module.</a>
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_layout">layout</td>
|
|
<td>Object</td>
|
|
<td>Object</td>
|
|
<td href="./layout.html">All options in this object are explained in the layout module.</a>
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_interaction">interaction</td>
|
|
<td>Object</td>
|
|
<td>Object</td>
|
|
<td href="./interaction.html">All options in this object are explained in the interaction module.</a>
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_manipulation">manipulation</td>
|
|
<td>Object</td>
|
|
<td>Object</td>
|
|
<td href="./manipulation.html">All options in this object are explained in the manipulation module.</a>
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_physics">physics</td>
|
|
<td>Object</td>
|
|
<td>Object</td>
|
|
<td href="./physics.html">All options in this object are explained in the physics module.</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
<br>
|
|
<h4 id="locales">Custom locales</h4>
|
|
|
|
<p>The locales object has the following format:</p>
|
|
<pre class="prettyprint lang-js">
|
|
var locales = {
|
|
en: {
|
|
edit: 'Edit',
|
|
del: 'Delete selected',
|
|
back: 'Back',
|
|
addNode: 'Add Node',
|
|
addEdge: 'Add Edge',
|
|
editNode: 'Edit Node',
|
|
editEdge: 'Edit Edge',
|
|
addDescription: 'Click in an empty space to place a new node.',
|
|
edgeDescription: 'Click on a node and drag the edge to another node to connect them.',
|
|
editEdgeDescription: 'Click on the control points and drag them to a node to connect to it.',
|
|
createEdgeError: 'Cannot link edges to a cluster.',
|
|
deleteClusterError: 'Clusters cannot be deleted.',
|
|
editClusterError: 'Clusters cannot be edited.'
|
|
}
|
|
}</pre>
|
|
<p>If you want to define your own locale, you can change the key ('en' here) and change all the strings. You can
|
|
then use your new key in the locale option.</p>
|
|
</div>
|
|
<br /><hr />
|
|
<div id="methodsDiv">
|
|
<h2 id="methods">Methods</h2>
|
|
|
|
<p>This is a list of all the methods in the public API. They have been grouped by category, which correspond to
|
|
the
|
|
modules listed above.</p>
|
|
<table class="methods-collapsable" id="methodTable">
|
|
<tr class="subHeader">
|
|
<td colspan="2">Global methods for the network.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','destroy', this);">
|
|
<td colspan="2"><span parent="destroy" class="right-caret" id="method_destroy"></span> destroy()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="destroy">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Remove the network from the DOM and remove all Hammer bindings and references.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','setData', this);">
|
|
<td colspan="2"><span parent="setData" class="right-caret" id="method_setData"></span> setData({<code><i>nodes: vis
|
|
DataSet/Array</i></code>,<code><i>edges: vis
|
|
DataSet/Array</i></code>})
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="setData">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Override all the data in the network. If stabilization is enabled in the <a href="physics.html">physics
|
|
module</a>, the network will stabilize again. This method is also performed when first initializing
|
|
the
|
|
network.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','setOptions', this);">
|
|
<td colspan="2"><span parent="setOptions" class="right-caret" id="method_setOptions"></span> setOptions(<code>Object
|
|
options</code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="setOptions">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Set the options. All available options can be found in the modules above. Each module requires it's
|
|
own
|
|
container with the module name to contain its options.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','onEvent', this);">
|
|
<td colspan="2"><span parent="onEvent" class="right-caret" id="method_on"></span> on(<code>String event name, Function callback</code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="onEvent">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Set an event listener. Depending on the type of event you get different parameters for the callback function. Look at the event section of the documentation for more information.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','offEvent', this);">
|
|
<td colspan="2"><span parent="offEvent" class="right-caret" id="method_off"></span> off(<code>String event name, Function callback</code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="offEvent">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Remove an event listener. The function you supply has to be the exact same as the one you used in the on function. If no function is supplied, all listeners will be removed. Look at the event section of the documentation for more information.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','onceEvent', this);">
|
|
<td colspan="2"><span parent="onceEvent" class="right-caret" id="method_once"></span> once(<code>String event name, Function callback</code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="onceEvent">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Set an event listener only once. After it has taken place, the event listener will be removed. Depending on the type of event you get different parameters for the callback function. Look at the event section of the documentation for more information.
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr class="subHeader">
|
|
<td colspan="2">Methods related to the canvas.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','canvasToDOM', this);">
|
|
<td colspan="2"><span parent="canvasToDOM" class="right-caret" id="method_canvasToDOM"></span> canvasToDOM({<code><i>x:
|
|
Number</i></code>,<code><i>y:
|
|
Number</i></code>})
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="canvasToDOM">
|
|
<td class="midMethods">Returns: Object</td>
|
|
<td>This function converts canvas coordinates to coordinates on the DOM. Input and output are in the
|
|
form of
|
|
<code>{x:Number,y:Number}</code>. The DOM values are relative to the network container.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','DOMtoCanvas', this);">
|
|
<td colspan="2"><span parent="DOMtoCanvas" class="right-caret" id="method_DOMtoCanvas"></span> DOMtoCanvas({<code><i>x:
|
|
Number</i></code>,<code><i>y:
|
|
Number</i></code>})
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="DOMtoCanvas">
|
|
<td class="midMethods">Returns: Object</td>
|
|
<td>This function converts DOM coordinates to coordinates on the canvas. Input and output are in the
|
|
form of
|
|
<code>{x:Number,y:Number}</code>. The DOM values are relative to the network container.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','redraw', this);">
|
|
<td colspan="2"><span parent="redraw" class="right-caret" id="method_redraw"></span> redraw()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="redraw">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Redraw the network.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','setSize', this);">
|
|
<td colspan="2"><span parent="setSize" class="right-caret" id="method_setSize"></span> setSize(<code><i>String
|
|
width</i></code>,<code><i>String
|
|
height</i></code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="setSize">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Set the size of the canvas. This is automatically done on a window resize.</td>
|
|
</tr>
|
|
|
|
<tr class="subHeader">
|
|
<td colspan="2">Clustering</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','cluster', this);">
|
|
<td colspan="2"><span parent="cluster" class="right-caret" id="method_cluster"></span> cluster(
|
|
<code>Object options</code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="cluster">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>The options object is explained in full <a data-scroll=""
|
|
data-options="{ "easing": "easeInCubic" }"
|
|
href="#optionsObject">below</a>. The joinCondition
|
|
function
|
|
is presented with all nodes.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','clusterByConnection', this);">
|
|
<td colspan="2"><span parent="clusterByConnection" class="right-caret" id="method_clusterByConnection"></span> clusterByConnection(
|
|
<code>String nodeId</code>,
|
|
<code>[Object options]</code>
|
|
)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="clusterByConnection">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>This method looks at the provided node and makes a cluster of it and all it's connected nodes. The
|
|
behaviour can be customized by proving the options object. All options of this object are explained
|
|
<a
|
|
data-scroll="" data-options="{ "easing": "easeInCubic" }"
|
|
href="#optionsObject">below</a>. The joinCondition is only presented with the connected
|
|
nodes.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','clusterByHubsize', this);">
|
|
<td colspan="2"><span parent="clusterByHubsize" class="right-caret" id="method_clusterByHubsize"></span> clusterByHubsize(
|
|
<code>[Number hubsize]</code>,
|
|
<code>[Object options]</code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="clusterByHubsize">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>This method checks all nodes in the network and those with a equal or higher amount of edges than
|
|
specified with the <code>hubsize</code> qualify. If a hubsize is not defined, the hubsize will be determined as the average
|
|
value plus two standard deviations. <br><br>
|
|
|
|
For all qualifying nodes, clusterByConnection is performed on each of them.
|
|
The options object is described for <code>clusterByConnection</code> and does the same here.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','clusterOutliers', this);">
|
|
<td colspan="2"><span parent="clusterOutliers" class="right-caret" id="method_clusterOutliers"></span> clusterOutliers(
|
|
<code>[Object options]</code>)
|
|
</tr>
|
|
<tr class="hidden" parent="clusterOutliers">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>This method will cluster all nodes with 1 edge with their respective connected node.
|
|
The options object is explained in full <a data-scroll="" data-options="{ "easing": "easeInCubic" }" href="#optionsObject">below</a>.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','findNode', this);">
|
|
<td colspan="2"><span parent="findNode" class="right-caret" id="method_findNode"></span> findNode(
|
|
<code>String nodeId</code>)
|
|
</tr>
|
|
<tr class="hidden" parent="findNode">
|
|
<td class="midMethods">Returns: Array</td>
|
|
<td>Nodes can be in clusters. Clusters can also be in clusters. This function returns and array of
|
|
nodeIds
|
|
showing where the node is. <br><br> Example:
|
|
cluster 'A' contains cluster 'B',
|
|
cluster 'B' contains cluster 'C',
|
|
cluster 'C' contains node 'fred'.
|
|
<code>network.clustering.findNode('fred')</code> will return <code>['A','B','C','fred']</code>.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','isCluster', this);">
|
|
<td colspan="2"><span parent="isCluster" class="right-caret" id="method_isCluster"></span> isCluster(
|
|
<code>String nodeId</code>)
|
|
</tr>
|
|
<tr class="hidden" parent="isCluster">
|
|
<td class="midMethods">Returns: Boolean</td>
|
|
<td>Returns true if the node whose ID has been supplied is a cluster.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','getNodesInCluster', this);">
|
|
<td colspan="2"><span parent="getNodesInCluster" class="right-caret" id="method_getNodesInCluster"></span> getNodesInCluster(
|
|
<code>String clusterNodeId</code>)
|
|
</tr>
|
|
<tr class="hidden" parent="getNodesInCluster">
|
|
<td class="midMethods">Returns: Array</td>
|
|
<td>Returns an array of all nodeIds of the nodes that would be released if you open the cluster.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','openCluster', this);">
|
|
<td colspan="2"><span parent="openCluster" class="right-caret" id="method_openCluster"></span> openCluster(
|
|
<code>String nodeId, Object options</code>)
|
|
</tr>
|
|
<tr class="hidden" parent="openCluster">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Opens the cluster, releases the contained nodes and edges, removing the cluster node and cluster
|
|
edges. The options object is optional and currently supports one option, releaseFunction, which is a function that can be used to manually
|
|
position the nodes after the cluster is opened. <br>
|
|
<pre class="code">
|
|
function releaseFunction (clusterPosition, containedNodesPositions) {
|
|
var newPositions = {};
|
|
// clusterPosition = {x:clusterX, y:clusterY};
|
|
// containedNodesPositions = {nodeId:{x:nodeX,y:nodeY}, nodeId2....}
|
|
newPositions[nodeId] = {x:newPosX, y:newPosY};
|
|
return newPositions;
|
|
}</pre>
|
|
The containedNodesPositions contain the positions of the nodes in the cluster at the moment they were clustered.
|
|
This function is expected to return the newPositions, which can be the containedNodesPositions (altered) or a new object. This has to be an object with keys equal
|
|
to the nodeIds that exist in the containedNodesPositions and an <code>{x:x,y:y}</code> position object. <br><br>
|
|
|
|
For all nodeIds not listed in this returned object, we will position them at the location of the cluster. This is also the default behaviour when no releaseFunction is defined.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr class="subHeader">
|
|
<td colspan="2">Layout</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','getSeed', this);">
|
|
<td colspan="2"><span parent="getSeed" class="right-caret" id="method_getSeed"></span> getSeed()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="clusterByHubsize">
|
|
</tr>
|
|
<tr class="hidden" parent="getSeed">
|
|
<td class="midMethods">Returns: Number</td>
|
|
<td>If you like the layout of your network and would like it to start in the same way next time, ask for
|
|
the
|
|
seed using this method and put it in the <code>layout.randomSeed</code> option.
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr class="subHeader">
|
|
<td colspan="2">Manipulation methods to use the manipulation system without GUI.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','enableEditMode', this);">
|
|
<td colspan="2"><span parent="enableEditMode" class="right-caret" id="method_enableEditMode"></span> enableEditMode()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="enableEditMode">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Programatically enable the edit mode. Similar effect to pressing the edit button.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','disableEditMode', this);">
|
|
<td colspan="2"><span parent="disableEditMode" class="right-caret" id="method_disableEditMode"></span> disableEditMode()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="disableEditMode">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Programatically disable the edit mode. Similar effect to pressing the close icon (small cross in the
|
|
corner of the toolbar).
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','addNodeMode', this);">
|
|
<td colspan="2"><span parent="addNodeMode" class="right-caret" id="method_addNodeMode"></span> addNodeMode()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="addNodeMode">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Go into addNode mode. Having edit mode or manipulation enabled is not required. To get out of this
|
|
mode,
|
|
call <code>disableEditMode()</code>. The callback functions defined in <code>handlerFunctions</code>
|
|
still apply. To use these methods without having the manipulation GUI, make sure you set
|
|
<code>enabled</code> to false.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','editNode', this);">
|
|
<td colspan="2"><span parent="editNode" class="right-caret" id="method_editNode"></span> editNode()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="editNode">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Edit the selected node. The explaination from <code>addNodeMode</code> applies here as well.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','addEdgeMode', this);">
|
|
<td colspan="2"><span parent="addEdgeMode" class="right-caret" id="method_addEdgeMode"></span> addEdgeMode()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="addEdgeMode">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Go into addEdge mode. The explaination from <code>addNodeMode</code> applies here as well.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','editEdgeMode', this);">
|
|
<td colspan="2"><span parent="editEdgeMode" class="right-caret" id="method_editEdgeMode"></span> editEdgeMode()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="editEdgeMode">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Go into editEdge mode. The explaination from <code>addNodeMode</code> applies here as well.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','deleteSelected', this);">
|
|
<td colspan="2"><span parent="deleteSelected" class="right-caret" id="method_deleteSelected"></span> deleteSelected()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="deleteSelected">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Delete selected. Having edit mode or manipulation enabled is not required.</td>
|
|
</tr>
|
|
|
|
|
|
<tr class="subHeader">
|
|
<td colspan="2">Methods to get information on nodes and edges.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','getPositions', this);">
|
|
<td colspan="2"><span parent="getPositions" class="right-caret" id="method_getPositions"></span> getPositions(<code><i>[Array of
|
|
nodeIds]</i></code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="getPositions">
|
|
<td class="midMethods">Returns: Object</td>
|
|
<td>Returns the x y positions in canvas space of the nodes with the supplied nodeIds as an object:
|
|
<pre class="code">
|
|
{
|
|
nodeId1: {x: xValue, y:yValue},
|
|
nodeId2: {x: xValue, y:yValue},
|
|
...
|
|
}
|
|
</pre>
|
|
Alternative inputs are a String containing a nodeId or nothing. When a String is supplied, the
|
|
position
|
|
of the node corresponding to the ID is returned. When nothing is supplied, the positions of all
|
|
nodes
|
|
are returned.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','storePositions', this);">
|
|
<td colspan="2"><span parent="storePositions" class="right-caret" id="method_storePositions"></span> storePositions()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="storePositions">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>When using the vis.DataSet to load your nodes into the network, this method will put the X and Y
|
|
positions of all nodes into that dataset. If you're loading your nodes from a database and have
|
|
this dynamically coupled with
|
|
the DataSet, you can
|
|
use this to stablize your network once, then save the positions in that database through the DataSet
|
|
so
|
|
the next
|
|
time you load the nodes, stabilization will be near instantaneous.
|
|
<br><br>
|
|
If the nodes are still moving and you're using dynamic smooth edges (which is on by default), you
|
|
can
|
|
use the option <code>stabilization.onlyDynamicEdges</code> in the <a href="physics.html">physics
|
|
module</a>
|
|
to improve initialization time.
|
|
<br><br>
|
|
<b>This method does not support clustering. At the moment it is not possible to cache
|
|
positions when using clusters since they cannot be correctly initialized from just the
|
|
positions.</b>
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','getBoundingBox', this);">
|
|
<td colspan="2"><span parent="getBoundingBox" class="right-caret" id="method_getBoundingBox"></span> getBoundingBox(<code><i>String
|
|
nodeId</i></code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="getBoundingBox">
|
|
<td class="midMethods">Returns: Object</td>
|
|
<td> Returns a bounding box for the node including label in the format:
|
|
<pre class="code">
|
|
{
|
|
top: Number,
|
|
left: Number,
|
|
right: Number,
|
|
bottom: Number
|
|
}
|
|
</pre>
|
|
These values are in canvas space.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','getConnectedNodes', this);">
|
|
<td colspan="2"><span parent="getConnectedNodes" class="right-caret" id="method_getConnectedNodes"></span> getConnectedNodes(<code><i>String
|
|
nodeId or edgeId</i></code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="getConnectedNodes">
|
|
<td class="midMethods">Returns: Array</td>
|
|
<td>Returns an array of nodeIds of the all the nodes that are directly connected to this node. If you supply an edgeId,
|
|
vis will first match the id to nodes. If no match is found, it will search in the edgelist and return an array: <code>[fromId, toId]</code>.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','getConnectedEdges', this);">
|
|
<td colspan="2"><span parent="getConnectedEdges" class="right-caret" id="method_getConnectedEdges"></span> getConnectedEdges(<code><i>String
|
|
nodeId</i></code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="getConnectedEdges">
|
|
<td class="midMethods">Returns: Array</td>
|
|
<td>Returns an array of edgeIds of the edges connected to this node.</td>
|
|
</tr>
|
|
|
|
|
|
<tr class="subHeader">
|
|
<td colspan="2">Physics methods to control when the simulation should run.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','startSimulation', this);">
|
|
<td colspan="2"><span parent="startSimulation" class="right-caret" id="method_startSimulation"></span> startSimulation()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="startSimulation">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Start the physics simulation. This is normally done whenever needed and is only really useful if you
|
|
stop the simulation yourself and wish to continue it afterwards.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','stopSimulation', this);">
|
|
<td colspan="2"><span parent="stopSimulation" class="right-caret" id="method_stopSimulation"></span> stopSimulation()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="stopSimulation">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>This stops the physics simulation and triggers a <code>stabilized</code> event. It can be restarted
|
|
by
|
|
dragging a node, altering the dataset or calling <code>startSimulation()</code>.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','stabilize', this);">
|
|
<td colspan="2"><span parent="stabilize" class="right-caret" id="method_stabilize"></span> stabilize([iterations])</td>
|
|
</tr>
|
|
<tr class="hidden" parent="stabilize">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>You can manually call stabilize at any time. All the stabilization options above are used. You can optionally supply the number of iterations it should do.</td>
|
|
</tr>
|
|
|
|
|
|
<tr class="subHeader">
|
|
<td colspan="2">Selection methods for nodes and edges.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','getSelection', this);">
|
|
<td colspan="2"><span parent="getSelection" class="right-caret" id="method_getSelection"></span> getSelection()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="getSelection">
|
|
<td class="midMethods">Returns: Object</td>
|
|
<td>Returns an object with selected nodes and edges ids like this:
|
|
<pre class="code">
|
|
{
|
|
nodes: [Array of selected nodeIds],
|
|
edges: [Array of selected edgeIds]
|
|
}</pre>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','getSelectedNodes', this);">
|
|
<td colspan="2"><span parent="getSelectedNodes" class="right-caret" id="method_getSelectedNodes"></span> getSelectedNodes()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="getSelectedNodes">
|
|
<td class="midMethods">Returns: Array</td>
|
|
<td>Returns an array of selected node ids like so:
|
|
<code>[nodeId1, nodeId2, ..]</code>.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','getSelectedEdges', this);">
|
|
<td colspan="2"><span parent="getSelectedEdges" class="right-caret" id="method_getSelectedEdges"></span> getSelectedEdges()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="getSelectedEdges">
|
|
<td class="midMethods">Returns: Array</td>
|
|
<td>Returns an array of selected edge ids like so: <code>[edgeId1, edgeId2, ..]</code>.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','getNodeAt', this);">
|
|
<td colspan="2"><span parent="getNodeAt" class="right-caret" id="method_getNodeAt"></span> getNodeAt(<code><i>{x: xPosition
|
|
DOM, y: yPosition DOM}</i></code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="getNodeAt">
|
|
<td class="midMethods">Returns: String</td>
|
|
<td>Returns a nodeId or undefined. The DOM positions are expected to be in pixels from the top left
|
|
corner
|
|
of the canvas.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','getEdgeAt', this);">
|
|
<td colspan="2"><span parent="getEdgeAt" class="right-caret" id="method_getEdgeAt"></span> getEdgeAt(<code><i>{x: xPosition
|
|
DOM, y: yPosition DOM}</i></code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="getEdgeAt">
|
|
<td class="midMethods">Returns: String</td>
|
|
<td>Returns a edgeId or undefined. The DOM positions are expected to be in pixels from the top left
|
|
corner
|
|
of the canvas..
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','selectNodes', this);">
|
|
<td colspan="2"><span parent="selectNodes" class="right-caret" id="method_selectNodes"></span> selectNodes(<code><i>Array with
|
|
nodeIds</i></code>,<code><i>[Boolean
|
|
highlightEdges]</i></code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="selectNodes">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Selects the nodes corresponding to the id's in the input array. If highlightEdges is true or
|
|
undefined,
|
|
the neighbouring edges will also be selected. This method unselects all other objects before
|
|
selecting
|
|
its own objects. <i>Does not fire events</i>.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','selectEdges', this);">
|
|
<td colspan="2"><span parent="selectEdges" class="right-caret" id="method_selectEdges"></span> selectEdges(<code><i>Array with
|
|
edgeIds</i></code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="selectEdges">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Selects the edges corresponding to the id's in the input array. This method unselects all other
|
|
objects
|
|
before selecting its own objects. <i>Does not fire events</i>.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','unselectAll', this);">
|
|
<td colspan="2"><span parent="unselectAll" class="right-caret" id="method_unselectAll"></span> unselectAll()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="unselectAll">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Unselect all objects. <i>Does not fire events</i>.</td>
|
|
</tr>
|
|
|
|
|
|
<tr class="subHeader">
|
|
<td colspan="2">Methods to control the viewport for zoom and animation.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','getScale', this);">
|
|
<td colspan="2"><span parent="getScale" class="right-caret" id="method_getScale"></span> getScale()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="getScale">
|
|
<td class="midMethods">Returns: Number</td>
|
|
<td>Returns the current scale of the network. 1.0 is comparible to 100%, 0 is zoomed out infinitely.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','clusterByHubsize', this);">
|
|
<td colspan="2"><span parent="clusterByHubsize" class="right-caret" id="method_getViewPosition"></span> getViewPosition()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="clusterByHubsize">
|
|
<td class="midMethods">Returns: Number</td>
|
|
<td>Returns the current central focus point of the view.</td>
|
|
</tr>
|
|
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','fit', this);">
|
|
<td colspan="2"><span parent="fit" class="right-caret" id="method_fit"></span> fit(<code>[Object
|
|
options]</code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="fit">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Zooms out so all nodes fit on the canvas. You can supply options to customize this:
|
|
<pre class="code">
|
|
{
|
|
nodes:[Array of nodeIds],
|
|
animation: { // -------------------> can be a boolean too!
|
|
duration: Number
|
|
easingFunction: String
|
|
}
|
|
}
|
|
</pre>
|
|
The nodes can be used to zoom to fit only specific nodes in the view. <br/><br/>
|
|
The other options are explained in the <code>moveTo()</code> description below.
|
|
All options are optional for the fit method.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','focus', this);">
|
|
<td colspan="2"><span parent="focus" class="right-caret" id="method_focus"></span> focus(
|
|
<code>String nodeId</code>,
|
|
<code>[Object options]</code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="focus">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>You can focus on a node with this function. What that means is the view will lock onto that node, if
|
|
it
|
|
is moving, the view will also move accordingly. If the view is dragged by the user, the focus is
|
|
broken.
|
|
You can supply options to customize the effect:
|
|
<pre class="code">
|
|
{
|
|
scale: Number,
|
|
offset: {x:Number, y:Number}
|
|
locked: boolean
|
|
animation: { // -------------------> can be a boolean too!
|
|
duration: Number
|
|
easingFunction: String
|
|
}
|
|
}
|
|
</pre>
|
|
All options except for locked are explained in the <code>moveTo()</code> description below. Locked
|
|
denotes whether or not the view remains locked to the node once the zoom-in animation is finished.
|
|
Default value is true. The options object is optional in the focus method.
|
|
</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','moveTo', this);">
|
|
<td colspan="2"><span parent="moveTo" class="right-caret" id="method_moveTo"></span> moveTo(<code>Object
|
|
options</code>)
|
|
</td>
|
|
</tr>
|
|
<tr class="hidden" parent="moveTo">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>You can animate or move the camera using the moveTo method. Options are:
|
|
<pre class="code">
|
|
{
|
|
position: {x:Number, y:Number},
|
|
scale: Number,
|
|
offset: {x:Number, y:Number}
|
|
animation: { // -------------------> can be a boolean too!
|
|
duration: Number
|
|
easingFunction: String
|
|
}
|
|
}
|
|
</pre>
|
|
The position (in canvas units!) is the position of the central focus point of the camera.
|
|
The scale is the target zoomlevel. Default value is 1.0.
|
|
The offset (in DOM units) is how many pixels from the center the view is focussed. Default value is
|
|
{x:0,y:0}.
|
|
For animation you can either use a Boolean to use it with the default options or disable it or you
|
|
can
|
|
define the duration (in milliseconds) and easing function manually. Available are:
|
|
<code>linear, easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, easeOutCubic, easeInOutCubic,
|
|
easeInQuart, easeOutQuart, easeInOutQuart, easeInQuint, easeOutQuint, easeInOutQuint</code>.
|
|
|
|
<i>You will have to define at least a scale, position or offset. Otherwise, there is nothing to move
|
|
to.</i>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','releaseNode', this);">
|
|
<td colspan="2"><span parent="releaseNode" class="right-caret" id="method_releaseNode"></span> releaseNode()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="releaseNode">
|
|
<td class="midMethods">Returns: none</td>
|
|
<td>Programatically release the focussed node.</td>
|
|
</tr>
|
|
<tr class="subHeader">
|
|
<td colspan="2">Methods to use with the configurator module.</td>
|
|
</tr>
|
|
<tr class="collapsible toggle" onclick="toggleTable('methodTable','getOptionsFromConfigurator', this);">
|
|
<td colspan="2"><span parent="getOptionsFromConfigurator" class="right-caret" id="method_getOptionsFromConfigurator"></span> getOptionsFromConfigurator()</td>
|
|
</tr>
|
|
<tr class="hidden" parent="getOptionsFromConfigurator">
|
|
<td class="midMethods">Returns: Object</td>
|
|
<td>If you use the configurator, you can call this method to get an options object that contains all differences from the default options
|
|
caused by users interacting with the configurator.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
<br>
|
|
|
|
<h4 id="optionsObject">Cluster methods options object</h4>
|
|
|
|
<p>The options object supplied to the cluster functions can contain these properties:</p>
|
|
<table class="methods">
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
<tr><td>joinCondition(<br> <code>nodeOptions: Object</code><br>)</td>
|
|
<td>Function</td>
|
|
<td><i>Optional for all but the cluster method. </i> The cluster module loops over all nodes that are
|
|
selected to be in the cluster and calls this function with their data as argument.
|
|
If this function returns true, this node will be added to the cluster. You have access to all
|
|
options
|
|
(including the default)
|
|
as well as any custom fields you may have added to the node to determine whether or not to include
|
|
it in
|
|
the cluster. Example:
|
|
<pre class="prettyprint lang-js">
|
|
var nodes = [
|
|
{id: 4, label: 'Node 4'},
|
|
{id: 5, label: 'Node 5'},
|
|
{id: 6, label: 'Node 6', cid:1},
|
|
{id: 7, label: 'Node 7', cid:1}
|
|
]
|
|
|
|
var options = {
|
|
joinCondition:function(nodeOptions) {
|
|
return nodeOptions.cid === 1;
|
|
}
|
|
}
|
|
|
|
network.clustering.cluster(options);
|
|
</pre>
|
|
</td>
|
|
</tr>
|
|
<tr><td>processProperties(<br> <code>clusterOptions: Object</code>,<br>
|
|
<code>childNodesOptions: Array</code>,<br>
|
|
<code>childEdgesOptions: Array</code><br>)</td>
|
|
<td>Function</td>
|
|
<td><i>Optional. </i> Before creating the new cluster node, this (optional) function will be called with
|
|
the
|
|
properties supplied by you (<code>clusterNodeProperties</code>), all contained nodes and all
|
|
contained
|
|
edges. You can use this to update the
|
|
properties of the cluster based on which items it contains. The function should return the
|
|
properties to
|
|
create the cluster node. In the example below, we ensure preservation of mass and value when forming
|
|
the
|
|
cluster:
|
|
<pre class="prettyprint lang-js">
|
|
var options = {
|
|
processProperties: function (clusterOptions,
|
|
childNodes, childEdges) {
|
|
var totalMass = 0;
|
|
var totalValue = 0;
|
|
for (var i = 0; i < childNodes.length; i++) {
|
|
totalMass += childNodes[i].mass;
|
|
totalValue = childNodes[i].value
|
|
? totalValue + childNodes[i].value
|
|
: totalValue;
|
|
}
|
|
clusterOptions.mass = totalMass;
|
|
if (totalValue > 0) {
|
|
clusterOptions.value = totalValue;
|
|
}
|
|
return clusterOptions;
|
|
},
|
|
}
|
|
</pre>
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_clusterNodeProperties">clusterNodeProperties</td>
|
|
<td>Object</td>
|
|
<td><i>Optional. </i> This is an object containing the options for the cluster node. All options
|
|
described
|
|
in the <a href="./nodes.html">nodes module</a> are allowed. This allows you to style your cluster
|
|
node
|
|
any way you want. This is also the style object that is provided in the processProperties function
|
|
for
|
|
fine tuning. If undefined, default node options will be used.
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_clusterEdgeProperties">clusterEdgeProperties</td>
|
|
<td>Object</td>
|
|
<td><i>Optional. </i> This is an object containing the options for the edges connected to the cluster.
|
|
All
|
|
options described in the <a href="./edges.html">edges module</a> are allowed. Using this, you can
|
|
style
|
|
the edges connecting to the cluster any way you want. If none are provided, the options from the
|
|
edges
|
|
that are replaced are used. If undefined, default edge options will be used.
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
<br /><hr />
|
|
<div id="eventsDiv">
|
|
<h2 id="Events">Events</h2>
|
|
|
|
<p>This is a list of all the events in the public API. They are collected here from all individual modules.</p>
|
|
|
|
<p>These events are fired by the interaction module. They are related to user input.</p>
|
|
<table class="events">
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Properties</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
<tr class="subHeader">
|
|
<td colspan="3">Events triggered by human interaction, selection, dragging etc.</td>
|
|
</tr>
|
|
<tr><td id="event_click">click</td>
|
|
<td>
|
|
Object
|
|
</td>
|
|
<td>Fired when the user clicks the mouse or taps on a touchscreen device. Passes an object with properties structured as:
|
|
|
|
<pre class="prettyprint lang-js">{
|
|
nodes: [Array of selected nodeIds],
|
|
edges: [Array of selected edgeIds],
|
|
event: [Object] original click event,
|
|
pointer: {
|
|
DOM: {x:pointer_x, y:pointer_y},
|
|
canvas: {x:canvas_x, y:canvas_y}
|
|
}
|
|
}
|
|
</pre>
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_doubleClick">doubleClick</td>
|
|
<td>same as <code>click</code>.</td>
|
|
<td>Fired when the user double clicks the mouse or double taps on a touchscreen device. Since a double
|
|
click
|
|
is in fact 2 clicks, 2 click events are fired, followed by a double click event. If you do not want
|
|
to
|
|
use the click events if a double click event is fired, just check the time between click events
|
|
before
|
|
processing them.
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_oncontext">oncontext</td>
|
|
<td>same as <code>click</code>.</td>
|
|
<td>Fired when the user click on the canvas with the right mouse button. The right mouse button does not
|
|
select by default. You can use the method <code>getNodeAt</code> to select the node if you
|
|
want.
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_hold">hold</td>
|
|
<td>same as <code>click</code>.</td>
|
|
<td>Fired when the user clicks and holds the mouse or taps and holds on a touchscreen device. A click
|
|
event
|
|
is also fired in this case.
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_release">release</td>
|
|
<td>same as <code>click</code>.</td>
|
|
<td>Fired after drawing on the canvas has been completed. Can be used to draw on top of the network.
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_select">select</td>
|
|
<td>same as <code>click</code>.</td>
|
|
<td>Fired when the selection has changed by user action. This means a node or edge has been selected,
|
|
added
|
|
to the selection or deselected. <b>All select events are only triggered on click and hold</b>.
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_selectNode">selectNode</td>
|
|
<td>same as <code>click</code>.</td>
|
|
<td>Fired when a node has been selected by the user.</td>
|
|
</tr>
|
|
<tr><td id="event_selectEdge">selectEdge</td>
|
|
<td>same as <code>click</code>.</td>
|
|
<td>Fired when a edge has been selected by the user.</td>
|
|
</tr>
|
|
<tr><td id="event_deselectNode">deselectNode</td>
|
|
<td>Object
|
|
</td>
|
|
<td>Fired when a node (or nodes) has (or have) been deselected by the user. The previous selection is the list of nodes and edges that were selected before the last user event. Passes an object with properties structured as:
|
|
<pre class="prettyprint lang-js">{
|
|
nodes: [Array of selected nodeIds],
|
|
edges: [Array of selected edgeIds],
|
|
event: [Object] original click event,
|
|
pointer: {
|
|
DOM: {x:pointer_x, y:pointer_y},
|
|
canvas: {x:canvas_x, y:canvas_y}
|
|
}
|
|
},
|
|
previousSelection: {
|
|
nodes: [Array of previously selected nodeIds],
|
|
edges: [Array of previously selected edgeIds]
|
|
}
|
|
}
|
|
</pre>
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_deselectEdge">deselectEdge</td>
|
|
<td>same as <code>deselectNode</code>.</td>
|
|
<td>Fired when a edge (or edges) has (or have) been deselected by the user. The previous selection is
|
|
the
|
|
list of nodes and edges that were selected before the last user event.
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_dragStart">dragStart</td>
|
|
<td>same as <code>click</code>.</td>
|
|
<td>Fired when starting a drag.</td>
|
|
</tr>
|
|
<tr><td id="event_dragging">dragging</td>
|
|
<td>same as <code>click</code>.</td>
|
|
<td>Fired when dragging node(s) or the view.</td>
|
|
</tr>
|
|
<tr><td id="event_dragEnd">dragEnd</td>
|
|
<td>same as <code>click</code>.</td>
|
|
<td>Fired when the drag has finished.</td>
|
|
</tr>
|
|
<tr><td id="event_hoverNode">hoverNode</td>
|
|
<td><code>{node: nodeId}</code></td>
|
|
<td>Fired interaction:{hover:true} and the mouse hovers over a node.</td>
|
|
</tr>
|
|
<tr><td id="event_blurNode">blurNode</td>
|
|
<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 id="event_hoverEdge">hoverEdge</td>
|
|
<td><code>{edge: edgeId}</code></td>
|
|
<td>Fired interaction:{hover:true} and the mouse hovers over an edge.</td>
|
|
</tr>
|
|
<tr><td id="event_blurEdge">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 id="event_zoom">zoom</td>
|
|
<td><code>{direction:'+'/'-', scale: Number}</code></td>
|
|
<td>Fired when the user zooms in or out. The properties tell you which direction the zoom is in. The scale is a number greater than 0, which is the same that you get with network.getScale().</td>
|
|
</tr>
|
|
<tr><td id="event_showPopup">showPopup</td>
|
|
<td><code>id of item corresponding to popup</code></td>
|
|
<td>Fired when the popup (tooltip) is shown.</td>
|
|
</tr>
|
|
<tr><td id="event_hidePopup">hidePopup</td>
|
|
<td>none</td>
|
|
<td>Fired when the popup (tooltip) is hidden.</td>
|
|
</tr>
|
|
<tr class="subHeader ">
|
|
<td colspan="3">Events triggered the physics simulation. Can be used to trigger GUI updates.</td>
|
|
</tr>
|
|
<tr><td id="event_startStabilizing">startStabilizing</td>
|
|
<td>none</td>
|
|
<td>Fired when stabilization starts. This is also the case when you drag a node and the physics
|
|
simulation
|
|
restarts to stabilize again. Stabilization does not neccesarily imply 'without showing'.
|
|
</td>
|
|
<tr><td id="event_stabilizationProgress">stabilizationProgress</td>
|
|
<td>Object</td>
|
|
<td>Fired when a multiple of the <code>updateInterval</code> number of iterations is reached. This only occurs in the 'hidden' stabilization. Passes an object with properties structured as:
|
|
|
|
<pre class="prettyprint lang-js">{
|
|
iterations: Number // iterations so far,
|
|
total: Number // total iterations in options
|
|
}</pre>
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_stabilizationIterationsDone">stabilizationIterationsDone</td>
|
|
<td>none</td>
|
|
<td>Fired when the 'hidden' stabilization finishes. This does not necessarily mean the network is stabilized; it could also mean that the amount of iterations defined in the options has been reached.
|
|
</td>
|
|
<tr><td id="event_stabilized">stabilized</td>
|
|
<td>Object</td>
|
|
<td>Fired when the network has stabilized or when the <code>stopSimulation()</code> has been called. The amount of iterations it took could be used to tweak the maximum amount of iterations needed to stabilize the network. Passes an object with properties structured as:
|
|
<pre class="prettyprint lang-js">{
|
|
iterations: Number // iterations it took
|
|
}</pre>
|
|
|
|
</td>
|
|
<tr class="subHeader">
|
|
<td colspan="3">Event triggered by the canvas.</td>
|
|
</tr>
|
|
<tr><td id="event_resize">resize</td>
|
|
<td>Object</td>
|
|
<td>Fired when the size of the canvas has been resized, either by a redraw call when the container div has changed in size, a setSize() call with new values or a setOptions() with new width and/or height values. Passes an object with properties structured as:
|
|
|
|
<pre class="prettyprint lang-js">
|
|
{
|
|
width: Number // the new width of the canvas
|
|
height: Number // the new height of the canvas
|
|
oldWidth: Number // the old width of the canvas
|
|
oldHeight: Number // the old height of the canvas
|
|
}
|
|
</pre>
|
|
</td>
|
|
|
|
</tr>
|
|
<tr class="subHeader ">
|
|
<td colspan="3">Events triggered by the rendering module. Can be used to draw custom elements on the
|
|
canvas.
|
|
</td>
|
|
</tr>
|
|
<tr><td id="event_initRedraw">initRedraw</td>
|
|
<td>none</td>
|
|
<td>Fired before the redrawing begins. The simulation step has completed at this point. Can be used to
|
|
move
|
|
custom elements before starting drawing the new frame.
|
|
</td>
|
|
<tr><td id="event_beforeDrawing">beforeDrawing</td>
|
|
<td><code>canvas context</code></td>
|
|
<td>Fired after the canvas has been cleared, scaled and translated to the viewing position but before
|
|
all
|
|
edges and nodes are drawn. Can be used to draw behind the network.
|
|
</td>
|
|
<tr><td id="event_afterDrawing">afterDrawing</td>
|
|
<td><code>canvas context</code></td>
|
|
<td>Fired after drawing on the canvas has been completed. Can be used to draw on top of the network.
|
|
</td>
|
|
</tr>
|
|
<tr class="subHeader">
|
|
<td colspan="3">Event triggered by the view module.</td>
|
|
</tr>
|
|
<tr><td id="event_animationFinished">animationFinished</td>
|
|
<td>none</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>
|
|
|
|
</div>
|
|
|
|
<br /><hr />
|
|
<div id="importDiv">
|
|
<h2 id="importing_data">Importing data</h2>
|
|
|
|
<p>Network contains conversion utilities to import data from <a href="#importGephi">Gephi</a> and graphs in the <a href="#importDot">DOT language</a>.</p>
|
|
|
|
<h3 id="importGephi">Import data from Gephi</h3>
|
|
|
|
<p>
|
|
Network can import data straight from an exported json file from gephi. You can get the JSON exporter here:
|
|
<a href="https://marketplace.gephi.org/plugin/json-exporter/" target="_blank">https://marketplace.gephi.org/plugin/json-exporter/</a>.
|
|
An example exists showing how to get a JSON file into Vis:
|
|
</p>
|
|
|
|
<p>
|
|
Example usage:
|
|
</p>
|
|
|
|
<pre class="prettyprint lang-js">
|
|
// load the JSON file containing the Gephi network.
|
|
var gephiJSON = loadJSON("./datasources/WorldCup2014.json"); // code in <a href="http://visjs.org/examples/network/data/importingFromGephi.html">importing_from_gephi</a>.
|
|
|
|
// you can customize the result like with these options. These are explained below.
|
|
// These are the default options.
|
|
var parserOptions = {
|
|
edges: {
|
|
inheritColors: false
|
|
},
|
|
nodes: {
|
|
fixed: true,
|
|
parseColor: false
|
|
}
|
|
}
|
|
|
|
// parse the gephi file to receive an object
|
|
// containing nodes and edges in vis format.
|
|
var parsed = vis.network.convertGephi(gephiJSON, parserOptions);
|
|
|
|
// provide data in the normal fashion
|
|
var data = {
|
|
nodes: parsed.nodes,
|
|
edged: parsed.edges
|
|
};
|
|
|
|
// create a network
|
|
var network = new vis.Network(container, data);
|
|
</pre>
|
|
|
|
<br>
|
|
<h4>Gephi parser options</h4>
|
|
|
|
There are a few options you can use to tell Vis what to do with the data from Gephi.
|
|
<table class="options">
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Default</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
<tr><td>nodes.fixed</td>
|
|
<td>Boolean</td>
|
|
<td><code>true</code></td>
|
|
<td>When false, the nodes will move according to the physics model after import. If true, the nodes do
|
|
not move at all. If set to true, the node positions have to be defined to avoid infinite recursion
|
|
errors in the physics.
|
|
</td>
|
|
</tr>
|
|
<tr><td>nodes.parseColor</td>
|
|
<td>Boolean</td>
|
|
<td><code>false</code></td>
|
|
<td>If true, the color will be parsed by the vis parser, generating extra colors for the borders,
|
|
highlighs and hover. If false, the node will be the supplied color.
|
|
</td>
|
|
</tr>
|
|
<tr><td>edges.inheritColor</td>
|
|
<td>Boolean</td>
|
|
<td><code>false</code></td>
|
|
<td>When true, the color supplied by gephi is ignored and the inherit color mode is used with the global
|
|
setting.
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<h3 id="importDot">Import data in DOT language</h3>
|
|
|
|
<p>
|
|
Network supports data in the
|
|
<a href="http://en.wikipedia.org/wiki/DOT_language" target="_blank">DOT language</a>.
|
|
To use data in the DOT language, you can use the vis.network.convertDot converter to transform the DOT
|
|
language
|
|
into a vis.Network compatible nodes, edges and options objects. You can extend the options object with other
|
|
options if you'd like.
|
|
</p>
|
|
|
|
<p>
|
|
Example usage:
|
|
</p>
|
|
|
|
<pre class="prettyprint lang-js">
|
|
// provide data in the DOT language
|
|
var DOTstring = 'dinetwork {1 -> 1 -> 2; 2 -> 3; 2 -- 4; 2 -> 1 }';
|
|
var parsedData = vis.network.convertDot(DOTstring);
|
|
|
|
var data = {
|
|
nodes: parsedData.nodes,
|
|
edges: parsedData.edges
|
|
}
|
|
|
|
var options = parsedData.options;
|
|
|
|
// you can extend the options like a normal JSON variable:
|
|
options.nodes = {
|
|
color: 'red'
|
|
}
|
|
|
|
// create a network
|
|
var network = new vis.Network(container, data, options);
|
|
</pre>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<!-- Bootstrap core JavaScript
|
|
================================================== -->
|
|
<!-- Placed at the end of the document so the pages load faster -->
|
|
<script src="../js/jquery.min.js"></script>
|
|
<script src="../js/bootstrap.min.js"></script>
|
|
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
|
|
<script src="../js/ie10-viewport-bug-workaround.js"></script>
|
|
<!-- jquery extensions -->
|
|
<script src="../js/jquery.highlight.js"></script>
|
|
<script src="../js/jquery.url.min.js"></script>
|
|
<!-- Tipue vendor js -->
|
|
<script src="../js/tipuesearch.config.js"></script>
|
|
<script src="../js/tipuesearch.js"></script>
|
|
<!-- controller -->
|
|
<script src="../js/main.js"></script> |