diff --git a/.gitignore b/.gitignore index 4279dd13..c145381d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ # vis.js files dist/ -test/ -dist/ # npm files node_modules diff --git a/.travis.yml b/.travis.yml index cb336928..ce6f1da0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,4 +2,6 @@ language: node_js node_js: "6" before_script: - npm install -g gulp -script: gulp \ No newline at end of file +script: + - gulp + - npm test diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 414327c7..a5fe23ea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,6 +9,7 @@ If you have any *general question* on how to use the vis.js library in your own If you really want to open a new issue: * Please use the [search functionality](//github.com/almende/vis/issues) to make sure that there is not already an issue concerning the same topic. * Please make sure to **mention which module** of vis.js (network, timeline, graph3d, ...) your are referring to. +* Note that development happens on the `develop` git branch. Be sure to submit PRs against this branch. * If you think you found a bug please **provide a simple example** (e.g. on [jsbin](jsbin.com)) that demonstrates the problem. * If you want to propose a feature-request please **describe what you are looking for in detail**, ideally providing a screenshot, drawing or something similar. * **Close the issue later**, when the issue is no longer needed. diff --git a/HISTORY.md b/HISTORY.md index cf855fbf..98831743 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -2,6 +2,34 @@ http://visjs.org +## 2017-01-29, version 4.18.1 + +### General + +- updated dependencies +- FIX: moved babel plugins from devDependencies to dependencies (#2629) + +### Network + +- FIX #2604: Handle label composition for long words (#2650) +- FIX #2640: Network manipulation styles together with Bootstrap styles (#2654) +- FIX #2494: Fix tree collision in hierarchical layout (#2625) +- FIX #2589: Vertically center label in network circle node (#2593) +- FIX #2591: Self reference edge should now appear in all cases (#2595) +- FIX #2613: Fixed return value for zoom in/out callback (#2615) +- FIX #2609: Values should be passed to check values.borderDashes (#2599) + +### Timeline / Graph2D + +- FIX: Fixed htmlContents example (#2651) +- FIX #2590: Min zoom bug (#2646) +- FIX #2597: Zoom while dragging (#2645) +- FIX: Minor cleanups in Timeline Range. (#2633) +- FIX #2458: Allow graph2D options to be undefined (#2634) +- FIX: Fix typo (#2622) +- FIX #2585: Fixed React example (#2587) + + ## 2017-01-15, version 4.18.0 ### General diff --git a/LICENSE-MIT b/LICENSE-MIT index 61da206c..ca928f7b 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2016 Almende B.V. +Copyright (c) 2014-2017 Almende B.V. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/NOTICE b/NOTICE deleted file mode 100644 index a5ef8dbf..00000000 --- a/NOTICE +++ /dev/null @@ -1,33 +0,0 @@ -Vis.js -Copyright 2010-2016 Almende B.V. - -Vis.js is dual licensed under both - - * The Apache 2.0 License - http://www.apache.org/licenses/LICENSE-2.0 - - and - - * The MIT License - http://opensource.org/licenses/MIT - -Vis.js may be distributed under either license. - - -Vis.js uses and redistributes the following third-party libraries: - -- component-emitter - https://github.com/component/emitter - The MIT License - -- hammer.js - http://hammerjs.github.io/ - The MIT License - -- moment.js - http://momentjs.com/ - The MIT License - -- keycharm - https://github.com/AlexDM0/keycharm - The MIT License diff --git a/README.md b/README.md index b08e5997..a61f1bd9 100644 --- a/README.md +++ b/README.md @@ -192,8 +192,8 @@ exports.Timeline = require('./lib/timeline/Timeline'); Then create a custom bundle using browserify, like: - $ browserify custom.js -t babelify -o dist/vis-custom.js -s vis - + $ browserify custom.js -t [ babelify --presets [es2015] ] -o dist/vis-custom.js -s vis + This will generate a custom bundle *vis-custom.js*, which exposes the namespace `vis` containing only `DataSet` and `Timeline`. The generated bundle can be minified using uglifyjs: $ uglifyjs dist/vis-custom.js -o dist/vis-custom.min.js @@ -217,7 +217,7 @@ The custom bundle can now be loaded like: The default bundle `vis.js` is standalone and includes external dependencies such as *hammer.js* and *moment.js*. When these libraries are already loaded by the application, vis.js does not need to include these dependencies itself too. To build a custom bundle of vis.js excluding *moment.js* and *hammer.js*, run browserify in the root of the project: - $ browserify index.js -t babelify -o dist/vis-custom.js -s vis -x moment -x hammerjs + $ browserify index.js -t [ babelify --presets [es2015] ] -o dist/vis-custom.js -s vis -x moment -x hammerjs This will generate a custom bundle *vis-custom.js*, which exposes the namespace `vis`, and has *moment.js* and *hammer.js* excluded. The generated bundle can be minified with uglifyjs: @@ -330,7 +330,7 @@ Then run the tests: ## License -Copyright (C) 2010-2016 Almende B.V. and Contributors +Copyright (C) 2010-2017 Almende B.V. and Contributors Vis.js is dual licensed under both diff --git a/docs/graph3d/index.html b/docs/graph3d/index.html index c29093b7..fd9ba49a 100644 --- a/docs/graph3d/index.html +++ b/docs/graph3d/index.html @@ -422,9 +422,27 @@ var options = { showGrid boolean true - If true, grid lines are draw in the x-y surface (the bottom of the 3d + If true, grid lines are drawn in the x-y surface (the bottom of the 3d graph). + + showXAxis + boolean + true + If true, X axis and X axis labels are drawn. + + + showYAxis + boolean + true + If true, Y axis and Y axis labels are drawn. + + + showZAxis + boolean + true + If true, Z axis and Z axis labels are drawn. + showPerspective boolean diff --git a/docs/network/nodes.html b/docs/network/nodes.html index 15a5bcef..2189b6ec 100644 --- a/docs/network/nodes.html +++ b/docs/network/nodes.html @@ -734,14 +734,28 @@ network.setOptions(options); undefined The id of the node. The id is mandatory for nodes and they have to be unique. This should obviously be set per node, not globally. - - image - String + + image + Object or String undefined When the shape is set to image or circularImage, this option should be the URL to an image. If the image cannot be found, the brokenImage option can be used. + + image.unselected + String + undefined + Unselected (default) image URL. + + + + image.selected + String + undefined + Selected image URL. + + label String diff --git a/docs/timeline/index.html b/docs/timeline/index.html index 351bb919..edc0f56f 100644 --- a/docs/timeline/index.html +++ b/docs/timeline/index.html @@ -1367,7 +1367,7 @@ document.getElementById('myTimeline').onclick = function (event) { setCustomTimeTitle(title [, id]) none Adjust the title attribute of a custom time bar. - Parameter title is the string to be set as title. Use empty string to hide the title completely. + Parameter title is the string or function to be set as title. Use empty string to hide the title completely. Parameter id is the id of the custom time bar, and is undefined by default. diff --git a/examples/googleAnalytics.js b/examples/googleAnalytics.js deleted file mode 100644 index 106072a0..00000000 --- a/examples/googleAnalytics.js +++ /dev/null @@ -1,12 +0,0 @@ -(function (i, s, o, g, r, a, m) { - i['GoogleAnalyticsObject'] = r; - i[r] = i[r] || function () { - (i[r].q = i[r].q || []).push(arguments) - }, i[r].l = 1 * new Date(); - a = s.createElement(o), m = s.getElementsByTagName(o)[0]; - a.async = 1; - a.src = g; - m.parentNode.insertBefore(a, m) -})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); -ga('create', 'UA-61231638-1', 'auto'); -ga('send', 'pageview'); \ No newline at end of file diff --git a/examples/graph2d/01_basic.html b/examples/graph2d/01_basic.html index 22c0931f..03e8c6ed 100644 --- a/examples/graph2d/01_basic.html +++ b/examples/graph2d/01_basic.html @@ -14,7 +14,7 @@ - +

Graph2d | Basic Example

@@ -49,4 +49,4 @@ var graph2d = new vis.Graph2d(container, dataset, options); - \ No newline at end of file + diff --git a/examples/graph2d/02_bars.html b/examples/graph2d/02_bars.html index 42957d74..c5d101e7 100644 --- a/examples/graph2d/02_bars.html +++ b/examples/graph2d/02_bars.html @@ -11,7 +11,7 @@ - +

Graph2d | Bar Graph Example

diff --git a/examples/graph2d/03_groups.html b/examples/graph2d/03_groups.html index fe5fa887..2ddcc1bc 100644 --- a/examples/graph2d/03_groups.html +++ b/examples/graph2d/03_groups.html @@ -12,7 +12,7 @@ - +

Graph2d | Groups Example

@@ -109,4 +109,4 @@ - \ No newline at end of file + diff --git a/examples/graph2d/04_rightAxis.html b/examples/graph2d/04_rightAxis.html index f13af137..49b8c6dd 100644 --- a/examples/graph2d/04_rightAxis.html +++ b/examples/graph2d/04_rightAxis.html @@ -25,7 +25,7 @@ - +

Graph2d | Right Axis Example

diff --git a/examples/graph2d/05_bothAxis.html b/examples/graph2d/05_bothAxis.html index 7b2a04c2..c197ae4b 100644 --- a/examples/graph2d/05_bothAxis.html +++ b/examples/graph2d/05_bothAxis.html @@ -35,7 +35,7 @@ } - +

Graph2d | Both Axis Example

diff --git a/examples/graph2d/06_interpolation.html b/examples/graph2d/06_interpolation.html index 9daa7e07..4dc4d285 100644 --- a/examples/graph2d/06_interpolation.html +++ b/examples/graph2d/06_interpolation.html @@ -11,7 +11,7 @@ - +

Graph2d | Interpolation

diff --git a/examples/graph2d/07_scrollingAndSorting.html b/examples/graph2d/07_scrollingAndSorting.html index f9328dc7..9f0f4abc 100644 --- a/examples/graph2d/07_scrollingAndSorting.html +++ b/examples/graph2d/07_scrollingAndSorting.html @@ -11,7 +11,7 @@ - +

Graph2d | Scrolling and Sorting

diff --git a/examples/graph2d/08_performance.html b/examples/graph2d/08_performance.html index 75701fa5..17f05152 100644 --- a/examples/graph2d/08_performance.html +++ b/examples/graph2d/08_performance.html @@ -19,7 +19,7 @@ - +

Graph2d | Performance

diff --git a/examples/graph2d/09_external_legend.html b/examples/graph2d/09_external_legend.html index 8ec82fa8..07994b3d 100644 --- a/examples/graph2d/09_external_legend.html +++ b/examples/graph2d/09_external_legend.html @@ -190,7 +190,7 @@ - +

Graph2d | External custom legend

