diff --git a/docs/network/index.html b/docs/network/index.html index 036fb67d..ca786bd6 100644 --- a/docs/network/index.html +++ b/docs/network/index.html @@ -190,7 +190,7 @@ </body> </html> -

The result of the code above will be the basic example which is shown here.

+

The result of the code above will be the basic example which is shown here.


@@ -1439,8 +1439,7 @@ var network = new vis.Network(container, data, options);

Network can import data straight from an exported json file from gephi. You can get the JSON exporter here: https://marketplace.gephi.org/plugin/json-exporter/. - An example exists showing how to get a JSON file into Vis: 30_importing_from_gephi. + An example exists showing how to get a JSON file into Vis:

@@ -1449,7 +1448,7 @@ var network = new vis.Network(container, data, options);

 // load the JSON file containing the Gephi network.
-var gephiJSON = loadJSON("./data/WorldCup2014.json"); // code in example 30
+var gephiJSON = loadJSON("./datasources/WorldCup2014.json"); // code in importing_from_gephi.
 
 // you can customize the result like with these options. These are explained below.
 // These are the default options.
diff --git a/examples/network/events/interactionEvents.html b/examples/network/events/interactionEvents.html
index 151e4783..737416e3 100644
--- a/examples/network/events/interactionEvents.html
+++ b/examples/network/events/interactionEvents.html
@@ -61,6 +61,18 @@
         params.event = "[original event]";
         document.getElementById('eventSpan').innerHTML = '

oncontext (right click) event:

' + JSON.stringify(params, null, 4); }); + network.on("dragStart", function (params) { + params.event = "[original event]"; + document.getElementById('eventSpan').innerHTML = '

dragStart event:

' + JSON.stringify(params, null, 4); + }); + network.on("dragging", function (params) { + params.event = "[original event]"; + document.getElementById('eventSpan').innerHTML = '

dragging event:

' + JSON.stringify(params, null, 4); + }); + network.on("dragEnd", function (params) { + params.event = "[original event]"; + document.getElementById('eventSpan').innerHTML = '

dragEnd event:

' + JSON.stringify(params, null, 4); + }); network.on("zoom", function (params) { document.getElementById('eventSpan').innerHTML = '

zoom event:

' + JSON.stringify(params, null, 4); }); diff --git a/examples/network/layout/hierarchica_layout_methods.html b/examples/network/layout/hierarchical_layout_methods.html similarity index 100% rename from examples/network/layout/hierarchica_layout_methods.html rename to examples/network/layout/hierarchical_layout_methods.html diff --git a/examples/timeline/12_custom_styling.html b/examples/timeline/12_custom_styling.html new file mode 100644 index 00000000..c0917b63 --- /dev/null +++ b/examples/timeline/12_custom_styling.html @@ -0,0 +1,100 @@ + + + + Timeline | Custom styling + + + + + + + + + + +

+ The style of the Timeline can be fully customized via CSS: +

+
+ + + + \ No newline at end of file diff --git a/examples/timeline/basicUsage.html b/examples/timeline/basicUsage.html new file mode 100644 index 00000000..16ea4d4f --- /dev/null +++ b/examples/timeline/basicUsage.html @@ -0,0 +1,45 @@ + + + + Timeline | Basic demo + + + + + + + + + +

+ A basic timeline. You can move and zoom the timeline, and select items. +

+ +
+ + + + \ No newline at end of file diff --git a/examples/timeline/dataHandling/dataSerialization.html b/examples/timeline/dataHandling/dataSerialization.html new file mode 100644 index 00000000..1b3fcfa7 --- /dev/null +++ b/examples/timeline/dataHandling/dataSerialization.html @@ -0,0 +1,121 @@ + + + + Timeline | Data serialization + + + + + + + + + +

Serialization and deserialization

+ +

This example shows how to serialize and deserialize JSON data, and load this in the Timeline via a DataSet. Serialization and deserialization is needed when loading or saving data from a server.

+ + + +
+ + +
+ +
+ + + + \ No newline at end of file diff --git a/examples/timeline/dataHandling/loadExternalData.html b/examples/timeline/dataHandling/loadExternalData.html new file mode 100644 index 00000000..a5002726 --- /dev/null +++ b/examples/timeline/dataHandling/loadExternalData.html @@ -0,0 +1,58 @@ + + + + Timeline | External data + + + + + + + + + + + +

+ This demo shows how to load external data via an ajax call. +

+
+
loading...
+ + + + \ No newline at end of file diff --git a/examples/timeline/editing/customSnappingOfItems.html b/examples/timeline/editing/customSnappingOfItems.html new file mode 100644 index 00000000..65a9a510 --- /dev/null +++ b/examples/timeline/editing/customSnappingOfItems.html @@ -0,0 +1,55 @@ + + + + Timeline | Custom snapping + + + + + + +

+ When moving the items in on the Timeline below, they will snap to full hours, + independent of being zoomed in or out. +

+
+ + + + \ No newline at end of file diff --git a/examples/timeline/editing/editingItems.html b/examples/timeline/editing/editingItems.html new file mode 100644 index 00000000..41f6e7c0 --- /dev/null +++ b/examples/timeline/editing/editingItems.html @@ -0,0 +1,77 @@ + + + + Timeline | Manipulation example + + + + + + + + + +

