@ -1,912 +0,0 @@ | |||||
<!DOCTYPE html> | |||||
<html lang="en"> | |||||
<head> | |||||
<script>(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');</script> | |||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |||||
<meta charset="utf-8"> | |||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |||||
<meta name="viewport" content="width=device-width, initial-scale=1"> | |||||
<meta name="description" content=""> | |||||
<meta name="author" content=""> | |||||
<link rel="icon" HREF="favicon.ico"> | |||||
<title>vis.js - A dynamic, browser based visualization library.</title> | |||||
<!-- Bootstrap core CSS --> | |||||
<link href="./css/bootstrap.css" rel="stylesheet"> | |||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> | |||||
<!--[if lt IE 9]> | |||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> | |||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> | |||||
<![endif]--> | |||||
<script src="./js/smooth-scroll.min.js"></script> | |||||
<script language="JavaScript"> | |||||
smoothScroll.init(); | |||||
</script> | |||||
<style> | |||||
html { | |||||
height: 100%; | |||||
} | |||||
body { | |||||
font-family: Lustria, Georgia, Times, "Times New Roman", serif !important; | |||||
height: 100%; | |||||
background: url('./images/crosswordStrong.png') /* Background pattern from subtlepatterns.com */ | |||||
} | |||||
img.icon { | |||||
position: relative; | |||||
top: -2px; | |||||
} | |||||
div.navbar-wrapper { | |||||
background-color: #07508E; | |||||
border-bottom: 3px solid #ffffff; | |||||
font-size: 16px; | |||||
} | |||||
div.center { | |||||
width: 970px; | |||||
margin-left: auto; | |||||
margin-right: auto; | |||||
} | |||||
div.container.small { | |||||
max-width: 970px; | |||||
} | |||||
div.blogHeader { | |||||
margin-left: auto; | |||||
margin-right: auto; | |||||
text-align: center; | |||||
width: 910px; | |||||
padding: 0px 30px 0px 30px; | |||||
margin-top: -150px; | |||||
color: #ffffff; | |||||
text-shadow: 1px 1px 3px rgba(0, 0, 0, 1); | |||||
margin-bottom: 60px; | |||||
} | |||||
div.post { | |||||
margin: 40px 80px 0px 190px; | |||||
padding: 10px 10px 10px 20px;; | |||||
border: 1px solid #eeeeee; | |||||
border-radius: 3px; | |||||
} | |||||
div.postHeader { | |||||
float: left; | |||||
font-size: 30px; | |||||
} | |||||
div.postDate { | |||||
margin-top: 19px; | |||||
float: right; | |||||
font-size: 12px; | |||||
} | |||||
div.postAuthor { | |||||
padding-left: 5px; | |||||
margin-top: 19px; | |||||
margin-right: 20px; | |||||
float: right; | |||||
font-size: 12px; | |||||
} | |||||
div.postContent { | |||||
font-size: 16px; | |||||
margin-top: 50px; | |||||
padding: 10px 20px 0px 20px; | |||||
text-align: justify; | |||||
} | |||||
div.full { | |||||
min-height: 100%; | |||||
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.4); | |||||
padding: 0px; | |||||
background-color: #ffffff; | |||||
} | |||||
div.postsMenu { | |||||
position: relative; | |||||
left: -15px; | |||||
top: -50px; | |||||
width: 0px; | |||||
height: 0px; | |||||
} | |||||
div.postsMenuContent { | |||||
padding: 10px; | |||||
background-color: #6787a6; | |||||
width: 180px; | |||||
height: 500px; | |||||
border-radius: 5px; | |||||
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.4); | |||||
color: #ffffff; | |||||
font-size: 16px; | |||||
} | |||||
a.post { | |||||
font-size: 12px; | |||||
text-decoration: none; | |||||
color: #ffffff; | |||||
display: block; | |||||
margin: 10px 0px 0px 0px; | |||||
} | |||||
</style> | |||||
</head> | |||||
<!-- NAVBAR | |||||
================================================== --> | |||||
<body> | |||||
<div class="navbar-wrapper"> | |||||
<div class="container"> | |||||
<nav class="navbar navbar-inverse navbar-static-top" role="navigation"> | |||||
<div class="container"> | |||||
<div class="navbar-header"> | |||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" | |||||
aria-expanded="false" aria-controls="navbar"> | |||||
<span class="sr-only">Toggle navigation</span> | |||||
<span class="icon-bar"></span> | |||||
<span class="icon-bar"></span> | |||||
<span class="icon-bar"></span> | |||||
</button> | |||||
<a class="navbar-brand hidden-sm" href="./index.html">vis.js</a> | |||||
</div> | |||||
<div id="navbar" class="navbar-collapse collapse"> | |||||
<ul class="nav navbar-nav"> | |||||
<li><a href="./index.html#modules">Modules</a></li> | |||||
<li><a href="./docs/index.html" target="_blank">Documentation <img class="icon" | |||||
src="./images/external-link-icons/external-link-icon-white.png"></a> | |||||
</li> | |||||
<li class="active"><a href="#">Blog</a></li> | |||||
<li><a href="./index.html#download_install">Download</a></li> | |||||
<li><a href="./showcase/index.html">Showcase</a></li> | |||||
<li><a href="./index.html#contribute">Contribute</a></li> | |||||
<li><a href="./featureRequests.html">Feature requests</a></li> | |||||
<li><a href="./index.html#licenses">License</a></li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
</nav> | |||||
</div> | |||||
</div> | |||||
<a href="https://github.com/almende/vis" class="hidden-xs hidden-sm hidden-md"><img | |||||
style="position: absolute; top: 0; right: 0; border: 0;" | |||||
src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" | |||||
alt="Fork me on GitHub" | |||||
data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a> | |||||
<div class="container full small"> | |||||
<div class="center"> | |||||
<img src="./images/wallHeader.png"> | |||||
</div> | |||||
<div class="blogHeader"> | |||||
<h1>vis.js</h1> | |||||
<p>A dynamic, browser based visualization library. | |||||
The library consists of the components DataSet, Timeline, Network, Graph2d and Graph3d. This blog is about | |||||
the latest developments, roadmap and releases. | |||||
</p> | |||||
</div> | |||||
<div class="postsMenu"> | |||||
<div class="postsMenuContent"> | |||||
Posts: | |||||
<a data-scroll class="post" href="#CrownstoneKickstarter">- The Crownstone kickstarter promotion</a> | |||||
<a data-scroll class="post" href="#V4Release">- V4, ES6 and what's next</a> | |||||
<a data-scroll class="post" href="#Released version 3.11.0">- Released version 3.11.0</a> | |||||
<a data-scroll class="post" href="#Released version 3.10.0">- Released version 3.10.0</a> | |||||
<a data-scroll class="post" href="#Released version 3.9.0">- Released version 3.9.0</a> | |||||
<a data-scroll class="post" href="#The 2015 roadmap for vis.js">- The 2015 roadmap for vis.js</a> | |||||
<a data-scroll class="post" href="#A look back on vis.js">- A look back on vis.js</a> | |||||
<a data-scroll class="post" href="#New website for vis.js!">- New website for vis.js!</a> | |||||
<a data-scroll class="post" href="#Released version 3.8.0">- Released version 3.8.0</a> | |||||
</div> | |||||
</div> | |||||
<div class="post"> | |||||
<div class="postHeader" id="CrownstoneKickstarter">The Crownstone kickstarter promotion</div> | |||||
<div class="postAuthor">by <a href="https://github.com/alexdm0">Alex</a></div> | |||||
<div class="postDate">15th of September 2015</div> | |||||
<div class="postContent"> | |||||
<p> | |||||
Hi Everyone, | |||||
</p> | |||||
<p> | |||||
So you may have noticed the big banner on our website and thought: "What the hell?". I'd like to explain why we're doing this. </p><p> | |||||
As you may know, vis.js is developed at Almende BV in the Netherlands. Almende has a number of daughter companies, among which: <a href="http://dobots.nl" target="_blank">DoBots</a>. | |||||
They share our building and we're working with them a lot! We have used their code and hardware in projects and have contributed some code for the | |||||
firmware as well. | |||||
</p> | |||||
<img src="./images/blog/kickstarter_1.png" style="position:relative; left:12px; padding:10px;"> | |||||
<p><a href="https://www.kickstarter.com/projects/dobots/crownstone">DoBots is now doing a kickstarter for the Crownstone, a smart upgrade for any power socket!</a> Recently I have spend a few weeks helping them settings up their campaign. I made the video's, | |||||
the 3D artwork and helped out with the texts. I think this is a great product and I believe it deserves a chance to enter the market!</p> | |||||
<img src="./images/blog/kickstarter_2.png" style="position:relative; left:12px; padding:10px;"> | |||||
<p>Like us (the vis.js team), the guys at DoBots believe in open source. The Crownstone's Bluetooth API's will be open but secure so only YOU can use YOUR Crownstones. This means you can use any BLE device to interact with your house! | |||||
If the stretchgoal is made, there'll even be Arduino support! I will also be working on the iOS app and that too will be open source.</p> | |||||
<p>I hope our community can help <a href="https://www.kickstarter.com/projects/dobots/crownstone">the kickstarter</a> reach it's goal and maybe even the stretchgoals.</p> | |||||
<img src="./images/blog/kickstarter_3.png" style="position:relative; left:12px; padding:10px;"> | |||||
<p><a href="https://www.kickstarter.com/projects/dobots/crownstone">Please support us and spread the word!</a></p><p>If you share it in a tweet, facebook or different way, <a href="https://github.com/almende/vis/issues/1302">leave a comment in issue #1302! :)</a></p> | |||||
<p>Regards and thank you,</p> | |||||
<p>Alex</p> | |||||
</div> | |||||
</div> | |||||
<div class="post"> | |||||
<div class="postHeader" id="V4Release">V4, ES6 and what's next</div> | |||||
<div class="postAuthor">by <a href="https://github.com/alexdm0">Alex</a></div> | |||||
<div class="postDate">22nd of May 2015</div> | |||||
<div class="postContent"> | |||||
<p> | |||||
It’s been a long time coming but its finally here! We have just released the newest version of vis.js: | |||||
v4! This is a breaking release (hence the version number change). This means the options and the API | |||||
have been changed in such a way that it is no longer backwards compatible. | |||||
</p> | |||||
<p> | |||||
We know it is annoying to go back to your code and making the required changes, but I guarantee that it | |||||
is for the best. To help with this migration, we have included an option validator to our new release. | |||||
This validator is currently applied on the network, timeline and graph2d. It checks if the options you | |||||
supply are of the right type. If your options do not exist or if the type is wrong, it will give | |||||
you an understandable message with suggestions of options you may have meant. We think this will make | |||||
developing for vis a lot easier, as well as the migration from v3 to v4. | |||||
</p> | |||||
<p> | |||||
The biggest change in this release is in the network module. We have rewritten the network module in | |||||
full and the results are cleanly separated ES6 modules. The option structure has been changed to suit | |||||
this structure. The options have also been grouped, making it easier to document and understand. For example, | |||||
lets look at the options for fonts. It used to be fontColor, fontFace fontSize, which is now | |||||
grouped in a font object with {color:’’,face:’’,size:’’}. Also completely new is the clustering | |||||
mechanism. It used to be mostly automatic and twitchy but this new version gives all the control to the | |||||
user. This should make the clustering very useful and I’ll be happy to hear of missing features for | |||||
this! | |||||
</p> | |||||
<p> | |||||
We have moved to hammer.js 2 for all of our touch and click events, and a lot of work has gone into | |||||
updating all the css elements (especially for timeline) to eliminate conflicts with large frameworks | |||||
that overload <i>everything</i>. | |||||
</p> | |||||
<p> | |||||
Over the last year, we have received a lot of issues on our Github page for which we are very thankful. | |||||
Whether it is a bug report, question or feature request, we handle all of them as quickly as we can, and | |||||
with these big new rewrites it gives us a new perspective on what is important. We hope the validator | |||||
will prevent a lot of issues. The new examples have also been designed to more clearly show simple | |||||
options. We plan to provide links to JSBin for all options, but this is a lot of work (for which we | |||||
wouldn’t mind some help ;) ). | |||||
</p> | |||||
<p> | |||||
So what’s next? Well the next module that really needs a good overhaul is the graph2d. This module is | |||||
used by us internally quite a lot, and we need to improve the architecture and make it easy to extend it | |||||
with new graph types. | |||||
</p> | |||||
<p> | |||||
We want to unify the code between the timeline and the graph2d even more. The ideal result would be | |||||
using a graph2d as a group in the timeline, or use the timeline items in a graph2d without nasty hacks. | |||||
The graph2d should get numeric x axis (so not necessarily only time), logarithmic axis and hopefully the | |||||
architecture will be flexible enough to allow the x and y axis to be interchanged. The API across the | |||||
modules will also be further unified, and I think we’ve made a great start with v4! | |||||
</p> | |||||
<p> | |||||
From all the modules currently in vis, the graph3d is the oldest and currently the one suffering a lack | |||||
of attention. If you are an excited user of the graph3d module and want to contribute, we’re open for | |||||
additions to the vis.js team! The graph3d is feature complete but a webgl implementation could be a | |||||
great improvement. | |||||
</p> | |||||
<p> | |||||
I cannot give a timeframe for the things I have discussed here, and we’re always open for ideas and | |||||
contributions. If you feel like you want to contribute, let us know :). | |||||
</p> | |||||
<h3>Changelog:</h3> | |||||
<h4>General</h4> | |||||
<ul> | |||||
<li>Changed the build scripts to include a transpilation of ES6 to ES5 | |||||
(using <a href="http://babel.org">http://babel.org</a>), so we can use ES6 features in the vis.js | |||||
code. | |||||
When creating a custom bundle using browserify, one now needs to add a | |||||
transform step using <code>babelify</code>, this is described in README.md. | |||||
</li> | |||||
</ul> | |||||
<h4>Timeline</h4> | |||||
<ul> | |||||
<li>Integrated an option configurator and validator.</li> | |||||
<li>Implemented option <code>multiselect</code>, which is false by default.</li> | |||||
<li>Added method <code>setData({groups: groups, items: items})</code>.</li> | |||||
<li>Fixed range items not being displayed smaller than 10 pixels (twice the | |||||
padding). In order to have overflowing text, one should now apply css style | |||||
<code>.vis.timeline .item.range { overflow: visible; }</code> instead of | |||||
<code>.vis.timeline .item.range .content { overflow: visible; }</code>. | |||||
See example 18_range_overflow.html. | |||||
</li> | |||||
<li>Fixed invalid css names for time axis grid, renamed hours class names from | |||||
<code>4-8h</code> to <code>h4-h8</code>. | |||||
</li> | |||||
<li>Deprecated option <code>showCustomTime</code>. Use method <code>addCustomTime()</code> instead.</li> | |||||
<li>Deprecated event <code>finishedRedraw</code> as it's redundant.</li> | |||||
<li>Renamed option <code>animate</code> to <code>animation</code>, and changed it to be either a boolean | |||||
or an object <code>{duration: number, easingFunction: string}</code>. | |||||
</li> | |||||
<li>Fixed #831: items losing selection when their type changed.</li> | |||||
</ul> | |||||
<h4>Graph2d</h4> | |||||
<ul> | |||||
<li>New option structure.</li> | |||||
<li>Cleaned up docs.</li> | |||||
<li>Fixed #628: stacking order.</li> | |||||
<li>Fixed #624: sorting order.</li> | |||||
<li>Fixed #616: stacking with negative bars.</li> | |||||
<li>Fixed #728: alignment issues.</li> | |||||
<li>Fixed #716: Height of graph <code>2px</code> too large when configuring a fixed height.</li> | |||||
</ul> | |||||
<h4>Network</h4> | |||||
<p>The network has been completely rewritten. The new modular setup using ES6 classes makes | |||||
it future proof for maintainability, extendability and clarity. A summary of new features:</p> | |||||
<ul> | |||||
<li>New examples, categorized by topic.</li> | |||||
<li>New docs.</li> | |||||
<li>New option structure, adhering to the modular setup on the backend.</li> | |||||
<li>New events for user interaction.</li> | |||||
<li>New render events for drawing custom elements on the canvas.</li> | |||||
<li>New physics events for making a loading bar during stabilization.</li> | |||||
<li>A lot of new methods that make extending easier.</li> | |||||
<li>Manipulation system now works without the UI neccesarily.</li> | |||||
<li>Nodes and edges can cast shadows.</li> | |||||
<li>Configurator system to dynamically change almost all options.</li> | |||||
<li>Validator has been created for the network's options, warning you about typo's and suggesting | |||||
alternatives. | |||||
</li> | |||||
<li>Diamond shape for nodes.</li> | |||||
<li>Unified the label code so edges and nodes have the same label settings.</li> | |||||
<li>InheritColors for edges can be set to both, making a gradient fade between two node colors.</li> | |||||
<li>Redesigned the clustering system giving full control over it.</li> | |||||
<li>Random seed can be saved so the network will be the same every time you start it.</li> | |||||
<li>New physics solver based on ForceAtlas2 as implemented in gephi.]</li> | |||||
<li>New avoidOverlap option for physics.</li> | |||||
<li>Many, many bugfixes.</li> | |||||
</ul> | |||||
<h4>DataSet</h4> | |||||
<ul> | |||||
<li>Dropped support for Google visualization DataTable.</li> | |||||
<li>Dropped support for appending data returned by <code>DataSet.get()</code> to an existing | |||||
Array or DataTable. | |||||
</li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
<div class="post"> | |||||
<div class="postHeader" id="Released version 3.11.0">Released version 3.11.0</div> | |||||
<div class="postAuthor">by <a href="https://github.com/josdejong">Jos</a></div> | |||||
<div class="postDate">6th of March 2015</div> | |||||
<div class="postContent"> | |||||
<p> | |||||
Today we released vis.js version 3.11.0. The Timeline has gotten quite some attention in this release: | |||||
For example, the Timeline finally has gotten more event handlers to enable custom behavior in a flexible | |||||
way. Network is evolving at a steady speed. It's really great to get more and more substantial | |||||
contributions from the community latest months! Thanks. | |||||
</p> | |||||
<p>Changelog:</p> | |||||
<h3>Network</h3> | |||||
<ul> | |||||
<li>(added gradient coloring for lines, but set for release in 4.0 due to required refactoring of | |||||
options). | |||||
</li> | |||||
<li>Fixed bug where a network that has frozen physics would resume redrawing after setData, setOptions | |||||
etc. | |||||
</li> | |||||
<li>Added option to bypass default groups. If more groups are specified in the nodes than there are in | |||||
the groups, loop over supplied groups instead of default. | |||||
</li> | |||||
<li>Added two new static smooth curves modes: curveCW and curve CCW.</li> | |||||
<li>Added request redraw for certain internal processes to reduce number of draw calls (performance | |||||
improvements!). | |||||
</li> | |||||
<li>Added pull request for usage of Icons. Thanks @Dude9177! | |||||
<li>Allow hierarchical view to be set in setOptions.</li> | |||||
<li>Fixed manipulation bar for mobile.</li> | |||||
<li>Fixed #670: Bug when updating data in a DataSet, when Network is connected to the DataSet via a | |||||
DataView. | |||||
</li> | |||||
<li>Fixed #688: Added a css class to be able to distinguish buttons "Edit node" and "Edit edge".</li> | |||||
</ul> | |||||
<h3>Timeline</h3> | |||||
<ul> | |||||
<li>Implemented orientation option `'both'`, displaying a time axis both on top | |||||
and bottom (#665). | |||||
</li> | |||||
<li>Implemented creating new range items by dragging in an empty space with the | |||||
ctrl key down. | |||||
</li> | |||||
<li>Implemented configuration option `order: function` to define a custom ordering | |||||
for the items (see #538, #234). | |||||
</li> | |||||
<li>Implemented events `click`, `doubleClick`, and `contextMenu`.</li> | |||||
<li>Implemented method `getEventProperties(event)`.</li> | |||||
<li>Fixed not property initializing with a DataView for groups.</li> | |||||
<li>Merged add custom timebar functionality, thanks @aytech! | |||||
<li>Fixed #664: end of item not restored when canceling a move event.</li> | |||||
<li>Fixed #609: reduce the left/right dragarea when an item range is very small, | |||||
so you can still move it as a whole. | |||||
</li> | |||||
<li>Fixed #676: misalignment of background items when using subgroups and the | |||||
group label's height is larger than the contents. | |||||
</li> | |||||
</ul> | |||||
<h3>Graph2d</h3> | |||||
<ul> | |||||
<li>Implemented events `click`, `doubleClick`, and `contextMenu`.</li> | |||||
<li>Implemented method `getEventProperties(event)`.</li> | |||||
</ul> | |||||
<h3>DataSet/DataView</h3> | |||||
<ul> | |||||
<li>Implemented support for mapping field names. Thanks @spatialillusions.</li> | |||||
<li>Fixed #670: DataView not passing a data property on update events (see #670) | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
<div class="post"> | |||||
<div class="postHeader" id="Released version 3.10.0">Released version 3.10.0</div> | |||||
<div class="postAuthor">by <a href="https://github.com/josdejong">Jos</a></div> | |||||
<div class="postDate">11th of February 2015</div> | |||||
<div class="postContent"> | |||||
<p> | |||||
Version 3.10.0 has been released. Lots of improvements in Network, and some smaller bug fixes and | |||||
improvements in Timeline and DataSet. | |||||
</p> | |||||
<p>Changelog:</p> | |||||
<h3>Network</h3> | |||||
<ul class="task-list"> | |||||
<li>Added option bindToWindow (default true) to choose whether the keyboard binds are global or to the | |||||
network div. | |||||
</li> | |||||
<li>Improved images handling so broken images are shown on all references of images that are broken. | |||||
</li> | |||||
<li>Added getConnectedNodes method.</li> | |||||
<li>Added fontSizeMin, fontSizeMax, fontSizeMaxVisible, scaleFontWithValue, fontDrawThreshold to | |||||
Nodes. | |||||
</li> | |||||
<li>Added fade in of labels (on nodes) near the fontDrawThreshold.</li> | |||||
<li>Added nodes option to zoomExtent to zoom in on specific set of nodes.</li> | |||||
<li>Added stabilizationIterationsDone event which fires at the end of the internal stabilization run. | |||||
Does not imply that the network is stabilized. | |||||
</li> | |||||
<li>Added freezeSimulation method.</li> | |||||
<li>Added clusterByZoom option.</li> | |||||
<li>Added class name 'network-tooltip' to the tooltip, allowing custom styling.</li> | |||||
<li>Fixed bug when redrawing was not right on zoomed-out browsers.</li> | |||||
<li>Added opacity option to edges. Opacity is only used for the unselected state.</li> | |||||
<li>Fixed bug where selections from removed data elements persisted.</li> | |||||
</ul> | |||||
<h3>Timeline</h3> | |||||
<ul class="task-list"> | |||||
<li>`Timeline.redraw()` now also recalculates the size of items.</li> | |||||
<li>Implemented option `snap: function` to customize snapping to nice date when dragging items.</li> | |||||
<li>Implemented option `timeAxis: {scale: string, step: number}` to set fixed scale.</li> | |||||
<li>Fixed width of range items not always being maintained when moving due to snapping to nice dates. | |||||
</li> | |||||
<li>Fixed not being able to drag items to an other group on mobile devices.</li> | |||||
<li>Fixed `setWindow` not working when applying an interval larger than the configured `zoomMax`.</li> | |||||
</ul> | |||||
<h3>DataSet/DataView</h3> | |||||
<ul class="task-list"> | |||||
<li>Added property `length` holding the total number of items to the `DataSet and `DataView`.</li> | |||||
<li>Added a method `refresh()` to the `DataView`, to update filter results.</li> | |||||
<li>Fixed a bug in the `DataSet` returning an empty object instead of `null` when no item was found when | |||||
using both a filter and specifying fields. | |||||
</li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
<div class="post"> | |||||
<div class="postHeader" id="Released version 3.9.0">Released version 3.9.0</div> | |||||
<div class="postAuthor">by <a href="https://github.com/AlexDM0">Alex</a></div> | |||||
<div class="postDate">16th of January 2015</div> | |||||
<div class="postContent"> | |||||
<p> | |||||
We have been very busy fixing a lot of the open Github issues over the last week. We have also received | |||||
multiple pull requests that could be added quickly! Special thanks to | |||||
our community members contributing this release: @klmdb, @pavlos256, @T-rav, @brendon1982. | |||||
Since this is a release with new features, we push the version number up to 3.9.0. Next up: big | |||||
refactoring and version 4.0.0! | |||||
</p> | |||||
<p>Changelog:</p> | |||||
<h3> | |||||
<a class="anchor" href="#network" aria-hidden="true"><span class="octicon octicon-link"></span></a>Network | |||||
</h3> | |||||
<ul class="task-list"> | |||||
<li>Reverted change in image class, fixed bug #552</li> | |||||
<li>Improved the fontFill offset between different browsers. #365</li> | |||||
<li>Fixed dashed lines on firefox on Unix systems</li> | |||||
<li>Altered the Manipulation Mixin to be succesfully destroyed from memory when calling destroy();</li> | |||||
<li>Improved drawing of arrowheads on smooth curves. #349</li> | |||||
<li>Caught case where click originated on external DOM element and drag progressed to vis.</li> | |||||
<li>Added label stroke support to Nodes, Edges & Groups as per-object or global settings. Thank you | |||||
@klmdb! | |||||
</li> | |||||
<li>Reverted patch that made nodes return to 'default' setting if no group was assigned to fix issue | |||||
#561. | |||||
The correct way to 'remove' a group from a node is to assign it a different one. | |||||
</li> | |||||
<li>Made the node/edge selected by the popup system the same as selected by the click-to-select system. | |||||
Thank you @pavlos256! | |||||
</li> | |||||
<li>Improved edit edge control nodes positions, altered style a little.</li> | |||||
<li>Fixed issue #564 by resetting state to initial when no callback is performed in the return | |||||
function. | |||||
</li> | |||||
<li>Added condition to Repulsion similar to BarnesHut to ensure nodes do not overlap.</li> | |||||
<li>Added labelAlignment option to edges. Thanks @T-rav!</li> | |||||
<li>Close active sessions in dataManipulation when calling setData().</li> | |||||
</ul> | |||||
<h3> | |||||
<a class="anchor" href="#timeline" aria-hidden="true"><span class="octicon octicon-link"></span></a>Timeline | |||||
</h3> | |||||
<ul class="task-list"> | |||||
<li>Added byUser flag to options of the rangechange and rangechanged event.</li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
<div class="post"> | |||||
<div class="postHeader" id="The 2015 roadmap for vis.js">The 2015 roadmap for vis.js</div> | |||||
<div class="postAuthor">by <a href="https://github.com/AlexDM0">Alex</a></div> | |||||
<div class="postDate">9th of January 2015</div> | |||||
<div class="postContent"> | |||||
<p> | |||||
I initially wanted to do a small recap of vis.js so far but it became larger (and more off topic) than I | |||||
expected. To understand some of the motivations for our roadmap, <a href="#A look back on vis.js">take a | |||||
look at the post below this one first</a>. | |||||
</p> | |||||
<p> | |||||
So now for our plans for 2015! We have added a lot of features over the last year, and we have to be | |||||
careful that vis does not die of option-obesity. To mediate this we thought of a few solutions. | |||||
Firstly, we will make the docs collapsible using a similar system to <a | |||||
href="https://www.jsoneditoronline.org/" target="_blank">Jos′s great online JSON editor</a>. | |||||
This is naturally a temporary fix but | |||||
the docs are one of the most important ways to get information. We think we ourselves may be the most | |||||
frequent visitor of those pages so it's a good start! | |||||
</p> | |||||
<p> | |||||
Secondly, the actual changes, we plan to reorganize some of the option structure. This will | |||||
unfortunately (but by definition) be a breaking change from our old versions. The new structure will be | |||||
clearer and more intuitive. The work our current | |||||
users will have to do to update will be minimal. If you're using the options we reorganize, you'll have | |||||
to update your options. Breaking releases are always a shame, but we feel it is necessary. | |||||
</p> | |||||
<p> | |||||
The third step we want to take is to go over the code of each module and modularize everything much | |||||
more. This will make the code easier to maintain as we move away from very large .js files, as well as | |||||
make it easier to expand on. | |||||
</p> | |||||
<p> | |||||
Once everything is modularized, we want to change the API to allow users to plug their own parts of vis | |||||
together. As an example: You start a network module, plug in the type of node module, edge module, | |||||
physics module and optionally navigation module (etc.) and you're good to go! | |||||
All of these modules will be individually configured. This means the huge list of options will be | |||||
segmented into smaller, more manageable parts. Additionally, the docs will become smaller and clearer. | |||||
</p> | |||||
<p> | |||||
Of course, we do not want to abandon all our plug-and-play functionality! We will also start to supply | |||||
more preconfigured constructors (i.e. a vis.BarChart that will give you a preconfigured graph2d module). | |||||
Apart from these constructors | |||||
we will continue to publish examples which will include code snippets that you can use in your own | |||||
project. | |||||
</p> | |||||
<p> | |||||
Once this has been completed, we expect there will be more options that accept functions as arguments | |||||
which gives you more control over vis. Finally, because everything (well, more than now) would be split | |||||
up into | |||||
modules, it becomes easier for the community to create additional modules, further improving vis! | |||||
</p> | |||||
<p> | |||||
The things I have listed here are the ideas that we have now. This is subject to change. We also cannot | |||||
provide a timeline for this because we work on vis whenever we have time. No deadlines, no constrains, | |||||
just when we have time. | |||||
</p> | |||||
<p> | |||||
To wrap up, there are a few things I did not mention here but I'd like to add to the post anyway. | |||||
<ul> | |||||
<li>We want to improve the fusion of graph2d and the timeline, with the ideal that a graph2d can be used | |||||
like a group in timeline now. | |||||
</li> | |||||
<li>Examples will be split in simple option/configuration examples and larger, feature | |||||
demonstration/exploration examples. | |||||
</li> | |||||
<li>Graph2d will be expanded.</li> | |||||
<li>We will move to hammer.js 2.0.</li> | |||||
<li>We will add features <a href="./featureRequests.html" target="_blank">from the list</a> when we can | |||||
</li> | |||||
<li>We hope to keep up the | |||||
<communi></communi> | |||||
cation with our community! | |||||
</li> | |||||
</ul> | |||||
Let's make 2015 as good as last year! | |||||
</p> | |||||
</div> | |||||
</div> | |||||
<div class="post"> | |||||
<div class="postHeader" id="A look back on vis.js">A look back on vis.js</div> | |||||
<div class="postAuthor">by <a href="https://github.com/AlexDM0">Alex</a></div> | |||||
<div class="postDate">9th of January 2015</div> | |||||
<div class="postContent"> | |||||
<p> | |||||
In April 2013, the initial commit was made for vis.js by <a href="https://github.com/josdejong">Jos</a> | |||||
because the old CHAP LINKS library was becoming too large to expand and maintain. | |||||
Vis.js was a clean, new start using all the knowledge gathered from the CHAP library with the ideal that | |||||
the new infrastructure would be more stable, faster and easier to maintain. | |||||
</p> | |||||
<p> | |||||
In January 2014, I joined the project and started to expand the Network module, which was called Graph | |||||
back then. I have been working alongside Jos since then we have poured a lot of hours into vis. | |||||
</p> | |||||
<p> | |||||
On the 16th of April 2014, exactly a year after the initial commit, <a | |||||
href="https://twitter.com/hackernewsbot/status/456231005678874624" target="_blank">a twitterbot with | |||||
a lot of followers</a> notified | |||||
the world that we were featured on hackernews! This was the boost we needed to really reach a large | |||||
community. We saw the amount of visitors and Github stars increase greatly over the months that | |||||
followed. | |||||
</p> | |||||
<p> | |||||
The 14th of October, we have altered the license of vis.js to MIT or APACHE 2.0. This allowed <a | |||||
href="http://tiddlywiki.com/" target="_blank">Tiddlywiki</a> to add vis.js to their keychain. From | |||||
what we hear, | |||||
their developers really enjoy working with vis and we look forward to hearing how their community uses | |||||
our software! | |||||
</p> | |||||
<p> | |||||
Now, we have a great community that helps out in issues, fixes our typos in the docs, notifies us of | |||||
bugs and sometimes fixes them for us. We have received pull requests with new features and improvements | |||||
and | |||||
it has been fantastic! | |||||
</p> | |||||
<p> | |||||
This post started out as the roadmap for vis in 2015, but the review was longer than I initially | |||||
expected thereby deserving its own post. | |||||
</p> | |||||
<p> | |||||
Have fun using vis! | |||||
</p> | |||||
</div> | |||||
</div> | |||||
<div class="post"> | |||||
<div class="postHeader" id="New website for vis.js!">New website for vis.js!</div> | |||||
<div class="postAuthor">by <a href="https://github.com/AlexDM0">Alex</a></div> | |||||
<div class="postDate">9th of January 2015</div> | |||||
<div class="postContent"> | |||||
<p> | |||||
The old website served us well, but now that we arrived in 2015... it is really time for an upgrade! We | |||||
hope the new website is more informative, modern and a good promotion for vis.js! | |||||
It also allows us to keep the community updated through this blog and to <a href="./showcase/index.html" | |||||
target="_blank">show off | |||||
great projects that make use of vis.js in our showcase</a>. | |||||
</p> | |||||
<p>If you have made something and would like it featured, | |||||
please make an <a href="https://github.com/almende/vis/issues" target="_blank">issue on Github</a> with | |||||
your project and how you'd like to be credited.</p> | |||||
</p><p> | |||||
The new website is in beta so if anyone spots a typo or other mistake, please let us know on our <a | |||||
href="https://www.github.com/almende/vis" target="_blank">Github</a> page. | |||||
</p> | |||||
<p> | |||||
There is no forum on this website. We prefer to keep all the communication with the community through | |||||
Github. We believe this is the best solution so everyone only has to check the Github issues | |||||
when there is a problem or suggestion. | |||||
</p> | |||||
<p> | |||||
A big change introduced with our new website, is the <a href="./featureRequests.html" target="_blank">feature | |||||
request page</a>. There are a lot of issues on Github that suggest features but we do not | |||||
always have time to implement these ourselves. On the other hand, there have been issues where people | |||||
tell us they want to contribute but are now sure where to start. To mediate this (and to make a clear | |||||
overview | |||||
for ourselves) we listed everything <a href="./featureRequests.html" target="_blank">here</a>. | |||||
</p> | |||||
<p>Once a feature is added to <a href="./featureRequests.html" target="_blank">the list</a>, it is not the | |||||
end of the line. At each new release, we'll look at the list and see which features we may want to pick | |||||
up for the next one. Discussions on these features | |||||
can still continue on the referenced Github issues. When we have added a feature to this list, we will | |||||
close the Github issue that requested it to keep our open issues more of a bug-todo list. The main | |||||
motivation for this | |||||
is because we have noticed that old bugs (on pages after 2) would be overlooked from time to time. | |||||
</p> | |||||
<p> | |||||
This feature page is an experiment. If it turns out that the community does not like us closing issues | |||||
with open feature requests or if it does not have the impact we'd like it to have, we'll revert back to | |||||
the old model. | |||||
</p> | |||||
<p> | |||||
We thank you all for using vis! Last year has seen a great increase in our user base and it is a great | |||||
motivating factor knowing that our work is used by others! | |||||
</p> | |||||
<p> | |||||
Here's to a great 2015! | |||||
</p> | |||||
</div> | |||||
</div> | |||||
<div class="post"> | |||||
<div class="postHeader" id="Released version 3.8.0">Released version 3.8.0</div> | |||||
<div class="postAuthor">by <a href="https://github.com/AlexDM0">Alex</a></div> | |||||
<div class="postDate">9th of January 2015</div> | |||||
<div class="postContent"> | |||||
<p> | |||||
We're proud to present a new version of the vis.js library: 3.8.0! This release has a lot of new | |||||
features and bugfixes, nearly all of which were suggested and/or discovered | |||||
by our community on <a href="https://www.github.com/almende/vis" target="_blank">Github</a>. A lot of | |||||
the issues on Github have been handled in this release and it is likely to be the | |||||
last release before 4.0.0. The 4.0.0 release will break compatibility with old code (only options will | |||||
be revisited on the API side) but more on that in <a href="#The 2015 roadmap for vis.js">the roadmap | |||||
post</a>. | |||||
</p> | |||||
<p>Changelog:</p> | |||||
<h3> | |||||
<a class="anchor" href="#network" aria-hidden="true"><span class="octicon octicon-link"></span></a>Network | |||||
</h3> | |||||
<ul class="task-list"> | |||||
<li>Fixed flipping of hierarchical network on update when using RL and DU.</li> | |||||
<li>Added zoomExtentOnStabilize option to network.</li> | |||||
<li>Improved destroy function, added them to the examples.</li> | |||||
<li>Nodes now have bounding boxes that are used for zoomExtent.</li> | |||||
<li>Made physics more stable (albeit a little slower).</li> | |||||
<li>Added a check so only one 'activator' overlay is created on clickToUse.</li> | |||||
<li>Made global color options for edges overrule the inheritColors.</li> | |||||
<li>Improved cleaning up of the physics configuration on destroy and in options.</li> | |||||
<li>Made nodes who lost their group revert back to default color.</li> | |||||
<li>Changed group behaviour, groups now extend the options, not replace. This allows partial defines of | |||||
color. | |||||
</li> | |||||
<li>Fixed bug where box shaped nodes did not use hover color.</li> | |||||
<li>Fixed Locales docs.</li> | |||||
<li>When hovering over a node that does not have a title, the title of one of the connected edges that | |||||
HAS a title is no longer shown. | |||||
</li> | |||||
<li>Fixed error in repulsion physics model.</li> | |||||
<li>Improved physics handling for smoother network simulation.</li> | |||||
<li>Fixed infinite loop when an image can not be found and no brokenImage is provided.</li> | |||||
<li>Added getBoundingBox method.</li> | |||||
<li>Community fix for SVG images in IE11, thanks @dponch!</li> | |||||
<li>Fixed repeating stabilized event when the network is already stabilized.</li> | |||||
<li>Added circularImages, thanks for the contribution @brendon1982!</li> | |||||
</ul> | |||||
<h3> | |||||
<a class="anchor" href="#graph2d" aria-hidden="true"><span class="octicon octicon-link"></span></a>Graph2d | |||||
</h3> | |||||
<ul class="task-list"> | |||||
<li>Fixed round-off errors of zero on the y-axis.</li> | |||||
<li>added show major/minor lines options to dataAxis.</li> | |||||
<li>Fixed adapting to width and height changes.</li> | |||||
<li>Added a check so only one 'activator' overlay is created on clickToUse.</li> | |||||
<li>DataAxis width option now draws correctly.</li> | |||||
</ul> | |||||
<h3> | |||||
<a class="anchor" href="#timeline" aria-hidden="true"><span class="octicon octicon-link"></span></a>Timeline | |||||
</h3> | |||||
<ul class="task-list"> | |||||
<li>Implemented support for styling of the vertical grid.</li> | |||||
<li>Support for custom date formatting of the labels on the time axis.</li> | |||||
<li>added show major/minor lines options to timeline.</li> | |||||
<li>Added a check so only one 'activator' overlay is created on clickToUse.</li> | |||||
</ul> | |||||
<h3> | |||||
<a class="anchor" href="#graph3d" aria-hidden="true"><span class="octicon octicon-link"></span></a>Graph3d | |||||
</h3> | |||||
<ul class="task-list"> | |||||
<li>Fixed mouse coordinates for tooltips.</li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
<br/> | |||||
<br/> | |||||
<br/> | |||||
<br/> | |||||
<br/> | |||||
</div> | |||||
<!-- Bootstrap core JavaScript | |||||
================================================== --> | |||||
<!-- Placed at the end of the document so the pages load faster --> | |||||
<script src="./js/jquery.min.js"></script> | |||||
<script src="./js/bootstrap.min.js"></script> | |||||
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> | |||||
<script src="./js/ie10-viewport-bug-workaround.js"></script> | |||||
@ -0,0 +1,30 @@ | |||||
@import url(https://fonts.googleapis.com/css?family=Gloria+Hallelujah); | |||||
.post-it { | |||||
background:#fefabc; | |||||
padding: 15px; | |||||
font-family: "Gloria Hallelujah"; | |||||
font-size: 18px; | |||||
line-height: 1.3em; | |||||
color: #000; | |||||
width: 320px; | |||||
-moz-transform: rotate(7deg); | |||||
-webkit-transform: rotate(7deg); | |||||
-o-transform: rotate(7deg); | |||||
-ms-transform: rotate(7deg); | |||||
transform: rotate(7deg); | |||||
box-shadow: 0px 4px 6px #333; | |||||
-moz-box-shadow: 0px 4px 6px #333; | |||||
-webkit-box-shadow: 0px 4px 6px #333; | |||||
} | |||||
.post-it-top-right { | |||||
position: absolute; | |||||
top: 50px; | |||||
right: 100px; | |||||
z-index: 999; | |||||
} |
@ -1,949 +0,0 @@ | |||||
<!doctype html> | |||||
<html> | |||||
<head> | |||||
<title>vis.js | DataSet documentation</title> | |||||
<link href="css/prettify.css" type="text/css" rel="stylesheet" /> | |||||
<link href='css/old_style.css' type='text/css' rel='stylesheet'> | |||||
<script type="text/javascript" src="js/prettify/prettify.js"></script> | |||||
<script>(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');</script></head> | |||||
<body onload="prettyPrint();"> | |||||
<div id="container"> | |||||
<h1>DataSet documentation</h1> | |||||
<h2 id="Contents">Contents</h2> | |||||
<ul> | |||||
<li><a href="#Overview">Overview</a></li> | |||||
<li><a href="#Example">Example</a></li> | |||||
<li><a href="#Construction">Construction</a></li> | |||||
<li><a href="#Methods">Methods</a></li> | |||||
<li><a href="#Properties">Properties</a></li> | |||||
<li><a href="#Subscriptions">Subscriptions</a></li> | |||||
<li><a href="#Data_Manipulation">Data Manipulation</a></li> | |||||
<li><a href="#Data_Selection">Data Selection</a></li> | |||||
<li><a href="#Data_Policy">Data Policy</a></li> | |||||
</ul> | |||||
<h2 id="Overview">Overview</h2> | |||||
<p> | |||||
Vis.js comes with a flexible DataSet, which can be used to hold and | |||||
manipulate unstructured data and listen for changes in the data. | |||||
The DataSet is key/value based. Data items can be added, updated and | |||||
removed from the DatSet, and one can subscribe to changes in the DataSet. | |||||
The data in the DataSet can be filtered and ordered, and fields (like | |||||
dates) can be converted to a specific type. Data can be normalized when | |||||
appending it to the DataSet as well. | |||||
</p> | |||||
<h2 id="Example">Example</h2> | |||||
<p> | |||||
The following example shows how to use a DataSet. | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
// create a DataSet | |||||
var options = {}; | |||||
var data = new vis.DataSet(options); | |||||
// add items | |||||
// note that the data items can contain different properties and data formats | |||||
data.add([ | |||||
{id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true}, | |||||
{id: 2, text: 'item 2', date: '2013-06-23', group: 2}, | |||||
{id: 3, text: 'item 3', date: '2013-06-25', group: 2}, | |||||
{id: 4, text: 'item 4'} | |||||
]); | |||||
// subscribe to any change in the DataSet | |||||
data.on('*', function (event, properties, senderId) { | |||||
console.log('event', event, properties); | |||||
}); | |||||
// update an existing item | |||||
data.update({id: 2, group: 1}); | |||||
// remove an item | |||||
data.remove(4); | |||||
// get all ids | |||||
var ids = data.getIds(); | |||||
console.log('ids', ids); | |||||
// get a specific item | |||||
var item1 = data.get(1); | |||||
console.log('item1', item1); | |||||
// retrieve a filtered subset of the data | |||||
var items = data.get({ | |||||
filter: function (item) { | |||||
return item.group == 1; | |||||
} | |||||
}); | |||||
console.log('filtered items', items); | |||||
// retrieve formatted items | |||||
var items = data.get({ | |||||
fields: ['id', 'date'], | |||||
type: { | |||||
date: 'ISODate' | |||||
} | |||||
}); | |||||
console.log('formatted items', items); | |||||
</pre> | |||||
<h2 id="Construction">Construction</h2> | |||||
<p> | |||||
A DataSet can be constructed as: | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
var data = new vis.DataSet([data] [, options]) | |||||
</pre> | |||||
<p> | |||||
After construction, data can be added to the DataSet using the methods | |||||
<code>add</code> and <code>update</code>, as described in section | |||||
<a href="#Data_Manipulation">Data Manipulation</a>. | |||||
</p> | |||||
<p> | |||||
The parameter <code>data</code> is optional and is an Array with items. | |||||
</p> | |||||
<p> | |||||
The parameter <code>options</code> is optional and is an object which can | |||||
contain the following properties: | |||||
</p> | |||||
<table> | |||||
<tr> | |||||
<th>Name</th> | |||||
<th>Type</th> | |||||
<th>Default value</th> | |||||
<th>Description</th> | |||||
</tr> | |||||
<tr> | |||||
<td>fieldId</td> | |||||
<td>String</td> | |||||
<td>"id"</td> | |||||
<td> | |||||
The name of the field containing the id of the items. | |||||
When data is fetched from a server which uses some specific | |||||
field to identify items, this field name can be specified | |||||
in the DataSet using the option <code>fieldId</code>. | |||||
For example <a href="http://couchdb.apache.org/" | |||||
target="_blank">CouchDB</a> uses the field | |||||
<code>"_id"</code> to identify documents. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>type</td> | |||||
<td>Object.<String, String></td> | |||||
<td>none</td> | |||||
<td> | |||||
An object containing field names as key, and data types as | |||||
value. By default, the type of the properties of items are left | |||||
unchanged. Item properties can be normalized by specifying a | |||||
field type. This is useful for example to automatically convert | |||||
stringified dates coming from a server into JavaScript Date | |||||
objects. The available data types are listed in section | |||||
<a href="#Data_Types">Data Types</a>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>queue</td> | |||||
<td>Object | boolean</td> | |||||
<td>none</td> | |||||
<td> | |||||
Queue data changes ('add', 'update', 'remove') and flush them at once. | |||||
The queue can be flushed manually by calling | |||||
<code>DataSet.flush()</code>, or can be flushed after a configured delay | |||||
or maximum number of entries. | |||||
<br> | |||||
<br> | |||||
When <code>queue</code> is true, a queue is created | |||||
with default options. Options can be specified by providing an object: | |||||
<ul> | |||||
<li><code>delay: number</code><br> | |||||
The queue will be flushed automatically after an inactivity of this | |||||
delay in milliseconds. Default value is <code>null</code>. | |||||
<li><code>max: number</code><br> | |||||
When the queue exceeds the given maximum number | |||||
of entries, the queue is flushed automatically. | |||||
Default value is <code>Infinity</code>. | |||||
</li> | |||||
</ul> | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
<h2 id="Methods">Methods</h2> | |||||
<p>DataSet contains the following methods.</p> | |||||
<table> | |||||
<colgroup> | |||||
<col width="200"> | |||||
</colgroup> | |||||
<tr> | |||||
<th>Method</th> | |||||
<th>Return Type</th> | |||||
<th>Description</th> | |||||
</tr> | |||||
<tr> | |||||
<td>add(data [, senderId])</td> | |||||
<td>Number[]</td> | |||||
<td>Add one or multiple items to the DataSet. <code>data</code> can be a single item or an array with items. Adding an item will fail when there already is an item with the same id. The function returns an array with the ids of the added items. See section <a href="#Data_Manipulation">Data Manipulation</a>.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>clear([senderId])</td> | |||||
<td>Number[]</td> | |||||
<td>Clear all data from the DataSet. The function returns an array with the ids of the removed items.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>distinct(field)</td> | |||||
<td>Array</td> | |||||
<td>Find all distinct values of a specified field. Returns an unordered array containing all distinct values. If data items do not contain the specified field are ignored.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>flush()</td> | |||||
<td>none</td> | |||||
<td>Flush queued changes. Only available when the DataSet is configured with the option <code>queue</code>, see section <a href="#Construction">Construction</a>.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>forEach(callback [, options])</td> | |||||
<td>none</td> | |||||
<td> | |||||
Execute a callback function for every item in the dataset. | |||||
The available options are described in section <a href="#Data_Selection">Data Selection</a>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td> | |||||
get([options] [, data])<br> | |||||
get(id [,options] [, data])<br> | |||||
get(ids [, options] [, data]) | |||||
</td> | |||||
<td>Object | Array</td> | |||||
<td> | |||||
Get a single item, multiple items, or all items from the DataSet. | |||||
Usage examples can be found in section <a href="#Getting_Data">Getting Data</a>, and the available <code>options</code> are described in section <a href="#Data_Selection">Data Selection</a>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td> | |||||
getDataSet() | |||||
</td> | |||||
<td>DataSet</td> | |||||
<td> | |||||
Get the DataSet itself. In case of a DataView, this function does not | |||||
return the DataSet to which the DataView is connected. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td> | |||||
getIds([options]) | |||||
</td> | |||||
<td>Number[]</td> | |||||
<td> | |||||
Get ids of all items or of a filtered set of items. | |||||
Available <code>options</code> are described in section <a href="#Data_Selection">Data Selection</a>, except that options <code>fields</code> and <code>type</code> are not applicable in case of <code>getIds</code>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>map(callback [, options])</td> | |||||
<td>Array</td> | |||||
<td> | |||||
Map every item in the DataSet. | |||||
The available options are described in section <a href="#Data_Selection">Data Selection</a>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>max(field)</td> | |||||
<td>Object | null</td> | |||||
<td> | |||||
Find the item with maximum value of specified field. Returns <code>null</code> if no item is found. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>min(field)</td> | |||||
<td>Object | null</td> | |||||
<td> | |||||
Find the item with minimum value of specified field. Returns <code>null</code> if no item is found. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>off(event, callback)</td> | |||||
<td>none</td> | |||||
<td> | |||||
Unsubscribe from an event, remove an event listener. See section <a href="#Subscriptions">Subscriptions</a>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>on(event, callback)</td> | |||||
<td>none</td> | |||||
<td> | |||||
Subscribe to an event, add an event listener. See section <a href="#Subscriptions">Subscriptions</a>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td> | |||||
remove(id [, senderId])<br> | |||||
remove(ids [, senderId]) | |||||
</td> | |||||
<td>Number[]</td> | |||||
<td> | |||||
Remove one or multiple items by id or by the items themselves. Returns an array with the ids of the removed items. See section <a href="#Data_Manipulation">Data Manipulation</a>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td> | |||||
setOptions(options) | |||||
</td> | |||||
<td>none</td> | |||||
<td> | |||||
Set options for the DataSet. Available options: | |||||
<ul> | |||||
<li> | |||||
<code>queue</code><br> | |||||
Queue data changes ('add', 'update', 'remove') and flush them at once. | |||||
The queue can be flushed manually by calling | |||||
<code>DataSet.flush()</code>, or can be flushed after a configured delay | |||||
or maximum number of entries. | |||||
<br> | |||||
<br> | |||||
When <code>queue</code> is true, a queue is created with default options. | |||||
When <code>queue</code> is false, an existing queue will be flushed and removed. | |||||
Options can be specified by providing an object: | |||||
<ul> | |||||
<li><code>delay: number</code><br> | |||||
The queue will be flushed automatically after an inactivity of this | |||||
delay in milliseconds. Default value is <code>null</code>. | |||||
<li><code>max: number</code><br> | |||||
When the queue exceeds the given maximum number | |||||
of entries, the queue is flushed automatically. | |||||
Default value is <code>Infinity</code>. | |||||
</li> | |||||
</ul> | |||||
</li> | |||||
</ul> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td> | |||||
update(data [, senderId]) | |||||
</td> | |||||
<td>Number[]</td> | |||||
<td> | |||||
Update on ore multiple existing items. <code>data</code> can be a single item or an array with items. When an item doesn't exist, it will be created. Returns an array with the ids of the removed items. See section <a href="#Data_Manipulation">Data Manipulation</a>. | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
<h2 id="Properties">Properties</h2> | |||||
<p>DataSet contains the following properties.</p> | |||||
<table> | |||||
<colgroup> | |||||
<col width="200"> | |||||
</colgroup> | |||||
<tr> | |||||
<th>Property</th> | |||||
<th>Type</th> | |||||
<th>Description</th> | |||||
</tr> | |||||
<tr> | |||||
<td>length</td> | |||||
<td>Number</td> | |||||
<td>The number of items in the DataSet.</td> | |||||
</tr> | |||||
</table> | |||||
<h2 id="Subscriptions">Subscriptions</h2> | |||||
<p> | |||||
One can subscribe on changes in a DataSet. | |||||
A subscription can be created using the method <code>on</code>, | |||||
and removed with <code>off</code>. | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
// create a DataSet | |||||
var data = new vis.DataSet(); | |||||
// subscribe to any change in the DataSet | |||||
data.on('*', function (event, properties, senderId) { | |||||
console.log('event:', event, 'properties:', properties, 'senderId:', senderId); | |||||
}); | |||||
// add an item | |||||
data.add({id: 1, text: 'item 1'}); // triggers an 'add' event | |||||
data.update({id: 1, text: 'item 1 (updated)'}); // triggers an 'update' event | |||||
data.remove(1); // triggers an 'remove' event | |||||
</pre> | |||||
<h3 id="On">On</h3> | |||||
<p> | |||||
Subscribe to an event. | |||||
</p> | |||||
Syntax: | |||||
<pre class="prettyprint lang-js">DataSet.on(event, callback)</pre> | |||||
Where: | |||||
<ul> | |||||
<li> | |||||
<code>event</code> is a String containing any of the events listed | |||||
in section <a href="#Events">Events</a>. | |||||
</li> | |||||
<li> | |||||
<code>callback</code> is a callback function which will be called | |||||
each time the event occurs. The callback function is described in | |||||
section <a href="#Callback">Callback</a>. | |||||
</li> | |||||
</ul> | |||||
<h3 id="Off">Off</h3> | |||||
<p> | |||||
Unsubscribe from an event. | |||||
</p> | |||||
Syntax: | |||||
<pre class="prettyprint lang-js">DataSet.off(event, callback)</pre> | |||||
Where <code>event</code> and <code>callback</code> correspond with the | |||||
parameters used to <a href="#On">subscribe</a> to the event. | |||||
<h3 id="Events">Events</h3> | |||||
<p> | |||||
The following events are available for subscription: | |||||
</p> | |||||
<table> | |||||
<tr> | |||||
<th>Event</th> | |||||
<th>Description</th> | |||||
</tr> | |||||
<tr> | |||||
<td>add</td> | |||||
<td> | |||||
The <code>add</code> event is triggered when an item | |||||
or a set of items is added, or when an item is updated while | |||||
not yet existing. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>update</td> | |||||
<td> | |||||
The <code>update</code> event is triggered when an existing item | |||||
or a set of existing items is updated. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>remove</td> | |||||
<td> | |||||
The <code>remove</code> event is triggered when an item | |||||
or a set of items is removed. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>*</td> | |||||
<td> | |||||
The <code>*</code> event is triggered when any of the events | |||||
<code>add</code>, <code>update</code>, and <code>remove</code> | |||||
occurs. | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
<h3 id="Callback">Callback</h3> | |||||
<p> | |||||
The callback functions of subscribers are called with the following | |||||
parameters: | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
function (event, properties, senderId) { | |||||
// handle the event | |||||
}); | |||||
</pre> | |||||
<p> | |||||
where the parameters are defined as | |||||
</p> | |||||
<table> | |||||
<tr> | |||||
<th>Parameter</th> | |||||
<th>Type</th> | |||||
<th>Description</th> | |||||
</tr> | |||||
<tr> | |||||
<td>event</td> | |||||
<td>String</td> | |||||
<td> | |||||
Any of the available events: <code>add</code>, | |||||
<code>update</code>, or <code>remove</code>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>properties</td> | |||||
<td>Object | null</td> | |||||
<td> | |||||
Optional properties providing more information on the event. | |||||
In case of the events <code>add</code>, | |||||
<code>update</code>, and <code>remove</code>, | |||||
<code>properties</code> is always an object containing a property | |||||
<code>items</code>, which contains an array with the ids of the affected | |||||
items. The <code>update</code> event has an extra field <code>data</code> | |||||
containing the original data of the updated items, i.e. the gives the | |||||
changed fields of the changed items. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>senderId</td> | |||||
<td>String | Number</td> | |||||
<td> | |||||
An senderId, optionally provided by the application code | |||||
which triggered the event. If senderId is not provided, the | |||||
argument will be <code>null</code>. | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
<h2 id="Data_Manipulation">Data Manipulation</h2> | |||||
<p> | |||||
The data in a DataSet can be manipulated using the methods | |||||
<a href="#Add"><code>add</code></a>, | |||||
<a href="#Update"><code>update</code></a>, | |||||
and <a href="#Remove"><code>remove</code></a>. | |||||
The DataSet can be emptied using the method | |||||
<a href="#Clear"><code>clear</code></a>. | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
// create a DataSet | |||||
var data = new vis.DataSet(); | |||||
// add items | |||||
data.add([ | |||||
{id: 1, text: 'item 1'}, | |||||
{id: 2, text: 'item 2'}, | |||||
{id: 3, text: 'item 3'} | |||||
]); | |||||
// update an item | |||||
data.update({id: 2, text: 'item 2 (updated)'}); | |||||
// remove an item | |||||
data.remove(3); | |||||
</pre> | |||||
<h3 id="Add">Add</h3> | |||||
<p> | |||||
Add a data item or an array with items. | |||||
</p> | |||||
Syntax: | |||||
<pre class="prettyprint lang-js">var addedIds = DataSet.add(data [, senderId])</pre> | |||||
The argument <code>data</code> can contain: | |||||
<ul> | |||||
<li> | |||||
An <code>Object</code> containing a single item to be | |||||
added. The item must contain an id. | |||||
</li> | |||||
<li> | |||||
An <code>Array</code> containing a list with items to be added. Each item must contain an id. | |||||
</li> | |||||
</ul> | |||||
<p> | |||||
After the items are added to the DataSet, the DataSet will | |||||
trigger an event <code>add</code>. When a <code>senderId</code> | |||||
is provided, this id will be passed with the triggered | |||||
event to all subscribers. | |||||
</p> | |||||
<p> | |||||
The method will throw an Error when an item with the same id | |||||
as any of the added items already exists. | |||||
</p> | |||||
<h3 id="Update">Update</h3> | |||||
<p> | |||||
Update a data item or an array with items. | |||||
</p> | |||||
Syntax: | |||||
<pre class="prettyprint lang-js">var updatedIds = DataSet.update(data [, senderId])</pre> | |||||
The argument <code>data</code> can contain: | |||||
<ul> | |||||
<li> | |||||
An <code>Object</code> containing a single item to be | |||||
updated. The item must contain an id. | |||||
</li> | |||||
<li> | |||||
An <code>Array</code> containing a list with items to be updated. Each item must contain an id. | |||||
</li> | |||||
</ul> | |||||
<p> | |||||
The provided properties will be merged in the existing item. | |||||
When an item does not exist, it will be created. | |||||
</p> | |||||
<p> | |||||
After the items are updated, the DataSet will | |||||
trigger an event <code>add</code> for the added items, and | |||||
an event <code>update</code>. When a <code>senderId</code> | |||||
is provided, this id will be passed with the triggered | |||||
event to all subscribers. | |||||
</p> | |||||
<h3 id="Remove">Remove</h3> | |||||
<p> | |||||
Remove a data item or an array with items. | |||||
</p> | |||||
Syntax: | |||||
<pre class="prettyprint lang-js">var removedIds = DataSet.remove(id [, senderId])</pre> | |||||
<p> | |||||
The argument <code>id</code> can be: | |||||
</p> | |||||
<ul> | |||||
<li> | |||||
A <code>Number</code> or <code>String</code> containing the id | |||||
of a single item to be removed. | |||||
</li> | |||||
<li> | |||||
An <code>Object</code> containing the item to be deleted. | |||||
The item will be deleted by its id. | |||||
</li> | |||||
<li> | |||||
An Array containing ids or items to be removed. | |||||
</li> | |||||
</ul> | |||||
<p> | |||||
The method ignores removal of non-existing items, and returns an array | |||||
containing the ids of the items which are actually removed from the | |||||
DataSet. | |||||
</p> | |||||
<p> | |||||
After the items are removed, the DataSet will | |||||
trigger an event <code>remove</code> for the removed items. | |||||
When a <code>senderId</code> is provided, this id will be passed with | |||||
the triggered event to all subscribers. | |||||
</p> | |||||
<h3 id="Clear">Clear</h3> | |||||
<p> | |||||
Clear the complete DataSet. | |||||
</p> | |||||
Syntax: | |||||
<pre class="prettyprint lang-js">var removedIds = DataSet.clear([senderId])</pre> | |||||
<p> | |||||
After the items are removed, the DataSet will | |||||
trigger an event <code>remove</code> for all removed items. | |||||
When a <code>senderId</code> is provided, this id will be passed with | |||||
the triggered event to all subscribers. | |||||
</p> | |||||
<h2 id="Data_Selection">Data Selection</h2> | |||||
<p> | |||||
The DataSet contains functionality to format, filter, and sort data retrieved via the | |||||
methods <code>get</code>, <code>getIds</code>, <code>forEach</code>, and <code>map</code>. These methods have the following syntax: | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
DataSet.get([id] [, options]); | |||||
DataSet.getIds([options]); | |||||
DataSet.forEach(callback [, options]); | |||||
DataSet.map(callback [, options]); | |||||
</pre> | |||||
<p> | |||||
Where <code>options</code> is an Object which can have the following | |||||
properties: | |||||
</p> | |||||
<table> | |||||
<tr> | |||||
<th>Name</th> | |||||
<th>Type</th> | |||||
<th>Description</th> | |||||
</tr> | |||||
<tr> | |||||
<td>fields</td> | |||||
<td>String[ ] | Object.<String, String></td> | |||||
<td> | |||||
An array with field names, or an object with current field name and | |||||
new field name that the field is returned as. | |||||
By default, all properties of the items are emitted. | |||||
When <code>fields</code> is defined, only the properties | |||||
whose name is specified in <code>fields</code> will be included | |||||
in the returned items. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>type</td> | |||||
<td>Object.<String, String></td> | |||||
<td> | |||||
An object containing field names as key, and data types as value. | |||||
By default, the type of the properties of an item are left | |||||
unchanged. When a field type is specified, this field in the | |||||
items will be converted to the specified type. This can be used | |||||
for example to convert ISO strings containing a date to a | |||||
JavaScript Date object, or convert strings to numbers or vice | |||||
versa. The available data types are listed in section | |||||
<a href="#Data_Types">Data Types</a>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>filter</td> | |||||
<td>Function</td> | |||||
<td>Items can be filtered on specific properties by providing a filter | |||||
function. A filter function is executed for each of the items in the | |||||
DataSet, and is called with the item as parameter. The function must | |||||
return a boolean. All items for which the filter function returns | |||||
true will be emitted. | |||||
See section <a href="#Data_Filtering">Data Filtering</a>.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>order</td> | |||||
<td>String | Function</td> | |||||
<td>Order the items by a field name or custom sort function.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>returnType</td> | |||||
<td>String</td> | |||||
<td>Determine the type of output of the get function. Allowed values are <code>'Array' | 'Object'</code>. | |||||
The default returnType is an Array. The Object type will return a JSON object with the ID's as keys.</td> | |||||
</tr> | |||||
</table> | |||||
<p> | |||||
The following example demonstrates formatting properties and filtering | |||||
properties from items. | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
// create a DataSet | |||||
var data = new vis.DataSet(); | |||||
data.add([ | |||||
{id: 1, text: 'item 1', date: '2013-06-20', group: 1, first: true}, | |||||
{id: 2, text: 'item 2', date: '2013-06-23', group: 2}, | |||||
{id: 3, text: 'item 3', date: '2013-06-25', group: 2}, | |||||
{id: 4, text: 'item 4'} | |||||
]); | |||||
// retrieve formatted items | |||||
var items = data.get({ | |||||
fields: ['id', 'date', 'group'], // output the specified fields only | |||||
type: { | |||||
date: 'Date', // convert the date fields to Date objects | |||||
group: 'String' // convert the group fields to Strings | |||||
} | |||||
}); | |||||
</pre> | |||||
<h3 id="Getting_Data">Getting Data</h3> | |||||
<p> | |||||
Data can be retrieved from the DataSet using the method <code>get</code>. | |||||
This method can return a single item or a list with items. | |||||
</p> | |||||
<p>A single item can be retrieved by its id:</p> | |||||
<pre class="prettyprint lang-js"> | |||||
var item1 = dataset.get(1); | |||||
</pre> | |||||
<p>A selection of items can be retrieved by providing an array with ids:</p> | |||||
<pre class="prettyprint lang-js"> | |||||
var items = dataset.get([1, 3, 4]); // retrieve items 1, 3, and 4 | |||||
</pre> | |||||
<p>All items can be retrieved by simply calling <code>get</code> without | |||||
specifying an id:</p> | |||||
<pre class="prettyprint lang-js"> | |||||
var items = dataset.get(); // retrieve all items | |||||
</pre> | |||||
<h3 id="Data_Filtering">Data Filtering</h3> | |||||
<p> | |||||
Items can be filtered on specific properties by providing a filter | |||||
function. A filter function is executed for each of the items in the | |||||
DataSet, and is called with the item as parameter. The function must | |||||
return a boolean. All items for which the filter function returns | |||||
true will be emitted. | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
// retrieve all items having a property group with value 2 | |||||
var group2 = dataset.get({ | |||||
filter: function (item) { | |||||
return (item.group == 2); | |||||
} | |||||
}); | |||||
// retrieve all items having a property balance with a value above zero | |||||
var positiveBalance = dataset.get({ | |||||
filter: function (item) { | |||||
return (item.balance > 0); | |||||
} | |||||
}); | |||||
</pre> | |||||
<h3 id="Data_Types">Data Types</h3> | |||||
<p> | |||||
DataSet supports the following data types: | |||||
</p> | |||||
<table style="width: 100%"> | |||||
<tr> | |||||
<th>Name</th> | |||||
<th>Description</th> | |||||
<th>Examples</th> | |||||
</tr> | |||||
<tr> | |||||
<td>Boolean</td> | |||||
<td>A JavaScript Boolean</td> | |||||
<td> | |||||
<code>true</code><br> | |||||
<code>false</code> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>Number</td> | |||||
<td>A JavaScript Number</td> | |||||
<td> | |||||
<code>32</code><br> | |||||
<code>2.4</code> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>String</td> | |||||
<td>A JavaScript String</td> | |||||
<td> | |||||
<code>"hello world"</code><br> | |||||
<code>"2013-06-28"</code> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>Date</td> | |||||
<td>A JavaScript Date object</td> | |||||
<td> | |||||
<code>new Date()</code><br> | |||||
<code>new Date(2013, 5, 28)</code><br> | |||||
<code>new Date(1372370400000)</code> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>Moment</td> | |||||
<td>A Moment object, created with | |||||
<a href="http://momentjs.com/" target="_blank">moment.js</a></td> | |||||
<td> | |||||
<code>moment()</code><br> | |||||
<code>moment('2013-06-28')</code> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>ISODate</td> | |||||
<td>A string containing an ISO Date</td> | |||||
<td> | |||||
<code>new Date().toISOString()</code><br> | |||||
<code>"2013-06-27T22:00:00.000Z"</code> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>ASPDate</td> | |||||
<td>A string containing an ASP Date</td> | |||||
<td> | |||||
<code>"/Date(1372370400000)/"</code><br> | |||||
<code>"/Date(1198908717056-0700)/"</code> | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
<h2 id="Data_Policy">Data Policy</h2> | |||||
<p> | |||||
All code and data is processed and rendered in the browser. | |||||
No data is sent to any server. | |||||
</p> | |||||
</div> | |||||
</body> | |||||
</html> |
@ -1,338 +0,0 @@ | |||||
<!doctype html> | |||||
<html> | |||||
<head> | |||||
<title>vis.js | DataView documentation</title> | |||||
<link href="css/prettify.css" type="text/css" rel="stylesheet" /> | |||||
<link href='css/old_style.css' type='text/css' rel='stylesheet'> | |||||
<script type="text/javascript" src="js/prettify/prettify.js"></script> | |||||
<script>(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');</script></head> | |||||
<body onload="prettyPrint();"> | |||||
<div id="container"> | |||||
<h1>DataView documentation</h1> | |||||
<h2 id="Contents">Contents</h2> | |||||
<ul> | |||||
<li><a href="#Overview">Overview</a></li> | |||||
<li><a href="#Example">Example</a></li> | |||||
<li><a href="#Construction">Construction</a></li> | |||||
<li><a href="#Methods">Methods</a></li> | |||||
<li><a href="#Properties">Properties</a></li> | |||||
<li><a href="#Getting_Data">Getting Data</a></li> | |||||
<li><a href="#Subscriptions">Subscriptions</a></li> | |||||
<li><a href="#Data_Policy">Data Policy</a></li> | |||||
</ul> | |||||
<h2 id="Overview">Overview</h2> | |||||
<p> | |||||
A DataView offers a filtered and/or formatted view on a | |||||
<a href="dataset.html">DataSet</a>. | |||||
One can subscribe on changes in a DataView, and easily get filtered or | |||||
formatted data without having to specify filters and field types all | |||||
the time. | |||||
</p> | |||||
<h2 id="Example">Example</h2> | |||||
<p> | |||||
The following example shows how to use a DataView. | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
// create a DataSet | |||||
var data = new vis.DataSet(); | |||||
data.add([ | |||||
{id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true}, | |||||
{id: 2, text: 'item 2', date: '2013-06-23', group: 2}, | |||||
{id: 3, text: 'item 3', date: '2013-06-25', group: 2}, | |||||
{id: 4, text: 'item 4'} | |||||
]); | |||||
// create a DataView | |||||
// the view will only contain items having a property group with value 1, | |||||
// and will only output fields id, text, and date. | |||||
var view = new vis.DataView(data, { | |||||
filter: function (item) { | |||||
return (item.group == 1); | |||||
}, | |||||
fields: ['id', 'text', 'date'] | |||||
}); | |||||
// subscribe to any change in the DataView | |||||
view.on('*', function (event, properties, senderId) { | |||||
console.log('event', event, properties); | |||||
}); | |||||
// update an item in the data set | |||||
data.update({id: 2, group: 1}); | |||||
// get all ids in the view | |||||
var ids = view.getIds(); | |||||
console.log('ids', ids); // will output [1, 2] | |||||
// get all items in the view | |||||
var items = view.get(); | |||||
</pre> | |||||
<h2 id="Construction">Construction</h2> | |||||
<p> | |||||
A DataView can be constructed as: | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
var data = new vis.DataView(dataset, options) | |||||
</pre> | |||||
<p> | |||||
where: | |||||
</p> | |||||
<ul> | |||||
<li> | |||||
<code>dataset</code> is a DataSet or DataView. | |||||
</li> | |||||
<li> | |||||
<code>options</code> is an object which can | |||||
contain the following properties. Note that these properties | |||||
are exactly the same as the properties available in methods | |||||
<code>DataSet.get</code> and <code>DataView.get</code>. | |||||
<table> | |||||
<tr> | |||||
<th>Name</th> | |||||
<th>Type</th> | |||||
<th>Description</th> | |||||
</tr> | |||||
<tr> | |||||
<td>convert</td> | |||||
<td>Object.<String, String></td> | |||||
<td> | |||||
An object containing field names as key, and data types as value. | |||||
By default, the type of the properties of an item are left | |||||
unchanged. When a field type is specified, this field in the | |||||
items will be converted to the specified type. This can be used | |||||
for example to convert ISO strings containing a date to a | |||||
JavaScript Date object, or convert strings to numbers or vice | |||||
versa. The available data types are listed in section | |||||
<a href="dataset.html#Data_Types">Data Types</a>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>fields</td> | |||||
<td>String[ ] | Object.<String, String></td> | |||||
<td> | |||||
An array with field names, or an object with current field name and | |||||
new field name that the field is returned as. | |||||
By default, all properties of the items are emitted. | |||||
When <code>fields</code> is defined, only the properties | |||||
whose name is specified in <code>fields</code> will be included | |||||
in the returned items. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>filter</td> | |||||
<td>function</td> | |||||
<td>Items can be filtered on specific properties by providing a filter | |||||
function. A filter function is executed for each of the items in the | |||||
DataSet, and is called with the item as parameter. The function must | |||||
return a boolean. All items for which the filter function returns | |||||
true will be emitted. | |||||
See also section <a href="dataset.html#Data_Filtering">Data Filtering</a>.</td> | |||||
</tr> | |||||
</table> | |||||
</li> | |||||
</ul> | |||||
<h2 id="Methods">Methods</h2> | |||||
<p>DataView contains the following methods.</p> | |||||
<table> | |||||
<colgroup> | |||||
<col width="200"> | |||||
</colgroup> | |||||
<tr> | |||||
<th>Method</th> | |||||
<th>Return Type</th> | |||||
<th>Description</th> | |||||
</tr> | |||||
<tr> | |||||
<td> | |||||
get([options] [, data])<br> | |||||
get(id [,options] [, data])<br> | |||||
get(ids [, options] [, data]) | |||||
</td> | |||||
<td>Object | Array</td> | |||||
<td> | |||||
Get a single item, multiple items, or all items from the DataView. | |||||
Usage examples can be found in section <a href="#Getting_Data">Getting Data</a>, and the available <code>options</code> are described in section <a href="#Data_Selection">Data Selection</a>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td> | |||||
getDataSet() | |||||
</td> | |||||
<td>DataSet</td> | |||||
<td> | |||||
Get the DataSet to which the DataView is connected. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td> | |||||
getIds([options]) | |||||
</td> | |||||
<td>Number[]</td> | |||||
<td> | |||||
Get ids of all items or of a filtered set of items. | |||||
Available <code>options</code> are described in section <a href="dataset.html#Data_Selection">Data Selection</a>, except that options <code>fields</code> and <code>type</code> are not applicable in case of <code>getIds</code>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>off(event, callback)</td> | |||||
<td>none</td> | |||||
<td> | |||||
Unsubscribe from an event, remove an event listener. See section <a href="#Subscriptions">Subscriptions</a>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>on(event, callback)</td> | |||||
<td>none</td> | |||||
<td> | |||||
Subscribe to an event, add an event listener. See section <a href="#Subscriptions">Subscriptions</a>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>refresh()</td> | |||||
<td>none</td> | |||||
<td> | |||||
Refresh the filter results of a DataView. Useful when the filter function contains dynamic properties, like: | |||||
<pre class="prettyprint lang-js">var data = new vis.DataSet(...); | |||||
var view = new vis.DataView(data, { | |||||
filter: function (item) { | |||||
return item.value > threshold; | |||||
} | |||||
});</pre> | |||||
In this example, <code>threshold</code> is an external parameter. When the value of <code>threshold</code> changes, the DataView must be notified that the filter results may have changed by calling <code>DataView.refresh()</code>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td> | |||||
setDataSet(data) | |||||
</td> | |||||
<td>none</td> | |||||
<td> | |||||
Replace the DataSet of the DataView. Parameter <code>data</code> can be a DataSet or a DataView. | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
<h2 id="Properties">Properties</h2> | |||||
<p>DataView contains the following properties.</p> | |||||
<table> | |||||
<colgroup> | |||||
<col width="200"> | |||||
</colgroup> | |||||
<tr> | |||||
<th>Property</th> | |||||
<th>Type</th> | |||||
<th>Description</th> | |||||
</tr> | |||||
<tr> | |||||
<td>length</td> | |||||
<td>Number</td> | |||||
<td>The number of items in the DataView.</td> | |||||
</tr> | |||||
</table> | |||||
<h2 id="Getting_Data">Getting Data</h2> | |||||
<p> | |||||
Data of the DataView can be retrieved using the method <code>get</code>. | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
var items = view.get(); | |||||
</pre> | |||||
<p> | |||||
Data of a DataView can be filtered and formatted again, in exactly the | |||||
same way as in a DataSet. See sections | |||||
<a href="dataset.html#Data_Manipulation">Data Manipulation</a> and | |||||
<a href="dataset.html#Data_Selection">Data Selection</a> for more | |||||
information. | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
var items = view.get({ | |||||
fields: ['id', 'score'], | |||||
filter: function (item) { | |||||
return (item.score > 50); | |||||
} | |||||
}); | |||||
</pre> | |||||
<h2 id="Subscriptions">Subscriptions</h2> | |||||
<p> | |||||
One can subscribe on changes in the DataView. Subscription works exactly | |||||
the same as for DataSets. See the documentation on | |||||
<a href="dataset.html#Subscriptions">subscriptions in a DataSet</a> | |||||
for more information. | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
// create a DataSet and a view on the data set | |||||
var data = new vis.DataSet(); | |||||
var view = new vis.DataView({ | |||||
filter: function (item) { | |||||
return (item.group == 2); | |||||
} | |||||
}); | |||||
// subscribe to any change in the DataView | |||||
view.on('*', function (event, properties, senderId) { | |||||
console.log('event:', event, 'properties:', properties, 'senderId:', senderId); | |||||
}); | |||||
// add, update, and remove data in the DataSet... | |||||
</pre> | |||||
<h2 id="Data_Policy">Data Policy</h2> | |||||
<p> | |||||
All code and data is processed and rendered in the browser. | |||||
No data is sent to any server. | |||||
</p> | |||||
</div> | |||||
</body> | |||||
</html> |
@ -1,673 +0,0 @@ | |||||
<html> | |||||
<head> | |||||
<title>vis.js | graph3d documentation</title> | |||||
<link href='../css/prettify.css' type='text/css' rel='stylesheet'> | |||||
<link href='../css/style.css' type='text/css' rel='stylesheet'> | |||||
<script type="text/javascript" src="../js/prettify/prettify.js"></script> | |||||
<script>(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');</script></head> | |||||
<body onload="prettyPrint();"> | |||||
<div id="container"> | |||||
<h1>Graph3d documentation</h1> | |||||
<h2 id="Overview">Overview</h2> | |||||
<p> | |||||
Graph3d is an interactive visualization chart to draw data in a three dimensional | |||||
graph. You can freely move and zoom in the graph by dragging and scrolling in the | |||||
window. Graph3d also supports animation of a graph. | |||||
</p> | |||||
<p> | |||||
Graph3d uses <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Canvas">HTML canvas</a> | |||||
to render graphs, and can render up to a few thousands of data points smoothly. | |||||
</p> | |||||
<h2 id="Contents">Contents</h2> | |||||
<ul> | |||||
<li><a href="#Overview">Overview</a></li> | |||||
<li><a href="#Loading">Loading</a></li> | |||||
<li><a href="#Data_Format">Data Format</a></li> | |||||
<li><a href="#Configuration_Options">Configuration Options</a></li> | |||||
<li><a href="#Methods">Methods</a></li> | |||||
<li><a href="#Events">Events</a></li> | |||||
<li><a href="#Data_Policy">Data Policy</a></li> | |||||
</ul> | |||||
<h2 id="Example">Example</h2> | |||||
<p> | |||||
The following code shows how to create a Graph3d and provide it with data. | |||||
More examples can be found in the <a href="../../examples">examples</a> directory. | |||||
</p> | |||||
<pre class="prettyprint lang-html"> | |||||
<!DOCTYPE HTML> | |||||
<html> | |||||
<head> | |||||
<title>Graph 3D demo</title> | |||||
<style> | |||||
body {font: 10pt arial;} | |||||
</style> | |||||
<script type="text/javascript" src="../../dist/vis.js"></script> | |||||
<script type="text/javascript"> | |||||
var data = null; | |||||
var graph = null; | |||||
function custom(x, y) { | |||||
return (Math.sin(x/50) * Math.cos(y/50) * 50 + 50); | |||||
} | |||||
// Called when the Visualization API is loaded. | |||||
function drawVisualization() { | |||||
// Create and populate a data table. | |||||
var data = new vis.DataSet(); | |||||
// create some nice looking data with sin/cos | |||||
var steps = 50; // number of datapoints will be steps*steps | |||||
var axisMax = 314; | |||||
var axisStep = axisMax / steps; | |||||
for (var x = 0; x < axisMax; x+=axisStep) { | |||||
for (var y = 0; y < axisMax; y+=axisStep) { | |||||
var value = custom(x, y); | |||||
data.add({ | |||||
x: x, | |||||
y: y, | |||||
z: value, | |||||
style: value | |||||
}); | |||||
} | |||||
} | |||||
// specify options | |||||
var options = { | |||||
width: '600px', | |||||
height: '600px', | |||||
style: 'surface', | |||||
showPerspective: true, | |||||
showGrid: true, | |||||
showShadow: false, | |||||
keepAspectRatio: true, | |||||
verticalRatio: 0.5 | |||||
}; | |||||
// create a graph3d | |||||
var container = document.getElementById('mygraph'); | |||||
graph3d = new vis.Graph3d(container, data, options); | |||||
} | |||||
</script> | |||||
</head> | |||||
<body onload="drawVisualization();"> | |||||
<div id="mygraph"></div> | |||||
</body> | |||||
</html> | |||||
</pre> | |||||
<h2 id="Loading">Loading</h2> | |||||
<p> | |||||
The class name of the Graph3d is <code>vis.Graph3d</code>. | |||||
When constructing a Graph3d, an HTML DOM container must be provided to attach | |||||
the graph to. Optionally, data an options can be provided. | |||||
Data is a vis <code>DataSet</code> or an <code>Array</code>, described in | |||||
section <a href="#Data_Format">Data Format</a>. | |||||
Options is a name-value map in the JSON format. The available options | |||||
are described in section <a href="#Configuration_Options">Configuration Options</a>. | |||||
</p> | |||||
<pre class="prettyprint lang-js">var graph = new vis.Graph3d(container [, data] [, options]);</pre> | |||||
<p> | |||||
Data and options can be set or changed later on using the functions | |||||
<code>Graph3d.setData(data)</code> and <code>Graph3d.setOptions(options)</code>. | |||||
</p> | |||||
<h2 id="Data_Format">Data Format</h2> | |||||
<p> | |||||
Graph3d can load data from an <code>Array</code>, a <code>DataSet</code> or a <code>DataView</code>. | |||||
JSON objects are added to this DataSet by using the <code>add()</code> function. | |||||
Data points must have properties <code>x</code>, <code>y</code>, and <code>z</code>, | |||||
and can optionally have a property <code>style</code> and <code>filter</code>. | |||||
<h3>Definition</h3> | |||||
<p> | |||||
The DataSet JSON objects are defined as: | |||||
</p> | |||||
<table> | |||||
<tr> | |||||
<th>Name</th> | |||||
<th>Type</th> | |||||
<th>Required</th> | |||||
<th>Description</th> | |||||
</tr> | |||||
<tr> | |||||
<td>x</td> | |||||
<td>number</td> | |||||
<td>yes</td> | |||||
<td>Location on the x-axis.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>y</td> | |||||
<td>number</td> | |||||
<td>yes</td> | |||||
<td>Location on the y-axis.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>z</td> | |||||
<td>number</td> | |||||
<td>yes</td> | |||||
<td>Location on the z-axis.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>style</td> | |||||
<td>number</td> | |||||
<td>no</td> | |||||
<td>The data value, required for graph styles <code>dot-color</code> and | |||||
<code>dot-size</code>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>filter</td> | |||||
<td>*</td> | |||||
<td>no</td> | |||||
<td>Filter values used for the animation. | |||||
This column may have any type, such as a number, string, or Date.</td> | |||||
</tr> | |||||
</table> | |||||
<h2 id="Configuration_Options">Configuration Options</h2> | |||||
<p> | |||||
Options can be used to customize the graph. Options are defined as a JSON object. | |||||
All options are optional. | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
var options = { | |||||
width: '100%', | |||||
height: '400px', | |||||
style: 'surface' | |||||
}; | |||||
</pre> | |||||
<p> | |||||
The following options are available. | |||||
</p> | |||||
<table> | |||||
<tr> | |||||
<th>Name</th> | |||||
<th>Type</th> | |||||
<th>Default</th> | |||||
<th>Description</th> | |||||
</tr> | |||||
<tr> | |||||
<td>animationInterval</td> | |||||
<td>number</td> | |||||
<td>1000</td> | |||||
<td>The animation interval in milliseconds. This determines how fast | |||||
the animation runs.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>animationPreload</td> | |||||
<td>boolean</td> | |||||
<td>false</td> | |||||
<td>If false, the animation frames are loaded as soon as they are requested. | |||||
if <code>animationPreload</code> is true, the graph will automatically load | |||||
all frames in the background, resulting in a smoother animation as soon as | |||||
all frames are loaded. The load progress is shown on screen.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>animationAutoStart</td> | |||||
<td>boolean</td> | |||||
<td>false</td> | |||||
<td>If true, the animation starts playing automatically after the graph | |||||
is created.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>backgroundColor</td> | |||||
<td>string or Object</td> | |||||
<td>'white'</td> | |||||
<td>The background color for the main area of the chart. | |||||
Can be either a simple HTML color string, for example: 'red' or '#00cc00', | |||||
or an object with the following properties.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>backgroundColor.stroke</td> | |||||
<td>string</td> | |||||
<td>'gray'</td> | |||||
<td>The color of the chart border, as an HTML color string.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>backgroundColor.strokeWidth</td> | |||||
<td>number</td> | |||||
<td>1</td> | |||||
<td>The border width, in pixels.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>backgroundColor.fill</td> | |||||
<td>string</td> | |||||
<td>'white'</td> | |||||
<td>The chart fill color, as an HTML color string.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>cameraPosition</td> | |||||
<td>Object</td> | |||||
<td>{horizontal: 1.0, vertical: 0.5, distance: 1.7}</td> | |||||
<td>Set the initial rotation and position of the camera. | |||||
The object <code>cameraPosition</code> contains three parameters: | |||||
<code>horizontal</code>, <code>vertical</code>, and <code>distance</code>. | |||||
Parameter <code>horizontal</code> is a value in radians and can have any | |||||
value (but normally in the range of 0 and 2*Pi). | |||||
Parameter <code>vertical</code> is a value in radians between 0 and 0.5*Pi. | |||||
Parameter <code>distance</code> is the (normalized) distance from the | |||||
camera to the center of the graph, in the range of 0.71 to 5.0. A | |||||
larger distance puts the graph further away, making it smaller. | |||||
All parameters are optional. | |||||
</tr> | |||||
<tr> | |||||
<td>height</td> | |||||
<td>string</td> | |||||
<td>'400px'</td> | |||||
<td>The height of the graph in pixels or as a percentage.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>keepAspectRatio</td> | |||||
<td>boolean</td> | |||||
<td>true</td> | |||||
<td>If <code>keepAspectRatio</code> is true, the x-axis and the y-axis | |||||
keep their aspect ratio. If false, the axes are scaled such that they | |||||
both have the same, maximum with.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>showAnimationControls</td> | |||||
<td>boolean</td> | |||||
<td>true</td> | |||||
<td>If true, animation controls are created at the bottom of the Graph. | |||||
The animation controls consists of buttons previous, start/stop, next, | |||||
and a slider showing the current frame. | |||||
Only applicable when the provided data contains an animation.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>showGrid</td> | |||||
<td>boolean</td> | |||||
<td>true</td> | |||||
<td>If true, grid lines are draw in the x-y surface (the bottom of the 3d | |||||
graph).</td> | |||||
</tr> | |||||
<tr> | |||||
<td>showPerspective</td> | |||||
<td>boolean</td> | |||||
<td>true</td> | |||||
<td>If true, the graph is drawn in perspective: points and lines which | |||||
are further away are drawn smaller. | |||||
Note that the graph currently does not support a gray colored bottom side | |||||
when drawn in perspective. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>showShadow</td> | |||||
<td>boolean</td> | |||||
<td>false</td> | |||||
<td>Show shadow on the graph.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>style</td> | |||||
<td>string</td> | |||||
<td>'dot'</td> | |||||
<td>The style of the 3d graph. Available styles: | |||||
<code>bar</code>, | |||||
<code>bar-color</code>, | |||||
<code>bar-size</code>, | |||||
<code>dot</code>, | |||||
<code>dot-line</code>, | |||||
<code>dot-color</code>, | |||||
<code>dot-size</code>, | |||||
<code>line</code>, | |||||
<code>grid</code>, | |||||
or <code>surface</code></td> | |||||
</tr> | |||||
<tr> | |||||
<td>tooltip</td> | |||||
<td>boolean | function</td> | |||||
<td>false</td> | |||||
<td>Show a tooltip showing the values of the hovered data point. | |||||
The contents of the tooltip can be customized by providing a callback | |||||
function as <code>tooltip</code>. In this case the function is called | |||||
with an object containing parameters <code>x</code>, | |||||
<code>y</code>, and <code>z</code> argument, | |||||
and must return a string which may contain HTML. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>valueMax</td> | |||||
<td>number</td> | |||||
<td>none</td> | |||||
<td>The maximum value for the value-axis. Only available in combination | |||||
with the styles <code>dot-color</code> and <code>dot-size</code>.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>valueMin</td> | |||||
<td>number</td> | |||||
<td>none</td> | |||||
<td>The minimum value for the value-axis. Only available in combination | |||||
with the styles <code>dot-color</code> and <code>dot-size</code>.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>verticalRatio</td> | |||||
<td>number</td> | |||||
<td>0.5</td> | |||||
<td>A value between 0.1 and 1.0. This scales the vertical size of the graph | |||||
When keepAspectRatio is set to false, and verticalRatio is set to 1.0, | |||||
the graph will be a cube.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>width</td> | |||||
<td>string</td> | |||||
<td>'400px'</td> | |||||
<td>The width of the graph in pixels or as a percentage.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>xBarWidth</td> | |||||
<td>number</td> | |||||
<td>none</td> | |||||
<td>The width of bars in x direction. By default, the width is equal to the distance | |||||
between the data points, such that bars adjoin each other. | |||||
Only applicable for styles <code>'bar'</code> and <code>'bar-color'</code>.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>xCenter</td> | |||||
<td>string</td> | |||||
<td>'55%'</td> | |||||
<td>The horizontal center position of the graph, as a percentage or in | |||||
pixels.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>xMax</td> | |||||
<td>number</td> | |||||
<td>none</td> | |||||
<td>The maximum value for the x-axis.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>xMin</td> | |||||
<td>number</td> | |||||
<td>none</td> | |||||
<td>The minimum value for the x-axis.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>xStep</td> | |||||
<td>number</td> | |||||
<td>none</td> | |||||
<td>Step size for the grid on the x-axis.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>xValueLabel</td> | |||||
<td>function</td> | |||||
<td>none</td> | |||||
<td>A function for custom formatting of the labels along the x-axis, | |||||
for example <code>function (x) {return (x * 100) + '%'}</code>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>yBarWidth</td> | |||||
<td>number</td> | |||||
<td>none</td> | |||||
<td>The width of bars in y direction. By default, the width is equal to the distance | |||||
between the data points, such that bars adjoin each other. | |||||
Only applicable for styles <code>'bar'</code> and <code>'bar-color'</code>.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>yCenter</td> | |||||
<td>string</td> | |||||
<td>'45%'</td> | |||||
<td>The vertical center position of the graph, as a percentage or in | |||||
pixels.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>yMax</td> | |||||
<td>number</td> | |||||
<td>none</td> | |||||
<td>The maximum value for the y-axis.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>yMin</td> | |||||
<td>number</td> | |||||
<td>none</td> | |||||
<td>The minimum value for the y-axis.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>yStep</td> | |||||
<td>number</td> | |||||
<td>none</td> | |||||
<td>Step size for the grid on the y-axis.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>yValueLabel</td> | |||||
<td>function</td> | |||||
<td>none</td> | |||||
<td>A function for custom formatting of the labels along the y-axis, | |||||
for example <code>function (y) {return (y * 100) + '%'}</code>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>zMin</td> | |||||
<td>number</td> | |||||
<td>none</td> | |||||
<td>The minimum value for the z-axis.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>zMax</td> | |||||
<td>number</td> | |||||
<td>none</td> | |||||
<td>The maximum value for the z-axis.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>zStep</td> | |||||
<td>number</td> | |||||
<td>none</td> | |||||
<td>Step size for the grid on the z-axis.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>zValueLabel</td> | |||||
<td>function</td> | |||||
<td>none</td> | |||||
<td>A function for custom formatting of the labels along the z-axis, | |||||
for example <code>function (z) {return (z * 100) + '%'}</code>. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>xLabel</td> | |||||
<td>String</td> | |||||
<td>x</td> | |||||
<td>Label on the X axis.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>yLabel</td> | |||||
<td>String</td> | |||||
<td>y</td> | |||||
<td>Label on the Y axis.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>zLabel</td> | |||||
<td>String</td> | |||||
<td>z</td> | |||||
<td>Label on the Z axis.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>filterLabel</td> | |||||
<td>String</td> | |||||
<td>time</td> | |||||
<td>Label for the filter column.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>legendLabel</td> | |||||
<td>String</td> | |||||
<td>value</td> | |||||
<td>Label for the style description.</td> | |||||
</tr> | |||||
</table> | |||||
<h2 id="Methods">Methods</h2> | |||||
<p> | |||||
Graph3d supports the following methods. | |||||
</p> | |||||
<table> | |||||
<tr> | |||||
<th>Method</th> | |||||
<th>Return Type</th> | |||||
<th>Description</th> | |||||
</tr> | |||||
<tr> | |||||
<td>animationStart()</td> | |||||
<td>none</td> | |||||
<td>Start playing the animation. | |||||
Only applicable when animation data is available.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>animationStop()</td> | |||||
<td>none</td> | |||||
<td>Stop playing the animation. | |||||
Only applicable when animation data is available.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>getCameraPosition()</td> | |||||
<td>An object with parameters <code>horizontal</code>, | |||||
<code>vertical</code> and <code>distance</code></td> | |||||
<td>Returns an object with parameters <code>horizontal</code>, | |||||
<code>vertical</code> and <code>distance</code>, | |||||
which each one of them is a number, representing the rotation and position | |||||
of the camera.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>redraw()</td> | |||||
<td>none</td> | |||||
<td>Redraw the graph. Useful after the camera position is changed externally, | |||||
when data is changed, or when the layout of the webpage changed.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>setData(data)</td> | |||||
<td>none</td> | |||||
<td>Replace the data in the Graph3d.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>setOptions(options)</td> | |||||
<td>none</td> | |||||
<td>Update options of Graph3d. | |||||
The provided options will be merged with current options.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>setSize(width, height)</td> | |||||
<td>none</td> | |||||
<td>Parameters <code>width</code> and <code>height</code> are strings, | |||||
containing a new size for the graph. Size can be provided in pixels | |||||
or in percentages.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>setCameraPosition (pos)</td> | |||||
<td>{horizontal: 1.0, vertical: 0.5, distance: 1.7}</td> | |||||
<td>Set the rotation and position of the camera. Parameter <code>pos</code> | |||||
is an object which contains three parameters: <code>horizontal</code>, | |||||
<code>vertical</code>, and <code>distance</code>. | |||||
Parameter <code>horizontal</code> is a value in radians and can have any | |||||
value (but normally in the range of 0 and 2*Pi). | |||||
Parameter <code>vertical</code> is a value in radians between 0 and 0.5*Pi. | |||||
Parameter <code>distance</code> is the (normalized) distance from the | |||||
camera to the center of the graph, in the range of 0.71 to 5.0. A | |||||
larger distance puts the graph further away, making it smaller. | |||||
All parameters are optional. | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
<h2 id="Events">Events</h2> | |||||
<p> | |||||
Graph3d fires events after the camera position has been changed. | |||||
The event can be catched by creating a listener. | |||||
Here an example on how to catch a <code>cameraPositionChange</code> event. | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
function onCameraPositionChange(event) { | |||||
alert('The camera position changed to:\n' + | |||||
'Horizontal: ' + event.horizontal + '\n' + | |||||
'Vertical: ' + event.vertical + '\n' + | |||||
'Distance: ' + event.distance); | |||||
} | |||||
// assuming var graph3d = new vis.Graph3d(document.getElementById('mygraph')); | |||||
graph3d.on('cameraPositionChange', onCameraPositionChange); | |||||
</pre> | |||||
<p> | |||||
The following events are available. | |||||
</p> | |||||
<table> | |||||
<col width="10%"> | |||||
<col width="60%"> | |||||
<col width="30%"> | |||||
<tr> | |||||
<th>name</th> | |||||
<th>Description</th> | |||||
<th>Properties</th> | |||||
</tr> | |||||
<tr> | |||||
<td>cameraPositionChange</td> | |||||
<td>The camera position changed. Fired after the user modified the camera position | |||||
by moving (dragging) the graph, or by zooming (scrolling), | |||||
but not after a call to <code>setCameraPosition</code> method. | |||||
The new camera position can be retrieved by calling the method | |||||
<code>getCameraPosition</code>.</td> | |||||
<td> | |||||
<ul> | |||||
<li><code>horizontal</code>: Number. The horizontal angle of the camera.</li> | |||||
<li><code>vertical</code>: Number. The vertical angle of the camera.</li> | |||||
<li><code>distance</code>: Number. The distance of the camera to the center of the graph.</li> | |||||
</ul> | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
<h2 id="Data_Policy">Data Policy</h2> | |||||
<p> | |||||
All code and data are processed and rendered in the browser. No data is sent to any server. | |||||
</p> | |||||
</div> | |||||
</body> | |||||
</html> |
@ -1,225 +0,0 @@ | |||||
<!doctype html> | |||||
<html> | |||||
<head> | |||||
<title>vis.js | documentation</title> | |||||
<link href="css/prettify.css" type="text/css" rel="stylesheet" /> | |||||
<link href='css/old_style.css' type='text/css' rel='stylesheet'> | |||||
<script type="text/javascript" src="js/prettify/prettify.js"></script> | |||||
<script>(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');</script></head> | |||||
<body onload="prettyPrint();"> | |||||
<div id="container"> | |||||
<h1>vis.js documentation</h1> | |||||
<p> | |||||
Vis.js is a dynamic, browser based visualization library. | |||||
The library is designed to be easy to use, handle large amounts | |||||
of dynamic data, and enable manipulation of the data. | |||||
</p> | |||||
<p> | |||||
The library is developed by | |||||
<a href="http://almende.com" target="_blank">Almende B.V.</a>. | |||||
Vis.js runs fine on Chrome, Firefox, Opera, Safari, IE9+, and most mobile | |||||
browsers (with full touch support). | |||||
</p> | |||||
<h2 id="Components">Components</h2> | |||||
<p> | |||||
Vis.js contains of the following components: | |||||
</p> | |||||
<div style="text-align: center; float: right; padding-left: 30px;"> | |||||
<a href="img/vis_overview.png" target="_blank"> | |||||
<img src="img/vis_overview.png" style="width: 350px; "/><br> | |||||
(click for a larger view) | |||||
</a> | |||||
</div> | |||||
<ul> | |||||
<li> | |||||
<a href="dataset.html"><b>DataSet</b></a>. | |||||
A flexible key/value based data set. | |||||
Add, update, and remove items. Subscribe on changes in the data set. | |||||
A DataSet can filter and order items, and convert fields of items. | |||||
</li> | |||||
<li> | |||||
<a href="dataview.html"><b>DataView</b></a>. | |||||
A filtered and/or formatted view on a DataSet. | |||||
</li> | |||||
<li> | |||||
<a href="network.html"><b>Network</b></a>. | |||||
Display a network (force directed graph) with nodes and edges (previously called Graph). | |||||
</li> | |||||
<li> | |||||
<a href="graph2d.html"><b>Graph2d</b></a>. | |||||
Plot data on a timeline with lines or barcharts. | |||||
</li> | |||||
<li> | |||||
<a href="old/graph3d.html"><b>Graph3d</b></a>. | |||||
Display data in a three dimensional graph. | |||||
</li> | |||||
<li> | |||||
<a href="timeline.html"><b>Timeline</b></a>. | |||||
Display different types of data on a timeline. | |||||
</li> | |||||
</ul> | |||||
<h2 id="Install">Install</h2> | |||||
<h3>npm</h3> | |||||
<pre class="prettyprint"> | |||||
npm install vis | |||||
</pre> | |||||
<h3>bower</h3> | |||||
<pre class="prettyprint"> | |||||
bower install vis | |||||
</pre> | |||||
<h3>download</h3> | |||||
Download the library from the website: | |||||
<a href="http://visjs.org" target="_blank">http://visjs.org</a>. | |||||
<h2 id="Load">Load</h2> | |||||
<p> | |||||
To load vis.js, include the javascript and css files of vis in your web page: | |||||
</p> | |||||
<pre class="prettyprint lang-html"><!DOCTYPE HTML> | |||||
<html> | |||||
<head> | |||||
<script src="components/vis/vis.js"></script> | |||||
<link href="components/vis/vis.css" rel="stylesheet" type="text/css" /> | |||||
</head> | |||||
<body> | |||||
<script type="text/javascript"> | |||||
// ... load a visualization | |||||
</script> | |||||
</body> | |||||
</html> | |||||
</pre> | |||||
<p> | |||||
or load vis.js using require.js: | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
require.config({ | |||||
paths: { | |||||
vis: 'path/to/vis', | |||||
} | |||||
}); | |||||
require(['vis'], function (math) { | |||||
// ... load a visualization | |||||
}); | |||||
</pre> | |||||
<p> | |||||
A timeline can be instantiated as follows. Other components can be | |||||
created in a similar way. | |||||
</p> | |||||
<pre class="prettyprint lang-js"> | |||||
var timeline = new vis.Timeline(container, data, options); | |||||
</pre> | |||||
<p> | |||||
Where <code>container</code> is an HTML element, <code>data</code> is | |||||
an Array with data or a DataSet, and <code>options</code> is an optional | |||||
object with configuration options for the component. | |||||
</p> | |||||
<h2 id="Use">Use</h2> | |||||
<p> | |||||
A basic example on using a Timeline is shown below. More examples can be | |||||
found in the <a href="https://github.com/almende/vis/tree/master/examples" | |||||
target="_blank">examples directory</a> of the project. | |||||
</p> | |||||
<pre class="prettyprint lang-html"> | |||||
<!DOCTYPE HTML> | |||||
<html> | |||||
<head> | |||||
<title>Timeline basic demo</title> | |||||
<script src="components/vis/vis.js"></script> | |||||
<link href="components/vis/vis.css" rel="stylesheet" type="text/css" /> | |||||
<style type="text/css"> | |||||
body, html { | |||||
font-family: sans-serif; | |||||
} | |||||
</style> | |||||
</head> | |||||
<body> | |||||
<div id="visualization"></div> | |||||
<script type="text/javascript"> | |||||
// DOM element where the Timeline will be attached | |||||
var container = document.getElementById('visualization'); | |||||
// Create a DataSet (allows two way data-binding) | |||||
var 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'} | |||||
]); | |||||
// Configuration for the Timeline | |||||
var options = {}; | |||||
// Create a Timeline | |||||
var timeline = new vis.Timeline(container, data, options); | |||||
</script> | |||||
</body> | |||||
</html> | |||||
</pre> | |||||
<h2 id="license">License</h2> | |||||
<p> | |||||
Copyright 2010-2014 Almende B.V. | |||||
</p> | |||||
<p> | |||||
Vis.js is dual licensed under both | |||||
</p> | |||||
<ul> | |||||
<li> | |||||
The Apache 2.0 License<br> | |||||
<a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a> | |||||
</li> | |||||
</ul> | |||||
<p> | |||||
and | |||||
</p> | |||||
<ul> | |||||
<li> | |||||
The MIT License<br> | |||||
<a href="http://opensource.org/licenses/MIT">http://opensource.org/licenses/MIT</a> | |||||
</li> | |||||
</ul> | |||||
<p> | |||||
Vis.js may be distributed under either license. | |||||
</p> | |||||
</div> | |||||
</body> | |||||
</html> |
@ -1,2 +0,0 @@ | |||||
PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, | |||||
null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]) |
@ -1,2 +0,0 @@ | |||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[ \t\r\n\f]+/,null," \t\r\n\u000c"]],[["str",/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],["str",/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],["kwd",/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//], | |||||
["com",/^(?:<!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#(?:[0-9a-f]{3}){1,2}/i],["pln",/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],["pun",/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^\)\"\']+/]]),["css-str"]) |
@ -1,2 +0,0 @@ | |||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])\'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:(?:--+(?:[^\r\n\x0C]*)?)|(?:\{-(?:[^-]|-+[^-\}])*-\}))/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^a-zA-Z0-9\']|$)/, | |||||
null],["pln",/^(?:[A-Z][\w\']*\.)*[a-zA-Z][\w\']*/],["pun",/^[^\t\n\x0B\x0C\r a-zA-Z0-9\'\"]+/]]),["hs"]) |
@ -1,2 +0,0 @@ | |||||
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(/,null,"("],["clo",/^\)/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, | |||||
null],["lit",/^[+\-]?(?:0x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["cl","el","lisp","scm"]) |
@ -1,2 +0,0 @@ | |||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\s\S]*?(?:\]\1\]|$)|[^\r\n]*)/],["str",/^\[(=*)\[[\s\S]*?(?:\]\1\]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i], | |||||
["pln",/^[a-z_]\w*/i],["pun",/^[^\w\t\n\r \xA0][^\w\t\n\r \xA0\"\'\-\+=]*/]]),["lua"]) |
@ -1,2 +0,0 @@ | |||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xA0]+(?:[a-z_$][\w\']*|``[^\r\n\t`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\(\*[\s\S]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], | |||||
["lit",/^[+\-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^(?:[a-z_]\w*[!?#]?|``[^\r\n\t`]*(?:``|$))/i],["pun",/^[^\t\n\r \xA0\"\'\w]+/]]),["fs","ml"]) |
@ -1 +0,0 @@ | |||||
PR.registerLangHandler(PR.sourceDecorator({keywords:"bool bytes default double enum extend extensions false fixed32 fixed64 float group import int32 int64 max message option optional package repeated required returns rpc service sfixed32 sfixed64 sint32 sint64 string syntax to true uint32 uint64",cStyleComments:true}),["proto"]) |
@ -1,2 +0,0 @@ | |||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:(?:""(?:""?(?!")|[^\\"]|\\.)*"{0,3})|(?:[^"\r\n\\]|\\.)*"?))/,null,'"'],["lit",/^`(?:[^\r\n\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&()*+,\-:;<=>?@\[\\\]^{|}~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\r\n\\']|\\(?:'|[^\r\n']+))'/],["lit",/^'[a-zA-Z_$][\w$]*(?!['$\w])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], | |||||
["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:(?:0(?:[0-7]+|X[0-9A-F]+))L?|(?:(?:0|[1-9][0-9]*)(?:(?:\.[0-9]+)?(?:E[+\-]?[0-9]+)?F?|L?))|\\.[0-9]+(?:E[+\-]?[0-9]+)?F?)/i],["typ",/^[$_]*[A-Z][_$A-Z0-9]*[a-z][\w$]*/],["pln",/^[$a-zA-Z_][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]) |
@ -1,2 +0,0 @@ | |||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\r\n]*|\/\*[\s\S]*?(?:\*\/|$))/],["kwd",/^(?:ADD|ALL|ALTER|AND|ANY|AS|ASC|AUTHORIZATION|BACKUP|BEGIN|BETWEEN|BREAK|BROWSE|BULK|BY|CASCADE|CASE|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COMMIT|COMPUTE|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATABASE|DBCC|DEALLOCATE|DECLARE|DEFAULT|DELETE|DENY|DESC|DISK|DISTINCT|DISTRIBUTED|DOUBLE|DROP|DUMMY|DUMP|ELSE|END|ERRLVL|ESCAPE|EXCEPT|EXEC|EXECUTE|EXISTS|EXIT|FETCH|FILE|FILLFACTOR|FOR|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GOTO|GRANT|GROUP|HAVING|HOLDLOCK|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IN|INDEX|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KILL|LEFT|LIKE|LINENO|LOAD|NATIONAL|NOCHECK|NONCLUSTERED|NOT|NULL|NULLIF|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|OPTION|OR|ORDER|OUTER|OVER|PERCENT|PLAN|PRECISION|PRIMARY|PRINT|PROC|PROCEDURE|PUBLIC|RAISERROR|READ|READTEXT|RECONFIGURE|REFERENCES|REPLICATION|RESTORE|RESTRICT|RETURN|REVOKE|RIGHT|ROLLBACK|ROWCOUNT|ROWGUIDCOL|RULE|SAVE|SCHEMA|SELECT|SESSION_USER|SET|SETUSER|SHUTDOWN|SOME|STATISTICS|SYSTEM_USER|TABLE|TEXTSIZE|THEN|TO|TOP|TRAN|TRANSACTION|TRIGGER|TRUNCATE|TSEQUAL|UNION|UNIQUE|UPDATE|UPDATETEXT|USE|USER|VALUES|VARYING|VIEW|WAITFOR|WHEN|WHERE|WHILE|WITH|WRITETEXT)(?=[^\w-]|$)/i, | |||||
null],["lit",/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^[a-z_][\w-]*/i],["pun",/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0+\-\"\']*/]]),["sql"]) |
@ -1,2 +0,0 @@ | |||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})(?:[\"\u201C\u201D]c|$)|[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})*(?:[\"\u201C\u201D]|$))/i,null,'"\u201c\u201d'],["com",/^[\'\u2018\u2019][^\r\n\u2028\u2029]*/,null,"'\u2018\u2019"]],[["kwd",/^(?:AddHandler|AddressOf|Alias|And|AndAlso|Ansi|As|Assembly|Auto|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDbl|CDec|Char|CInt|Class|CLng|CObj|Const|CShort|CSng|CStr|CType|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get|GetType|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|New|Next|Not|NotInheritable|NotOverridable|Object|On|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Preserve|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TypeOf|Unicode|Until|Variant|Wend|When|While|With|WithEvents|WriteOnly|Xor|EndIf|GoSub|Let|Variant|Wend)\b/i, | |||||
null],["com",/^REM[^\r\n\u2028\u2029]*/i],["lit",/^(?:True\b|False\b|Nothing\b|\d+(?:E[+\-]?\d+[FRD]?|[FRDSIL])?|(?:&H[0-9A-F]+|&O[0-7]+)[SIL]?|\d*\.\d+(?:E[+\-]?\d+)?[FRD]?|#\s+(?:\d+[\-\/]\d+[\-\/]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)?|\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*|\[(?:[a-z]|_\w)\w*\])/i],["pun",/^[^\w\t\n\r \"\'\[\]\xA0\u2018\u2019\u201C\u201D\u2028\u2029]+/],["pun",/^(?:\[|\])/]]),["vb","vbs"]) |
@ -1,3 +0,0 @@ | |||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[BOX]?"(?:[^\"]|"")*"|'.')/i],["com",/^--[^\r\n]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, | |||||
null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^\'(?:ACTIVE|ASCENDING|BASE|DELAYED|DRIVING|DRIVING_VALUE|EVENT|HIGH|IMAGE|INSTANCE_NAME|LAST_ACTIVE|LAST_EVENT|LAST_VALUE|LEFT|LEFTOF|LENGTH|LOW|PATH_NAME|POS|PRED|QUIET|RANGE|REVERSE_RANGE|RIGHT|RIGHTOF|SIMPLE_NAME|STABLE|SUCC|TRANSACTION|VAL|VALUE)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w\\.]+#(?:[+\-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:E[+\-]?\d+(?:_\d+)*)?)/i], | |||||
["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0\-\"\']*/]]),["vhdl","vhd"]) |
@ -1,2 +0,0 @@ | |||||
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t \xA0a-gi-z0-9]+/,null,"\t \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[=*~\^\[\]]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^(?:[A-Z][a-z][a-z0-9]+[A-Z][a-z][a-zA-Z0-9]+)\b/],["lang-",/^\{\{\{([\s\S]+?)\}\}\}/],["lang-",/^`([^\r\n`]+)`/],["str",/^https?:\/\/[^\/?#\s]*(?:\/[^?#\s]*)?(?:\?[^#\s]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\s\S])[^#=*~^A-Zh\{`\[\r\n]*/]]),["wiki"]); | |||||
PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]) |
@ -1,2 +0,0 @@ | |||||
PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:|>?]+/,null,":|>?"],["dec",/^%(?:YAML|TAG)[^#\r\n]+/,null,"%"],["typ",/^[&]\S+/,null,"&"],["typ",/^!\S*/,null,"!"],["str",/^"(?:[^\\"]|\\.)*(?:"|$)/,null,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,null,"'"],["com",/^#[^\r\n]*/,null,"#"],["pln",/^\s+/,null," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\r\n]|$)/],["pun",/^-/],["kwd",/^\w+:[ \r\n]/],["pln",/^\w+/]]), | |||||
["yaml","yml"]) |
@ -1 +0,0 @@ | |||||
.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun{color:#660}.pln{color:#000}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec{color:#606}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}@media print{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun{color:#440}.pln{color:#000}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}} |
@ -1,33 +0,0 @@ | |||||
window.PR_SHOULD_USE_CONTINUATION=true;window.PR_TAB_WIDTH=8;window.PR_normalizedHtml=window.PR=window.prettyPrintOne=window.prettyPrint=void 0;window._pr_isIE6=function(){var y=navigator&&navigator.userAgent&&navigator.userAgent.match(/\bMSIE ([678])\./);y=y?+y[1]:false;window._pr_isIE6=function(){return y};return y}; | |||||
(function(){function y(b){return b.replace(L,"&").replace(M,"<").replace(N,">")}function H(b,f,i){switch(b.nodeType){case 1:var o=b.tagName.toLowerCase();f.push("<",o);var l=b.attributes,n=l.length;if(n){if(i){for(var r=[],j=n;--j>=0;)r[j]=l[j];r.sort(function(q,m){return q.name<m.name?-1:q.name===m.name?0:1});l=r}for(j=0;j<n;++j){r=l[j];r.specified&&f.push(" ",r.name.toLowerCase(),'="',r.value.replace(L,"&").replace(M,"<").replace(N,">").replace(X,"""),'"')}}f.push(">"); | |||||
for(l=b.firstChild;l;l=l.nextSibling)H(l,f,i);if(b.firstChild||!/^(?:br|link|img)$/.test(o))f.push("</",o,">");break;case 3:case 4:f.push(y(b.nodeValue));break}}function O(b){function f(c){if(c.charAt(0)!=="\\")return c.charCodeAt(0);switch(c.charAt(1)){case "b":return 8;case "t":return 9;case "n":return 10;case "v":return 11;case "f":return 12;case "r":return 13;case "u":case "x":return parseInt(c.substring(2),16)||c.charCodeAt(1);case "0":case "1":case "2":case "3":case "4":case "5":case "6":case "7":return parseInt(c.substring(1), | |||||
8);default:return c.charCodeAt(1)}}function i(c){if(c<32)return(c<16?"\\x0":"\\x")+c.toString(16);c=String.fromCharCode(c);if(c==="\\"||c==="-"||c==="["||c==="]")c="\\"+c;return c}function o(c){var d=c.substring(1,c.length-1).match(RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g"));c=[];for(var a=[],k=d[0]==="^",e=k?1:0,h=d.length;e<h;++e){var g=d[e];switch(g){case "\\B":case "\\b":case "\\D":case "\\d":case "\\S":case "\\s":case "\\W":case "\\w":c.push(g); | |||||
continue}g=f(g);var s;if(e+2<h&&"-"===d[e+1]){s=f(d[e+2]);e+=2}else s=g;a.push([g,s]);if(!(s<65||g>122)){s<65||g>90||a.push([Math.max(65,g)|32,Math.min(s,90)|32]);s<97||g>122||a.push([Math.max(97,g)&-33,Math.min(s,122)&-33])}}a.sort(function(v,w){return v[0]-w[0]||w[1]-v[1]});d=[];g=[NaN,NaN];for(e=0;e<a.length;++e){h=a[e];if(h[0]<=g[1]+1)g[1]=Math.max(g[1],h[1]);else d.push(g=h)}a=["["];k&&a.push("^");a.push.apply(a,c);for(e=0;e<d.length;++e){h=d[e];a.push(i(h[0]));if(h[1]>h[0]){h[1]+1>h[0]&&a.push("-"); | |||||
a.push(i(h[1]))}}a.push("]");return a.join("")}function l(c){for(var d=c.source.match(RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),a=d.length,k=[],e=0,h=0;e<a;++e){var g=d[e];if(g==="(")++h;else if("\\"===g.charAt(0))if((g=+g.substring(1))&&g<=h)k[g]=-1}for(e=1;e<k.length;++e)if(-1===k[e])k[e]=++n;for(h=e=0;e<a;++e){g=d[e];if(g==="("){++h;if(k[h]===undefined)d[e]="(?:"}else if("\\"=== | |||||
g.charAt(0))if((g=+g.substring(1))&&g<=h)d[e]="\\"+k[h]}for(h=e=0;e<a;++e)if("^"===d[e]&&"^"!==d[e+1])d[e]="";if(c.ignoreCase&&r)for(e=0;e<a;++e){g=d[e];c=g.charAt(0);if(g.length>=2&&c==="[")d[e]=o(g);else if(c!=="\\")d[e]=g.replace(/[a-zA-Z]/g,function(s){s=s.charCodeAt(0);return"["+String.fromCharCode(s&-33,s|32)+"]"})}return d.join("")}for(var n=0,r=false,j=false,q=0,m=b.length;q<m;++q){var t=b[q];if(t.ignoreCase)j=true;else if(/[a-z]/i.test(t.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, | |||||
""))){r=true;j=false;break}}var p=[];q=0;for(m=b.length;q<m;++q){t=b[q];if(t.global||t.multiline)throw Error(""+t);p.push("(?:"+l(t)+")")}return RegExp(p.join("|"),j?"gi":"g")}function Y(b){var f=0;return function(i){for(var o=null,l=0,n=0,r=i.length;n<r;++n)switch(i.charAt(n)){case "\t":o||(o=[]);o.push(i.substring(l,n));l=b-f%b;for(f+=l;l>=0;l-=16)o.push(" ".substring(0,l));l=n+1;break;case "\n":f=0;break;default:++f}if(!o)return i;o.push(i.substring(l));return o.join("")}}function I(b, | |||||
f,i,o){if(f){b={source:f,c:b};i(b);o.push.apply(o,b.d)}}function B(b,f){var i={},o;(function(){for(var r=b.concat(f),j=[],q={},m=0,t=r.length;m<t;++m){var p=r[m],c=p[3];if(c)for(var d=c.length;--d>=0;)i[c.charAt(d)]=p;p=p[1];c=""+p;if(!q.hasOwnProperty(c)){j.push(p);q[c]=null}}j.push(/[\0-\uffff]/);o=O(j)})();var l=f.length;function n(r){for(var j=r.c,q=[j,z],m=0,t=r.source.match(o)||[],p={},c=0,d=t.length;c<d;++c){var a=t[c],k=p[a],e=void 0,h;if(typeof k==="string")h=false;else{var g=i[a.charAt(0)]; | |||||
if(g){e=a.match(g[1]);k=g[0]}else{for(h=0;h<l;++h){g=f[h];if(e=a.match(g[1])){k=g[0];break}}e||(k=z)}if((h=k.length>=5&&"lang-"===k.substring(0,5))&&!(e&&typeof e[1]==="string")){h=false;k=P}h||(p[a]=k)}g=m;m+=a.length;if(h){h=e[1];var s=a.indexOf(h),v=s+h.length;if(e[2]){v=a.length-e[2].length;s=v-h.length}k=k.substring(5);I(j+g,a.substring(0,s),n,q);I(j+g+s,h,Q(k,h),q);I(j+g+v,a.substring(v),n,q)}else q.push(j+g,k)}r.d=q}return n}function x(b){var f=[],i=[];if(b.tripleQuotedStrings)f.push([A,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/, | |||||
null,"'\""]);else b.multiLineStrings?f.push([A,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):f.push([A,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]);b.verbatimStrings&&i.push([A,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);if(b.hashComments)if(b.cStyleComments){f.push([C,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]);i.push([A,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/, | |||||
null])}else f.push([C,/^#[^\r\n]*/,null,"#"]);if(b.cStyleComments){i.push([C,/^\/\/[^\r\n]*/,null]);i.push([C,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}b.regexLiterals&&i.push(["lang-regex",RegExp("^"+Z+"(/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/)")]);b=b.keywords.replace(/^\s+|\s+$/g,"");b.length&&i.push([R,RegExp("^(?:"+b.replace(/\s+/g,"|")+")\\b"),null]);f.push([z,/^\s+/,null," \r\n\t\u00a0"]);i.push([J,/^@[a-z_$][a-z_$@0-9]*/i,null],[S,/^@?[A-Z]+[a-z][A-Za-z_$@0-9]*/, | |||||
null],[z,/^[a-z_$][a-z_$@0-9]*/i,null],[J,/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],[E,/^.[^\s\w\.$@\'\"\`\/\#]*/,null]);return B(f,i)}function $(b){function f(D){if(D>r){if(j&&j!==q){n.push("</span>");j=null}if(!j&&q){j=q;n.push('<span class="',j,'">')}var T=y(p(i.substring(r,D))).replace(e?d:c,"$1 ");e=k.test(T);n.push(T.replace(a,s));r=D}}var i=b.source,o=b.g,l=b.d,n=[],r=0,j=null,q=null,m=0,t=0,p=Y(window.PR_TAB_WIDTH),c=/([\r\n ]) /g, | |||||
d=/(^| ) /gm,a=/\r\n?|\n/g,k=/[ \r\n]$/,e=true,h=window._pr_isIE6();h=h?b.b.tagName==="PRE"?h===6?" \r\n":h===7?" <br>\r":" \r":" <br />":"<br />";var g=b.b.className.match(/\blinenums\b(?::(\d+))?/),s;if(g){for(var v=[],w=0;w<10;++w)v[w]=h+'</li><li class="L'+w+'">';var F=g[1]&&g[1].length?g[1]-1:0;n.push('<ol class="linenums"><li class="L',F%10,'"');F&&n.push(' value="',F+1,'"');n.push(">");s=function(){var D=v[++F%10];return j?"</span>"+D+'<span class="'+j+'">':D}}else s=h; | |||||
for(;;)if(m<o.length?t<l.length?o[m]<=l[t]:true:false){f(o[m]);if(j){n.push("</span>");j=null}n.push(o[m+1]);m+=2}else if(t<l.length){f(l[t]);q=l[t+1];t+=2}else break;f(i.length);j&&n.push("</span>");g&&n.push("</li></ol>");b.a=n.join("")}function u(b,f){for(var i=f.length;--i>=0;){var o=f[i];if(G.hasOwnProperty(o))"console"in window&&console.warn("cannot override language handler %s",o);else G[o]=b}}function Q(b,f){b&&G.hasOwnProperty(b)||(b=/^\s*</.test(f)?"default-markup":"default-code");return G[b]} | |||||
function U(b){var f=b.f,i=b.e;b.a=f;try{var o,l=f.match(aa);f=[];var n=0,r=[];if(l)for(var j=0,q=l.length;j<q;++j){var m=l[j];if(m.length>1&&m.charAt(0)==="<"){if(!ba.test(m))if(ca.test(m)){f.push(m.substring(9,m.length-3));n+=m.length-12}else if(da.test(m)){f.push("\n");++n}else if(m.indexOf(V)>=0&&m.replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,' $1="$2$3$4"').match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/)){var t=m.match(W)[2],p=1,c;c=j+1;a:for(;c<q;++c){var d=l[c].match(W);if(d&& | |||||
d[2]===t)if(d[1]==="/"){if(--p===0)break a}else++p}if(c<q){r.push(n,l.slice(j,c+1).join(""));j=c}else r.push(n,m)}else r.push(n,m)}else{var a;p=m;var k=p.indexOf("&");if(k<0)a=p;else{for(--k;(k=p.indexOf("&#",k+1))>=0;){var e=p.indexOf(";",k);if(e>=0){var h=p.substring(k+3,e),g=10;if(h&&h.charAt(0)==="x"){h=h.substring(1);g=16}var s=parseInt(h,g);isNaN(s)||(p=p.substring(0,k)+String.fromCharCode(s)+p.substring(e+1))}}a=p.replace(ea,"<").replace(fa,">").replace(ga,"'").replace(ha,'"').replace(ia," ").replace(ja, | |||||
"&")}f.push(a);n+=a.length}}o={source:f.join(""),h:r};var v=o.source;b.source=v;b.c=0;b.g=o.h;Q(i,v)(b);$(b)}catch(w){if("console"in window)console.log(w&&w.stack?w.stack:w)}}var A="str",R="kwd",C="com",S="typ",J="lit",E="pun",z="pln",P="src",V="nocode",Z=function(){for(var b=["!","!=","!==","#","%","%=","&","&&","&&=","&=","(","*","*=","+=",",","-=","->","/","/=",":","::",";","<","<<","<<=","<=","=","==","===",">",">=",">>",">>=",">>>",">>>=","?","@","[","^","^=","^^","^^=","{","|","|=","||","||=", | |||||
"~","break","case","continue","delete","do","else","finally","instanceof","return","throw","try","typeof"],f="(?:^^|[+-]",i=0;i<b.length;++i)f+="|"+b[i].replace(/([^=<>:&a-z])/g,"\\$1");f+=")\\s*";return f}(),L=/&/g,M=/</g,N=/>/g,X=/\"/g,ea=/</g,fa=/>/g,ga=/'/g,ha=/"/g,ja=/&/g,ia=/ /g,ka=/[\r\n]/g,K=null,aa=RegExp("[^<]+|<!--[\\s\\S]*?--\>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>|</?[a-zA-Z](?:[^>\"']|'[^']*'|\"[^\"]*\")*>|<","g"),ba=/^<\!--/,ca=/^<!\[CDATA\[/,da=/^<br\b/i,W=/^<(\/?)([a-zA-Z][a-zA-Z0-9]*)/, | |||||
la=x({keywords:"break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename using virtual wchar_t where break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof abstract boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params partial readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof debugger eval export function get null set undefined var with Infinity NaN caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END break continue do else for if return while and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None break continue do else for if return while alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END break continue do else for if return while case done elif esac eval fi function in local set then until ", | |||||
hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true}),G={};u(la,["default-code"]);u(B([],[[z,/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],[C,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[E,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup", | |||||
"htm","html","mxml","xhtml","xml","xsl"]);u(B([[z,/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[E,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i], | |||||
["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);u(B([],[["atv",/^[\s\S]+/]]),["uq.val"]);u(x({keywords:"break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename using virtual wchar_t where ", | |||||
hashComments:true,cStyleComments:true}),["c","cc","cpp","cxx","cyc","m"]);u(x({keywords:"null true false"}),["json"]);u(x({keywords:"break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof abstract boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params partial readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var ", | |||||
hashComments:true,cStyleComments:true,verbatimStrings:true}),["cs"]);u(x({keywords:"break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof abstract boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient ", | |||||
cStyleComments:true}),["java"]);u(x({keywords:"break continue do else for if return while case done elif esac eval fi function in local set then until ",hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);u(x({keywords:"break continue do else for if return while and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None ",hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]); | |||||
u(x({keywords:"caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END ",hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);u(x({keywords:"break continue do else for if return while alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END ",hashComments:true, | |||||
multiLineStrings:true,regexLiterals:true}),["rb"]);u(x({keywords:"break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof debugger eval export function get null set undefined var with Infinity NaN ",cStyleComments:true,regexLiterals:true}),["js"]);u(B([],[[A,/^[\s\S]+/]]), | |||||
["regex"]);window.PR_normalizedHtml=H;window.prettyPrintOne=function(b,f){var i={f:b,e:f};U(i);return i.a};window.prettyPrint=function(b){function f(){for(var t=window.PR_SHOULD_USE_CONTINUATION?j.now()+250:Infinity;q<o.length&&j.now()<t;q++){var p=o[q];if(p.className&&p.className.indexOf("prettyprint")>=0){var c=p.className.match(/\blang-(\w+)\b/);if(c)c=c[1];for(var d=false,a=p.parentNode;a;a=a.parentNode)if((a.tagName==="pre"||a.tagName==="code"||a.tagName==="xmp")&&a.className&&a.className.indexOf("prettyprint")>= | |||||
0){d=true;break}if(!d){a=p;if(null===K){d=document.createElement("PRE");d.appendChild(document.createTextNode('<!DOCTYPE foo PUBLIC "foo bar">\n<foo />'));K=!/</.test(d.innerHTML)}if(K){d=a.innerHTML;if("XMP"===a.tagName)d=y(d);else{a=a;if("PRE"===a.tagName)a=true;else if(ka.test(d)){var k="";if(a.currentStyle)k=a.currentStyle.whiteSpace;else if(window.getComputedStyle)k=window.getComputedStyle(a,null).whiteSpace;a=!k||k==="pre"}else a=true;a||(d=d.replace(/(<br\s*\/?>)[\r\n]+/g,"$1").replace(/(?:[\r\n]+[ \t]*)+/g, | |||||
" "))}d=d}else{d=[];for(a=a.firstChild;a;a=a.nextSibling)H(a,d);d=d.join("")}d=d.replace(/(?:\r\n?|\n)$/,"");m={f:d,e:c,b:p};U(m);if(p=m.a){c=m.b;if("XMP"===c.tagName){d=document.createElement("PRE");for(a=0;a<c.attributes.length;++a){k=c.attributes[a];if(k.specified)if(k.name.toLowerCase()==="class")d.className=k.value;else d.setAttribute(k.name,k.value)}d.innerHTML=p;c.parentNode.replaceChild(d,c)}else c.innerHTML=p}}}}if(q<o.length)setTimeout(f,250);else b&&b()}for(var i=[document.getElementsByTagName("pre"), | |||||
document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],o=[],l=0;l<i.length;++l)for(var n=0,r=i[l].length;n<r;++n)o.push(i[l][n]);i=null;var j=Date;j.now||(j={now:function(){return(new Date).getTime()}});var q=0,m;f()};window.PR={combinePrefixPatterns:O,createSimpleLexer:B,registerLangHandler:u,sourceDecorator:x,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:C,PR_DECLARATION:"dec",PR_KEYWORD:R,PR_LITERAL:J,PR_NOCODE:V,PR_PLAIN:z,PR_PUNCTUATION:E,PR_SOURCE:P,PR_STRING:A, | |||||
PR_TAG:"tag",PR_TYPE:S}})() |
@ -1,211 +0,0 @@ | |||||
<!DOCTYPE html> | |||||
<html lang="en"> | |||||
<head> | |||||
<meta charset="utf-8"> | |||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |||||
<meta name="viewport" content="width=device-width, initial-scale=1"> | |||||
<meta name="description" content=""> | |||||
<meta name="author" content=""> | |||||
<link rel="icon" HREF="favicon.ico"> | |||||
<title>vis.js - A dynamic, browser based visualization library.</title> | |||||
<!-- Bootstrap core CSS --> | |||||
<link href="../css/bootstrap.css" rel="stylesheet"> | |||||
<link href="../css/newdocs.css" rel="stylesheet"> | |||||
<link href="../css/prettify.css" type="text/css" rel="stylesheet" /> | |||||
<script type="text/javascript" src="../js/toggleTable.js"></script> | |||||
<script type="text/javascript" src="../js/googleAnalytics.js"></script> | |||||
<script type="text/javascript" src="../js/prettify/prettify.js"></script> | |||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> | |||||
<!--[if lt IE 9]> | |||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> | |||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> | |||||
<![endif]--> | |||||
<script src="../js/smooth-scroll.min.js"></script> | |||||
<script language="JavaScript"> | |||||
smoothScroll.init(); | |||||
</script> | |||||
</head> | |||||
<!-- NAVBAR | |||||
================================================== --> | |||||
<body onload="prettyPrint();"> | |||||
<div class="navbar-wrapper"> | |||||
<div class="container"> | |||||
<nav class="navbar navbar-inverse navbar-static-top" role="navigation"> | |||||
<div class="container"> | |||||
<div class="navbar-header"> | |||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" | |||||
aria-expanded="false" aria-controls="navbar"> | |||||
<span class="sr-only">Toggle navigation</span> | |||||
<span class="icon-bar"></span> | |||||
<span class="icon-bar"></span> | |||||
<span class="icon-bar"></span> | |||||
</button> | |||||
<a class="navbar-brand hidden-sm" href="./index.html">vis.js</a> | |||||
</div> | |||||
<div id="navbar" class="navbar-collapse collapse"> | |||||
<ul class="nav navbar-nav"> | |||||
<li><a href="../index.html#modules">Modules</a></li> | |||||
<li><a href="../blog.html">Blog</a></li> | |||||
<li><a href="../index.html#download_install">Download</a></li> | |||||
<li><a href="../showcase/index.html">Showcase</a></li> | |||||
<li><a href="../index.html#contribute">Contribute</a></li> | |||||
<li><a href="../featureRequests.html">Feature requests</a></li> | |||||
<li><a href="../index.html#licenses">License</a></li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
</nav> | |||||
</div> | |||||
</div> | |||||
<a href="https://github.com/almende/vis" class="hidden-xs hidden-sm hidden-md"><img | |||||
style="position: absolute; top: 0; right: 0; border: 0;" | |||||
src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" | |||||
alt="Fork me on GitHub" | |||||
data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a> | |||||
<div class="container full"> | |||||
<h1>Network - canvas</h1> | |||||
<p>Handles the HTML part of the canvas.</p> | |||||
<h3>Options</h3> | |||||
<p>The options for the canvas have to be contained in an object titled 'canvas'.</p> | |||||
<p>Click on the options shown to show how these options are supposed to be used.</p> | |||||
<ul class="nav nav-tabs"> | |||||
<li role="presentation" class="active" onclick="hideOptions('fullTab','fullOptions');" id="hiddenTab"><a href="#">options hidden</a></li> | |||||
<li role="presentation" onclick="toggleTab('fullTab','fullOptions');" id="fullTab"><a href="#">options shown</a></li> | |||||
</ul> | |||||
<br> | |||||
<pre class="prettyprint lang-js options hidden" id="fullOptions"> | |||||
var options = { | |||||
canvas:{ | |||||
width:'100%', // other format: '400px' | |||||
height:'100%', | |||||
autoResize: true | |||||
} | |||||
} | |||||
network.setOptions(options); | |||||
</pre> | |||||
<p>All of the individual options are explained here:</p> | |||||
<table> | |||||
<tr class="header"> | |||||
<td class="name">name</td> | |||||
<td class="type">type</td> | |||||
<td class="default">default</td> | |||||
<td class="description">description</td> | |||||
</tr> | |||||
<tr> | |||||
<td>width</td> | |||||
<td class="mid">String</td> | |||||
<td class="mid"><code>'100%'</code></td> | |||||
<td>the width of the canvas. Can be in percentages or pixels (ie. <code>'400px'</code>).</td> | |||||
</tr> | |||||
<tr> | |||||
<td>height</td> | |||||
<td class="mid">String</td> | |||||
<td class="mid"><code>'100%'</code></td> | |||||
<td>the height of the canvas. Can be in percentages or pixels (ie. <code>'400px'</code>).</td> | |||||
</tr> | |||||
<tr> | |||||
<td>autoResize</td> | |||||
<td class="mid">Boolean</td> | |||||
<td class="mid"><code>true</code></td> | |||||
<td>If true, the Network will automatically detect when its container is resized, and redraw itself | |||||
accordingly. If false, the Network can be forced to repaint after its container has been resized | |||||
using the function redraw() and setSize().</td> | |||||
</tr> | |||||
</table> | |||||
<h3>Methods</h3> | |||||
<p>This is a list of all the methods in the public API. Options can be set directly to the module or you can use the | |||||
setOptions method of the network itself and use the module name as an object name.</p> | |||||
<table> | |||||
<tr class="header"> | |||||
<td class="methodName">name</td> | |||||
<td>returns</td> | |||||
<td>description</td> | |||||
</tr> | |||||
<tr> | |||||
<td>setSize(<br> <code><i>String width</i></code>,<br> <code><i>String | |||||
height</i></code><br>) | |||||
</td> | |||||
<td class="mid">none</td> | |||||
<td>Set the size of the canvas. This is automatically done on a window resize.</td> | |||||
</tr> | |||||
<tr> | |||||
<td>canvasToDOM({<br> <code><i>x: Number</i></code>,<br> <code><i>y: | |||||
Number</i></code><br>}) | |||||
</td> | |||||
<td class="mid">Object</td> | |||||
<td>This function converts canvas coordinates to coordinates on the DOM. Input and output are in the form of | |||||
<code>{x:Number,y:Number}</code>. The DOM values are relative to the network container. | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>DOMtoCanvas({<br> <code><i>x: Number</i></code>,<br> <code><i>y: | |||||
Number</i></code><br>}) | |||||
</td> | |||||
<td class="mid">Object</td> | |||||
<td>This function converts DOM coordinates to coordinates on the canvas. Input and output are in the form of | |||||
<code>{x:Number,y:Number}</code>. The DOM values are relative to the network container. | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
<h3>Events</h3> | |||||
<p>This is a list of all the events in the public API. They are collected here from all individual modules.</p> | |||||
<table> | |||||
<tr class="header"> | |||||
<td class="eventName">name</td> | |||||
<td class="eventProperties">properties</td> | |||||
<td>description</td> | |||||
</tr> | |||||
<tr> | |||||
<td>resize</td> | |||||
<td class="mid"> | |||||
<pre class="code"> | |||||
{ | |||||
width: Number // the new width of the canvas | |||||
height: Number // the new height of the canvas | |||||
oldWidth: Number // the old width of the canvas | |||||
oldHeight: Number // the old height of the canvas | |||||
} | |||||
</pre> | |||||
<ul> | |||||
</ul> | |||||
</td> | |||||
<td>Fired when the size of the canvas has been resized, either by a redraw call when the container div has | |||||
changed in size, a setSize() call with new values or a setOptions() with new width and/or height values. | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
<br/> | |||||
<br/> | |||||
<br/> | |||||
<br/> | |||||
<br/> | |||||
<br/> | |||||
<br/> | |||||
</div> | |||||
<!-- Bootstrap core JavaScript | |||||
================================================== --> | |||||
<!-- Placed at the end of the document so the pages load faster --> | |||||
<script src="../js/jquery.min.js"></script> | |||||
<script src="../js/bootstrap.min.js"></script> | |||||
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> | |||||
<script src="../js/ie10-viewport-bug-workaround.js"></script> |
@ -1,182 +0,0 @@ | |||||
<!DOCTYPE html> | |||||
<html lang="en"><head> | |||||
<meta charset="utf-8"> | |||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |||||
<meta name="viewport" content="width=device-width, initial-scale=1"> | |||||
<meta name="description" content=""> | |||||
<meta name="author" content=""> | |||||
<link rel="icon" HREF="favicon.ico"> | |||||
<title>vis.js - A dynamic, browser based visualization library.</title> | |||||
<!-- Bootstrap core CSS --> | |||||
<link href="../css/bootstrap.css" rel="stylesheet"> | |||||
<link href="../css/newdocs.css" rel="stylesheet"> | |||||
<link href="../css/prettify.css" type="text/css" rel="stylesheet" /> | |||||
<script type="text/javascript" src="../js/googleAnalytics.js"></script> | |||||
<script type="text/javascript" src="../js/prettify/prettify.js"></script> | |||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> | |||||
<!--[if lt IE 9]> | |||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> | |||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> | |||||
<![endif]--> | |||||
<script src="../js/smooth-scroll.min.js"></script> | |||||
<script language="JavaScript"> | |||||
smoothScroll.init(); | |||||
</script> | |||||
<style> | |||||
td.properties { | |||||
width:350px; | |||||
} | |||||
td.name { | |||||
width:180px; | |||||
} | |||||
</style> | |||||
</head> | |||||
<!-- NAVBAR | |||||
================================================== --> | |||||
<body onload="prettyPrint();"> | |||||
<div class="navbar-wrapper"> | |||||
<div class="container"> | |||||
<nav class="navbar navbar-inverse navbar-static-top" role="navigation"> | |||||
<div class="container"> | |||||
<div class="navbar-header"> | |||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> | |||||
<span class="sr-only">Toggle navigation</span> | |||||
<span class="icon-bar"></span> | |||||
<span class="icon-bar"></span> | |||||
<span class="icon-bar"></span> | |||||
</button> | |||||
<a class="navbar-brand hidden-sm" href="./index.html">vis.js</a> | |||||
</div> | |||||
<div id="navbar" class="navbar-collapse collapse"> | |||||
<ul class="nav navbar-nav"> | |||||
<li><a href="../index.html#modules">Modules</a></li> | |||||
<li><a href="../blog.html">Blog</a></li> | |||||
<li><a href="../index.html#download_install">Download</a></li> | |||||
<li><a href="../showcase/index.html">Showcase</a></li> | |||||
<li><a href="../index.html#contribute">Contribute</a></li> | |||||
<li><a href="../featureRequests.html">Feature requests</a></li> | |||||
<li><a href="../index.html#licenses">License</a></li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
</nav> | |||||
</div> | |||||
</div> | |||||
<a href="https://github.com/almende/vis" class="hidden-xs hidden-sm hidden-md"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a> | |||||
<div class="container full"> | |||||
<h1>Network - clustering</h1> | |||||
<p>Handles the HTML part of the canvas.</p> | |||||
<h3>Options</h3> | |||||
<p>Clustering has no options, everything is done with methods.</p> | |||||
<h3>Methods</h3> | |||||
<p>This is a list of all the methods in the public API. Options can be set directly to the module or you can use the setOptions method of the network itself and use the module name as an object name.</p> | |||||
<table> | |||||
<tr class="header"><td class="name">name</td><td>returns</td><td>description</td></tr> | |||||
<tr><td>findNode(<br> | |||||
<code>String nodeId</code><br>)</td> <td class="mid">Array</td> <td>Nodes can be in clusters. Clusters can also be in clusters. This function returns and array of nodeIds showing where the node is. Example: <br> | |||||
cluster 'A' contains cluster 'B',<br> | |||||
cluster 'B' contains cluster 'C',<br> | |||||
cluster 'C' contains node 'fred'.<br> | |||||
<code>network.clustering.findNode('fred')</code> will return <code>['A','B','C','fred']</code>. | |||||
</td></tr> | |||||
<tr><td>isCluster(<br> | |||||
<code>String nodeId</code><br>)</td> <td class="mid">Boolean</td> <td>Returns true if the node whose ID has been supplied is a cluster.</td></tr> | |||||
<tr><td>openCluster(<br> | |||||
<code>String nodeId</code><br>)</td> <td class="mid">none</td> <td>Opens the cluster, releases the contained nodes and edges, removing the cluster node and cluster edges.</td></tr> | |||||
<tr><td>cluster(<br> | |||||
<code>Object options</code><br>)</td> <td class="mid">none</td> <td>The options object is explained in full <a data-scroll="" data-options="{ "easing": "easeInCubic" }" href="#optionsObject">below</a>. The joinCondition function is presented with all nodes.</td></tr> | |||||
<tr><td>clusterByConnection(<br> | |||||
<code>String nodeId</code>,<br> | |||||
<code>[Object options]</code><br> | |||||
)</td> <td class="mid">none</td> <td>This method looks at the provided node and makes a cluster of it and all it's connected nodes. The behaviour can be customized by proving the options object. All options of this object are explained <a data-scroll="" data-options="{ "easing": "easeInCubic" }" href="#optionsObject">below</a>. The joinCondition is only presented with the connected nodes.</td></tr> | |||||
<tr><td>clusterByHubsize(<br> | |||||
<code>Number hubsize</code>,<br> | |||||
<code>[Object options]</code><br>)</td><td class="mid">none</td> <td>This method checks all nodes in the network and those with a equal or higher amount of edges than specified with the <code>hubsize</code> qualify. Cluster by connection is performed on each of them. The options object is described for <code>clusterByConnection</code> and does the same here.</td></tr> | |||||
<tr><td>clusterOutliers(<br> | |||||
<code>[Object options]</code><br>)</td><td class="mid">none</td> <td>This method will cluster all nodes with 1 edge with their respective connected node.</td></tr> | |||||
</table> | |||||
<br> | |||||
<h4 id="optionsObject">Cluster options object</h4> | |||||
<p>The options object supplied to the cluster functions can contain these properties:</p> | |||||
<table> | |||||
<tr class="header"><td class="name">name</td><td>Type</td><td>description</td></tr> | |||||
<tr><td>joinCondition(<br> <code>Object nodeOptions</code><br>)</td> <td class="mid">Function</td> | |||||
<td><i>Optional for all but the cluster method. </i> The cluster module loops over all nodes that are selected to be in the cluster and calls this function with their data as argument. | |||||
If this function returns true, this node will be added to the cluster. You have access to all options (including the default) | |||||
as well as any custom fields you may have added to the node to determine whether or not to include it in the cluster. Example: | |||||
<pre class="prettyprint lang-js"> | |||||
var nodes = [ | |||||
{id: 4, label: 'Node 4'}, | |||||
{id: 5, label: 'Node 5'}, | |||||
{id: 6, label: 'Node 6', cid:1}, | |||||
{id: 7, label: 'Node 7', cid:1} | |||||
] | |||||
var options = { | |||||
joinCondition:function(nodeOptions) { | |||||
return nodeOptions.cid === 1; | |||||
} | |||||
} | |||||
network.clustering.cluster(options); | |||||
</pre></td></tr> | |||||
<tr><td>processProperties(<br> <code>Object nodeOptions</code><br>)</td> <td class="mid">Function</td> <td><i>Optional. </i> Before creating the new cluster node, this (optional) function will be called with the properties supplied by you (<code>clusterNodeProperties</code>), all contained nodes and all contained edges. You can use this to update the | |||||
properties of the cluster based on which items it contains. The function should return the properties to create the cluster node. In the example below, we ensure preservation of mass and value when forming the cluster: | |||||
<pre class="prettyprint lang-js"> | |||||
var options = { | |||||
processProperties: function (clusterOptions, childNodes, childEdges) { | |||||
var totalMass = 0; | |||||
var totalValue = 0; | |||||
for (var i = 0; i < childNodes.length; i++) { | |||||
totalMass += childNodes[i].mass; | |||||
totalValue = childNodes[i].value ? totalValue + childNodes[i].value : totalValue; | |||||
} | |||||
clusterOptions.mass = totalMass; | |||||
if (totalValue > 0) { | |||||
clusterOptions.value = totalValue; | |||||
} | |||||
return clusterOptions; | |||||
}, | |||||
} | |||||
</pre></td></tr> | |||||
<tr><td>clusterNodeProperties</td> <td class="mid">Object</td> <td><i>Optional. </i> This is an object containing the options for the cluster node. All options described in the <a href="./nodes.html">nodes module</a> are allowed. This allows you to style your cluster node any way you want. This is also the style object that is provided in the processProperties function for fine tuning. If undefined, default node options will be used.</td></tr> | |||||
<tr><td>clusterEdgeProperties</td> <td class="mid">Object</td> <td><i>Optional. </i> This is an object containing the options for the edges connected to the cluster. All options described in the <a href="./edges.html">edges module</a> are allowed. Using this, you can style the edges connecting to the cluster any way you want. If none are provided, the optoins from the edges that are replaced are used. If undefined, default edge options will be used.</td></tr> | |||||
</table> | |||||
<p> | |||||
</p> | |||||
<br><br> | |||||
<h3>Events</h3> | |||||
<p>The clustering module does not have any events.</p> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
</div> | |||||
<!-- Bootstrap core JavaScript | |||||
================================================== --> | |||||
<!-- Placed at the end of the document so the pages load faster --> | |||||
<script src="../js/jquery.min.js"></script> | |||||
<script src="../js/bootstrap.min.js"></script> | |||||
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> | |||||
<script src="../js/ie10-viewport-bug-workaround.js"></script> |
@ -1,127 +0,0 @@ | |||||
<!DOCTYPE html> | |||||
<html lang="en"><head> | |||||
<meta charset="utf-8"> | |||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |||||
<meta name="viewport" content="width=device-width, initial-scale=1"> | |||||
<meta name="description" content=""> | |||||
<meta name="author" content=""> | |||||
<link rel="icon" HREF="favicon.ico"> | |||||
<title>vis.js - A dynamic, browser based visualization library.</title> | |||||
<!-- Bootstrap core CSS --> | |||||
<link href="../css/bootstrap.css" rel="stylesheet"> | |||||
<link href="../css/newdocs.css" rel="stylesheet"> | |||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> | |||||
<!--[if lt IE 9]> | |||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> | |||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> | |||||
<![endif]--> | |||||
<link href="../css/prettify.css" type="text/css" rel="stylesheet"/> | |||||
<script type="text/javascript" src="../js/googleAnalytics.js"></script> | |||||
<script type="text/javascript" src="../js/prettify/prettify.js"></script> | |||||
<script src="../js/smooth-scroll.min.js"></script> | |||||
<script language="JavaScript"> | |||||
smoothScroll.init(); | |||||
</script> | |||||
<script type="text/javascript" src="../js/toggleTable.js"></script> | |||||
</head> | |||||
<body onload="prettyPrint();"> | |||||
<div class="navbar-wrapper"> | |||||
<div class="container"> | |||||
<nav class="navbar navbar-inverse navbar-static-top" role="navigation"> | |||||
<div class="container"> | |||||
<div class="navbar-header"> | |||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" | |||||
aria-expanded="false" aria-controls="navbar"> | |||||
<span class="sr-only">Toggle navigation</span> | |||||
<span class="icon-bar"></span> | |||||
<span class="icon-bar"></span> | |||||
<span class="icon-bar"></span> | |||||
</button> | |||||
<a class="navbar-brand hidden-sm" href="./index.html">vis.js</a> | |||||
</div> | |||||
<div id="navbar" class="navbar-collapse collapse"> | |||||
<ul class="nav navbar-nav"> | |||||
<li><a href="http://www.visjs.org/index.html#modules">Modules</a></li> | |||||
<li><a href="http://www.visjs.org/blog.html">Blog</a></li> | |||||
<li><a href="http://www.visjs.org/index.html#download_install">Download</a></li> | |||||
<li><a href="http://www.visjs.org/showcase/index.html">Showcase</a></li> | |||||
<li><a href="http://www.visjs.org/index.html#contribute">Contribute</a></li> | |||||
<li><a href="http://www.visjs.org/featureRequests.html">Feature requests</a></li> | |||||
<li><a href="http://www.visjs.org/index.html#licenses">License</a></li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
</nav> | |||||
</div> | |||||
</div> | |||||
<a href="https://github.com/almende/vis" class="hidden-xs hidden-sm hidden-md"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a> | |||||
<div class="container full"> | |||||
<h1>Network - rendering</h1> | |||||
<p>Handles the rendering aspect of vis. It governs the render loop, it draws the nodes and edges and provides events to allow users to hook into the drawing.</p> | |||||
<h3>Options</h3> | |||||
<p>The options for the rendering have to be contained in an object titled 'rendering'.</p> | |||||
<p>Click on the options shown to show how these options are supposed to be used.</p> | |||||
<ul class="nav nav-tabs"> | |||||
<li role="presentation" class="active" onclick="hideOptions('fullTab','fullOptions');" id="hiddenTab"><a href="#">options hidden</a></li> | |||||
<li role="presentation" onclick="toggleTab('fullTab','fullOptions');" id="fullTab"><a href="#">options shown</a></li> | |||||
</ul> | |||||
<br> | |||||
<pre class="prettyprint lang-js options hidden" id="fullOptions"> | |||||
var options = { | |||||
rendering:{ | |||||
hideEdgesOnDrag: true, | |||||
hideNodesOnDrag: false | |||||
} | |||||
} | |||||
network.setOptions(options); | |||||
</pre> | |||||
<p>All of the individual options are explained here:</p> | |||||
<table> | |||||
<tr class="header"><td>name</td><td>type</td><td>default</td><td>description</td></tr> | |||||
<tr><td>hideEdgesOnDrag</td><td class="mid">Boolean</td><td class="mid"><code>false</code></td><td>When true, the edges are not drawn when dragging the view. This can greatly speed up responsiveness on dragging, improving user experience.</td></tr> | |||||
<tr><td>hideNodesOnDrag</td><td class="mid">Boolean</td><td class="mid"><code>false</code></td><td>When true, the nodes are not drawn when dragging the view. This can greatly speed up responsiveness on dragging, improving user experience.</td></tr> | |||||
</table> | |||||
<h3>Methods</h3> | |||||
<p>This is a list of all the methods in the public API. Options can be set directly to the module or you can use the setOptions method of the network itself and use the module name as an object name.</p> | |||||
<table> | |||||
<tr class="header"><td>name</td><td>returns</td><td>description</td></tr> | |||||
<tr><td>redraw()</td><td class="mid">none</td><td>Redraw the network.</td></tr> | |||||
</table> | |||||
<h3>Events</h3> | |||||
<p>These events are fired by the renderer and can be used to move and draw custom elements on the same canvas as the rest of the network.</p> | |||||
<table> | |||||
<tr class="header"><td>name</td><td class="properties">properties</td><td>description</td></tr> | |||||
<tr><td>initRedraw</td><td class="mid">none</td><td>Fired before the redrawing begins. The simulation step has completed at this point. Can be used to move custom elements before starting drawing the new frame.</td> | |||||
<tr><td>beforeDrawing</td><td class="mid"><code>canvas context</code></td><td>Fired after the canvas has been cleared, scaled and translated to the viewing position but before all edges and nodes are drawn. Can be used to draw behind the network.</td> | |||||
<tr><td>initRedraw</td><td class="mid"><code>canvas context</code></td><td>Fired after drawing on the canvas has been completed. Can be used to draw on top of the network.</td></tr> | |||||
</table> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
</div> | |||||
<!-- Bootstrap core JavaScript | |||||
================================================== --> | |||||
<!-- Placed at the end of the document so the pages load faster --> | |||||
<script src="../js/jquery.min.js"></script> | |||||
<script src="../js/bootstrap.min.js"></script> | |||||
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> | |||||
<script src="../js/ie10-viewport-bug-workaround.js"></script> |
@ -1,135 +0,0 @@ | |||||
<!DOCTYPE html> | |||||
<html lang="en"> | |||||
<head> | |||||
<meta charset="utf-8"> | |||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |||||
<meta name="viewport" content="width=device-width, initial-scale=1"> | |||||
<meta name="description" content=""> | |||||
<meta name="author" content=""> | |||||
<link rel="icon" HREF="favicon.ico"> | |||||
<title>vis.js - A dynamic, browser based visualization library.</title> | |||||
<!-- Bootstrap core CSS --> | |||||
<link href="../css/bootstrap.css" rel="stylesheet"> | |||||
<link href="../css/newdocs.css" rel="stylesheet"> | |||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> | |||||
<!--[if lt IE 9]> | |||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> | |||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> | |||||
<![endif]--> | |||||
<link href="../css/prettify.css" type="text/css" rel="stylesheet"/> | |||||
<script type="text/javascript" src="../js/googleAnalytics.js"></script> | |||||
<script type="text/javascript" src="../js/prettify/prettify.js"></script> | |||||
<script src="../js/smooth-scroll.min.js"></script> | |||||
<script language="JavaScript"> | |||||
smoothScroll.init(); | |||||
</script> | |||||
<script type="text/javascript" src="../js/toggleTable.js"></script> | |||||
</head> | |||||
<body onload="prettyPrint();"> | |||||
<div class="navbar-wrapper"> | |||||
<div class="container"> | |||||
<nav class="navbar navbar-inverse navbar-static-top" role="navigation"> | |||||
<div class="container"> | |||||
<div class="navbar-header"> | |||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" | |||||
aria-expanded="false" aria-controls="navbar"> | |||||
<span class="sr-only">Toggle navigation</span> | |||||
<span class="icon-bar"></span> | |||||
<span class="icon-bar"></span> | |||||
<span class="icon-bar"></span> | |||||
</button> | |||||
<a class="navbar-brand hidden-sm" href="./index.html">vis.js</a> | |||||
</div> | |||||
<div id="navbar" class="navbar-collapse collapse"> | |||||
<ul class="nav navbar-nav"> | |||||
<li><a href="http://www.visjs.org/index.html#modules">Modules</a></li> | |||||
<li><a href="http://www.visjs.org/blog.html">Blog</a></li> | |||||
<li><a href="http://www.visjs.org/index.html#download_install">Download</a></li> | |||||
<li><a href="http://www.visjs.org/showcase/index.html">Showcase</a></li> | |||||
<li><a href="http://www.visjs.org/index.html#contribute">Contribute</a></li> | |||||
<li><a href="http://www.visjs.org/featureRequests.html">Feature requests</a></li> | |||||
<li><a href="http://www.visjs.org/index.html#licenses">License</a></li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
</nav> | |||||
</div> | |||||
</div> | |||||
<a href="https://github.com/almende/vis" class="hidden-xs hidden-sm hidden-md"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a> | |||||
<div class="container full"> | |||||
<h1>Network - selection</h1> | |||||
<p>Handles the selection of nodes and edges.</p> | |||||
<h3>Options</h3> | |||||
<p>The options for the selection have to be contained in an object titled 'selection'.</p> | |||||
<p>Click on the options shown to show how these options are supposed to be used.</p> | |||||
<ul class="nav nav-tabs"> | |||||
<li role="presentation" class="active" onclick="hideOptions('fullTab','fullOptions');" id="hiddenTab"><a href="#">options hidden</a></li> | |||||
<li role="presentation" onclick="toggleTab('fullTab','fullOptions');" id="fullTab"><a href="#">options shown</a></li> | |||||
</ul> | |||||
<br> | |||||
<pre class="prettyprint lang-js options hidden" id="fullOptions"> | |||||
var options = { | |||||
selection:{ | |||||
selectable: true, | |||||
selectConnectedEdges: false | |||||
} | |||||
} | |||||
network.setOptions(options); | |||||
</pre> | |||||
<p>All of the individual options are explained here:</p> | |||||
<table> | |||||
<tr class="header"><td>name</td><td>type</td><td>default</td><td>description</td></tr> | |||||
<tr><td>selectable</td> <td class="mid">Boolean</td><td class="mid"><code>true</code></td><td>When true, the nodes and edges can be selected by the user.</td></tr> | |||||
<tr><td>selectConnectedEdges</td> <td class="mid">Boolean</td><td class="mid"><code>true</code></td><td>When true, on selecting a node, its connecting edges are highlighted.</td></tr> | |||||
</table> | |||||
<h3>Methods</h3> | |||||
<p>This is a list of all the methods in the public API. Options can be set directly to the module or you can use the setOptions method of the network itself and use the module name as an object name.</p> | |||||
<table> | |||||
<tr class="header"><td class="methodName">name</td><td>returns</td><td>description</td></tr> | |||||
<tr><td>getSelection()</td> <td class="mid"> | |||||
<pre class="code"> | |||||
{ | |||||
nodes: [Array of selected nodeIds], | |||||
edges: [Array of selected edgeIds] | |||||
}</pre> </td><td>Returns an object with selected nodes and edges ids.</td></tr> | |||||
<tr><td>getSelectedNodes()</td> <td class="mid"><code>[nodeId1, nodeId2, ..]</code></td><td>Returns an array of selected node ids.</td></tr> | |||||
<tr><td>getSelectedEdges()</td> <td class="mid"><code>[edgeId1, edgeId2, ..]</code></td><td>Returns an array of selected edge ids.</td></tr> | |||||
<tr><td>getNodeAt(<br> <code><i>{x: xPosition DOM,<br> y: yPosition DOM}</i></code><br>)</td> <td class="mid">nodeId</td><td>Returns a nodeId or undefined. The DOM positions are expected to be in pixels from the top left corner of the canvas.</td></tr> | |||||
<tr><td>getEdgeAt(<br> <code><i>{x: xPosition DOM,<br> y: yPosition DOM}</i></code><br>)</td> <td class="mid">edgeId</code></td><td>Returns a edgeId or undefined. The DOM positions are expected to be in pixels from the top left corner of the canvas..</td></tr> | |||||
<tr><td>selectNodes(<br> <code><i>Array with nodeIds</i></code>,<br> <code><i>[Boolean highlightEdges]</i></code><br>)</td> <td class="mid">none</td><td>Selects the nodes corresponding to the id's in the input array. If highlightEdges is true or undefined, the neighbouring edges will also be selected. This method unselects all other objects before selecting its own objects. <i>Does not fire events</i>.</td></tr> | |||||
<tr><td>selectEdges(<br> <code><i>Array with edgeIds</i></code><br>)</td> <td class="mid">none</td><td>Selects the edges corresponding to the id's in the input array. This method unselects all other objects before selecting its own objects. <i>Does not fire events</i>.</td></tr> | |||||
<tr><td>unselectAll()</td> <td class="mid">none</td> <td>Unselect all objects. <i>Does not fire events</i>.</td></tr> | |||||
</table> | |||||
<h3>Events</h3> | |||||
<p>The selection handler does not fire events. All related events are fired by the <a href="./interaction.html">interaction module</a> because they are triggered by user interaction.</p> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
</div> | |||||
<!-- Bootstrap core JavaScript | |||||
================================================== --> | |||||
<!-- Placed at the end of the document so the pages load faster --> | |||||
<script src="../js/jquery.min.js"></script> | |||||
<script src="../js/bootstrap.min.js"></script> | |||||
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> | |||||
<script src="../js/ie10-viewport-bug-workaround.js"></script> |
@ -1,161 +0,0 @@ | |||||
<!DOCTYPE html> | |||||
<html lang="en"><head> | |||||
<meta charset="utf-8"> | |||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |||||
<meta name="viewport" content="width=device-width, initial-scale=1"> | |||||
<meta name="description" content=""> | |||||
<meta name="author" content=""> | |||||
<link rel="icon" HREF="favicon.ico"> | |||||
<title>vis.js - A dynamic, browser based visualization library.</title> | |||||
<!-- Bootstrap core CSS --> | |||||
<link href="../css/bootstrap.css" rel="stylesheet"> | |||||
<link href="../css/newdocs.css" rel="stylesheet"> | |||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> | |||||
<!--[if lt IE 9]> | |||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> | |||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> | |||||
<![endif]--> | |||||
<link href="../css/prettify.css" type="text/css" rel="stylesheet"/> | |||||
<script type="text/javascript" src="../js/googleAnalytics.js"></script> | |||||
<script type="text/javascript" src="../js/prettify/prettify.js"></script> | |||||
<script src="../js/smooth-scroll.min.js"></script> | |||||
<script language="JavaScript"> | |||||
smoothScroll.init(); | |||||
</script> | |||||
<script type="text/javascript" src="../js/toggleTable.js"></script> | |||||
</head> | |||||
<body onload="prettyPrint();"> | |||||
<div class="navbar-wrapper"> | |||||
<div class="container"> | |||||
<nav class="navbar navbar-inverse navbar-static-top" role="navigation"> | |||||
<div class="container"> | |||||
<div class="navbar-header"> | |||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" | |||||
aria-expanded="false" aria-controls="navbar"> | |||||
<span class="sr-only">Toggle navigation</span> | |||||
<span class="icon-bar"></span> | |||||
<span class="icon-bar"></span> | |||||
<span class="icon-bar"></span> | |||||
</button> | |||||
<a class="navbar-brand hidden-sm" href="./index.html">vis.js</a> | |||||
</div> | |||||
<div id="navbar" class="navbar-collapse collapse"> | |||||
<ul class="nav navbar-nav"> | |||||
<li><a href="http://www.visjs.org/index.html#modules">Modules</a></li> | |||||
<li><a href="http://www.visjs.org/blog.html">Blog</a></li> | |||||
<li><a href="http://www.visjs.org/index.html#download_install">Download</a></li> | |||||
<li><a href="http://www.visjs.org/showcase/index.html">Showcase</a></li> | |||||
<li><a href="http://www.visjs.org/index.html#contribute">Contribute</a></li> | |||||
<li><a href="http://www.visjs.org/featureRequests.html">Feature requests</a></li> | |||||
<li><a href="http://www.visjs.org/index.html#licenses">License</a></li> | |||||
</ul> | |||||
</div> | |||||
</div> | |||||
</nav> | |||||
</div> | |||||
</div> | |||||
<a href="https://github.com/almende/vis" class="hidden-xs hidden-sm hidden-md"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a> | |||||
<div class="container full"> | |||||
<h1>Network - view</h1> | |||||
<p>Acts as the camera that looks on the canvas. Does the animation, zooming and focusing.</p> | |||||
<h3>Options</h3> | |||||
<p>The view has no options.</p> | |||||
<h3>Methods</h3> | |||||
<p>This is a list of all the methods in the public API. Options can be set directly to the module or you can use the setOptions method of the network itself and use the module name as an object name.</p> | |||||
<table> | |||||
<tr class="header"><td class="methodName">name</td><td>returns</td><td>description</td></tr> | |||||
<tr><td>getScale()</td> <td class="mid">Number</td><td>Returns the current scale of the network. 1.0 is comparible to 100%, 0 is zoomed out infinitely.</td></tr> | |||||
<tr><td>getPosition()</td> <td class="mid">Number</td><td>Returns the current central focus point of the camera.</td></tr> | |||||
<tr><td>fit(<code>[Object options]</code>)</td><td class="mid">none</td><td>Zooms out so all nodes fit on the canvas. You can supply options to customize this: | |||||
<pre class="code"> | |||||
{ | |||||
nodes:[Array of nodeIds], | |||||
animation: { // -------------------> can be a boolean too! | |||||
duration: Number | |||||
easingFunction: String | |||||
} | |||||
} | |||||
</pre> | |||||
The nodes can be used to zoom to fit only specific nodes in the view. <br /><br /> | |||||
The other options are explained in the <code>moveTo()</code> description below. | |||||
All options are optional for the fit method. | |||||
</td></tr> | |||||
<tr><td>focus(<br> | |||||
<code>String nodeId</code>,<br> | |||||
<code>[Object options]</code><br>)</td><td class="mid">none</td> | |||||
<td>You can focus on a node with this function. What that means is the view will lock onto that node, if it is moving, the view will also move accordingly. If the view is dragged by the user, the focus is broken. | |||||
You can supply options to customize the effect: | |||||
<pre class="code"> | |||||
{ | |||||
scale: Number, | |||||
offset: {x:Number, y:Number} | |||||
locked: boolean | |||||
animation: { // -------------------> can be a boolean too! | |||||
duration: Number | |||||
easingFunction: String | |||||
} | |||||
} | |||||
</pre> | |||||
All options except for locked are explained in the <code>moveTo()</code> description below. Locked denotes whether or not the view remains locked to the node once the zoom-in animation is finished. Default value is true. The options object is optional in the focus method.</td></tr> | |||||
<tr><td>moveTo(<code>Object options</code>)</td> <td class="mid">none</td><td>You can animate or move the camera using the moveTo method. Options are: | |||||
<pre class="code"> | |||||
{ | |||||
position: {x:Number, y:Number}, | |||||
scale: Number, | |||||
offset: {x:Number, y:Number} | |||||
animation: { // -------------------> can be a boolean too! | |||||
duration: Number | |||||
easingFunction: String | |||||
} | |||||
} | |||||
</pre> | |||||
The position (in canvas units!) is the position of the central focus point of the camera. <br><br> | |||||
The scale is the target zoomlevel. Default value is 1.0. <br><br> | |||||
The offset (in DOM units) is how many pixels from the center the view is focussed. Default value is {x:0,y:0}.<br><br> | |||||
For animation you can either use a Boolean to use it with the default options or disable it or you can define the duration (in milliseconds) and easing function manually. Available are: | |||||
<code>linear, easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, easeOutCubic, easeInOutCubic, easeInQuart, easeOutQuart, easeInOutQuart, easeInQuint, easeOutQuint, easeInOutQuint</code>. <br><br> | |||||
<i>You will have to define at least a scale or a position. Otherwise, there is nothing to move to.</i> | |||||
</td></tr> | |||||
<tr><td>releaseNode()</td><td class="mid">none</td><td>Programatically release the focussed node.</td></tr> | |||||
</table> | |||||
<h3>Events</h3> | |||||
<p>These events are fired by the renderer and can be used to move and draw custom elements on the same canvas as the rest of the network.</p> | |||||
<table> | |||||
<tr class="header"><td>name</td><td class="properties">properties</td><td>description</td></tr> | |||||
<tr><td>animationFinished</td><td class="mid">none</td><td>Fired when an animation is finished.</td> | |||||
</table> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
<br /> | |||||
</div> | |||||
<!-- Bootstrap core JavaScript | |||||
================================================== --> | |||||
<!-- Placed at the end of the document so the pages load faster --> | |||||
<script src="../js/jquery.min.js"></script> | |||||
<script src="../js/bootstrap.min.js"></script> | |||||
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> | |||||
<script src="../js/ie10-viewport-bug-workaround.js"></script> | |||||
@ -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'); |
@ -0,0 +1,51 @@ | |||||
<!DOCTYPE HTML> | |||||
<html> | |||||
<head> | |||||
<title>Graph2d | Bar Graph Example</title> | |||||
<style type="text/css"> | |||||
body, html { | |||||
font-family: sans-serif; | |||||
} | |||||
</style> | |||||
<script src="../../dist/vis.js"></script> | |||||
<link href="../../dist/vis-timeline-graph2d.min.css" rel="stylesheet" type="text/css" /> | |||||
</head> | |||||
<body> | |||||
<h2>Graph2d | Bar Graph With End Example</h2> | |||||
<div style="width:700px; font-size:14px; text-align: justify;"> | |||||
This example shows how you can plot a bar chart and supply an end value to have it fill. | |||||
</div> | |||||
<br /> | |||||
<div id="visualization"></div> | |||||
<script type="text/javascript"> | |||||
var container = document.getElementById('visualization'); | |||||
var items = [ | |||||
{x: '2014-06-11 00:00:00', end: '2014-06-13 00:00:00', y: 10 }, | |||||
{x: '2014-06-13 00:00:00', end: '2014-06-14 00:00:00', y: 15 }, | |||||
{x: '2014-06-15 00:00:00', end: '2014-06-16 00:00:00', y: 14 }, | |||||
{x: '2014-06-16 00:00:00', end: '2014-06-17 00:00:00', y: 17 }, | |||||
{x: '2014-06-17 00:00:00', end: '2014-06-18 00:00:00', y: 20 }, | |||||
{x: '2014-06-18 00:00:00', end: '2014-06-25 00:00:00', y: 25 }, | |||||
]; | |||||
var dataset = new vis.DataSet(items); | |||||
var options = { | |||||
style:'bar', | |||||
drawPoints: false, | |||||
dataAxis: { | |||||
icons:true | |||||
}, | |||||
orientation:'top', | |||||
start: '2014-06-10', | |||||
end: '2014-06-18' | |||||
}; | |||||
var graph2d = new vis.Graph2d(container, items, options); | |||||
</script> | |||||
</body> | |||||
</html> |