diff --git a/examples/graph2d/10_barsSideBySide.html b/examples/graph2d/10_barsSideBySide.html index 7afdf6ef..6022df0c 100644 --- a/examples/graph2d/10_barsSideBySide.html +++ b/examples/graph2d/10_barsSideBySide.html @@ -11,7 +11,7 @@ - +

Graph2d | Bar Graphs Side by Side Example

diff --git a/examples/graph2d/11_barsSideBySideGroups.html b/examples/graph2d/11_barsSideBySideGroups.html index b1ed1504..7eb94617 100644 --- a/examples/graph2d/11_barsSideBySideGroups.html +++ b/examples/graph2d/11_barsSideBySideGroups.html @@ -11,7 +11,7 @@ - +

Graph2d | Bar Graphs Side by Side Example with Groups

diff --git a/examples/graph2d/12_customRange.html b/examples/graph2d/12_customRange.html index 0e85ab53..92fa59be 100644 --- a/examples/graph2d/12_customRange.html +++ b/examples/graph2d/12_customRange.html @@ -11,7 +11,7 @@ - +

Graph2d | Custom axis range

diff --git a/examples/graph2d/13_localization.html b/examples/graph2d/13_localization.html index c0130d5d..7fc7227f 100644 --- a/examples/graph2d/13_localization.html +++ b/examples/graph2d/13_localization.html @@ -16,7 +16,7 @@ - +

Graph2d | Localization

diff --git a/examples/graph2d/14_toggleGroups.html b/examples/graph2d/14_toggleGroups.html index 60db882b..54b0e93a 100644 --- a/examples/graph2d/14_toggleGroups.html +++ b/examples/graph2d/14_toggleGroups.html @@ -17,7 +17,7 @@ - +

Graph2d | Groups Example

diff --git a/examples/graph2d/15_streaming_data.html b/examples/graph2d/15_streaming_data.html index 1a822391..34696853 100644 --- a/examples/graph2d/15_streaming_data.html +++ b/examples/graph2d/15_streaming_data.html @@ -14,7 +14,7 @@ - +

Graph2d | Streaming data

diff --git a/examples/graph2d/16_bothAxisTitles.html b/examples/graph2d/16_bothAxisTitles.html index 5fe0e6d8..901fce51 100644 --- a/examples/graph2d/16_bothAxisTitles.html +++ b/examples/graph2d/16_bothAxisTitles.html @@ -36,7 +36,7 @@ } - +

Graph2d | Axis Titles and Styling

diff --git a/examples/graph2d/17_dynamicStyling.html b/examples/graph2d/17_dynamicStyling.html index 01beacf4..b5a01eee 100644 --- a/examples/graph2d/17_dynamicStyling.html +++ b/examples/graph2d/17_dynamicStyling.html @@ -14,7 +14,7 @@ - +

Graph2d | Dynamic Styling Example

diff --git a/examples/graph2d/18_scatterplot.html b/examples/graph2d/18_scatterplot.html index bdeb63e4..a55ffd41 100644 --- a/examples/graph2d/18_scatterplot.html +++ b/examples/graph2d/18_scatterplot.html @@ -11,7 +11,7 @@ - +

Graph2d | Scatterplot

diff --git a/examples/graph2d/19_labels.html b/examples/graph2d/19_labels.html index f93853eb..d7bb50a7 100644 --- a/examples/graph2d/19_labels.html +++ b/examples/graph2d/19_labels.html @@ -18,7 +18,7 @@ - +

Graph2d | Label Example

diff --git a/examples/graph2d/20_shading.html b/examples/graph2d/20_shading.html index 1bfb4bdb..e585c909 100644 --- a/examples/graph2d/20_shading.html +++ b/examples/graph2d/20_shading.html @@ -12,7 +12,7 @@ - +

Graph2d | Shading Example

diff --git a/examples/graph3d/01_basics.html b/examples/graph3d/01_basics.html index 10cd9e55..48a319a6 100644 --- a/examples/graph3d/01_basics.html +++ b/examples/graph3d/01_basics.html @@ -50,7 +50,7 @@ graph = new vis.Graph3d(container, data, options); } - + diff --git a/examples/graph3d/02_camera.html b/examples/graph3d/02_camera.html index bbc9f7d0..52d938d0 100644 --- a/examples/graph3d/02_camera.html +++ b/examples/graph3d/02_camera.html @@ -79,7 +79,7 @@ graph.on('cameraPositionChange', onCameraPositionChange); } - + diff --git a/examples/graph3d/03_filter_data.html b/examples/graph3d/03_filter_data.html index 4fd4a739..859dba67 100644 --- a/examples/graph3d/03_filter_data.html +++ b/examples/graph3d/03_filter_data.html @@ -53,7 +53,7 @@ graph = new vis.Graph3d(container, data, options); } - + diff --git a/examples/graph3d/04_animation.html b/examples/graph3d/04_animation.html index c0d99664..b9c81515 100644 --- a/examples/graph3d/04_animation.html +++ b/examples/graph3d/04_animation.html @@ -60,7 +60,7 @@ graph = new vis.Graph3d(container, data, options); } - + diff --git a/examples/graph3d/05_line.html b/examples/graph3d/05_line.html index 40de188e..fbae24d1 100644 --- a/examples/graph3d/05_line.html +++ b/examples/graph3d/05_line.html @@ -49,7 +49,7 @@ graph.setCameraPosition(0.4, undefined, undefined); } - + diff --git a/examples/graph3d/06_moving_dots.html b/examples/graph3d/06_moving_dots.html index b24bb520..91ca7881 100644 --- a/examples/graph3d/06_moving_dots.html +++ b/examples/graph3d/06_moving_dots.html @@ -67,7 +67,7 @@ graph = new vis.Graph3d(container, data, options); } - + diff --git a/examples/graph3d/07_dot_cloud_colors.html b/examples/graph3d/07_dot_cloud_colors.html index 44d554fc..cc10df6e 100644 --- a/examples/graph3d/07_dot_cloud_colors.html +++ b/examples/graph3d/07_dot_cloud_colors.html @@ -61,7 +61,7 @@ graph = new vis.Graph3d(container, data, options); } - + diff --git a/examples/graph3d/08_dot_cloud_size.html b/examples/graph3d/08_dot_cloud_size.html index 46218108..1d6fb47f 100644 --- a/examples/graph3d/08_dot_cloud_size.html +++ b/examples/graph3d/08_dot_cloud_size.html @@ -57,7 +57,7 @@ graph = new vis.Graph3d(container, data, options); } - +
diff --git a/examples/graph3d/09_mobile.html b/examples/graph3d/09_mobile.html index b3a99598..0c09ab12 100644 --- a/examples/graph3d/09_mobile.html +++ b/examples/graph3d/09_mobile.html @@ -70,7 +70,7 @@ graph = new vis.Graph3d(container, data, options); } - + diff --git a/examples/graph3d/10_styling.html b/examples/graph3d/10_styling.html index 033b7ba5..23b08c44 100644 --- a/examples/graph3d/10_styling.html +++ b/examples/graph3d/10_styling.html @@ -73,7 +73,7 @@ document.getElementById('yBarWidth').onchange = drawVisualization; } - + diff --git a/examples/graph3d/11_tooltips.html b/examples/graph3d/11_tooltips.html index c37b35f4..67d84443 100644 --- a/examples/graph3d/11_tooltips.html +++ b/examples/graph3d/11_tooltips.html @@ -86,7 +86,7 @@ document.getElementById('style').onchange = drawVisualization; } - + diff --git a/examples/graph3d/12_custom_labels.html b/examples/graph3d/12_custom_labels.html index b6fe8176..45750178 100644 --- a/examples/graph3d/12_custom_labels.html +++ b/examples/graph3d/12_custom_labels.html @@ -85,7 +85,7 @@ document.getElementById('style').onchange = drawVisualization; } - + diff --git a/examples/graph3d/playground/csv2datatable.html b/examples/graph3d/playground/csv2datatable.html index 08d3c65d..35dc9bd0 100644 --- a/examples/graph3d/playground/csv2datatable.html +++ b/examples/graph3d/playground/csv2datatable.html @@ -58,7 +58,7 @@ alert(csvArray.length + " rows converted"); } - +
diff --git a/examples/graph3d/playground/datasource.html b/examples/graph3d/playground/datasource.html index 7a593604..efb47e1c 100644 --- a/examples/graph3d/playground/datasource.html +++ b/examples/graph3d/playground/datasource.html @@ -6,7 +6,7 @@ - + diff --git a/examples/graph3d/playground/index.html b/examples/graph3d/playground/index.html index 134bb264..25d891c5 100644 --- a/examples/graph3d/playground/index.html +++ b/examples/graph3d/playground/index.html @@ -16,7 +16,7 @@ // TODO } - + @@ -112,6 +112,19 @@ showGrid + + showXAxis + + + + showYAxis + + + + showZAxis + + + showPerspective diff --git a/examples/graph3d/playground/playground.js b/examples/graph3d/playground/playground.js index a2e28728..6b2ee04f 100644 --- a/examples/graph3d/playground/playground.js +++ b/examples/graph3d/playground/playground.js @@ -406,6 +406,9 @@ function getOptions() { style: document.getElementById("style").value, showAnimationControls: (document.getElementById("showAnimationControls").checked != false), showGrid: (document.getElementById("showGrid").checked != false), + showXAxis: (document.getElementById("showXAxis").checked != false), + showYAxis: (document.getElementById("showYAxis").checked != false), + showZAxis: (document.getElementById("showZAxis").checked != false), showPerspective: (document.getElementById("showPerspective").checked != false), showLegend: (document.getElementById("showLegend").checked != false), showShadow: (document.getElementById("showShadow").checked != false), diff --git a/examples/network/basicUsage.html b/examples/network/basicUsage.html index f1f4e5f9..a89aefa0 100644 --- a/examples/network/basicUsage.html +++ b/examples/network/basicUsage.html @@ -51,6 +51,6 @@ var network = new vis.Network(container, data, options); - + diff --git a/examples/network/data/datasets.html b/examples/network/data/datasets.html index c4bb5f8f..81bb8ca6 100644 --- a/examples/network/data/datasets.html +++ b/examples/network/data/datasets.html @@ -135,6 +135,6 @@ startNetwork(); - + diff --git a/examples/network/data/dotLanguage/dotLanguage.html b/examples/network/data/dotLanguage/dotLanguage.html index 318aa91d..a57ebaf4 100644 --- a/examples/network/data/dotLanguage/dotLanguage.html +++ b/examples/network/data/dotLanguage/dotLanguage.html @@ -4,7 +4,7 @@ - +