An editable timeline allows to drag items around, create new items, and remove items. Changes are logged in the browser console.

+ +
+ + + + \ No newline at end of file diff --git a/examples/timeline/editing/editingItemsCallbacks.html b/examples/timeline/editing/editingItemsCallbacks.html new file mode 100644 index 00000000..8797683f --- /dev/null +++ b/examples/timeline/editing/editingItemsCallbacks.html @@ -0,0 +1,108 @@ + + + + Timeline | Manipulation callbacks + + + + + + + + +

+ This example shows how to use callback functions onAdd, onMove, onMoving, onUpdate, and onRemove. The onMoving function updates an item while dragging, and can be used to prevent the item from being drawn at disallowed or infeasible timeslots. In this example, the items cannot be moved outside of the month April 2013. The other callback functions are called after an add, move, update, or remove action has taken place, and can be used to cancel these actions. +

+ +
+

+
+ + + + \ No newline at end of file diff --git a/examples/timeline/editing/updateDataOnEvent.html b/examples/timeline/editing/updateDataOnEvent.html new file mode 100644 index 00000000..aedb885f --- /dev/null +++ b/examples/timeline/editing/updateDataOnEvent.html @@ -0,0 +1,90 @@ + + + Timeline | Update data on event + + + + + + + + + +

+ When the custom time bar is shown, the user can drag this bar to a specific + time. The Timeline sends an event that the custom time is changed, after + which the contents of the timeline can be changed according to the specified + time in past or future. +

+ +
 
+

+ +
+ + + + + + diff --git a/examples/timeline/groups/groups.html b/examples/timeline/groups/groups.html new file mode 100644 index 00000000..1fe6938e --- /dev/null +++ b/examples/timeline/groups/groups.html @@ -0,0 +1,74 @@ + + + + Timeline | Group example + + + + + + + + + + + +

+ This example demonstrate using groups. Note that a DataSet is used for both + items and groups, allowing to dynamically add, update or remove both items + and groups via the DataSet. +

+
+ + + + \ No newline at end of file diff --git a/examples/timeline/groups/groupsOrdering.html b/examples/timeline/groups/groupsOrdering.html new file mode 100644 index 00000000..8b9d03e2 --- /dev/null +++ b/examples/timeline/groups/groupsOrdering.html @@ -0,0 +1,68 @@ + + + + Timeline | Groups ordering + + + + + + + + +

+ This example demonstrates custom ordering of groups. +

+
+ + + + \ No newline at end of file diff --git a/examples/timeline/groups/subgroups.html b/examples/timeline/groups/subgroups.html new file mode 100644 index 00000000..770a88d8 --- /dev/null +++ b/examples/timeline/groups/subgroups.html @@ -0,0 +1,76 @@ + + + + Timeline | Background areas + + + + + + + + + +

This example shows the workings of the subgroups. Subgroups do not use stacking, and only work when stacking is disabled.

+ +
+ + + + \ No newline at end of file diff --git a/examples/timeline/interaction/animateWindow.html b/examples/timeline/interaction/animateWindow.html new file mode 100644 index 00000000..5ec8d7bd --- /dev/null +++ b/examples/timeline/interaction/animateWindow.html @@ -0,0 +1,96 @@ + + + + Timeline | Animate window + + + + + + + + + +

This example demonstrates functions to programmatically adjust the visible window of the Timeline.

+ +

+
+
+
+
+
+
+
+
+

+ +
+ + + + \ No newline at end of file diff --git a/examples/timeline/interaction/clickToUse.html b/examples/timeline/interaction/clickToUse.html new file mode 100644 index 00000000..97d465f6 --- /dev/null +++ b/examples/timeline/interaction/clickToUse.html @@ -0,0 +1,73 @@ + + + + Timeline | Click to use + + + + + + + + +
+

Timeline click to use

+

+ This example demonstrates how to use the clickToUse option: before you can scroll and drag in the timeline, you first have to click in the timeline to activate. +

+
+ + + + \ No newline at end of file diff --git a/examples/timeline/interaction/eventListeners.html b/examples/timeline/interaction/eventListeners.html new file mode 100644 index 00000000..53f94da6 --- /dev/null +++ b/examples/timeline/interaction/eventListeners.html @@ -0,0 +1,64 @@ + + + + Timeline | Event listeners + + + + + + + + +

+ This example listens for events select, rangechange, and rangechanged of the Timeline, and listens for changes in the DataSet (add, update, or remove items). +

+
+

+
+ + + + \ No newline at end of file diff --git a/examples/timeline/interaction/limitMoveAndZoom.html b/examples/timeline/interaction/limitMoveAndZoom.html new file mode 100644 index 00000000..d6632187 --- /dev/null +++ b/examples/timeline/interaction/limitMoveAndZoom.html @@ -0,0 +1,53 @@ + + + + Timeline | Limit move and zoom + + + + + + + + +

+ The visible range is limited in this demo: +

+ +
+ + + + \ No newline at end of file diff --git a/examples/timeline/interaction/navigationMenu.html b/examples/timeline/interaction/navigationMenu.html new file mode 100644 index 00000000..07ec66c1 --- /dev/null +++ b/examples/timeline/interaction/navigationMenu.html @@ -0,0 +1,94 @@ + + + + Timeline | navigation menu + + + + + + + + + +

