mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-20 00:22:03 +02:00
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
1644 lines
63 KiB
HTML
1644 lines
63 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en"><head>
|
|
<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="">
|
|
<link rel="icon" HREF="favicon.ico">
|
|
<title>timeline - vis.js - A dynamic, browser based visualization library.</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>
|
|
|
|
<!-- Tipue vendor css -->
|
|
<link href="../css/tipuesearch.css" rel="stylesheet">
|
|
|
|
<!-- Tipue vendor css -->
|
|
<link href="../css/tipuesearch.css" rel="stylesheet">
|
|
|
|
<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>
|
|
</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>Timeline</h1>
|
|
|
|
<h2 id="Overview">Overview</h2>
|
|
<p>
|
|
The Timeline is an interactive visualization chart to visualize data in time.
|
|
The data items can take place on a single date, or have a start and end date (a range).
|
|
You can freely move and zoom in the timeline by dragging and scrolling in the
|
|
Timeline. Items can be created, edited, and deleted in the timeline.
|
|
The time scale on the axis is adjusted automatically, and supports scales ranging
|
|
from milliseconds to years.
|
|
</p>
|
|
<p>
|
|
Timeline uses regular HTML DOM to render the timeline and items put on the
|
|
timeline. This allows for flexible customization using css styling.
|
|
</p>
|
|
|
|
<h2 id="Contents">Contents</h2>
|
|
<ul>
|
|
<li><a href="#Overview">Overview</a></li>
|
|
<li><a href="#Example">Example</a></li>
|
|
<li><a href="#Loading">Loading</a></li>
|
|
<li><a href="#Data_Format">Data Format</a>
|
|
<ul>
|
|
<li><a href="#items">Items</a></li>
|
|
<li><a href="#groups">Groups</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#Configuration_Options">Configuration Options</a></li>
|
|
<li><a href="#Methods">Methods</a></li>
|
|
<li><a href="#Events">Events</a></li>
|
|
<li><a href="#Editing_Items">Editing Items</a></li>
|
|
<li><a href="#Templates">Templates</a></li>
|
|
<li><a href="#Localization">Localization</a></li>
|
|
<li><a href="#Styles">Styles</a></li>
|
|
<li><a href="#Data_Policy">Data Policy</a></li>
|
|
</ul>
|
|
|
|
<h2 id="Example">Example</h2>
|
|
<p>
|
|
The following code shows how to create a Timeline and provide it with data.
|
|
More examples can be found in the <a href="../examples">examples</a> directory.
|
|
</p>
|
|
|
|
<pre class="prettyprint lang-html"><!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>Timeline | Basic demo</title>
|
|
|
|
<style type="text/css">
|
|
body, html {
|
|
font-family: sans-serif;
|
|
}
|
|
</style>
|
|
|
|
<script src="../../dist/vis.js"></script>
|
|
<link href="../../dist/vis.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="visualization"></div>
|
|
|
|
<script type="text/javascript">
|
|
// DOM element where the Timeline will be attached
|
|
var container = document.getElementById('visualization');
|
|
|
|
// Create a DataSet (allows two way data-binding)
|
|
var items = new vis.DataSet([
|
|
{id: 1, content: 'item 1', start: '2013-04-20'},
|
|
{id: 2, content: 'item 2', start: '2013-04-14'},
|
|
{id: 3, content: 'item 3', start: '2013-04-18'},
|
|
{id: 4, content: 'item 4', start: '2013-04-16', end: '2013-04-19'},
|
|
{id: 5, content: 'item 5', start: '2013-04-25'},
|
|
{id: 6, content: 'item 6', start: '2013-04-27'}
|
|
]);
|
|
|
|
// Configuration for the Timeline
|
|
var options = {};
|
|
|
|
// Create a Timeline
|
|
var timeline = new vis.Timeline(container, items, options);
|
|
</script>
|
|
</body>
|
|
</html>
|
|
</pre>
|
|
|
|
|
|
<h2 id="Loading">Loading</h2>
|
|
<p>
|
|
Install or download the <a href="http://visjs.org" target="_blank">vis.js</a> library.
|
|
in a subfolder of your project. Include the libraries script and css files in the
|
|
head of your html code:
|
|
</p>
|
|
|
|
<pre class="prettyprint lang-html">
|
|
<script src="vis/dist/vis.js"></script>
|
|
<link href="vis/dist/vis.css" rel="stylesheet" type="text/css" />
|
|
</pre>
|
|
|
|
The constructor of the Timeline is <code>vis.Timeline</code>
|
|
<pre class="prettyprint lang-js">var timeline = new vis.Timeline(container, items, options);</pre>
|
|
or when using groups:
|
|
<pre class="prettyprint lang-js">var timeline = new vis.Timeline(container, items, groups, options);</pre>
|
|
|
|
The constructor accepts four parameters:
|
|
<ul>
|
|
<li>
|
|
<code>container</code> is the DOM element in which to create the timeline.
|
|
</li>
|
|
<li>
|
|
<code>items</code> is an Array containing items. The properties of an
|
|
item are described in section <a href="#Data_Format">Data Format, items</a>.
|
|
</li><li>
|
|
<code>groups</code> is an Array containing groups. The properties of a
|
|
group are described in section <a href="#groups">Data Format, groups</a>.
|
|
</li>
|
|
<li>
|
|
<code>options</code> is an optional Object containing a name-value map
|
|
with options. Options can also be set using the method
|
|
<code>setOptions</code>.
|
|
</li>
|
|
</ul>
|
|
|
|
<h2 id="Data_Format">Data Format</h2>
|
|
|
|
<p>
|
|
The timeline can be provided with two types of data:
|
|
</p>
|
|
<ul>
|
|
<li><a href="#items">Items</a> containing a set of items to be displayed in time.</li>
|
|
<li><a href="#groups">Groups</a> containing a set of groups used to group items
|
|
together.</li>
|
|
</ul>
|
|
|
|
<h3 id="items">Items</h3>
|
|
<p>
|
|
The Timeline uses regular Arrays and Objects as data format.
|
|
Data items can contain the properties <code>start</code>,
|
|
<code>end</code> (optional), <code>content</code>,
|
|
<code>group</code> (optional), <code>className</code> (optional),
|
|
<code>editable</code> (optional), and <code>style</code> (optional).
|
|
</p>
|
|
|
|
<p>
|
|
A table is constructed as:
|
|
</p>
|
|
|
|
<pre class="prettyprint lang-js">
|
|
var items = [
|
|
{
|
|
start: new Date(2010, 7, 15),
|
|
end: new Date(2010, 8, 2), // end is optional
|
|
content: 'Trajectory A'
|
|
// Optional: fields 'id', 'type', 'group', 'className', 'style'
|
|
}
|
|
// more items...
|
|
]);
|
|
</pre>
|
|
|
|
<p>
|
|
The item properties are defined as:
|
|
</p>
|
|
|
|
<table class="properties">
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
<tr>
|
|
<td>className</td>
|
|
<td>String</td>
|
|
<td>no</td>
|
|
<td>This field is optional. A className can be used to give items
|
|
an individual css style. For example, when an item has className
|
|
'red', one can define a css style like:
|
|
<pre class="prettyprint lang-css">
|
|
.vis-item.red {
|
|
color: white;
|
|
background-color: red;
|
|
border-color: darkred;
|
|
}</pre>
|
|
More details on how to style items can be found in the section
|
|
<a href="#Styles">Styles</a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>content</td>
|
|
<td>String</td>
|
|
<td>yes</td>
|
|
<td>The contents of the item. This can be plain text or html code.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>end</td>
|
|
<td>Date or number or string or Moment</td>
|
|
<td>no</td>
|
|
<td>The end date of the item. The end date is optional, and can be left <code>null</code>.
|
|
If end date is provided, the item is displayed as a range.
|
|
If not, the item is displayed as a box.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>group</td>
|
|
<td>any type</td>
|
|
<td>no</td>
|
|
<td>This field is optional. When the group column is provided,
|
|
all items with the same group are placed on one line.
|
|
A vertical axis is displayed showing the groups.
|
|
Grouping items can be useful for example when showing availability of multiple
|
|
people, rooms, or other resources next to each other.<br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String or Number</td>
|
|
<td>no</td>
|
|
<td>An id for the item. Using an id is not required but highly
|
|
recommended. An id is needed when dynamically adding, updating,
|
|
and removing items in a DataSet.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>start</td>
|
|
<td>Date or number or string or Moment</td>
|
|
<td>yes</td>
|
|
<td>The start date of the item, for example <code>new Date(2010,9,23)</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>style</td>
|
|
<td>String</td>
|
|
<td>no</td>
|
|
<td>
|
|
A css text string to apply custom styling for an individual item, for
|
|
example <code>"color: red; background-color: pink;"</code>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>subgroup</td>
|
|
<td>String or Number</td>
|
|
<td>none</td>
|
|
<td>The id of a subgroup.
|
|
Groups all items within a group per subgroup, and positions them on the
|
|
same height instead of staking them on top of each other. can be ordered
|
|
by specifying the option <code>subgroupOrder</code> of a group.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>none</td>
|
|
<td>Add a title for the item, displayed when holding the mouse on the item.
|
|
The title can only contain plain text.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>no</td>
|
|
<td>The type of the item. Can be 'box' (default), 'point', 'range', or 'background'.
|
|
Types 'box' and 'point' need a start date, the types 'range' and 'background' needs both a start and end date.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>editable</td>
|
|
<td>Boolean</td>
|
|
<td>no</td>
|
|
<td>Override the editable option of the timeline for a specific item.</td>
|
|
</table>
|
|
|
|
<h3 id="groups">Groups</h3>
|
|
<p>
|
|
Like the items, groups are regular JavaScript Arrays and Objects.
|
|
Using groups, items can be grouped together.
|
|
Items are filtered per group, and displayed as
|
|
|
|
Group items can contain the properties <code>id</code>,
|
|
<code>content</code>, and <code>className</code> (optional).
|
|
</p>
|
|
<p>
|
|
Groups can be applied to a timeline using the method <code>setGroups</code> or supplied in the constructor.
|
|
A table with groups can be created like:
|
|
</p>
|
|
|
|
<pre class="prettyprint lang-js">
|
|
var groups = [
|
|
{
|
|
id: 1,
|
|
content: 'Group 1'
|
|
// Optional: a field 'className', 'style'
|
|
}
|
|
// more groups...
|
|
]);
|
|
</pre>
|
|
|
|
|
|
<p>
|
|
Groups can have the following properties:
|
|
</p>
|
|
|
|
<table class="properties">
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
<tr>
|
|
<td>className</td>
|
|
<td>String</td>
|
|
<td>no</td>
|
|
<td>This field is optional. A className can be used to give groups
|
|
an individual css style. For example, when a group has className
|
|
'red', one can define a css style
|
|
<code>
|
|
.red {
|
|
color: red;
|
|
}
|
|
</code>.
|
|
More details on how to style groups can be found in the section
|
|
<a href="#Styles">Styles</a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>content</td>
|
|
<td>String</td>
|
|
<td>yes</td>
|
|
<td>The contents of the group. This can be plain text or html code.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String or Number</td>
|
|
<td>yes</td>
|
|
<td>An id for the group. The group will display all items having a
|
|
property <code>group</code> which matches the <code>id</code>
|
|
of the group.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>style</td>
|
|
<td>String</td>
|
|
<td>no</td>
|
|
<td>
|
|
A css text string to apply custom styling for an individual group label, for
|
|
example <code>"color: red; background-color: pink;"</code>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>subgroupOrder</td>
|
|
<td>String or Function</td>
|
|
<td>none</td>
|
|
<td>Order the subgroups by a field name or custom sort function.
|
|
By default, groups are ordered by first-come, first-show.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>none</td>
|
|
<td>A title for the group, displayed when holding the mouse on the groups label.
|
|
The title can only contain plain text.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
|
|
<h2 id="Configuration_Options">Configuration Options</h2>
|
|
|
|
<p>
|
|
Options can be used to customize the timeline.
|
|
Options are defined as a JSON object. All options are optional.
|
|
</p>
|
|
|
|
<pre class="prettyprint lang-js">
|
|
var options = {
|
|
width: '100%',
|
|
height: '30px',
|
|
margin: {
|
|
item: 20
|
|
}
|
|
};
|
|
</pre>
|
|
|
|
<p>
|
|
The following options are available.
|
|
</p>
|
|
|
|
<table class="options" id="optionTable">
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Default</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>align</td>
|
|
<td>String</td>
|
|
<td><code>'center'</code></td>
|
|
<td>Alignment of items with type 'box', 'range', and 'background'. Available values are 'auto' (default), 'center', 'left', or 'right'. For 'box' items, the 'auto' alignment is 'center'. For 'range' items, the auto alignment is dynamic: positioned left and shifted such that the contents is always visible on screen.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>autoResize</td>
|
|
<td>boolean</td>
|
|
<td><code>true</code></td>
|
|
<td>If true, the Timeline will automatically detect when its container is resized, and redraw itself accordingly. If false, the Timeline can be forced to repaint after its container has been resized using the function <code>redraw()</code>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>clickToUse</td>
|
|
<td>boolean</td>
|
|
<td><code>false</code></td>
|
|
<td>When a Timeline is configured to be <code>clickToUse</code>, it will react to mouse and touch events only when active.
|
|
When active, a blue shadow border is displayed around the Timeline. The Timeline is set active by clicking on it, and is changed to inactive again by clicking outside the Timeline or by pressing the ESC key.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>configure</td>
|
|
<td>boolean or function</td>
|
|
<td><code>false</code></td>
|
|
<td>When true, a configurator is loaded where all configuration options of the Timeline can be changed live.
|
|
|
|
The displayed options can be filtered by providing a filter function. This function is invoked with two arguments: the current <code>option</code> and the <code>path</code> (an Array) of the option within the options object. The option will be displayed when the filter function returns true. For example to only display format options:
|
|
<pre class="prettyprint lang-js">
|
|
function (option, path) {
|
|
return option === 'format' || path.indexOf('format') !== -1;
|
|
}</pre>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>dataAttributes</td>
|
|
<td>string[] or 'all'</string></td>
|
|
<td><code>false</code></td>
|
|
<td>An array of fields optionally defined on the timeline items that will be appended as <code>data-</code> attributes to the DOM element of the items.<br>
|
|
If value is <code>'all'</code> then each field defined on the timeline item will become a <code>data-</code> attribute.</td>
|
|
</tr>
|
|
|
|
<tr class='toggle collapsible' onclick="toggleTable('optionTable','editable', this);">
|
|
<td><span parent="editable" class="right-caret"></span> editable</td>
|
|
<td>boolean or Object</td>
|
|
<td><code>false</code></td>
|
|
<td>If true, the items in the timeline can be manipulated. Only applicable when option <code>selectable</code> is <code><code>true</code></code>. See also the callbacks <code>onAdd</code>, <code>onUpdate</code>, <code>onMove</code>, and <code>onRemove</code>. When <code>editable</code> is an object, one can enable or disable individual manipulation actions.
|
|
See section <a href="#Editing_Items">Editing Items</a> for a detailed explanation.
|
|
</td>
|
|
</tr>
|
|
<tr parent="editable" class="hidden">
|
|
<td class="indent">editable.add</td>
|
|
<td>boolean</td>
|
|
<td><code>false</code></td>
|
|
<td>If true, new items can be created by double tapping an empty space in the Timeline. See section <a href="#Editing_Items">Editing Items</a> for a detailed explanation.</td>
|
|
</tr>
|
|
<tr parent="editable" class="hidden">
|
|
<td class="indent">editable.remove</td>
|
|
<td>boolean</td>
|
|
<td><code>false</code></td>
|
|
<td>If true, items can be deleted by first selecting them, and then clicking the delete button on the top right of the item. See section <a href="#Editing_Items">Editing Items</a> for a detailed explanation.</td>
|
|
</tr>
|
|
<tr parent="editable" class="hidden">
|
|
<td class="indent">editable.updateGroup</td>
|
|
<td>boolean</td>
|
|
<td><code>false</code></td>
|
|
<td>If true, items can be dragged from one group to another. Only applicable when the Timeline has groups. See section <a href="#Editing_Items">Editing Items</a> for a detailed explanation.</td>
|
|
</tr>
|
|
<tr parent="editable" class="hidden">
|
|
<td class="indent">editable.updateTime</td>
|
|
<td>boolean</td>
|
|
<td><code>false</code></td>
|
|
<td>If true, items can be dragged to another moment in time. See section <a href="#Editing_Items">Editing Items</a> for a detailed explanation.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>end</td>
|
|
<td>Date or Number or String or Moment</td>
|
|
<td>none</td>
|
|
<td>The initial end date for the axis of the timeline.
|
|
If not provided, the latest date present in the items set is taken as
|
|
end date.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>format</td>
|
|
<td>Object</td>
|
|
<td>none</td>
|
|
<td>
|
|
Apply custom date formatting of the labels on the time axis. The default value of <code>format</code> is:
|
|
<pre class="prettyprint lang-js">{
|
|
minorLabels: {
|
|
millisecond:'SSS',
|
|
second: 's',
|
|
minute: 'HH:mm',
|
|
hour: 'HH:mm',
|
|
weekday: 'ddd D',
|
|
day: 'D',
|
|
month: 'MMM',
|
|
year: 'YYYY'
|
|
},
|
|
majorLabels: {
|
|
millisecond:'HH:mm:ss',
|
|
second: 'D MMMM HH:mm',
|
|
minute: 'ddd D MMMM',
|
|
hour: 'ddd D MMMM',
|
|
weekday: 'MMMM YYYY',
|
|
day: 'MMMM YYYY',
|
|
month: 'YYYY',
|
|
year: ''
|
|
}
|
|
}</pre>
|
|
For values which not provided in the customized <code>options.format</code>, the default values will be used.
|
|
All available formatting syntax is described in the <a href="http://momentjs.com/docs/#/displaying/format/">docs of moment.js</a>.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>groupOrder</td>
|
|
<td>String or Function</td>
|
|
<td>none</td>
|
|
<td>Order the groups by a field name or custom sort function.
|
|
By default, groups are not ordered.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>groupTemplate</td>
|
|
<td>function</td>
|
|
<td>none</td>
|
|
<td>A template function used to generate the contents of the groups. The function is called by the Timeline with a groups data as argument, and must return HTML code as result. When the option groupTemplate is specified, the groups do not need to have a field <code>content</code>. See section <a href="#Templates">Templates</a> for a detailed explanation.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>height</td>
|
|
<td>number or String</td>
|
|
<td>none</td>
|
|
<td>The height of the timeline in pixels or as a percentage.
|
|
When height is undefined or null, the height of the timeline is automatically
|
|
adjusted to fit the contents.
|
|
It is possible to set a maximum height using option <code>maxHeight</code>
|
|
to prevent the timeline from getting too high in case of automatically
|
|
calculated height.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>hiddenDates</td>
|
|
<td>Object</td>
|
|
<td>none</td>
|
|
<td>This option allows you to hide specific timespans from the time axis. The dates can be supplied as an object:
|
|
<code>{start: '2014-03-21 00:00:00', end: '2014-03-28 00:00:00', [repeat:'daily']}</code> or as an Array of these objects. The repeat argument is optional.
|
|
The possible values are (case-sensitive): <code>daily, weekly, monthly, yearly</code>. To hide a weekend, pick any Saturday as start and the following Monday as end
|
|
and set repeat to weekly.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>locale</td>
|
|
<td>String</td>
|
|
<td>none</td>
|
|
<td>Select a locale for the Timeline. See section <a href="#Localization">Localization</a> for more information.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>locales</td>
|
|
<td>Object</td>
|
|
<td>none</td>
|
|
<td>A map with i18n locales. See section <a href="#Localization">Localization</a> for more information.</td>
|
|
</tr>
|
|
|
|
<tr class='toggle collapsible' onclick="toggleTable('optionTable','margin', this);">
|
|
<td><span parent="margin" class="right-caret"></span> margin</td>
|
|
<td>number or Object</td>
|
|
<td>Object</td>
|
|
<td>When a number, applies the margin to <code>margin.axis</code>, <code>margin.item.horizontal</code>, and <code>margin.item.vertical</code>.</td>
|
|
</tr>
|
|
<tr parent="margin" class="hidden">
|
|
<td class="indent">margin.axis</td>
|
|
<td>number</td>
|
|
<td><code>20</code></td>
|
|
<td>The minimal margin in pixels between items and the time axis.</td>
|
|
</tr>
|
|
<tr parent="margin" class="hidden">
|
|
<td class="indent">margin.item</td>
|
|
<td>number</td>
|
|
<td><code>10</code></td>
|
|
<td>The minimal margin in pixels between items in both horizontal and vertical direction.</td>
|
|
</tr>
|
|
<tr parent="margin" class="hidden">
|
|
<td class="indent2">margin.item.horizontal</td>
|
|
<td>number</td>
|
|
<td><code>10</code></td>
|
|
<td>The minimal horizontal margin in pixels between items.</td>
|
|
</tr>
|
|
<tr parent="margin" class="hidden">
|
|
<td class="indent2">margin.item.vertical</td>
|
|
<td>number</td>
|
|
<td><code>10</code></td>
|
|
<td>The minimal vertical margin in pixels between items.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>max</td>
|
|
<td>Date or Number or String or Moment</td>
|
|
<td>none</td>
|
|
<td>Set a maximum Date for the visible range.
|
|
It will not be possible to move beyond this maximum.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>maxHeight</td>
|
|
<td>number or String</td>
|
|
<td>none</td>
|
|
<td>Specifies the maximum height for the Timeline. Can be a number in pixels or a string like "300px".</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>min</td>
|
|
<td>Date or Number or String or Moment</td>
|
|
<td>none</td>
|
|
<td>Set a minimum Date for the visible range.
|
|
It will not be possible to move beyond this minimum.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>minHeight</td>
|
|
<td>number or String</td>
|
|
<td>none</td>
|
|
<td>Specifies the minimum height for the Timeline. Can be a number in pixels or a string like "300px".</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>moveable</td>
|
|
<td>boolean</td>
|
|
<td><code>true</code></td>
|
|
<td>
|
|
Specifies whether the Timeline can be moved and zoomed by dragging the window.
|
|
See also option <code>zoomable</code>.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>multiselect</td>
|
|
<td>boolean</td>
|
|
<td><code>false</code></td>
|
|
<td>
|
|
If true, multiple items can be selected using ctrl+click, shift+click, or by holding items.
|
|
Only applicable when option <code>selectable</code> is <code>true</code>.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>onAdd</td>
|
|
<td>function</td>
|
|
<td>none</td>
|
|
<td>Callback function triggered when an item is about to be added: when the user double taps an empty space in the Timeline. See section <a href="#Editing_Items">Editing Items</a> for more information. Only applicable when both options <code>selectable</code> and <code>editable.add</code> are set <code><code>true</code></code>.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>onUpdate</td>
|
|
<td>function</td>
|
|
<td>none</td>
|
|
<td>Callback function triggered when an item is about to be updated, when the user double taps an item in the Timeline. See section <a href="#Editing_Items">Editing Items</a> for more information. Only applicable when both options <code>selectable</code> and <code>editable.updateTime</code> or <code>editable.updateGroup</code> are set <code><code>true</code></code>.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>onMove</td>
|
|
<td>function</td>
|
|
<td>none</td>
|
|
<td>Callback function triggered when an item has been moved: after the user has dragged the item to an other position. See section <a href="#Editing_Items">Editing Items</a> for more information. Only applicable when both options <code>selectable</code> and <code>editable.updateTime</code> or <code>editable.updateGroup</code> are set <code><code>true</code></code>.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>onMoving</td>
|
|
<td>function</td>
|
|
<td>none</td>
|
|
<td>Callback function triggered repeatedly when an item is being moved. See section <a href="#Editing_Items">Editing Items</a> for more information. Only applicable when both options <code>selectable</code> and <code>editable.updateTime</code> or <code>editable.updateGroup</code> are set <code><code>true</code></code>.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>onRemove</td>
|
|
<td>function</td>
|
|
<td>none</td>
|
|
<td>Callback function triggered when an item is about to be removed: when the user tapped the delete button on the top right of a selected item. See section <a href="#Editing_Items">Editing Items</a> for more information. Only applicable when both options <code>selectable</code> and <code>editable.remove</code> are set <code><code>true</code></code>.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>order</td>
|
|
<td>function</td>
|
|
<td>none</td>
|
|
<td>
|
|
<p>Provide a custom sort function to order the items. The order of the
|
|
items is determining the way they are stacked. The function
|
|
order is called with two arguments containing the data of two items to be
|
|
compared.
|
|
</p>
|
|
<p style="font-style: italic">WARNING: Use with caution. Custom ordering is not suitable for large amounts of items. On load, the Timeline will render all items once to determine their width and height. Keep the number of items in this configuration limited to a maximum of a few hundred items.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr class='toggle collapsible' onclick="toggleTable('optionTable','orientation', this);">
|
|
<td><span parent="orientation" class="right-caret"></span> orientation</td>
|
|
<td>String or Object</td>
|
|
<td><code>'bottom'</code></td>
|
|
<td>Orientation of the timelines axis and items. When orientation is a string, the value is applied to both items and axis. Can be 'top', 'bottom' (default), 'both', or 'none'.</td>
|
|
</tr>
|
|
<tr parent="orientation" class="hidden">
|
|
<td class="indent">orientation.axis</td>
|
|
<td>String</td>
|
|
<td><code>'bottom'</code></td>
|
|
<td>Orientation of the timeline axis: 'top', 'bottom' (default), 'both', or 'none'. If orientation is 'bottom', the time axis is drawn at the bottom. When 'top', the axis is drawn on top. When 'both', two axes are drawn, both on top and at the bottom. In case of 'none', no axis is drawn at all.</td>
|
|
</tr>
|
|
<tr parent="orientation" class="hidden">
|
|
<td class="indent">orientation.item</td>
|
|
<td>String</td>
|
|
<td><code>'bottom'</code></td>
|
|
<td>Orientation of the timeline items: 'top' or 'bottom' (default). Determines whether items are aligned to the top or bottom of the Timeline.</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td>selectable</td>
|
|
<td>boolean</td>
|
|
<td><code>true</code></td>
|
|
<td>If true, the items on the timeline can be selected. Multiple items can be selected by long pressing them, or by using ctrl+click or shift+click. The event <code>select</code> is fired each time the selection has changed (see section <a href="#Events">Events</a>).</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>showCurrentTime</td>
|
|
<td>boolean</td>
|
|
<td><code>true</code></td>
|
|
<td>Show a vertical bar at the current time.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<tr>
|
|
<td>showMajorLabels</td>
|
|
<td>boolean</td>
|
|
<td><code>true</code></td>
|
|
<td>By default, the timeline shows both minor and major date labels on the
|
|
time axis.
|
|
For example the minor labels show minutes and the major labels show hours.
|
|
When <code>showMajorLabels</code> is <code><code>false</code></code>, no major labels
|
|
are shown.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>showMinorLabels</td>
|
|
<td>boolean</td>
|
|
<td><code>true</code></td>
|
|
<td>By default, the timeline shows both minor and major date labels on the
|
|
time axis.
|
|
For example the minor labels show minutes and the major labels show hours.
|
|
When <code>showMinorLabels</code> is <code><code>false</code></code>, no minor labels
|
|
are shown. When both <code>showMajorLabels</code> and
|
|
<code>showMinorLabels</code> are false, no horizontal axis will be
|
|
visible.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>stack</td>
|
|
<td>boolean</td>
|
|
<td><code>true</code></td>
|
|
<td>If true (default), items will be stacked on top of each other such that they do not overlap.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>snap</td>
|
|
<td>function or null</td>
|
|
<td>function</td>
|
|
<td>When moving items on the Timeline, they will be snapped to nice dates like full hours or days, depending on the current scale. The <code>snap</code> function can be replaced with a custom function, or can be set to <code>null</code> to disable snapping. The signature of the snap function is:
|
|
<pre class="prettyprint lang-js">function snap(date: Date, scale: string, step: number) : Date or number</pre>
|
|
The parameter <code>scale</code> can be can be 'millisecond', 'second', 'minute', 'hour', 'weekday, 'day, 'month, or 'year'. The parameter <code>step</code> is a number like 1, 2, 4, 5.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>start</td>
|
|
<td>Date or Number or String or Moment</td>
|
|
<td>none</td>
|
|
<td>The initial start date for the axis of the timeline.
|
|
If not provided, the earliest date present in the events is taken as start date.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>template</td>
|
|
<td>function</td>
|
|
<td>none</td>
|
|
<td>A template function used to generate the contents of the items. The function is called by the Timeline with an items data as argument, and must return HTML code as result. When the option template is specified, the items do not need to have a field <code>content</code>. See section <a href="#Templates">Templates</a> for a detailed explanation.</td>
|
|
</tr>
|
|
|
|
<tr class='toggle collapsible' onclick="toggleTable('optionTable','timeAxis', this);">
|
|
<td><span parent="timeAxis" class="right-caret"></span> timeAxis</td>
|
|
<td>Object</td>
|
|
<td><code>Object</code></td>
|
|
<td>Specify a fixed scale and step size for the time axis.</td>
|
|
</tr>
|
|
<tr parent="timeAxis" class="hidden">
|
|
<td class="indent">timeAxis.scale</td>
|
|
<td>String</td>
|
|
<td>none</td>
|
|
<td>Set a fixed scale for the time axis of the Timeline. Choose from <code>'millisecond'</code>, <code>'second'</code>, <code>'minute'</code>, <code>'hour'</code>, <code>'weekday'</code>, <code>'day'</code>, <code>'month'</code>, <code>'year'</code>. Example usage:
|
|
<pre class="prettyprint lang-js">var options = {
|
|
timeAxis: {scale: 'minute', step: 5}
|
|
}</pre>
|
|
</td>
|
|
</tr>
|
|
<tr parent="timeAxis" class="hidden">
|
|
<td class="indent">timeAxis.step</td>
|
|
<td>number</td>
|
|
<td><code>1</code></td>
|
|
<td>
|
|
Set a fixed step size for the time axis. Only applicable when used together with <code>timeAxis.scale</code>.
|
|
Choose for example 1, 2, 5, or 10.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>none</td>
|
|
<td>Specifies the default type for the timeline items. Choose from 'box', 'point', 'range', and 'background'. Note that individual items can override this default type. If undefined, the Timeline will auto detect the type from the items data: if a start and end date is available, a 'range' will be created, and else, a 'box' is created. Items of type 'background' are not editable.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>width</td>
|
|
<td>String or Number</td>
|
|
<td><code>'100%'</code></td>
|
|
<td>The width of the timeline in pixels or as a percentage.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>zoomable</td>
|
|
<td>boolean</td>
|
|
<td><code>true</code></td>
|
|
<td>
|
|
Specifies whether the Timeline can be zoomed by pinching or scrolling in the window.
|
|
Only applicable when option <code>moveable</code> is set <code><code>true</code></code>.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>zoomKey</td>
|
|
<td>String</td>
|
|
<td><code>''</code></td>
|
|
<td>Specifies whether the Timeline is only zoomed when an additional key is down.
|
|
Available values are '' (does not apply), 'altKey', 'ctrlKey', or 'metaKey'.
|
|
Only applicable when option <code>moveable</code> is set <code><code>true</code></code>.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>zoomMax</td>
|
|
<td>number</td>
|
|
<td><code>315360000000000</code></td>
|
|
<td>Set a maximum zoom interval for the visible range in milliseconds.
|
|
It will not be possible to zoom out further than this maximum.
|
|
Default value equals about 10000 years.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>zoomMin</td>
|
|
<td>number</td>
|
|
<td><code>10</code></td>
|
|
<td>Set a minimum zoom interval for the visible range in milliseconds.
|
|
It will not be possible to zoom in further than this minimum.
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
|
<h2 id="Methods">Methods</h2>
|
|
<p>
|
|
The Timeline supports the following methods.
|
|
</p>
|
|
|
|
<table class="methods">
|
|
<tr>
|
|
<th>Method</th>
|
|
<th>Return Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>addCustomTime([time] [, id])</td>
|
|
<td>number or String</td>
|
|
<td>
|
|
Add new vertical bar representing a custom time that can be dragged by the user.
|
|
Parameter <code>time</code> can be a Date, Number, or String, and is <code>new Date()</code> by default.
|
|
Parameter <code>id</code> can be Number or String and is <code>undefined</code> by default.
|
|
The <code>id</code>code> is added as CSS class name of the custom time bar, allowing to style multiple time bars differently.
|
|
The method returns id of the created bar.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>destroy()</td>
|
|
<td>none</td>
|
|
<td>Destroy the Timeline. The timeline is removed from memory. all DOM elements and event listeners are cleaned up.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>fit([options])</td>
|
|
<td>none</td>
|
|
<td>Adjust the visible window such that it fits all items. See also function <code>focus(id)</code>.
|
|
Available options:
|
|
<ul>
|
|
<li><code>animation: boolean or {duration: number, easingFunction: string}</code><br>If true (default) or an Object, the range is animated smoothly to the new window. An object can be provided to specify duration and easing function. Default duration is 500 ms, and default easing function is <code>'easeInOutQuad'</code>. Available easing functions: <code>"linear"</code>, <code>"easeInQuad"</code>, <code>"easeOutQuad"</code>, <code>"easeInOutQuad"</code>, <code>"easeInCubic"</code>, <code>"easeOutCubic"</code>, <code>"easeInOutCubic"</code>, <code>"easeInQuart"</code>, <code>"easeOutQuart"</code>, <code>"easeInOutQuart"</code>, <code>"easeInQuint"</code>, <code>"easeOutQuint"</code>, <code>"easeInOutQuint"</code>.
|
|
</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>focus(id or ids [, options])</td>
|
|
<td>none</td>
|
|
<td>Adjust the visible window such that the selected item (or multiple items) are centered on screen. See also function <code>fit()</code>. Available options:
|
|
<ul>
|
|
<li><code>animation: boolean or {duration: number, easingFunction: string}</code><br>If true (default) or an Object, the range is animated smoothly to the new window. An object can be provided to specify duration and easing function. Default duration is 500 ms, and default easing function is <code>'easeInOutQuad'</code>. Available easing functions: <code>"linear"</code>, <code>"easeInQuad"</code>, <code>"easeOutQuad"</code>, <code>"easeInOutQuad"</code>, <code>"easeInCubic"</code>, <code>"easeOutCubic"</code>, <code>"easeInOutCubic"</code>, <code>"easeInQuart"</code>, <code>"easeOutQuart"</code>, <code>"easeInOutQuart"</code>, <code>"easeInQuint"</code>, <code>"easeOutQuint"</code>, <code>"easeInOutQuint"</code>.</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>getCurrentTime()</td>
|
|
<td>Date</td>
|
|
<td>Get the current time. Only applicable when option <code>showCurrentTime</code> is true.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>getCustomTime([id])</td>
|
|
<td>Date</td>
|
|
<td>Retrieve the custom time from the custom time bar with given id. Id is <code>undefined</code> by default.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="getEventProperties">
|
|
<td>getEventProperties(event)</td>
|
|
<td>Object</td>
|
|
<td>
|
|
Returns an Object with relevant properties from an event:
|
|
<ul>
|
|
<li><code>group</code> (Number or null): the id of the clicked group.</li>
|
|
<li><code>item</code> (Number or null): the id of the clicked item.</li>
|
|
<li><code>pageX</code> (Number): absolute horizontal position of the click event.</li>
|
|
<li><code>pageY</code> (Number): absolute vertical position of the click event.</li>
|
|
<li><code>x</code> (Number): relative horizontal position of the click event.</li>
|
|
<li><code>y</code> (Number): relative vertical position of the click event.</li>
|
|
<li><code>time</code> (Date): Date of the clicked event.</li>
|
|
<li><code>snappedTime</code> (Date): Date of the clicked event, snapped to a nice value.</li>
|
|
<li><code>what</code> (String or null): name of the clicked thing: <code>item</code>, <code>background</code>, <code>axis</code>, <code>group-label</code>, <code>custom-time</code>, or <code>current-time</code>.</li>
|
|
<li><code>event</code> (Object): the original click event.</li>
|
|
</ul>
|
|
Example usage:
|
|
<pre class="prettyprint lang-js">
|
|
document.getElementById('myTimeline').onclick = function (event) {
|
|
var props = timeline.getEventProperties(event)
|
|
console.log(props);
|
|
}</pre>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>getSelection()</td>
|
|
<td>number[]</td>
|
|
<td>Get an array with the ids of the currently selected items.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>getVisibleItems()</td>
|
|
<td>number[]</td>
|
|
<td>Get an array with the ids of the currently visible items.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>getWindow()</td>
|
|
<td>Object</td>
|
|
<td>Get the current visible window. Returns an object with properties <code>start: Date</code> and <code>end: Date</code>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>moveTo(time [, options])</td>
|
|
<td>none</td>
|
|
<td>Move the window such that given time is centered on screen. Parameter <code>time</code> can be a <code>Date</code>, <code>Number</code>, or <code>String</code>. Available options:
|
|
<ul>
|
|
<li><code>animation: boolean or {duration: number, easingFunction: string}</code><br>If true (default) or an Object, the range is animated smoothly to the new window. An object can be provided to specify duration and easing function. Default duration is 500 ms, and default easing function is <code>'easeInOutQuad'</code>. Available easing functions: <code>"linear"</code>, <code>"easeInQuad"</code>, <code>"easeOutQuad"</code>, <code>"easeInOutQuad"</code>, <code>"easeInCubic"</code>, <code>"easeOutCubic"</code>, <code>"easeInOutCubic"</code>, <code>"easeInQuart"</code>, <code>"easeOutQuart"</code>, <code>"easeInOutQuart"</code>, <code>"easeInQuint"</code>, <code>"easeOutQuint"</code>, <code>"easeInOutQuint"</code>.</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>on(event, callback)</td>
|
|
<td>none</td>
|
|
<td>Create an event listener. The callback function is invoked every time the event is triggered. Avialable events: <code>rangechange</code>, <code>rangechanged</code>, <code>select</code>. The callback function is invoked as <code>callback(properties)</code>, where <code>properties</code> is an object containing event specific properties. See section <a href="#Events">Events for more information</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>off(event, callback)</td>
|
|
<td>none</td>
|
|
<td>Remove an event listener created before via function <code>on(event, callback)</code>. See section <a href="#Events">Events for more information</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>redraw()</td>
|
|
<td>none</td>
|
|
<td>Force a redraw of the Timeline. The size of all items will be recalculated.
|
|
Can be useful to manually redraw when option <code>autoResize=false</code> and the window
|
|
has been resized, or when the items CSS has been changed.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>removeCustomTime(id)</td>
|
|
<td>none</td>
|
|
<td>
|
|
Remove vertical bars previously added to the timeline via <code>addCustomTime</code> method. Parameter <code>id</code> is the ID of the custom vertical bar returned by <code>addCustomTime</code> method.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>setCurrentTime(time)</td>
|
|
<td>none</td>
|
|
<td>Set a current time. This can be used for example to ensure that a client's time is synchronized with a shared server time.
|
|
<code>time</code> can be a Date object, numeric timestamp, or ISO date string.
|
|
Only applicable when option <code>showCurrentTime</code> is true.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>setCustomTime(time [, id])</td>
|
|
<td>none</td>
|
|
<td>Adjust the time of a custom time bar.
|
|
Parameter <code>time</code> can be a Date object, numeric timestamp, or ISO date string.
|
|
Parameter <code>id</code> is the idof the custom time bar, and is <code>undefined</code> by default.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>setData({<br> groups: groups,<br> items: items<br>})</td>
|
|
<td>none</td>
|
|
<td>Set both groups and items at once. Both properties are optional. This is a convenience method for individually calling both <code>setItems(items)</code> and <code>setGroups(groups)</code>.
|
|
Both <code>items</code> and <code>groups</code> can be an Array with Objects,
|
|
a DataSet, or a DataView. For each of the groups, the items of the
|
|
timeline are filtered on the property <code>group</code>, which
|
|
must correspond with the id of the group.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>setGroups(groups)</td>
|
|
<td>none</td>
|
|
<td>Set a data set with groups for the Timeline.
|
|
<code>groups</code> can be an Array with Objects,
|
|
a DataSet, or a DataView. For each of the groups, the items of the
|
|
timeline are filtered on the property <code>group</code>, which
|
|
must correspond with the id of the group.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>setItems(items)</td>
|
|
<td>none</td>
|
|
<td>Set a data set with items for the Timeline.
|
|
<code>items</code> can be an Array with Objects,
|
|
a DataSet, or a DataView.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>setOptions(options)</td>
|
|
<td>none</td>
|
|
<td>Set or update options. It is possible to change any option of the timeline at any time. You can for example switch orientation on the fly.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>setSelection(id or ids [, options])</td>
|
|
<td>none</td>
|
|
<td>Select one or multiple items by their id. The currently selected items will be unselected. To unselect all selected items, call `setSelection([])`. Available options:
|
|
<ul>
|
|
<li><code>focus: boolean</code><br>If true, focus will be set to the selected item(s)</li>
|
|
<li><code>animation: boolean or {duration: number, easingFunction: string}</code><br>If true (default) or an Object, the range is animated smoothly to the new window. An object can be provided to specify duration and easing function. Default duration is 500 ms, and default easing function is <code>'easeInOutQuad'</code>. Only applicable when option focus is true. Available easing functions: <code>"linear"</code>, <code>"easeInQuad"</code>, <code>"easeOutQuad"</code>, <code>"easeInOutQuad"</code>, <code>"easeInCubic"</code>, <code>"easeOutCubic"</code>, <code>"easeInOutCubic"</code>, <code>"easeInQuart"</code>, <code>"easeOutQuart"</code>, <code>"easeInOutQuart"</code>, <code>"easeInQuint"</code>, <code>"easeOutQuint"</code>, <code>"easeInOutQuint"</code>.</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>setWindow(start, end [, options])</td>
|
|
<td>none</td>
|
|
<td>Set the current visible window. The parameters <code>start</code> and <code>end</code> can be a <code>Date</code>, <code>Number</code>, or <code>String</code>. If the parameter value of <code>start</code> or <code>end</code> is null, the parameter will be left unchanged. Available options:
|
|
<ul>
|
|
<li><code>animation: boolean or {duration: number, easingFunction: string}</code><br>If true (default) or an Object, the range is animated smoothly to the new window. An object can be provided to specify duration and easing function. Default duration is 500 ms, and default easing function is <code>'easeInOutQuad'</code>. Available easing functions: <code>"linear"</code>, <code>"easeInQuad"</code>, <code>"easeOutQuad"</code>, <code>"easeInOutQuad"</code>, <code>"easeInCubic"</code>, <code>"easeOutCubic"</code>, <code>"easeInOutCubic"</code>, <code>"easeInQuart"</code>, <code>"easeOutQuart"</code>, <code>"easeInOutQuart"</code>, <code>"easeInQuint"</code>, <code>"easeOutQuint"</code>, <code>"easeInOutQuint"</code>.</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<h2 id="Events">Events</h2>
|
|
<p>
|
|
Timeline fires events when changing the visible window by dragging, when
|
|
selecting items, and when dragging the custom time bar.
|
|
</p>
|
|
|
|
<p>
|
|
Here an example on how to listen for a <code>select</code> event.
|
|
</p>
|
|
|
|
<pre class="prettyprint lang-js">
|
|
timeline.on('select', function (properties) {
|
|
alert('selected items: ' + properties.nodes);
|
|
});
|
|
</pre>
|
|
|
|
<p>
|
|
A listener can be removed via the function <code>off</code>:
|
|
</p>
|
|
|
|
<pre class="prettyprint lang-js">
|
|
function onSelect (properties) {
|
|
alert('selected items: ' + properties.nodes);
|
|
}
|
|
|
|
// add event listener
|
|
timeline.on('select', onSelect);
|
|
|
|
// do stuff...
|
|
|
|
// remove event listener
|
|
timeline.off('select', onSelect);
|
|
</pre>
|
|
|
|
|
|
<p>
|
|
The following events are available.
|
|
</p>
|
|
|
|
<table class="events">
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Properties</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>click</td>
|
|
<td>
|
|
Passes a properties object as returned by the method <a href="#getEventProperties"><code>Timeline.getEventProperties(event)</code></a>.
|
|
</td>
|
|
<td>Fired when clicked inside the Timeline.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>contextmenu</td>
|
|
<td>
|
|
Passes a properties object as returned by the method <a href="#getEventProperties"><code>Timeline.getEventProperties(event)</code></a>.
|
|
</td>
|
|
<td>Fired when right-clicked inside the Timeline. Note that in order to prevent the context menu from showing up, default behavior of the event must be stopped:
|
|
<pre class="prettyprint lang-js">timeline.on('contextmenu', function (props) {
|
|
alert('Right click!');
|
|
props.event.preventDefault();
|
|
});
|
|
</pre>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>doubleClick</td>
|
|
<td>
|
|
Passes a properties object as returned by the method <a href="#getEventProperties"><code>Timeline.getEventProperties(event)</code></a>.
|
|
</td>
|
|
<td>Fired when double clicked inside the Timeline.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>rangechange</td>
|
|
<td>
|
|
<ul>
|
|
<li><code>start</code> (Number): timestamp of the current start of the window.</li>
|
|
<li><code>end</code> (Number): timestamp of the current end of the window.</li>
|
|
<li><code>byUser</code> (Boolean): change happened because of user drag/zoom.</li>
|
|
</ul>
|
|
</td>
|
|
<td>Fired repeatedly when the timeline window is being changed.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>rangechanged</td>
|
|
<td>
|
|
<ul>
|
|
<li><code>start</code> (Number): timestamp of the current start of the window.</li>
|
|
<li><code>end</code> (Number): timestamp of the current end of the window.</li>
|
|
<li><code>byUser</code> (Boolean): change happened because of user drag/zoom.</li>
|
|
</ul>
|
|
</td>
|
|
<td>Fired once after the timeline window has been changed.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>select</td>
|
|
<td>
|
|
<ul>
|
|
<li><code>items</code>: an array with the ids of the selected items</li>
|
|
<li><code>event</code>: the original click event</li>
|
|
</ul>
|
|
</td>
|
|
<td>Fired after the user selects or deselects items by tapping or holding them.
|
|
When a use taps an already selected item, the select event is fired again.
|
|
Not fired when the method <code>setSelection</code>is executed.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>timechange</td>
|
|
<td>
|
|
<ul>
|
|
<li><code>id</code> (Number or String): custom time bar id.</li>
|
|
<li><code>time</code> (Date): the custom time.</li>
|
|
</ul>
|
|
</td>
|
|
<td>Fired repeatedly when the user is dragging the custom time bar.
|
|
Only available when the custom time bar is enabled.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>timechanged</td>
|
|
<td>
|
|
<ul>
|
|
<li><code>id</code> (Number or String): custom time bar id.</li>
|
|
<li><code>time</code> (Date): the custom time.</li>
|
|
</ul>
|
|
</td>
|
|
<td>Fired once after the user has dragged the custom time bar.
|
|
Only available when the custom time bar is enabled.
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<h2 id="Editing_Items">Editing Items</h2>
|
|
<p>
|
|
When the Timeline is configured to be editable (both options <code>selectable</code> and <code>editable</code> are <code><code>true</code></code>), the user can:
|
|
</p>
|
|
<ul>
|
|
<li>Select an item by clicking it, and use ctrl+click to or shift+click to select multiple items (when <code>multiselect: true</code>).</li>
|
|
<li>Move selected items by dragging them.</li>
|
|
<li>Create a new item by double tapping on an empty space.</li>
|
|
<li>Create a new range item by dragging on an empty space with the ctrl key down.</li>
|
|
<li>Update an item by double tapping it.</li>
|
|
<li>Delete a selected item by clicking the delete button on the top right.</li>
|
|
</ul>
|
|
|
|
<p>Option <code>editable</code> accepts a boolean or an object. When <code>editable</code> is a boolean, all manipulation actions will be either enabled or disabled. When <code>editable</code> is an object, one can enable individual manipulation actions:</p>
|
|
|
|
<pre class="prettyprint lang-js">// enable or disable all manipulation actions
|
|
var options = {
|
|
editable: true // true or false
|
|
};
|
|
|
|
// enable or disable individual manipulation actions
|
|
var options = {
|
|
editable: {
|
|
add: true, // add new items by double tapping
|
|
updateTime: true, // drag items horizontally
|
|
updateGroup: true, // drag items from one group to another
|
|
remove: true // delete an item by tapping the delete button top right
|
|
}
|
|
};</pre>
|
|
|
|
<p>
|
|
Editing can be enabled/disabled for specific items. Setting the property <code>editable</code> to <code>true</code> or <code>false</code> on a data item will override the timeline option.
|
|
</p>
|
|
|
|
<pre class="prettyprint lang-js">
|
|
var items = new vis.DataSet([
|
|
{id: 1, content: 'read-only item', start: '2013-04-20', editable: false},
|
|
{id: 2, content: 'editable item', start: '2013-04-14'}
|
|
]);
|
|
</pre>
|
|
|
|
<p>
|
|
One can specify callback functions to validate changes made by the user. There are a number of callback functions for this purpose:
|
|
</p>
|
|
|
|
<ul>
|
|
<li><code>onAdd(item, callback)</code> Fired when a new item is about to be added. If not implemented, the item will be added with default text contents.</li>
|
|
<li><code>onUpdate(item, callback)</code> Fired when an item is about to be updated. This function typically has to show a dialog where the user change the item. If not implemented, nothing happens.</li>
|
|
<li><code>onMove(item, callback)</code> Fired when an item has been moved. If not implemented, the move action will be accepted.</li>
|
|
<li><code>onMoving(item, callback)</code> Fired repeatedly while an item is being moved (dragged). Can be used to adjust the items start, end, and/or group to allowed regions.</li>
|
|
<li><code>onRemove(item, callback)</code> Fired when an item is about to be deleted. If not implemented, the item will be always removed.</li>
|
|
</ul>
|
|
|
|
<p>
|
|
Each of the callbacks is invoked with two arguments:
|
|
</p>
|
|
<ul>
|
|
<li><code>item</code>: the item being manipulated</li>
|
|
<li><code>callback</code>: a callback function which must be invoked to report back. The callback must be invoked as <code>callback(item or null)</code>. Here, <code>item</code> can contain changes to the passed item. Parameter `item` typically contains fields `content`, `start`, and optionally `end`. The type of `start` and `end` is determined by the DataSet type configuration and is `Date` by default. When invoked as <code>callback(null)</code>, the action will be cancelled.</li>
|
|
</ul>
|
|
|
|
<p>
|
|
Example code:
|
|
</p>
|
|
|
|
<pre class="prettyprint lang-js">var options = {
|
|
onUpdate: function (item, callback) {
|
|
item.content = prompt('Edit items text:', item.content);
|
|
if (item.content != null) {
|
|
callback(item); // send back adjusted item
|
|
}
|
|
else {
|
|
callback(null); // cancel updating the item
|
|
}
|
|
}
|
|
};
|
|
</pre>
|
|
|
|
A full example is available here: <a href="../../examples/timeline/08_manipulation_callbacks.html">08_manipulation_callbacks.html</a>.
|
|
|
|
|
|
<h2 id="Templates">Templates</h2>
|
|
|
|
<p>
|
|
Timeline supports templates to format item contents. Any template engine (such as <a href="http://handlebarsjs.com/">handlebars</a> or <a href="http://mustache.github.io/">mustache</a>) can be used, and one can also manually build HTML. In the options, one can provide a template handler. This handler is a function accepting an items data as argument, and outputs formatted HTML:
|
|
</p>
|
|
|
|
<pre class="prettyprint lang-js">var options = {
|
|
template: function (item) {
|
|
var html = ... // generate HTML markup for this item
|
|
return html;
|
|
}
|
|
};
|
|
</pre>
|
|
|
|
<h3>Create HTML manually</h3>
|
|
|
|
The HTML for an item can be created manually:
|
|
|
|
<pre class="prettyprint lang-js">var options = {
|
|
template: function (item) {
|
|
return '<h1>' + item.header + '</h1><p>' + item.description + '</p>';
|
|
}
|
|
};
|
|
</pre>
|
|
|
|
<h3>Using a template engine</h3>
|
|
|
|
Using <a href="http://handlebarsjs.com/">handlebars</a>, one can write the template in HTML:
|
|
|
|
<pre class="prettyprint lang-html">
|
|
<script id="item-template" type="text/x-handlebars-template">
|
|
<h1>{{header}}</h1>
|
|
<p>{{description}}</p>
|
|
</script>
|
|
</pre>
|
|
|
|
Compile the template:
|
|
|
|
<pre class="prettyprint lang-js">
|
|
var source = document.getElementById('item-template').innerHTML;
|
|
var template = Handlebars.compile(source);
|
|
</pre>
|
|
|
|
And then specify the template in the Timeline options
|
|
|
|
<pre class="prettyprint lang-js">var options = {
|
|
template: template
|
|
};
|
|
</pre>
|
|
|
|
<h3>Multiple templates</h3>
|
|
|
|
In order to support multiple templates, the template handler can be extended to switch between different templates, depending on a specific item property:
|
|
|
|
<pre class="prettyprint lang-js">
|
|
var templates = {
|
|
template1: Handlebars.compile(...),
|
|
template2: Handlebars.compile(...),
|
|
template2: Handlebars.compile(...),
|
|
...
|
|
};
|
|
|
|
var options = {
|
|
template: function (item) {
|
|
var template = templates[item.template]; // choose the right template
|
|
return template(item); // execute the template
|
|
}
|
|
};
|
|
</pre>
|
|
|
|
Now the items can be extended with a property <code>template</code>, specifying which template to use for the item.
|
|
|
|
|
|
<h2 id="Localization">Localization</h2>
|
|
<p>
|
|
Timeline can be localized. For localization, Timeline depends largely on the localization of <a href="http://momentjs.com">moment.js</a>. Locales are not included in vis.js by default. To enable localization, moment.js must be loaded with locales. Moment.js offers a bundle named "moment-with-locales.min.js" for this and there are various alternative ways to load locales.
|
|
</p>
|
|
|
|
<p>
|
|
To set a locale for the Timeline, specify the option <code>locale</code>:
|
|
</p>
|
|
|
|
<pre class="prettyprint lang-js">var options = {
|
|
locale: 'nl'
|
|
};
|
|
</pre>
|
|
|
|
<h3>Create a new locale</h3>
|
|
|
|
To load a locale into the Timeline not supported by default, one can add a new locale to the option <code>locales</code>:
|
|
|
|
<pre class="prettyprint lang-js">var options = {
|
|
locales: {
|
|
// create a new locale (text strings should be replaced with localized strings)
|
|
mylocale: {
|
|
current: 'current',
|
|
time: 'time',
|
|
}
|
|
},
|
|
|
|
// use the new locale
|
|
locale: 'mylocale'
|
|
};
|
|
</pre>
|
|
|
|
<h3 id="available-locales">Available locales</h3>
|
|
|
|
<p>
|
|
Timeline comes with support for the following locales:
|
|
</p>
|
|
|
|
<table>
|
|
<tr>
|
|
<th>Language</th>
|
|
<th>Code</th>
|
|
</tr>
|
|
<tr>
|
|
<td>English</td>
|
|
<td>
|
|
<code>en</code><br>
|
|
<code>en_EN</code><br>
|
|
<code>en_US</code>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Dutch</td>
|
|
<td>
|
|
<code>nl</code><br>
|
|
<code>nl_NL</code><br>
|
|
<code>nl_BE</code>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
<h2 id="Styles">Styles</h2>
|
|
<p>
|
|
All parts of the Timeline have a class name and a default css style.
|
|
The styles can be overwritten, which enables full customization of the layout
|
|
of the Timeline.
|
|
</p>
|
|
|
|
<p>For example, to change the border and background color of all items, include the
|
|
following code inside the head of your html code or in a separate stylesheet.</p>
|
|
<pre class="prettyprint lang-html"><style>
|
|
.vis-item {
|
|
border-color: orange;
|
|
background-color: yellow;
|
|
}
|
|
</style>
|
|
</pre>
|
|
|
|
<h3 id="Grid_Backgrounds">Grid Backgrounds</h3>
|
|
<p>
|
|
The background grid of the time axis can be styled, for example to highlight
|
|
weekends or to create grids with an alternating white/lightgray background.
|
|
</p>
|
|
<p>
|
|
Depending on the zoom level, the grids get certain css classes attached.
|
|
The following classes are available:
|
|
</p>
|
|
|
|
<table class="styles">
|
|
<tr>
|
|
<th>Description</th><th>Values</th>
|
|
</tr>
|
|
<tr>
|
|
<td>Alternating columns</td><td><code>vis-even</code>, <code>vis-odd</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Current date</td><td><code>vis-today</code>, <code>vis-tomorrow</code>, <code>vis-yesterday</code>, <code>vis-current-week</code>, <code>vis-current-month</code>, <code>vis-current-year</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Hours</td><td><code>vis-h0</code>, <code>vis-h1</code>, ..., <code>vis-h23</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Grouped hours</td><td><code>vis-h0-h4</code> to <code>vis-h20-h24</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Weekday</td><td><code>vis-monday</code>, <code>vis-tuesday</code>, <code>vis-wednesday</code>, <code>vis-thursday</code>, <code>vis-friday</code>, <code>vis-saturday</code>, <code>vis-sunday</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Days</td><td><code>vis-date1</code>, <code>vis-date2</code>, ..., <code>vis-date31</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Months</td><td><code>vis-januari</code>, <code>vis-februari</code>, <code>vis-march</code>, <code>vis-april</code>, <code>vis-may</code>, <code>vis-june</code>, <code>vis-july</code>, <code>vis-august</code>, <code>vis-september</code>, <code>vis-october</code>, <code>vis-november</code>, <code>vis-december</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Years</td><td><code>vis-year2014</code>, <code>vis-year2015</code>, ...</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p>Examples:</p>
|
|
|
|
<pre class="prettyprint lang-html"><style>
|
|
/* alternating column backgrounds */
|
|
.vis-time-axis .grid.vis-odd {
|
|
background: #f5f5f5;
|
|
}
|
|
|
|
/* gray background in weekends, white text color */
|
|
.vis-time-axis .vis-grid.vis-saturday,
|
|
.vis-time-axis .vis-grid.vis-sunday {
|
|
background: gray;
|
|
}
|
|
.vis-time-axis .vis-text.vis-saturday,
|
|
.vis-time-axis .vis-text.vis-sunday {
|
|
color: white;
|
|
}
|
|
</style>
|
|
</pre>
|
|
|
|
|
|
<h2 id="Data_Policy">Data Policy</h2>
|
|
<p>
|
|
All code and data is processed and rendered in the browser.
|
|
No data is sent to any server.
|
|
</p>
|
|
|
|
</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>
|