diff --git a/examples/network/data/dotLanguage/dotPlayground.html b/examples/network/data/dotLanguage/dotPlayground.html index b31bfd48..217736d3 100644 --- a/examples/network/data/dotLanguage/dotPlayground.html +++ b/examples/network/data/dotLanguage/dotPlayground.html @@ -82,7 +82,7 @@ } - + diff --git a/examples/network/data/dynamicData.html b/examples/network/data/dynamicData.html index 1c54e34b..8b53e601 100644 --- a/examples/network/data/dynamicData.html +++ b/examples/network/data/dynamicData.html @@ -166,7 +166,7 @@ } - + diff --git a/examples/network/data/importingFromGephi.html b/examples/network/data/importingFromGephi.html index f39f15a4..d5724163 100644 --- a/examples/network/data/importingFromGephi.html +++ b/examples/network/data/importingFromGephi.html @@ -51,7 +51,7 @@ color: red; } - + diff --git a/examples/network/data/scalingCustom.html b/examples/network/data/scalingCustom.html index b1ffede5..a059fe8e 100644 --- a/examples/network/data/scalingCustom.html +++ b/examples/network/data/scalingCustom.html @@ -75,7 +75,7 @@ network = new vis.Network(container, data, options); } - +

diff --git a/examples/network/data/scalingNodesEdges.html b/examples/network/data/scalingNodesEdges.html index a19e7e10..748b421e 100644 --- a/examples/network/data/scalingNodesEdges.html +++ b/examples/network/data/scalingNodesEdges.html @@ -68,7 +68,7 @@ network = new vis.Network(container, data, options); } - +

diff --git a/examples/network/data/scalingNodesEdgesLabels.html b/examples/network/data/scalingNodesEdgesLabels.html index fc41fbb7..6316d8b7 100644 --- a/examples/network/data/scalingNodesEdgesLabels.html +++ b/examples/network/data/scalingNodesEdgesLabels.html @@ -74,7 +74,7 @@ network = new vis.Network(container, data, options); } - +

diff --git a/examples/network/edgeStyles/arrowTypes.html b/examples/network/edgeStyles/arrowTypes.html index 25cf63bf..7e251395 100644 --- a/examples/network/edgeStyles/arrowTypes.html +++ b/examples/network/edgeStyles/arrowTypes.html @@ -50,6 +50,6 @@ var network = new vis.Network(container, data, options); - + diff --git a/examples/network/edgeStyles/arrows.html b/examples/network/edgeStyles/arrows.html index b9d43636..51758926 100644 --- a/examples/network/edgeStyles/arrows.html +++ b/examples/network/edgeStyles/arrows.html @@ -56,6 +56,6 @@ var network = new vis.Network(container, data, options); - + diff --git a/examples/network/edgeStyles/colors.html b/examples/network/edgeStyles/colors.html index 4f99a340..7eb7a7ad 100644 --- a/examples/network/edgeStyles/colors.html +++ b/examples/network/edgeStyles/colors.html @@ -66,6 +66,6 @@ var network = new vis.Network(container, data, options); - + diff --git a/examples/network/edgeStyles/dashes.html b/examples/network/edgeStyles/dashes.html index 941fdc5e..2fa846c8 100644 --- a/examples/network/edgeStyles/dashes.html +++ b/examples/network/edgeStyles/dashes.html @@ -52,6 +52,6 @@ var network = new vis.Network(container, data, options); - + diff --git a/examples/network/edgeStyles/smooth.html b/examples/network/edgeStyles/smooth.html index 2b222bdb..3f52423f 100644 --- a/examples/network/edgeStyles/smooth.html +++ b/examples/network/edgeStyles/smooth.html @@ -13,7 +13,7 @@ border: 1px solid lightgray; } - + diff --git a/examples/network/edgeStyles/smoothWorldCup.html b/examples/network/edgeStyles/smoothWorldCup.html index 02b95d6b..03a8f8d2 100644 --- a/examples/network/edgeStyles/smoothWorldCup.html +++ b/examples/network/edgeStyles/smoothWorldCup.html @@ -20,7 +20,7 @@ height:280px; } - + diff --git a/examples/network/events/interactionEvents.html b/examples/network/events/interactionEvents.html index 33f1ae70..f9ba9c1e 100644 --- a/examples/network/events/interactionEvents.html +++ b/examples/network/events/interactionEvents.html @@ -114,6 +114,6 @@ - + diff --git a/examples/network/events/physicsEvents.html b/examples/network/events/physicsEvents.html index 418f403a..bd11c3c7 100644 --- a/examples/network/events/physicsEvents.html +++ b/examples/network/events/physicsEvents.html @@ -68,6 +68,6 @@ - + diff --git a/examples/network/events/renderEvents.html b/examples/network/events/renderEvents.html index e28e4ea3..426cad90 100644 --- a/examples/network/events/renderEvents.html +++ b/examples/network/events/renderEvents.html @@ -78,6 +78,6 @@ - + diff --git a/examples/network/exampleApplications/lesMiserables.html b/examples/network/exampleApplications/lesMiserables.html index b97c32b0..681cef12 100644 --- a/examples/network/exampleApplications/lesMiserables.html +++ b/examples/network/exampleApplications/lesMiserables.html @@ -383,7 +383,7 @@ } - + diff --git a/examples/network/exampleApplications/loadingBar.html b/examples/network/exampleApplications/loadingBar.html index 519289e4..c00f5bdb 100644 --- a/examples/network/exampleApplications/loadingBar.html +++ b/examples/network/exampleApplications/loadingBar.html @@ -481,7 +481,7 @@ } - + diff --git a/examples/network/exampleApplications/neighbourhoodHighlight.html b/examples/network/exampleApplications/neighbourhoodHighlight.html index 8e05d482..f750e34c 100644 --- a/examples/network/exampleApplications/neighbourhoodHighlight.html +++ b/examples/network/exampleApplications/neighbourhoodHighlight.html @@ -15,7 +15,7 @@ border: 1px solid lightgray; } - + diff --git a/examples/network/exampleApplications/nodeLegend.html b/examples/network/exampleApplications/nodeLegend.html index 69769d9b..ca4b40e4 100644 --- a/examples/network/exampleApplications/nodeLegend.html +++ b/examples/network/exampleApplications/nodeLegend.html @@ -151,7 +151,7 @@ network = new vis.Network(container, data, options); } - + diff --git a/examples/network/exampleApplications/worldCupPerformance.html b/examples/network/exampleApplications/worldCupPerformance.html index 7de0667b..dbd41611 100644 --- a/examples/network/exampleApplications/worldCupPerformance.html +++ b/examples/network/exampleApplications/worldCupPerformance.html @@ -17,7 +17,7 @@ border: 1px solid lightgray; } - + diff --git a/examples/network/imageSelected/broken-image.png b/examples/network/imageSelected/broken-image.png new file mode 100644 index 00000000..c9107195 Binary files /dev/null and b/examples/network/imageSelected/broken-image.png differ diff --git a/examples/network/imageSelected/imageSelected.html b/examples/network/imageSelected/imageSelected.html new file mode 100644 index 00000000..ea6f70dd --- /dev/null +++ b/examples/network/imageSelected/imageSelected.html @@ -0,0 +1,82 @@ + + + Network | Selected/Unselected Image + + + + + + + + +

+ + + + diff --git a/examples/network/imageSelected/selected.svg b/examples/network/imageSelected/selected.svg new file mode 100644 index 00000000..a15c04af --- /dev/null +++ b/examples/network/imageSelected/selected.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/network/imageSelected/unselected.svg b/examples/network/imageSelected/unselected.svg new file mode 100644 index 00000000..538cb255 --- /dev/null +++ b/examples/network/imageSelected/unselected.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/examples/network/labels/labelAlignment.html b/examples/network/labels/labelAlignment.html index 42eb9bd0..dd837ca7 100644 --- a/examples/network/labels/labelAlignment.html +++ b/examples/network/labels/labelAlignment.html @@ -16,7 +16,7 @@ max-width:600px; } - + diff --git a/examples/network/labels/labelBackground.html b/examples/network/labels/labelBackground.html index 01664a67..4341f965 100644 --- a/examples/network/labels/labelBackground.html +++ b/examples/network/labels/labelBackground.html @@ -16,7 +16,7 @@ max-width:600px; } - + diff --git a/examples/network/labels/labelColorAndSize.html b/examples/network/labels/labelColorAndSize.html index f91a0d22..90c5767c 100644 --- a/examples/network/labels/labelColorAndSize.html +++ b/examples/network/labels/labelColorAndSize.html @@ -16,7 +16,7 @@ max-width:600px; } - + diff --git a/examples/network/labels/labelMargins.html b/examples/network/labels/labelMargins.html index 8be983a7..e91a9a38 100644 --- a/examples/network/labels/labelMargins.html +++ b/examples/network/labels/labelMargins.html @@ -16,7 +16,7 @@ max-width:600px; } - + diff --git a/examples/network/labels/labelMultifont.html b/examples/network/labels/labelMultifont.html index 70013818..6f3b75e4 100644 --- a/examples/network/labels/labelMultifont.html +++ b/examples/network/labels/labelMultifont.html @@ -35,7 +35,7 @@ font-weight: normal; } - + diff --git a/examples/network/labels/labelStroke.html b/examples/network/labels/labelStroke.html index 71a7dccd..6fb07669 100644 --- a/examples/network/labels/labelStroke.html +++ b/examples/network/labels/labelStroke.html @@ -16,7 +16,7 @@ max-width:600px; } - + diff --git a/examples/network/labels/multilineText.html b/examples/network/labels/multilineText.html index 99dc8eb2..6857312c 100644 --- a/examples/network/labels/multilineText.html +++ b/examples/network/labels/multilineText.html @@ -43,7 +43,7 @@ var network = new vis.Network(container, data, options); } - + diff --git a/examples/network/layout/hierarchicalLayout.html b/examples/network/layout/hierarchicalLayout.html index d8e317ec..39000948 100644 --- a/examples/network/layout/hierarchicalLayout.html +++ b/examples/network/layout/hierarchicalLayout.html @@ -57,7 +57,7 @@ } - + diff --git a/examples/network/layout/hierarchicalLayoutMethods.html b/examples/network/layout/hierarchicalLayoutMethods.html index 6664bd2d..44fcab16 100644 --- a/examples/network/layout/hierarchicalLayoutMethods.html +++ b/examples/network/layout/hierarchicalLayoutMethods.html @@ -77,7 +77,7 @@ } - + diff --git a/examples/network/layout/hierarchicalLayoutUserdefined.html b/examples/network/layout/hierarchicalLayoutUserdefined.html index de536e54..e0f6cd0d 100644 --- a/examples/network/layout/hierarchicalLayoutUserdefined.html +++ b/examples/network/layout/hierarchicalLayoutUserdefined.html @@ -103,7 +103,7 @@ } - + diff --git a/examples/network/layout/randomSeed.html b/examples/network/layout/randomSeed.html index 1ca075ae..10310326 100644 --- a/examples/network/layout/randomSeed.html +++ b/examples/network/layout/randomSeed.html @@ -55,6 +55,6 @@ var network = new vis.Network(container, data, options); - + diff --git a/examples/network/nodeStyles/HTMLInNodes.html b/examples/network/nodeStyles/HTMLInNodes.html index e80590b7..5f0f53da 100644 --- a/examples/network/nodeStyles/HTMLInNodes.html +++ b/examples/network/nodeStyles/HTMLInNodes.html @@ -68,7 +68,7 @@ network = new vis.Network(container, data, options); } - + diff --git a/examples/network/nodeStyles/circularImages.html b/examples/network/nodeStyles/circularImages.html index b0f144c5..56100056 100644 --- a/examples/network/nodeStyles/circularImages.html +++ b/examples/network/nodeStyles/circularImages.html @@ -92,7 +92,7 @@ network = new vis.Network(container, data, options); } - + diff --git a/examples/network/nodeStyles/colors.html b/examples/network/nodeStyles/colors.html index 05bae1dd..c1c4dc11 100644 --- a/examples/network/nodeStyles/colors.html +++ b/examples/network/nodeStyles/colors.html @@ -62,6 +62,6 @@ var network = new vis.Network(container, data, options); - + diff --git a/examples/network/nodeStyles/customGroups.html b/examples/network/nodeStyles/customGroups.html index 5c4b11c9..e14a2acd 100644 --- a/examples/network/nodeStyles/customGroups.html +++ b/examples/network/nodeStyles/customGroups.html @@ -22,7 +22,7 @@ - + diff --git a/examples/network/nodeStyles/groups.html b/examples/network/nodeStyles/groups.html index 148ffa64..1d56c09d 100644 --- a/examples/network/nodeStyles/groups.html +++ b/examples/network/nodeStyles/groups.html @@ -21,7 +21,7 @@ - + diff --git a/examples/network/nodeStyles/icons.html b/examples/network/nodeStyles/icons.html index 859fc065..c44e5bec 100644 --- a/examples/network/nodeStyles/icons.html +++ b/examples/network/nodeStyles/icons.html @@ -174,7 +174,7 @@ var networkIO = new vis.Network(containerIO, dataIO, optionsIO); } - +