+ Create your own navigation menu by creating an overlay with buttons to zoom and move. +

+ +
+ +
+ + + + \ No newline at end of file diff --git a/examples/timeline/interaction/setSelection.html b/examples/timeline/interaction/setSelection.html new file mode 100644 index 00000000..b68fb022 --- /dev/null +++ b/examples/timeline/interaction/setSelection.html @@ -0,0 +1,66 @@ + + + + Timeline | Select items + + + + + + + + +

Set selection

+

+ Enter one or multiple ids of items, then press select to select the items. This demo uses the function Timeline.setSelection(ids). Optionally, the window can be moved to the selected items. +

+ +

+ Select item(s):
+ +

+
+ + + + \ No newline at end of file diff --git a/examples/timeline/items/backgroundAreas.html b/examples/timeline/items/backgroundAreas.html new file mode 100644 index 00000000..5f6d547c --- /dev/null +++ b/examples/timeline/items/backgroundAreas.html @@ -0,0 +1,50 @@ + + + + Timeline | Background areas + + + + + + + + + +

This example demonstrates the item type "background", see "Period A" and "Period B". The background areas can be styled with css.

+ +
+ + + + \ No newline at end of file diff --git a/examples/timeline/items/backgroundAreasWithGroups.html b/examples/timeline/items/backgroundAreasWithGroups.html new file mode 100644 index 00000000..409f3e54 --- /dev/null +++ b/examples/timeline/items/backgroundAreasWithGroups.html @@ -0,0 +1,57 @@ + + + + Timeline | Background areas with groups + + + + + + + + + +

This example demonstrates the item type "background" when using groups.

+ +
+ + + + \ No newline at end of file diff --git a/examples/timeline/items/htmlContents.html b/examples/timeline/items/htmlContents.html new file mode 100644 index 00000000..6a818c30 --- /dev/null +++ b/examples/timeline/items/htmlContents.html @@ -0,0 +1,75 @@ + + + + Timeline | HTML data + + + + + + + + + +

+ Load HTML contents in the Timeline in various ways. +

+
+ + + + \ No newline at end of file diff --git a/examples/timeline/items/itemOrdering.html b/examples/timeline/items/itemOrdering.html new file mode 100644 index 00000000..e8cafdc9 --- /dev/null +++ b/examples/timeline/items/itemOrdering.html @@ -0,0 +1,82 @@ + + + + Timeline | Item ordering + + + + + + + + + +

Item ordering

+

+ By default, the items displayed on the Timeline are unordered. They are + stacked in the order that they where loaded. This means that way items are + stacked can change while moving and zooming the Timeline. +

+

+ To display and stack the items in a controlled order, you can provide a + custom sorting function via the configuration option order. +

+

+ WARNING: Custom ordering is only suitable for small amounts of items (up to a few + hundred), as the Timeline has to render all items once on load to + determine their width and height. +

+

+ +

+ +
+ + + + \ No newline at end of file diff --git a/examples/timeline/items/pointItems.html b/examples/timeline/items/pointItems.html new file mode 100644 index 00000000..67082cc0 --- /dev/null +++ b/examples/timeline/items/pointItems.html @@ -0,0 +1,60 @@ + + + + Timeline | Point items + + + + + + + + +

World War II timeline

+

Source: http://www.onwar.com/chrono/index.htm

+
+ +
+ + + + diff --git a/examples/timeline/items/rangeOverflowItem.html b/examples/timeline/items/rangeOverflowItem.html new file mode 100644 index 00000000..12582a69 --- /dev/null +++ b/examples/timeline/items/rangeOverflowItem.html @@ -0,0 +1,54 @@ + + + + Timeline | Range overflow + + + + + + + + + +

+ In case of ranges being spread over a wide range of time, it can be interesting to have the text contents of the ranges overflow the box. This can be achieved by changing the overflow property of the contents to visible with css: +

+
+.vis-item .vis-item-overflow {
+  overflow: visible;
+}
+
+ +
+ + + + \ No newline at end of file diff --git a/examples/timeline/other/customTimeBars.html b/examples/timeline/other/customTimeBars.html new file mode 100644 index 00000000..4794904c --- /dev/null +++ b/examples/timeline/other/customTimeBars.html @@ -0,0 +1,89 @@ + + + + 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 new file mode 100644 index 00000000..f852fffb --- /dev/null +++ b/examples/timeline/other/dataAttributes.html @@ -0,0 +1,44 @@ + + + + Timeline | Basic demo + + + + + + + + +

+ In this example all items get an HTML attribute attached: each item gets an attribute data-id, and items 1 and 6 have an additional attribute data-tooltip. +

+ +
+ + + + \ No newline at end of file diff --git a/examples/timeline/other/dataAttributesAll.html b/examples/timeline/other/dataAttributesAll.html new file mode 100644 index 00000000..7938f0bd --- /dev/null +++ b/examples/timeline/other/dataAttributesAll.html @@ -0,0 +1,44 @@ + + + + Timeline | Basic demo + + + + + + + + +

+ In this example all items get HTML attributes attached: each item gets data-? attributes for each field defined on the JS object. +