diff --git a/examples/network/nodeStyles/images.html b/examples/network/nodeStyles/images.html index 78810181..8599cd6e 100644 --- a/examples/network/nodeStyles/images.html +++ b/examples/network/nodeStyles/images.html @@ -69,7 +69,7 @@ network = new vis.Network(container, data, options); } - + diff --git a/examples/network/nodeStyles/imagesWithBorders.html b/examples/network/nodeStyles/imagesWithBorders.html index 7c65cee6..542e69d8 100644 --- a/examples/network/nodeStyles/imagesWithBorders.html +++ b/examples/network/nodeStyles/imagesWithBorders.html @@ -95,7 +95,7 @@ network = new vis.Network(container, data, options); } - + diff --git a/examples/network/nodeStyles/shadows.html b/examples/network/nodeStyles/shadows.html index 277b8b00..8126067f 100644 --- a/examples/network/nodeStyles/shadows.html +++ b/examples/network/nodeStyles/shadows.html @@ -21,7 +21,7 @@ - + diff --git a/examples/network/nodeStyles/shapes.html b/examples/network/nodeStyles/shapes.html index 26625301..d60901f6 100644 --- a/examples/network/nodeStyles/shapes.html +++ b/examples/network/nodeStyles/shapes.html @@ -59,7 +59,7 @@ network = new vis.Network(container, data, options); } - + diff --git a/examples/network/nodeStyles/shapesWithDashedBorders.html b/examples/network/nodeStyles/shapesWithDashedBorders.html index a2d65aed..a129782e 100644 --- a/examples/network/nodeStyles/shapesWithDashedBorders.html +++ b/examples/network/nodeStyles/shapesWithDashedBorders.html @@ -47,7 +47,7 @@ network = new vis.Network(container, data, options); } - + diff --git a/examples/network/nodeStyles/widthHeight.html b/examples/network/nodeStyles/widthHeight.html index 565e900b..ab68eb6a 100644 --- a/examples/network/nodeStyles/widthHeight.html +++ b/examples/network/nodeStyles/widthHeight.html @@ -29,7 +29,7 @@ background-color: #dddddd; } - + @@ -86,7 +86,7 @@ Whole-set node and edge constraints are exclusive.

{ from: 300, to: 301, label: "more minimum height"}, { from: 100, to: 400, label: "unconstrained to top valign"}, { from: 400, to: 401, label: "top valign to middle valign"}, - { from: 401, to: 402, label: "middle valign to bottom valign"}, + { from: 401, to: 402, widthConstraint: { maximum: 150 }, label: "middle valign to bottom valign"}, ]; var container = document.getElementById('mynetwork'); @@ -105,7 +105,10 @@ Whole-set node and edge constraints are exclusive.

}, nodes: { shape: 'box', - margin: 10 + margin: 10, + widthConstraint: { + maximum: 200 + } }, physics: { enabled: false diff --git a/examples/network/other/animationShowcase.html b/examples/network/other/animationShowcase.html index 1e0d82ae..b16f0544 100644 --- a/examples/network/other/animationShowcase.html +++ b/examples/network/other/animationShowcase.html @@ -192,7 +192,7 @@ } } - + diff --git a/examples/network/other/changingClusteredEdgesNodes.html b/examples/network/other/changingClusteredEdgesNodes.html index 145dcb72..0f079720 100644 --- a/examples/network/other/changingClusteredEdgesNodes.html +++ b/examples/network/other/changingClusteredEdgesNodes.html @@ -20,7 +20,7 @@ margin-bottom:3px; } - + diff --git a/examples/network/other/chosen.html b/examples/network/other/chosen.html index 15c7638d..6717571c 100644 --- a/examples/network/other/chosen.html +++ b/examples/network/other/chosen.html @@ -29,7 +29,7 @@ background-color: #dddddd; } - + diff --git a/examples/network/other/clustering.html b/examples/network/other/clustering.html index bd68c42f..c8230458 100644 --- a/examples/network/other/clustering.html +++ b/examples/network/other/clustering.html @@ -20,7 +20,7 @@ margin-bottom:3px; } - + diff --git a/examples/network/other/clusteringByZoom.html b/examples/network/other/clusteringByZoom.html index e2391f16..e403f899 100644 --- a/examples/network/other/clusteringByZoom.html +++ b/examples/network/other/clusteringByZoom.html @@ -21,7 +21,7 @@ margin-bottom: 3px; } - + diff --git a/examples/network/other/configuration.html b/examples/network/other/configuration.html index a13470d4..5a86c0e5 100644 --- a/examples/network/other/configuration.html +++ b/examples/network/other/configuration.html @@ -63,7 +63,7 @@ } - + diff --git a/examples/network/other/manipulation.html b/examples/network/other/manipulation.html index b399c098..f86b6b90 100644 --- a/examples/network/other/manipulation.html +++ b/examples/network/other/manipulation.html @@ -153,7 +153,7 @@ } - + diff --git a/examples/network/other/manipulationEditEdgeNoDrag.html b/examples/network/other/manipulationEditEdgeNoDrag.html index 985ae767..f5029c13 100644 --- a/examples/network/other/manipulationEditEdgeNoDrag.html +++ b/examples/network/other/manipulationEditEdgeNoDrag.html @@ -201,7 +201,7 @@ } - + diff --git a/examples/network/other/navigation.html b/examples/network/other/navigation.html index 760bb539..22fd3b8c 100644 --- a/examples/network/other/navigation.html +++ b/examples/network/other/navigation.html @@ -83,7 +83,7 @@ }); } - + diff --git a/examples/network/other/performance.html b/examples/network/other/performance.html index 0b3ea663..7b8c6597 100644 --- a/examples/network/other/performance.html +++ b/examples/network/other/performance.html @@ -71,7 +71,7 @@ - +

diff --git a/examples/network/other/saveAndLoad.html b/examples/network/other/saveAndLoad.html index 08165c85..ee71b528 100644 --- a/examples/network/other/saveAndLoad.html +++ b/examples/network/other/saveAndLoad.html @@ -36,7 +36,7 @@ - + diff --git a/examples/network/physics/physicsConfiguration.html b/examples/network/physics/physicsConfiguration.html index d28d20db..b700f248 100644 --- a/examples/network/physics/physicsConfiguration.html +++ b/examples/network/physics/physicsConfiguration.html @@ -60,7 +60,7 @@ network = new vis.Network(container, data, options); } - + diff --git a/examples/timeline/basicUsage.html b/examples/timeline/basicUsage.html index 8ad5fda1..4a1106cd 100644 --- a/examples/timeline/basicUsage.html +++ b/examples/timeline/basicUsage.html @@ -11,7 +11,7 @@ - + @@ -42,4 +42,4 @@ var timeline = new vis.Timeline(container, items, options); - \ No newline at end of file + diff --git a/examples/timeline/dataHandling/dataSerialization.html b/examples/timeline/dataHandling/dataSerialization.html index 79b6aebf..e1936438 100644 --- a/examples/timeline/dataHandling/dataSerialization.html +++ b/examples/timeline/dataHandling/dataSerialization.html @@ -25,7 +25,7 @@ - + diff --git a/examples/timeline/dataHandling/loadExternalData.html b/examples/timeline/dataHandling/loadExternalData.html index f594d2aa..a6e56689 100644 --- a/examples/timeline/dataHandling/loadExternalData.html +++ b/examples/timeline/dataHandling/loadExternalData.html @@ -14,7 +14,7 @@ - +

diff --git a/examples/timeline/editing/customSnappingOfItems.html b/examples/timeline/editing/customSnappingOfItems.html index b1c8ef75..2b85305a 100644 --- a/examples/timeline/editing/customSnappingOfItems.html +++ b/examples/timeline/editing/customSnappingOfItems.html @@ -5,7 +5,7 @@ - +

diff --git a/examples/timeline/editing/editingItems.html b/examples/timeline/editing/editingItems.html index 186a363c..93c4ad8e 100644 --- a/examples/timeline/editing/editingItems.html +++ b/examples/timeline/editing/editingItems.html @@ -12,7 +12,7 @@ - + diff --git a/examples/timeline/editing/editingItemsCallbacks.html b/examples/timeline/editing/editingItemsCallbacks.html index 7c15d878..4c6ad5b2 100644 --- a/examples/timeline/editing/editingItemsCallbacks.html +++ b/examples/timeline/editing/editingItemsCallbacks.html @@ -15,7 +15,7 @@ - +

diff --git a/examples/timeline/editing/individualEditableItems.html b/examples/timeline/editing/individualEditableItems.html index c004473a..ef7f0987 100644 --- a/examples/timeline/editing/individualEditableItems.html +++ b/examples/timeline/editing/individualEditableItems.html @@ -25,7 +25,7 @@ - + diff --git a/examples/timeline/editing/overrideEditingItems.html b/examples/timeline/editing/overrideEditingItems.html index c80f8b6b..d035e8f7 100644 --- a/examples/timeline/editing/overrideEditingItems.html +++ b/examples/timeline/editing/overrideEditingItems.html @@ -25,7 +25,7 @@ - + diff --git a/examples/timeline/editing/tooltipOnItemChange.html b/examples/timeline/editing/tooltipOnItemChange.html index 18380beb..dd72fb79 100644 --- a/examples/timeline/editing/tooltipOnItemChange.html +++ b/examples/timeline/editing/tooltipOnItemChange.html @@ -11,7 +11,7 @@ } - + diff --git a/examples/timeline/editing/updateDataOnEvent.html b/examples/timeline/editing/updateDataOnEvent.html index 985551ee..2d442baa 100644 --- a/examples/timeline/editing/updateDataOnEvent.html +++ b/examples/timeline/editing/updateDataOnEvent.html @@ -15,7 +15,7 @@ - + diff --git a/examples/timeline/groups/groups.html b/examples/timeline/groups/groups.html index 56bad599..8f1ba759 100644 --- a/examples/timeline/groups/groups.html +++ b/examples/timeline/groups/groups.html @@ -21,7 +21,7 @@ - +

diff --git a/examples/timeline/groups/groupsEditable.html b/examples/timeline/groups/groupsEditable.html index d8a578ad..b10adada 100644 --- a/examples/timeline/groups/groupsEditable.html +++ b/examples/timeline/groups/groupsEditable.html @@ -24,7 +24,7 @@ - +

diff --git a/examples/timeline/groups/groupsOrdering.html b/examples/timeline/groups/groupsOrdering.html index b4da7755..617de53f 100644 --- a/examples/timeline/groups/groupsOrdering.html +++ b/examples/timeline/groups/groupsOrdering.html @@ -18,7 +18,7 @@ - +

diff --git a/examples/timeline/groups/verticalItemsHide.html b/examples/timeline/groups/verticalItemsHide.html index 5f0523b9..ff81a08c 100644 --- a/examples/timeline/groups/verticalItemsHide.html +++ b/examples/timeline/groups/verticalItemsHide.html @@ -12,7 +12,7 @@ font: 10pt arial; } - + diff --git a/examples/timeline/interaction/animateWindow.html b/examples/timeline/interaction/animateWindow.html index 40a416f1..1ecad7be 100644 --- a/examples/timeline/interaction/animateWindow.html +++ b/examples/timeline/interaction/animateWindow.html @@ -15,7 +15,7 @@ - + diff --git a/examples/timeline/interaction/clickToUse.html b/examples/timeline/interaction/clickToUse.html index d00f4428..45afe516 100644 --- a/examples/timeline/interaction/clickToUse.html +++ b/examples/timeline/interaction/clickToUse.html @@ -19,7 +19,7 @@ - +

diff --git a/examples/timeline/interaction/eventListeners.html b/examples/timeline/interaction/eventListeners.html index 50ed1e9e..b88e846b 100644 --- a/examples/timeline/interaction/eventListeners.html +++ b/examples/timeline/interaction/eventListeners.html @@ -11,7 +11,7 @@ - +

diff --git a/examples/timeline/interaction/limitMoveAndZoom.html b/examples/timeline/interaction/limitMoveAndZoom.html index 4eadd36a..527d3f30 100644 --- a/examples/timeline/interaction/limitMoveAndZoom.html +++ b/examples/timeline/interaction/limitMoveAndZoom.html @@ -12,7 +12,7 @@ - +

diff --git a/examples/timeline/interaction/navigationMenu.html b/examples/timeline/interaction/navigationMenu.html index cb7c19ad..75a04fdb 100755 --- a/examples/timeline/interaction/navigationMenu.html +++ b/examples/timeline/interaction/navigationMenu.html @@ -24,7 +24,7 @@ - + diff --git a/examples/timeline/interaction/rollingMode.html b/examples/timeline/interaction/rollingMode.html index 80b599f4..ebe3fcfb 100644 --- a/examples/timeline/interaction/rollingMode.html +++ b/examples/timeline/interaction/rollingMode.html @@ -5,7 +5,7 @@ - + diff --git a/examples/timeline/interaction/setSelection.html b/examples/timeline/interaction/setSelection.html index f6a038ce..36278797 100644 --- a/examples/timeline/interaction/setSelection.html +++ b/examples/timeline/interaction/setSelection.html @@ -12,7 +12,7 @@ - +

Set selection

diff --git a/examples/timeline/items/backgroundAreas.html b/examples/timeline/items/backgroundAreas.html index 3ec18a66..94c27a08 100644 --- a/examples/timeline/items/backgroundAreas.html +++ b/examples/timeline/items/backgroundAreas.html @@ -16,7 +16,7 @@ - + diff --git a/examples/timeline/items/backgroundAreasWithGroups.html b/examples/timeline/items/backgroundAreasWithGroups.html index f8a78608..7602791f 100644 --- a/examples/timeline/items/backgroundAreasWithGroups.html +++ b/examples/timeline/items/backgroundAreasWithGroups.html @@ -12,7 +12,7 @@ - + diff --git a/examples/timeline/items/htmlContents.html b/examples/timeline/items/htmlContents.html index d790133a..431e7fd1 100644 --- a/examples/timeline/items/htmlContents.html +++ b/examples/timeline/items/htmlContents.html @@ -19,7 +19,7 @@ - +

@@ -48,7 +48,7 @@ item5.appendChild(document.createTextNode('item 5')); item5.appendChild(document.createElement('br')); var img5 = document.createElement('img'); - img5.src = 'img/attachment-icon.png'; + img5.src = '../resources/img/attachment-icon.png'; img5.style.width = '48px'; img5.style.height = '48px'; item5.appendChild(img5); @@ -72,4 +72,4 @@ var timeline = new vis.Timeline(container, items, options); - \ No newline at end of file + diff --git a/examples/timeline/items/itemOrdering.html b/examples/timeline/items/itemOrdering.html index 323c9501..43fe83b8 100644 --- a/examples/timeline/items/itemOrdering.html +++ b/examples/timeline/items/itemOrdering.html @@ -15,7 +15,7 @@ - +

Item ordering

diff --git a/examples/timeline/items/pointItems.html b/examples/timeline/items/pointItems.html index 68201801..40f705ed 100755 --- a/examples/timeline/items/pointItems.html +++ b/examples/timeline/items/pointItems.html @@ -11,7 +11,7 @@ - +

World War II timeline

diff --git a/examples/timeline/items/rangeOverflowItem.html b/examples/timeline/items/rangeOverflowItem.html index fbea2f37..a760bb19 100644 --- a/examples/timeline/items/rangeOverflowItem.html +++ b/examples/timeline/items/rangeOverflowItem.html @@ -16,7 +16,7 @@ } - +

diff --git a/examples/timeline/items/tooltip.html b/examples/timeline/items/tooltip.html index 38701586..ad2c8723 100644 --- a/examples/timeline/items/tooltip.html +++ b/examples/timeline/items/tooltip.html @@ -12,7 +12,7 @@ - + diff --git a/examples/timeline/other/customTimeBars.html b/examples/timeline/other/customTimeBars.html index 2c1a5f7c..41d8d360 100644 --- a/examples/timeline/other/customTimeBars.html +++ b/examples/timeline/other/customTimeBars.html @@ -12,7 +12,7 @@ - + diff --git a/examples/timeline/other/customTimeBarsTooltip.html b/examples/timeline/other/customTimeBarsTooltip.html new file mode 100644 index 00000000..0fe62f36 --- /dev/null +++ b/examples/timeline/other/customTimeBarsTooltip.html @@ -0,0 +1,95 @@ + + + + Timeline | Show current and custom time bars + + + + + + + + + +

+ The Timeline has functions to add multiple custom time bars which can be dragged by the user. +

+

+ + +

+

+ + +

+

+ timechange event, index: , time: +

+

+ timechanged event, index: , time: +


+ +
+ + + + \ No newline at end of file diff --git a/examples/timeline/other/dataAttributes.html b/examples/timeline/other/dataAttributes.html index 0aa1f14e..e94e8274 100644 --- a/examples/timeline/other/dataAttributes.html +++ b/examples/timeline/other/dataAttributes.html @@ -11,7 +11,7 @@ - +

diff --git a/examples/timeline/other/dataAttributesAll.html b/examples/timeline/other/dataAttributesAll.html index 5b926b54..219f1c0b 100644 --- a/examples/timeline/other/dataAttributesAll.html +++ b/examples/timeline/other/dataAttributesAll.html @@ -11,7 +11,7 @@ - +

diff --git a/examples/timeline/other/drag&drop.html b/examples/timeline/other/drag&drop.html index 5810eb9b..ab0d589d 100644 --- a/examples/timeline/other/drag&drop.html +++ b/examples/timeline/other/drag&drop.html @@ -7,7 +7,7 @@ - + - + diff --git a/examples/timeline/other/hidingPeriods.html b/examples/timeline/other/hidingPeriods.html index 52ec6f9a..07edfd1f 100644 --- a/examples/timeline/other/hidingPeriods.html +++ b/examples/timeline/other/hidingPeriods.html @@ -11,7 +11,7 @@ - +

diff --git a/examples/timeline/other/horizontalScroll.html b/examples/timeline/other/horizontalScroll.html index a999cd51..a2ad8b23 100644 --- a/examples/timeline/other/horizontalScroll.html +++ b/examples/timeline/other/horizontalScroll.html @@ -5,7 +5,7 @@ - + diff --git a/examples/timeline/other/localization.html b/examples/timeline/other/localization.html index 5b58923b..caa5d38a 100644 --- a/examples/timeline/other/localization.html +++ b/examples/timeline/other/localization.html @@ -13,7 +13,7 @@ - +

diff --git a/examples/timeline/other/performance.html b/examples/timeline/other/performance.html index 45b22aab..52b4c184 100644 --- a/examples/timeline/other/performance.html +++ b/examples/timeline/other/performance.html @@ -15,7 +15,7 @@ - +

diff --git a/examples/timeline/other/requirejs/requirejs_example.html b/examples/timeline/other/requirejs/requirejs_example.html index 363845fe..88125b6c 100644 --- a/examples/timeline/other/requirejs/requirejs_example.html +++ b/examples/timeline/other/requirejs/requirejs_example.html @@ -6,7 +6,7 @@ - +