+ +
+ + + + \ No newline at end of file diff --git a/examples/timeline/other/groupsPerformance.html b/examples/timeline/other/groupsPerformance.html new file mode 100644 index 00000000..58dc9ca1 --- /dev/null +++ b/examples/timeline/other/groupsPerformance.html @@ -0,0 +1,110 @@ + + + Timeline | A lot of grouped data + + + + + + + + + +

Timeline grouping performance

+ +

+ Choose a number of items: + 100, + 1000, + 10000, + 100000 +

+

+ Current number of items: 100 +

+ +
+ + + + + diff --git a/examples/timeline/other/hidingPeriods.html b/examples/timeline/other/hidingPeriods.html new file mode 100644 index 00000000..9b2f359a --- /dev/null +++ b/examples/timeline/other/hidingPeriods.html @@ -0,0 +1,53 @@ + + + + Timeline | Hiding periods + + + + + + + + +

+ It's possible to hide (recurring) periods from the Timeline. The following example hides weekends and nights. +

+
+ + + \ No newline at end of file diff --git a/examples/timeline/other/localization.html b/examples/timeline/other/localization.html new file mode 100644 index 00000000..39080c89 --- /dev/null +++ b/examples/timeline/other/localization.html @@ -0,0 +1,66 @@ + + + + Timeline | Localization + + + + + + + + + +

+ To localize the Timeline, one has to load a version of moment.js including locales. To set a locale, specify option {locale: STRING}. +

+ +

+ + +

+ +
+ + + + \ No newline at end of file diff --git a/examples/timeline/other/performance.html b/examples/timeline/other/performance.html new file mode 100644 index 00000000..4f914354 --- /dev/null +++ b/examples/timeline/other/performance.html @@ -0,0 +1,65 @@ + + + + Timeline | performance + + + + + + + + + + + +

+ Test the performance with a lot of items. The Timeline can load hundreds of thousands of items, but the performance of rendering them in the browser is limited. Rendering typically runs smooth for up to a few hundreds of items at once (you can set a zoomMax to prevent the user from zooming out too far). +

+

+ + + +

+
+ + + + \ No newline at end of file diff --git a/examples/timeline/other/requirejs/requirejs_example.html b/examples/timeline/other/requirejs/requirejs_example.html new file mode 100644 index 00000000..d4531591 --- /dev/null +++ b/examples/timeline/other/requirejs/requirejs_example.html @@ -0,0 +1,17 @@ + + + + Timeline require.js demo + + + + + + + +

+ This example shows how to load the vis.js library using require.js. +

+
+ + diff --git a/examples/timeline/other/requirejs/scripts/main.js b/examples/timeline/other/requirejs/scripts/main.js new file mode 100644 index 00000000..f8148540 --- /dev/null +++ b/examples/timeline/other/requirejs/scripts/main.js @@ -0,0 +1,19 @@ +require.config({ + paths: { + vis: '../../../../../dist/vis' + } +}); + +require(['vis'], function (vis) { + var container = document.getElementById('visualization'); + var data = 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'} + ]); + var options = {}; + var timeline = new vis.Timeline(container, data, options); +}); diff --git a/examples/timeline/other/requirejs/scripts/require.js b/examples/timeline/other/requirejs/scripts/require.js new file mode 100644 index 00000000..8de013dc --- /dev/null +++ b/examples/timeline/other/requirejs/scripts/require.js @@ -0,0 +1,35 @@ +/* + RequireJS 2.1.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. + Available via the MIT or new BSD license. + see: http://github.com/jrburke/requirejs for details +*/ +var requirejs,require,define; +(function(Y){function H(b){return"[object Function]"===L.call(b)}function I(b){return"[object Array]"===L.call(b)}function x(b,c){if(b){var d;for(d=0;dthis.depCount&&!this.defined){if(H(n)){if(this.events.error)try{e=j.execCb(c,n,b,e)}catch(d){a=d}else e=j.execCb(c,n,b,e);this.map.isDefine&&((b=this.module)&&void 0!==b.exports&&b.exports!==this.exports?e=b.exports:void 0===e&&this.usingExports&&(e=this.exports));if(a)return a.requireMap=this.map,a.requireModules=[this.map.id],a.requireType="define",C(this.error=a)}else e=n;this.exports=e;if(this.map.isDefine&& +!this.ignore&&(p[c]=e,l.onResourceLoad))l.onResourceLoad(j,this.map,this.depMaps);delete k[c];this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=this.map,b=a.id,d=h(a.prefix);this.depMaps.push(d);s(d,"defined",t(this,function(e){var n,d;d=this.map.name;var v=this.map.parentMap?this.map.parentMap.name:null,f=j.makeRequire(a.parentMap,{enableBuildCallback:!0, +skipMap:!0});if(this.map.unnormalized){if(e.normalize&&(d=e.normalize(d,function(a){return c(a,v,!0)})||""),e=h(a.prefix+"!"+d,this.map.parentMap),s(e,"defined",t(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),d=i(k,e.id)){this.depMaps.push(e);if(this.events.error)d.on("error",t(this,function(a){this.emit("error",a)}));d.enable()}}else n=t(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),n.error=t(this,function(a){this.inited=!0;this.error= +a;a.requireModules=[b];E(k,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&delete k[a.map.id]});C(a)}),n.fromText=t(this,function(e,c){var d=a.name,u=h(d),v=O;c&&(e=c);v&&(O=!1);q(u);r(m.config,b)&&(m.config[d]=m.config[b]);try{l.exec(e)}catch(k){throw Error("fromText eval for "+d+" failed: "+k);}v&&(O=!0);this.depMaps.push(u);j.completeLoad(d);f([d],n)}),e.load(a.name,f,n,m)}));j.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){this.enabling=this.enabled=!0;x(this.depMaps,t(this,function(a, +b){var c,e;if("string"===typeof a){a=h(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=i(N,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;s(a,"defined",t(this,function(a){this.defineDep(b,a);this.check()}));this.errback&&s(a,"error",this.errback)}c=a.id;e=k[c];!r(N,c)&&(e&&!e.enabled)&&j.enable(a,this)}));E(this.pluginMaps,t(this,function(a){var b=i(k,a.id);b&&!b.enabled&&j.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c= +this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){x(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};j={config:m,contextName:b,registry:k,defined:p,urlFetched:S,defQueue:F,Module:W,makeModuleMap:h,nextTick:l.nextTick,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=m.pkgs,c=m.shim,e={paths:!0,config:!0,map:!0};E(a,function(a,b){e[b]?"map"===b?Q(m[b],a,!0,!0):Q(m[b],a,!0):m[b]=a});a.shim&&(E(a.shim,function(a, +b){I(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=j.makeShimExports(a);c[b]=a}),m.shim=c);a.packages&&(x(a.packages,function(a){a="string"===typeof a?{name:a}:a;b[a.name]={name:a.name,location:a.location||a.name,main:(a.main||"main").replace(ga,"").replace(aa,"")}}),m.pkgs=b);E(k,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=h(b))});if(a.deps||a.callback)j.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(Y,arguments)); +return b||a.exports&&Z(a.exports)}},makeRequire:function(a,d){function f(e,c,u){var i,m;d.enableBuildCallback&&(c&&H(c))&&(c.__requireJsBuild=!0);if("string"===typeof e){if(H(c))return C(J("requireargs","Invalid require call"),u);if(a&&r(N,e))return N[e](k[a.id]);if(l.get)return l.get(j,e,a);i=h(e,a,!1,!0);i=i.id;return!r(p,i)?C(J("notloaded",'Module name "'+i+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):p[i]}K();j.nextTick(function(){K();m=q(h(null,a));m.skipMap=d.skipMap; +m.init(e,c,u,{enabled:!0});B()});return f}d=d||{};Q(f,{isBrowser:z,toUrl:function(b){var d=b.lastIndexOf("."),g=null;-1!==d&&(g=b.substring(d,b.length),b=b.substring(0,d));return j.nameToUrl(c(b,a&&a.id,!0),g)},defined:function(b){return r(p,h(b,a,!1,!0).id)},specified:function(b){b=h(b,a,!1,!0).id;return r(p,b)||r(k,b)}});a||(f.undef=function(b){w();var c=h(b,a,!0),d=i(k,b);delete p[b];delete S[c.url];delete X[b];d&&(d.events.defined&&(X[b]=d.events),delete k[b])});return f},enable:function(a){i(k, +a.id)&&q(a).enable()},completeLoad:function(a){var b,c,d=i(m.shim,a)||{},h=d.exports;for(w();F.length;){c=F.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);D(c)}c=i(k,a);if(!b&&!r(p,a)&&c&&!c.inited){if(m.enforceDefine&&(!h||!Z(h)))return y(a)?void 0:C(J("nodefine","No define call for "+a,null,[a]));D([a,d.deps||[],d.exportsFn])}B()},nameToUrl:function(a,b){var c,d,h,f,j,k;if(l.jsExtRegExp.test(a))f=a+(b||"");else{c=m.paths;d=m.pkgs;f=a.split("/");for(j=f.length;0f.attachEvent.toString().indexOf("[native code"))&&!V?(O=!0,f.attachEvent("onreadystatechange", +b.onScriptLoad)):(f.addEventListener("load",b.onScriptLoad,!1),f.addEventListener("error",b.onScriptError,!1)),f.src=d,K=f,D?A.insertBefore(f,D):A.appendChild(f),K=null,f;$&&(importScripts(d),b.completeLoad(c))};z&&M(document.getElementsByTagName("script"),function(b){A||(A=b.parentNode);if(s=b.getAttribute("data-main"))return q.baseUrl||(G=s.split("/"),ba=G.pop(),ca=G.length?G.join("/")+"/":"./",q.baseUrl=ca,s=ba),s=s.replace(aa,""),q.deps=q.deps?q.deps.concat(s):[s],!0});define=function(b,c,d){var i, +f;"string"!==typeof b&&(d=c,c=b,b=null);I(c)||(d=c,c=[]);!c.length&&H(d)&&d.length&&(d.toString().replace(ia,"").replace(ja,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c));if(O){if(!(i=K))P&&"interactive"===P.readyState||M(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return P=b}),i=P;i&&(b||(b=i.getAttribute("data-requiremodule")),f=B[i.getAttribute("data-requirecontext")])}(f?f.defQueue:R).push([b,c,d])};define.amd= +{jQuery:!0};l.exec=function(b){return eval(b)};l(q)}})(this); diff --git a/examples/timeline/resources/data/basic.json b/examples/timeline/resources/data/basic.json new file mode 100644 index 00000000..711dd8e2 --- /dev/null +++ b/examples/timeline/resources/data/basic.json @@ -0,0 +1,34 @@ +[ + { + "id": 1, + "content": "item 1", + "start": "2014-04-20" + }, + { + "id": 2, + "content": "item 2", + "start": "2014-04-14" + }, + { + "id": 3, + "content": "item 3", + "start": "2014-04-18" + }, + { + "id": 4, + "content": "item 4", + "start": "2014-04-16", + "end": "2014-04-19" + }, + { + "id": 5, + "content": "item 5", + "start": "2014-04-25" + }, + { + "id": 6, + "content": "item 6", + "start": "2014-04-27", + "type": "point" + } +] \ No newline at end of file diff --git a/examples/timeline/resources/data/wk2014.json b/examples/timeline/resources/data/wk2014.json new file mode 100644 index 00000000..2bcb3d75 --- /dev/null +++ b/examples/timeline/resources/data/wk2014.json @@ -0,0 +1,152 @@ +[ + { + "player1": "Brazil", + "abbr1": "br", + "score1": "1 (3)", + "player2": "Chile", + "abbr2": "cl", + "score2": "1 (2)", + "description": "round of 16", + "start": "2014-06-28 13:00" + }, + { + "player1": "Colombia", + "abbr1": "co", + "score1": 2, + "player2": "Uruguay", + "abbr2": "uy", + "score2": 0, + "description": "round of 16", + "start": "2014-06-28 17:00" + }, + { + "player1": "Netherlands", + "abbr1": "nl", + "score1": 2, + "player2": "Mexico", + "abbr2": "mx", + "score2": 1, + "description": "round of 16", + "start": "2014-06-29 13:00" + }, + { + "player1": "Costa Rica", + "abbr1": "cr", + "score1": "1 (5)", + "player2": "Greece", + "abbr2": "gr", + "score2": "1 (3)", + "description": "round of 16", + "start": "2014-06-29 17:00" + }, + { + "player1": "France", + "abbr1": "fr", + "score1": 2, + "player2": "Nigeria", + "abbr2": "ng", + "score2": 0, + "description": "round of 16", + "start": "2014-06-30 13:00" + }, + { + "player1": "Germany", + "abbr1": "de", + "score1": 2, + "player2": "Algeria", + "abbr2": "dz", + "score2": 1, + "description": "round of 16", + "start": "2014-06-30 17:00" + }, + { + "player1": "Argentina", + "abbr1": "ar", + "score1": 1, + "player2": "Switzerland", + "abbr2": "ch", + "score2": 0, + "description": "round of 16", + "start": "2014-07-01 13:00" + }, + { + "player1": "Belgium", + "abbr1": "be", + "score1": 2, + "player2": "USA", + "abbr2": "us", + "score2": 1, + "description": "round of 16", + "start": "2014-07-01 17:00" + }, + { + "player1": "France", + "abbr1": "fr", + "score1": 0, + "player2": "Germany", + "abbr2": "de", + "score2": 1, + "description": "quarter-finals", + "start": "2014-07-04 13:00" + }, + { + "player1": "Brazil", + "abbr1": "br", + "score1": 2, + "player2": "Colombia", + "abbr2": "co", + "score2": 1, + "description": "quarter-finals", + "start": "2014-07-04 17:00" + }, + { + "player1": "Argentina", + "abbr1": "ar", + "score1": 1, + "player2": "Belgium", + "abbr2": "be", + "score2": 0, + "description": "quarter-finals", + "start": "2014-07-05 13:00" + }, + { + "player1": "Netherlands", + "abbr1": "nl", + "score1": "0 (4)", + "player2": "Costa Rica", + "abbr2": "cr", + "score2": "0 (3)", + "description": "quarter-finals", + "start": "2014-07-05 17:00" + }, + { + "player1": "Brazil", + "abbr1": "br", + "score1": 1, + "player2": "Germany", + "abbr2": "de", + "score2": 7, + "description": "semi-finals", + "start": "2014-07-08 17:00" + }, + { + "player1": "Netherlands", + "abbr1": "nl", + "score1": "0 (2)", + "player2": "Argentina", + "abbr2": "ar", + "score2": "0 (4)", + "description": "semi-finals", + "start": "2014-07-09 17:00" + }, + { + "player1": "Germany", + "score1": 1, + "abbr1": "de", + "player2": "Argentina", + "abbr2": "ar", + "score2": 0, + "description": "final", + "start": "2014-07-13 16:00" + } +] \ No newline at end of file diff --git a/examples/timeline/resources/img/Hardware-Mobile-Phone-icon.png b/examples/timeline/resources/img/Hardware-Mobile-Phone-icon.png new file mode 100644 index 00000000..66a6d35f Binary files /dev/null and b/examples/timeline/resources/img/Hardware-Mobile-Phone-icon.png differ diff --git a/examples/timeline/resources/img/attachment-icon.png b/examples/timeline/resources/img/attachment-icon.png new file mode 100644 index 00000000..fc825177 Binary files /dev/null and b/examples/timeline/resources/img/attachment-icon.png differ diff --git a/examples/timeline/resources/img/blog-post-edit-icon.png b/examples/timeline/resources/img/blog-post-edit-icon.png new file mode 100644 index 00000000..12ab23c6 Binary files /dev/null and b/examples/timeline/resources/img/blog-post-edit-icon.png differ diff --git a/examples/timeline/resources/img/comments-icon.png b/examples/timeline/resources/img/comments-icon.png new file mode 100644 index 00000000..736789ed Binary files /dev/null and b/examples/timeline/resources/img/comments-icon.png differ diff --git a/examples/timeline/resources/img/community-users-icon.png b/examples/timeline/resources/img/community-users-icon.png new file mode 100644 index 00000000..a77e239a Binary files /dev/null and b/examples/timeline/resources/img/community-users-icon.png differ diff --git a/examples/timeline/resources/img/license.txt b/examples/timeline/resources/img/license.txt new file mode 100644 index 00000000..9d65f9f5 --- /dev/null +++ b/examples/timeline/resources/img/license.txt @@ -0,0 +1,17 @@ +IMAGE LICENSES + +REFRESH CL +http://www.iconarchive.com/category/system/refresh-cl-icons-by-tpdkdesign.net.html + +License: Free for non-commercial use. +http://www.iconarchive.com/icons/tpdkdesign.net/refresh-cl/readme_eng.txt + + + +AESTHETICA 2 +http://www.iconarchive.com/category/application/aesthetica-2-icons-by-dryicons.html + +License: +DryIcons Terms of Use +http://dryicons.com/terms/ + diff --git a/examples/timeline/resources/img/license_aesthetica-2.txt b/examples/timeline/resources/img/license_aesthetica-2.txt new file mode 100644 index 00000000..28554c00 --- /dev/null +++ b/examples/timeline/resources/img/license_aesthetica-2.txt @@ -0,0 +1,36 @@ +Aesthetica Icon Set, version 2.0 +http://dryicons.com/free-icons/preview/aesthetica-version-2/ + +Information +---------------------- + +This icon set contains 181 quality icons in the following formats: + Transparent PNG + 16 x 16 px + 24 x 24 px + 32 x 32 px + 48 x 48 px + 128 x 128 px + + + +Licensing +---------------------- + +The usage of DryIcons' work (icons, icon sets and graphics) is limited to the terms of the "Free License" and "Commercial License" use. +The DryIcons Free License means that you can use our icons, icon sets and graphics in any publicly accesible web site, web application or any form of presentation publicly accessible through the World Wide Web only according to the DryIcons Free License Terms and Conditions: + +* You must put a back link with credits to http://dryicons.com on every page where DryIcons' Works are used (example: Icons by http://dryicons.com); + +* You must include the correct back link to DryIcons website, which is: http://dryicons.com; + +* You must place the link on an easy-to-see, recognizable place, so there is no confusion about the Original Author of the Works (DryIcons); + +* When copying, or paraphrasing description text (or title) on one of the Works, you must make sure there are no spelling mistakes; + +* Do not try to take credit or imply in any way that you and not DryIcons is the Original Author of the Works (icons, icon sets and graphics). + +For a more detailed look at our Free License Agreement, please follow the link: http://dryicons.com/terms/#free-license + + +The DryIcons Commercial License means that you can use our Free Icon Sets and Free Graphics without being obligated to put a back link to DryIcons.com for a certain fee. After you complete yourpayment transaction DryIcons grants you a Commercial License. \ No newline at end of file diff --git a/examples/timeline/resources/img/license_refresh-cl.txt b/examples/timeline/resources/img/license_refresh-cl.txt new file mode 100644 index 00000000..78427f03 --- /dev/null +++ b/examples/timeline/resources/img/license_refresh-cl.txt @@ -0,0 +1,26 @@ +RefreshCL Icon Pack by TPDK ©2005 www.tpdkdesign.net +All rights reserved. +version 1.0 2005/18/11 + + +Terms of use +Theses icons are copyrighted, and for personal use only. +Until now, COMMERCIAL USE is strictly forbidden. + +You cannot (non-exhaustive list) : +- Use my icons in commercial website +- Use my icons in a professional website layout +- Sell or distribute those icons + +For any other use, such as : +- using in non-commercial website +- using icon in free software under GPL licence +you need my authorization to use them. If you have my permission, you need to credit me in your terms and put a link to my website. +I would not be responsible fo any damage you may encounter while using this product. +For any question or request about the pack, please send me an email to tpdk@tpdkdesign.net. + +Special thanks to customxp's & crystalxp's teams and members for help and support ;) +http://crystalxp.net +http://customxp.net +http://pngfactory.net +visit my deviantart webpage : http://tpdkcasimir.deviantart.com/ diff --git a/examples/timeline/resources/img/mail-icon.png b/examples/timeline/resources/img/mail-icon.png new file mode 100644 index 00000000..f11ce5c3 Binary files /dev/null and b/examples/timeline/resources/img/mail-icon.png differ diff --git a/examples/timeline/resources/img/notes-edit-icon.png b/examples/timeline/resources/img/notes-edit-icon.png new file mode 100644 index 00000000..7f903df4 Binary files /dev/null and b/examples/timeline/resources/img/notes-edit-icon.png differ diff --git a/examples/timeline/resources/img/product-icon.png b/examples/timeline/resources/img/product-icon.png new file mode 100644 index 00000000..fb12da43 Binary files /dev/null and b/examples/timeline/resources/img/product-icon.png differ diff --git a/examples/timeline/resources/img/truck-icon.png b/examples/timeline/resources/img/truck-icon.png new file mode 100644 index 00000000..89d92622 Binary files /dev/null and b/examples/timeline/resources/img/truck-icon.png differ diff --git a/examples/timeline/styling/axisOrientation.html b/examples/timeline/styling/axisOrientation.html new file mode 100644 index 00000000..899a6bd2 --- /dev/null +++ b/examples/timeline/styling/axisOrientation.html @@ -0,0 +1,75 @@ + + + + Timeline | Orientation + + + + + + + + + + +

+ There are a number of orientation options for the time axis and the items. +

+ +

+ + +

+ +

+ + +

+ +
+ + + + \ No newline at end of file diff --git a/examples/timeline/styling/customCss.html b/examples/timeline/styling/customCss.html new file mode 100644 index 00000000..906d44a6 --- /dev/null +++ b/examples/timeline/styling/customCss.html @@ -0,0 +1,100 @@ + + + + Timeline | Custom styling + + + + + + + + + + +

+ The style of the Timeline can be fully customized via CSS: +

+
+ + + + \ No newline at end of file diff --git a/examples/timeline/styling/gridStyling.html b/examples/timeline/styling/gridStyling.html new file mode 100644 index 00000000..aaa39c45 --- /dev/null +++ b/examples/timeline/styling/gridStyling.html @@ -0,0 +1,54 @@ + + + + Timeline | Grid styling + + + + + + + + +
+ + + + \ No newline at end of file diff --git a/examples/timeline/styling/itemClassNames.html b/examples/timeline/styling/itemClassNames.html new file mode 100644 index 00000000..38b2735d --- /dev/null +++ b/examples/timeline/styling/itemClassNames.html @@ -0,0 +1,117 @@ + + + Timeline | Item class names + + + + + + + + + +

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 new file mode 100644 index 00000000..a8772afa --- /dev/null +++ b/examples/timeline/styling/itemTemplates.html @@ -0,0 +1,251 @@ + + + + Timeline | Templates + + + + + + + + + + + + + +

WK 2014

+

+ This example demonstrates using templates to format item contents. In this case handlebars is used as template engine, but you can just use your favorite template engine or manually craft HTML from the data of an item. +

+ +
+ +
+ + + + \ No newline at end of file diff --git a/network_examples.html b/network_examples.html index 8c728feb..99952d70 100644 --- a/network_examples.html +++ b/network_examples.html @@ -23,34 +23,21 @@ - + a.exampleLink { + display:block; + text-decoration: underline; + } + @@ -88,276 +75,64 @@
-

Network Examples

View all examples » View docs » - -
This small code example shows the easiest way to get a network up and running. This code has been taken from example 1. The working example is shown next to it. (click it to start interacting with it).
-
-<div id="visualization"></div>
-<script type="text/javascript">
-    // create an array with nodes
-    var nodes = [
-        {id: 1, label: 'Node 1'},
-        {id: 2, label: 'Node 2'},
-        {id: 3, label: 'Node 3'},
-        {id: 4, label: 'Node 4'},
-        {id: 5, label: 'Node 5'}
-    ];
+

Network Examples

+ We have seperated the examples into groups to make it easier to navigate them. For the documentation, please click the button below:

+ View docs » - // create an array with edges - var edges = [ - {from: 1, to: 2}, - {from: 1, to: 3}, - {from: 2, to: 4}, - {from: 2, to: 5} - ]; - - // create a network - var container = document.getElementById('visualization'); - var data = { - nodes: nodes, - edges: edges - }; - var network = new vis.Network(container, data, {}); -</script> -
-
- -

All examples

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +

node styles

+ colors + groups + custom groups + HTML in nodes + icons (Fontawesome and Ionicons) + images + circular images + node shadows + node shapes +

edge styles

+ arrows (also combined with dashes) + different colors + dashes + smooth curves + smooth curves in action +

labels

+ label alignment (for edges only) + label background + colors and sizes + label stroke + multiline text +

layout

+ hierarchical layout + hierarchical layout - different methods + hierarchical layout - user defined + set the random seed so every network will be the same +

events

+ interaction events, click, rightclick, drag etc. + physics events, stabilization etc. + rendering events, use to draw custom items on the canvas. +

dynamic data

+ dataset for dynamic data + dynamic data, playground + importing data from gephi + scaling the nodes with the value. + scaling the nodes and edges with the value. + scaling the nodes, edges and labels with the value. +

physics

+ physics configuration +

example applications

+ les miserables cast + loading bar during stabilization + neighbourhood heighlight + using nodes as a legend + performance test with the worldcup data +

other

+ animation showcase + clustering possibilities + clustering by zoom + dynamic configuration + manipulation interface and localization + navigation buttons and keyboard shortcuts + performance test with scale free network, customize the amount of nodes