diff --git a/examples/timeline/other/rtl.html b/examples/timeline/other/rtl.html index f53b1802..b6a33d8b 100644 --- a/examples/timeline/other/rtl.html +++ b/examples/timeline/other/rtl.html @@ -5,7 +5,7 @@ - + diff --git a/examples/timeline/other/timezone.html b/examples/timeline/other/timezone.html index 8994ba98..438a9164 100644 --- a/examples/timeline/other/timezone.html +++ b/examples/timeline/other/timezone.html @@ -12,7 +12,7 @@ - + diff --git a/examples/timeline/other/verticalScroll.html b/examples/timeline/other/verticalScroll.html index 78946765..3ebec29b 100644 --- a/examples/timeline/other/verticalScroll.html +++ b/examples/timeline/other/verticalScroll.html @@ -5,7 +5,7 @@ - + diff --git a/examples/timeline/styling/axisOrientation.html b/examples/timeline/styling/axisOrientation.html index b3978f17..c52e1ed1 100644 --- a/examples/timeline/styling/axisOrientation.html +++ b/examples/timeline/styling/axisOrientation.html @@ -12,7 +12,7 @@ - + diff --git a/examples/timeline/styling/customCss.html b/examples/timeline/styling/customCss.html index ed700a1d..2ad9f5b5 100644 --- a/examples/timeline/styling/customCss.html +++ b/examples/timeline/styling/customCss.html @@ -62,7 +62,7 @@ } - + diff --git a/examples/timeline/styling/gridStyling.html b/examples/timeline/styling/gridStyling.html index 9fec28b2..cc154380 100644 --- a/examples/timeline/styling/gridStyling.html +++ b/examples/timeline/styling/gridStyling.html @@ -26,7 +26,7 @@ color: white; } - +

diff --git a/examples/timeline/styling/itemClassNames.html b/examples/timeline/styling/itemClassNames.html index 62433484..9c06d7b5 100755 --- a/examples/timeline/styling/itemClassNames.html +++ b/examples/timeline/styling/itemClassNames.html @@ -65,7 +65,7 @@ } - +

This page demonstrates the Timeline with custom css classes for individual items.

diff --git a/examples/timeline/styling/itemTemplates.html b/examples/timeline/styling/itemTemplates.html index 13e43c46..76900d2b 100644 --- a/examples/timeline/styling/itemTemplates.html +++ b/examples/timeline/styling/itemTemplates.html @@ -57,7 +57,7 @@ } - +

WK 2014

diff --git a/lib/DataSet.js b/lib/DataSet.js index 8ebee256..ca1ef887 100644 --- a/lib/DataSet.js +++ b/lib/DataSet.js @@ -211,7 +211,7 @@ DataSet.prototype.add = function (data, senderId) { addedIds.push(id); } } - else if (data instanceof Object) { + else if (data && typeof data === 'object') { // Single item id = me._addItem(data); addedIds.push(id); @@ -261,14 +261,14 @@ DataSet.prototype.update = function (data, senderId) { if (Array.isArray(data)) { // Array for (var i = 0, len = data.length; i < len; i++) { - if (data[i] instanceof Object){ + if (data[i] && typeof data[i] === 'object'){ addOrUpdate(data[i]); } else { console.warn('Ignoring input item, which is not an object at index ' + i); } } } - else if (data instanceof Object) { + else if (data && typeof data === 'object') { // Single item addOrUpdate(data); } @@ -707,7 +707,7 @@ DataSet.prototype._remove = function (id) { if (util.isNumber(id) || util.isString(id)) { ident = id; } - else if (id instanceof Object) { + else if (id && typeof id === 'object') { ident = id[this._fieldId]; // look for the identifier field using _fieldId } diff --git a/lib/graph3d/Graph3d.js b/lib/graph3d/Graph3d.js old mode 100644 new mode 100755 index df2fd885..b0cbe8a0 --- a/lib/graph3d/Graph3d.js +++ b/lib/graph3d/Graph3d.js @@ -45,6 +45,9 @@ var DEFAULTS = { xValueLabel : function(v) { return v; }, yValueLabel : function(v) { return v; }, zValueLabel : function(v) { return v; }, + showXAxis : true, + showYAxis : true, + showZAxis : true, showGrid : true, showPerspective : true, showShadow : false, @@ -1288,7 +1291,7 @@ Graph3d.prototype._redrawAxis = function() { to = new Point3d(x, yRange.max, zRange.min); this._line3d(ctx, from, to, this.gridColor); } - else { + else if (this.showXAxis) { from = new Point3d(x, yRange.min, zRange.min); to = new Point3d(x, yRange.min+gridLenX, zRange.min); this._line3d(ctx, from, to, this.axisColor); @@ -1298,10 +1301,12 @@ Graph3d.prototype._redrawAxis = function() { this._line3d(ctx, from, to, this.axisColor); } - yText = (armVector.x > 0) ? yRange.min : yRange.max; - var point3d = new Point3d(x, yText, zRange.min); - var msg = ' ' + this.xValueLabel(x) + ' '; - this.drawAxisLabelX(ctx, point3d, msg, armAngle, textMargin); + if (this.showXAxis) { + yText = (armVector.x > 0) ? yRange.min : yRange.max; + var point3d = new Point3d(x, yText, zRange.min); + var msg = ' ' + this.xValueLabel(x) + ' '; + this.drawAxisLabelX(ctx, point3d, msg, armAngle, textMargin); + } step.next(); } @@ -1320,7 +1325,7 @@ Graph3d.prototype._redrawAxis = function() { to = new Point3d(xRange.max, y, zRange.min); this._line3d(ctx, from, to, this.gridColor); } - else { + else if (this.showYAxis){ from = new Point3d(xRange.min, y, zRange.min); to = new Point3d(xRange.min+gridLenY, y, zRange.min); this._line3d(ctx, from, to, this.axisColor); @@ -1330,71 +1335,79 @@ Graph3d.prototype._redrawAxis = function() { this._line3d(ctx, from, to, this.axisColor); } - xText = (armVector.y > 0) ? xRange.min : xRange.max; - point3d = new Point3d(xText, y, zRange.min); - var msg = ' ' + this.yValueLabel(y) + ' '; - this.drawAxisLabelY(ctx, point3d, msg, armAngle, textMargin); + if (this.showYAxis) { + xText = (armVector.y > 0) ? xRange.min : xRange.max; + point3d = new Point3d(xText, y, zRange.min); + var msg = ' ' + this.yValueLabel(y) + ' '; + this.drawAxisLabelY(ctx, point3d, msg, armAngle, textMargin); + } step.next(); } // draw z-grid lines and axis - ctx.lineWidth = 1; - prettyStep = (this.defaultZStep === undefined); - step = new StepNumber(zRange.min, zRange.max, this.zStep, prettyStep); - step.start(true); + if (this.showZAxis) { + ctx.lineWidth = 1; + prettyStep = (this.defaultZStep === undefined); + step = new StepNumber(zRange.min, zRange.max, this.zStep, prettyStep); + step.start(true); - xText = (armVector.x > 0) ? xRange.min : xRange.max; - yText = (armVector.y < 0) ? yRange.min : yRange.max; + xText = (armVector.x > 0) ? xRange.min : xRange.max; + yText = (armVector.y < 0) ? yRange.min : yRange.max; - while (!step.end()) { - var z = step.getCurrent(); + while (!step.end()) { + var z = step.getCurrent(); - // TODO: make z-grid lines really 3d? - var from3d = new Point3d(xText, yText, z); - var from2d = this._convert3Dto2D(from3d); - to = new Point2d(from2d.x - textMargin, from2d.y); - this._line(ctx, from2d, to, this.axisColor); + // TODO: make z-grid lines really 3d? + var from3d = new Point3d(xText, yText, z); + var from2d = this._convert3Dto2D(from3d); + to = new Point2d(from2d.x - textMargin, from2d.y); + this._line(ctx, from2d, to, this.axisColor); - var msg = this.zValueLabel(z) + ' '; - this.drawAxisLabelZ(ctx, from3d, msg, 5); + var msg = this.zValueLabel(z) + ' '; + this.drawAxisLabelZ(ctx, from3d, msg, 5); - step.next(); - } + step.next(); + } - ctx.lineWidth = 1; - from = new Point3d(xText, yText, zRange.min); - to = new Point3d(xText, yText, zRange.max); - this._line3d(ctx, from, to, this.axisColor); + ctx.lineWidth = 1; + from = new Point3d(xText, yText, zRange.min); + to = new Point3d(xText, yText, zRange.max); + this._line3d(ctx, from, to, this.axisColor); + } // draw x-axis - var xMin2d; - var xMax2d; - ctx.lineWidth = 1; + if (this.showXAxis) { + var xMin2d; + var xMax2d; + ctx.lineWidth = 1; - // line at yMin - xMin2d = new Point3d(xRange.min, yRange.min, zRange.min); - xMax2d = new Point3d(xRange.max, yRange.min, zRange.min); - this._line3d(ctx, xMin2d, xMax2d, this.axisColor); - // line at ymax - xMin2d = new Point3d(xRange.min, yRange.max, zRange.min); - xMax2d = new Point3d(xRange.max, yRange.max, zRange.min); - this._line3d(ctx, xMin2d, xMax2d, this.axisColor); + // line at yMin + xMin2d = new Point3d(xRange.min, yRange.min, zRange.min); + xMax2d = new Point3d(xRange.max, yRange.min, zRange.min); + this._line3d(ctx, xMin2d, xMax2d, this.axisColor); + // line at ymax + xMin2d = new Point3d(xRange.min, yRange.max, zRange.min); + xMax2d = new Point3d(xRange.max, yRange.max, zRange.min); + this._line3d(ctx, xMin2d, xMax2d, this.axisColor); + } // draw y-axis - ctx.lineWidth = 1; - // line at xMin - from = new Point3d(xRange.min, yRange.min, zRange.min); - to = new Point3d(xRange.min, yRange.max, zRange.min); - this._line3d(ctx, from, to, this.axisColor); - // line at xMax - from = new Point3d(xRange.max, yRange.min, zRange.min); - to = new Point3d(xRange.max, yRange.max, zRange.min); - this._line3d(ctx, from, to, this.axisColor); + if (this.showYAxis) { + ctx.lineWidth = 1; + // line at xMin + from = new Point3d(xRange.min, yRange.min, zRange.min); + to = new Point3d(xRange.min, yRange.max, zRange.min); + this._line3d(ctx, from, to, this.axisColor); + // line at xMax + from = new Point3d(xRange.max, yRange.min, zRange.min); + to = new Point3d(xRange.max, yRange.max, zRange.min); + this._line3d(ctx, from, to, this.axisColor); + } // draw x-label var xLabel = this.xLabel; - if (xLabel.length > 0) { + if (xLabel.length > 0 && this.showXAxis) { yOffset = 0.1 / this.scale.y; xText = (xRange.max + 3*xRange.min)/4; yText = (armVector.x > 0) ? yRange.min - yOffset: yRange.max + yOffset; @@ -1404,7 +1417,7 @@ Graph3d.prototype._redrawAxis = function() { // draw y-label var yLabel = this.yLabel; - if (yLabel.length > 0) { + if (yLabel.length > 0 && this.showYAxis) { xOffset = 0.1 / this.scale.x; xText = (armVector.y > 0) ? xRange.min - xOffset : xRange.max + xOffset; yText = (yRange.max + 3*yRange.min)/4; @@ -1415,7 +1428,7 @@ Graph3d.prototype._redrawAxis = function() { // draw z-label var zLabel = this.zLabel; - if (zLabel.length > 0) { + if (zLabel.length > 0 && this.showZAxis) { offset = 30; // pixels. // TODO: relate to the max width of the values on the z axis? xText = (armVector.x > 0) ? xRange.min : xRange.max; yText = (armVector.y < 0) ? yRange.min : yRange.max; diff --git a/lib/graph3d/Settings.js b/lib/graph3d/Settings.js old mode 100644 new mode 100755 index edb41538..75566748 --- a/lib/graph3d/Settings.js +++ b/lib/graph3d/Settings.js @@ -53,6 +53,9 @@ var OPTIONKEYS = [ 'xValueLabel', 'yValueLabel', 'zValueLabel', + 'showXAxis', + 'showYAxis', + 'showZAxis', 'showGrid', 'showPerspective', 'showShadow', diff --git a/lib/header.js b/lib/header.js index 3045a797..0cdc0e21 100644 --- a/lib/header.js +++ b/lib/header.js @@ -8,7 +8,7 @@ * @date @@date * * @license - * Copyright (C) 2011-2016 Almende B.V, http://almende.com + * Copyright (C) 2011-2017 Almende B.V, http://almende.com * * Vis.js is dual licensed under both * diff --git a/lib/network/css/network-manipulation.css b/lib/network/css/network-manipulation.css index 89c1dc2c..d40de077 100644 --- a/lib/network/css/network-manipulation.css +++ b/lib/network/css/network-manipulation.css @@ -1,4 +1,6 @@ div.vis-network div.vis-manipulation { + box-sizing: content-box; + border-width: 0; border-bottom: 1px; border-style:solid; @@ -146,4 +148,4 @@ div.network-navigation_wrapper { width: 100%; height: 100%; } -*/ \ No newline at end of file +*/ diff --git a/lib/network/modules/components/Node.js b/lib/network/modules/components/Node.js index d2f0879e..996d3229 100644 --- a/lib/network/modules/components/Node.js +++ b/lib/network/modules/components/Node.js @@ -107,6 +107,7 @@ class Node { if (!options) { return; } + // basic options if (options.id !== undefined) {this.id = options.id;} @@ -114,7 +115,6 @@ class Node { throw "Node must have an id"; } - // set these options locally // clear x and y positions if (options.x !== undefined) { @@ -144,7 +144,12 @@ class Node { // load the images if (this.options.image !== undefined) { if (this.imagelist) { - this.imageObj = this.imagelist.load(this.options.image, this.options.brokenImage, this.id); + if (typeof this.options.image === 'string') { + this.imageObj = this.imagelist.load(this.options.image, this.options.brokenImage, this.id); + } else { + this.imageObj = this.imagelist.load(this.options.image.unselected, this.options.brokenImage, this.id); + this.imageObjAlt = this.imagelist.load(this.options.image.selected, this.options.brokenImage, this.id); + } } else { throw "No imagelist provided"; @@ -295,7 +300,7 @@ class Node { updateShape(currentShape) { if (currentShape === this.options.shape && this.shape) { - this.shape.setOptions(this.options, this.imageObj); + this.shape.setOptions(this.options, this.imageObj, this.imageObjAlt); } else { // choose draw method depending on the shape @@ -307,7 +312,7 @@ class Node { this.shape = new Circle(this.options, this.body, this.labelModule); break; case 'circularImage': - this.shape = new CircularImage(this.options, this.body, this.labelModule, this.imageObj); + this.shape = new CircularImage(this.options, this.body, this.labelModule, this.imageObj, this.imageObjAlt); break; case 'database': this.shape = new Database(this.options, this.body, this.labelModule); @@ -325,7 +330,7 @@ class Node { this.shape = new Icon(this.options, this.body, this.labelModule); break; case 'image': - this.shape = new Image(this.options, this.body, this.labelModule, this.imageObj); + this.shape = new Image(this.options, this.body, this.labelModule, this.imageObj, this.imageObjAlt); break; case 'square': this.shape = new Square(this.options, this.body, this.labelModule); diff --git a/lib/network/modules/components/nodes/shapes/CircularImage.js b/lib/network/modules/components/nodes/shapes/CircularImage.js index 8fa39b7f..0eefe7bc 100644 --- a/lib/network/modules/components/nodes/shapes/CircularImage.js +++ b/lib/network/modules/components/nodes/shapes/CircularImage.js @@ -1,12 +1,13 @@ 'use strict'; - import CircleImageBase from '../util/CircleImageBase' class CircularImage extends CircleImageBase { - constructor (options, body, labelModule, imageObj) { + constructor (options, body, labelModule, imageObj, imageObjAlt) { super(options, body, labelModule); - this.imageObj = imageObj; + + this.setImages(imageObj, imageObjAlt); + this._swapToImageResizeWhenImageLoaded = true; } @@ -31,6 +32,11 @@ class CircularImage extends CircleImageBase { } draw(ctx, x, y, selected, hover, values) { + // switch images depending on 'selected' if imageObjAlt exists + if (this.imageObjAlt) { + this.switchImages(selected); + } + this.resize(); this.left = x - this.width / 2; diff --git a/lib/network/modules/components/nodes/shapes/Image.js b/lib/network/modules/components/nodes/shapes/Image.js index 431f6915..5b22f9f2 100644 --- a/lib/network/modules/components/nodes/shapes/Image.js +++ b/lib/network/modules/components/nodes/shapes/Image.js @@ -3,9 +3,10 @@ import CircleImageBase from '../util/CircleImageBase' class Image extends CircleImageBase { - constructor (options, body, labelModule, imageObj) { + constructor (options, body, labelModule, imageObj, imageObjAlt) { super(options, body, labelModule); - this.imageObj = imageObj; + + this.setImages(imageObj, imageObjAlt); } resize() { @@ -13,6 +14,13 @@ class Image extends CircleImageBase { } draw(ctx, x, y, selected, hover, values) { + // switch images depending on 'selected' if imageObjAlt exists + if (this.imageObjAlt) { + this.switchImages(selected); + } + + this.selected = selected; + this.resize(); this.left = x - this.width / 2; this.top = y - this.height / 2; diff --git a/lib/network/modules/components/nodes/util/CircleImageBase.js b/lib/network/modules/components/nodes/util/CircleImageBase.js index 7e5c38db..7630236f 100644 --- a/lib/network/modules/components/nodes/util/CircleImageBase.js +++ b/lib/network/modules/components/nodes/util/CircleImageBase.js @@ -5,13 +5,36 @@ class CircleImageBase extends NodeBase { super(options, body, labelModule); this.labelOffset = 0; this.imageLoaded = false; + this.selected = false; } - setOptions(options, imageObj) { + setOptions(options, imageObj, imageObjAlt) { this.options = options; + this.setImages(imageObj, imageObjAlt); + } + + setImages(imageObj, imageObjAlt) { if (imageObj) { this.imageObj = imageObj; + + if (imageObjAlt) { + this.imageObjAlt = imageObjAlt; + } + } + } + + /** + * Switch between the base and the selected image. + */ + switchImages(selected) { + if ((selected && !this.selected) || (!selected && this.selected)) { + let imageTmp = this.imageObj; + this.imageObj = this.imageObjAlt; + this.imageObjAlt = imageTmp; } + + // keep current state in memory + this.selected = selected; } /** diff --git a/lib/network/modules/components/shared/Label.js b/lib/network/modules/components/shared/Label.js index 1601e7a3..c5cb3fb1 100644 --- a/lib/network/modules/components/shared/Label.js +++ b/lib/network/modules/components/shared/Label.js @@ -797,14 +797,15 @@ class Label { let words = blocks[j].text.split(" "); let atStart = true let text = ""; - let measure; + let measure = { width: 0 }; let lastMeasure; let w = 0; while (w < words.length) { let pre = atStart ? "" : " "; lastMeasure = measure; measure = ctx.measureText(text + pre + words[w]); - if (lineWidth + measure.width > this.fontOptions.maxWdt) { + if ((lineWidth + measure.width > this.fontOptions.maxWdt) && + (lastMeasure.width != 0)) { lineHeight = (values.height > lineHeight) ? values.height : lineHeight; lines.add(k, text, values.font, values.color, lastMeasure.width, values.height, values.vadjust, blocks[j].mod, values.strokeWidth, values.strokeColor); lines.accumulate(k, lastMeasure.width, lineHeight); @@ -850,14 +851,14 @@ class Label { if (this.fontOptions.maxWdt > 0) { let words = nlLines[i].split(" "); let text = ""; - let measure; + let measure = { width: 0 }; let lastMeasure; let w = 0; while (w < words.length) { let pre = (text === "") ? "" : " "; lastMeasure = measure; measure = ctx.measureText(text + pre + words[w]); - if (measure.width > this.fontOptions.maxWdt) { + if ((measure.width > this.fontOptions.maxWdt) && (lastMeasure.width != 0)) { lines.addAndAccumulate(k, text, values.font, values.color, lastMeasure.width, values.size, values.vadjust, "normal", values.strokeWidth, values.strokeColor) width = lines[k].width > width ? lines[k].width : width; height += lines[k].height; diff --git a/lib/network/options.js b/lib/network/options.js index 921c819a..66f123ca 100644 --- a/lib/network/options.js +++ b/lib/network/options.js @@ -280,7 +280,11 @@ let allOptions = { __type__: { object } }, id: { string, number }, - image: { string, 'undefined': 'undefined' }, // --> URL + image: { + selected: { string, 'undefined': 'undefined' }, // --> URL + unselected: { string, 'undefined': 'undefined' }, // --> URL + __type__: { object, string } + }, label: { string, 'undefined': 'undefined' }, labelHighlightBold: { boolean: bool }, level: { number, 'undefined': 'undefined' }, diff --git a/lib/timeline/Range.js b/lib/timeline/Range.js index e2ef0bbb..8b269d2e 100644 --- a/lib/timeline/Range.js +++ b/lib/timeline/Range.js @@ -342,7 +342,9 @@ Range.prototype._applyRange = function(start, end) { zoomMin = 0; } if ((newEnd - newStart) < zoomMin) { - if ((this.end - this.start) === zoomMin && newStart > this.start && newEnd < this.end) { + // compensate for a scale of 0.5 ms + var compensation = 0.5; + if ((this.end - this.start) === zoomMin && newStart >= this.start - compensation && newEnd <= this.end) { // ignore this action, we are already zoomed to the minimum newStart = this.start; newEnd = this.end; diff --git a/lib/timeline/component/CustomTime.js b/lib/timeline/component/CustomTime.js index 6a94b2ac..6aa6502a 100644 --- a/lib/timeline/component/CustomTime.js +++ b/lib/timeline/component/CustomTime.js @@ -143,6 +143,8 @@ CustomTime.prototype.redraw = function () { if (title === undefined) { title = locale.time + ': ' + this.options.moment(this.customTime).format('dddd, MMMM Do YYYY, H:mm:ss'); title = title.charAt(0).toUpperCase() + title.substring(1); + } else if (typeof title === "function") { + title = title.call(this.customTime); } this.bar.style.left = x + 'px'; diff --git a/lib/timeline/component/ItemSet.js b/lib/timeline/component/ItemSet.js index 9d93d792..be95aa7d 100644 --- a/lib/timeline/component/ItemSet.js +++ b/lib/timeline/component/ItemSet.js @@ -157,6 +157,8 @@ function ItemSet(body, options) { this.selection = []; // list with the ids of all selected nodes this.stackDirty = true; // if true, all items will be restacked on next redraw + this.popup = null; + this.touchParams = {}; // stores properties while dragging this.groupTouchParams = {}; // create the HTML DOM @@ -259,6 +261,8 @@ ItemSet.prototype._create = function(){ // right-click on timeline this.body.dom.centerContainer.addEventListener('contextmenu', this._onDragEnd.bind(this)); + this.body.dom.centerContainer.addEventListener('mousewheel', this._onMouseWheel.bind(this)); + // attach to the DOM this.show(); }; @@ -887,12 +891,6 @@ ItemSet.prototype.removeItem = function(id) { // remove by id here, it is possible that an item has no id defined // itself, so better not delete by the item itself dataset.remove(id); - - // Remove it's popup - if (itemObj.popup) { - itemObj.popup.destroy(); - itemObj.popup = null; - } } }); } @@ -1897,17 +1895,26 @@ ItemSet.prototype._onMouseOver = function (event) { return; } - if (item.getTitle()) { - if (item.popup == null) { - item.setPopup(new Popup(this.body.dom.root, this.options.tooltip.overflowMethod || 'flip')); + var title = item.getTitle(); + if (title) { + if (this.popup == null) { + this.popup = new Popup(this.body.dom.root, + this.options.tooltip.overflowMethod || 'flip'); } + this.popup.setText(title); var container = this.body.dom.centerContainer; - item.popup.setPosition( + this.popup.setPosition( event.clientX - util.getAbsoluteLeft(container) + container.offsetLeft, event.clientY - util.getAbsoluteTop(container) + container.offsetTop ); - item.popup.show(); + this.popup.show(); + } else { + // Hovering over item without a title, hide popup + // Needed instead of _just_ in _onMouseOut due to #2572 + if (this.popup != null) { + this.popup.hide(); + } } this.body.emitter.emit('itemover', { @@ -1926,8 +1933,8 @@ ItemSet.prototype._onMouseOut = function (event) { return; } - if (item.popup != null) { - item.popup.hide(); + if (this.popup != null) { + this.popup.hide(); } this.body.emitter.emit('itemout', { @@ -1940,19 +1947,29 @@ ItemSet.prototype._onMouseMove = function (event) { if (!item) return; if (this.options.tooltip.followMouse) { - if (item.popup) { - if (!item.popup.hidden) { + if (this.popup) { + if (!this.popup.hidden) { var container = this.body.dom.centerContainer; - item.popup.setPosition( + this.popup.setPosition( event.clientX - util.getAbsoluteLeft(container) + container.offsetLeft, event.clientY - util.getAbsoluteTop(container) + container.offsetTop ); - item.popup.show(); // Redraw + this.popup.show(); // Redraw } } } }; +/** + * Handle mousewheel + * @param event + * @private + */ +ItemSet.prototype._onMouseWheel = function(event) { + if (this.touchParams.itemIsDragging) { + this._onDragEnd(event); + } +} /** * Handle updates of an item on double tap diff --git a/lib/timeline/component/item/BackgroundItem.js b/lib/timeline/component/item/BackgroundItem.js index 6d6ce456..f0255415 100644 --- a/lib/timeline/component/item/BackgroundItem.js +++ b/lib/timeline/component/item/BackgroundItem.js @@ -100,7 +100,6 @@ BackgroundItem.prototype.redraw = function() { // - the item is selected/deselected if (this.dirty) { this._updateContents(this.dom.content); - this._updateTitle(); this._updateDataAttributes(this.dom.content); this._updateStyle(this.dom.box); diff --git a/lib/timeline/component/item/BoxItem.js b/lib/timeline/component/item/BoxItem.js index 377b2e06..25b3e3e4 100644 --- a/lib/timeline/component/item/BoxItem.js +++ b/lib/timeline/component/item/BoxItem.js @@ -118,7 +118,6 @@ BoxItem.prototype.redraw = function() { // - the item is selected/deselected if (this.dirty) { this._updateContents(this.dom.content); - this._updateTitle(); this._updateDataAttributes(this.dom.box); this._updateStyle(this.dom.box); diff --git a/lib/timeline/component/item/Item.js b/lib/timeline/component/item/Item.js index edae028a..5ddbd736 100644 --- a/lib/timeline/component/item/Item.js +++ b/lib/timeline/component/item/Item.js @@ -23,7 +23,6 @@ function Item (data, conversion, options) { this.displayed = false; this.groupShowing = true; this.dirty = true; - this.popup = null; this.top = null; this.right = null; @@ -397,18 +396,6 @@ Item.prototype._updateContents = function (element) { } }; -/** - * Set HTML contents for the item - * @private - */ -Item.prototype._updateTitle = function () { - if (this.data.title != null) { - if (this.popup != null) { - this.popup.setText(this.data.title || ''); - } - } -}; - /** * Process dataAttributes timeline option and set as data- attributes on dom.content * @param {Element} element HTML element to which the attributes will be attached @@ -498,13 +485,4 @@ Item.prototype.getTitle = function () { return this.data.title; }; -/** - * Set the popup object, and update the title - * @param {Popup} popup - */ -Item.prototype.setPopup = function (popup) { - this.popup = popup; - this._updateTitle(); -}; - module.exports = Item; diff --git a/lib/timeline/component/item/PointItem.js b/lib/timeline/component/item/PointItem.js index 83c4e67b..959d22da 100644 --- a/lib/timeline/component/item/PointItem.js +++ b/lib/timeline/component/item/PointItem.js @@ -96,7 +96,6 @@ PointItem.prototype.redraw = function() { // - the item is selected/deselected if (this.dirty) { this._updateContents(this.dom.content); - this._updateTitle(); this._updateDataAttributes(this.dom.point); this._updateStyle(this.dom.point); diff --git a/lib/timeline/component/item/RangeItem.js b/lib/timeline/component/item/RangeItem.js index d432376b..b0d71636 100644 --- a/lib/timeline/component/item/RangeItem.js +++ b/lib/timeline/component/item/RangeItem.js @@ -100,7 +100,6 @@ RangeItem.prototype.redraw = function() { // - the item is selected/deselected if (this.dirty) { this._updateContents(this.dom.content); - this._updateTitle(); this._updateDataAttributes(this.dom.box); this._updateStyle(this.dom.box); diff --git a/misc/we_need_help.md b/misc/we_need_help.md index a3eb9106..00287215 100644 --- a/misc/we_need_help.md +++ b/misc/we_need_help.md @@ -13,3 +13,5 @@ If you have shown some commitment to the project you can ask [@ludost](//github. * [@ludost](//github.com/ludost) (almende maintainer) * [@mojoaxel](//github.com/mojoaxel) * [@yotamberk](//github.com/yotamberk) +* [@Tooa](//github.com/Tooa) +* [@eymiha](//github.com/eymiha) diff --git a/package.json b/package.json index 243889ca..8326d010 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vis", - "version": "4.18.0-SNAPSHOT", + "version": "4.18.1-SNAPSHOT", "description": "A dynamic, browser-based visualization library.", "homepage": "http://visjs.org/", "license": "(Apache-2.0 OR MIT)", @@ -27,38 +27,38 @@ "build": "gulp", "watch": "gulp watch", "watch-dev": "gulp watch --bundle" - }, + }, "dependencies": { - "babel-core": "^6.21.0", - "babel-loader": "^6.2.10", - "babel-polyfill": "^6.20.0", - "babel-plugin-transform-es3-member-expression-literals": "^6.8.0", - "babel-plugin-transform-es3-property-literals": "^6.8.0", - "babel-plugin-transform-runtime": "^6.15.0", - "babel-preset-es2015": "^6.18.0", - "babel-runtime": "^6.20.0", + "babel-core": "^6.6.5", + "babel-loader": "^6.2.4", + "babel-polyfill": "^6.22.0", + "babel-plugin-transform-es3-member-expression-literals": "^6.22.0", + "babel-plugin-transform-es3-property-literals": "^6.8.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-preset-es2015": "^6.6.0", + "babel-runtime": "^6.22.0", "emitter-component": "^1.1.1", - "moment": "^2.12.0", + "moment": "^2.17.1", "propagating-hammerjs": "^1.4.6", - "hammerjs": "^2.0.6", + "hammerjs": "^2.0.8", "keycharm": "^0.2.0" }, "devDependencies": { - "async": "^2.0.0-rc.2", + "async": "^2.1.4", "babelify": "^7.3.0", - "clean-css": "^3.4.10", + "clean-css": "^4.0.2", "gulp": "^3.9.1", - "gulp-clean-css": "^2.0.11", - "gulp-concat": "^2.6.0", + "gulp-clean-css": "^2.3.2", + "gulp-concat": "^2.6.1", "gulp-rename": "^1.2.2", - "gulp-util": "^3.0.7", + "gulp-util": "^3.0.8", "jsdom": "9.9.1", - "mocha": "^3.1.2", + "mocha": "^3.2.0", "mocha-jsdom": "^1.1.0", - "rimraf": "^2.5.2", - "uglify-js": "^2.6.2", + "rimraf": "^2.5.4", + "uglify-js": "^2.7.5", "uuid": "^3.0.1", - "webpack": "^1.12.14", - "yargs": "^6.3.0" + "webpack": "^1.14.0", + "yargs": "^6.6.0" } } diff --git a/test/network/maximumWidthEdgeCase.html b/test/network/maximumWidthEdgeCase.html new file mode 100644 index 00000000..34ff24d4 --- /dev/null +++ b/test/network/maximumWidthEdgeCase.html @@ -0,0 +1,66 @@ + + + + Maximum Width Edge Case Test + + + + + + + + + + +

A word in a label that's wider than the maximum width will be forced onto a line. We can't do better without breaking the word into pieces, and even then the pieces could still be too wide.

+ +

Avoid the problem. Don't set ridiculously small maximum widths.

+ +
+ + + + +