vis.js

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.

The Crownstone kickstarter promotion

Hi Everyone,

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.

As you may know, vis.js is developed at Almende BV in the Netherlands. Almende has a number of daughter companies, among which: DoBots. 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.

Dobots is now doing a kickstarter for the Crownstone, a smart upgrade for any power socket! 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!

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.

I hope our community can help

the kickstarter reach it's goal and maybe even the stretchgoals.

Please support us and spread the word!
If you share it in a tweet, facebook or different way, leave a comment in issue #1302!

Regards,

Alex

V4, ES6 and what's next

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.

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.

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!

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 everything.

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 ;) ).

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.

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!

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.

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 :).

Changelog:

General

  • Changed the build scripts to include a transpilation of ES6 to ES5 (using http://babel.org), 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 babelify, this is described in README.md.

Timeline

  • Integrated an option configurator and validator.
  • Implemented option multiselect, which is false by default.
  • Added method setData({groups: groups, items: items}).
  • 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 .vis.timeline .item.range { overflow: visible; } instead of .vis.timeline .item.range .content { overflow: visible; }. See example 18_range_overflow.html.
  • Fixed invalid css names for time axis grid, renamed hours class names from 4-8h to h4-h8.
  • Deprecated option showCustomTime. Use method addCustomTime() instead.
  • Deprecated event finishedRedraw as it's redundant.
  • Renamed option animate to animation, and changed it to be either a boolean or an object {duration: number, easingFunction: string}.
  • Fixed #831: items losing selection when their type changed.

Graph2d

  • New option structure.
  • Cleaned up docs.
  • Fixed #628: stacking order.
  • Fixed #624: sorting order.
  • Fixed #616: stacking with negative bars.
  • Fixed #728: alignment issues.
  • Fixed #716: Height of graph 2px too large when configuring a fixed height.

Network

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:

  • New examples, categorized by topic.
  • New docs.
  • New option structure, adhering to the modular setup on the backend.
  • New events for user interaction.
  • New render events for drawing custom elements on the canvas.
  • New physics events for making a loading bar during stabilization.
  • A lot of new methods that make extending easier.
  • Manipulation system now works without the UI neccesarily.
  • Nodes and edges can cast shadows.
  • Configurator system to dynamically change almost all options.
  • Validator has been created for the network's options, warning you about typo's and suggesting alternatives.
  • Diamond shape for nodes.
  • Unified the label code so edges and nodes have the same label settings.
  • InheritColors for edges can be set to both, making a gradient fade between two node colors.
  • Redesigned the clustering system giving full control over it.
  • Random seed can be saved so the network will be the same every time you start it.
  • New physics solver based on ForceAtlas2 as implemented in gephi.]
  • New avoidOverlap option for physics.
  • Many, many bugfixes.

DataSet

  • Dropped support for Google visualization DataTable.
  • Dropped support for appending data returned by DataSet.get() to an existing Array or DataTable.
Released version 3.11.0

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.

Changelog:

Network

  • (added gradient coloring for lines, but set for release in 4.0 due to required refactoring of options).
  • Fixed bug where a network that has frozen physics would resume redrawing after setData, setOptions etc.
  • 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.
  • Added two new static smooth curves modes: curveCW and curve CCW.
  • Added request redraw for certain internal processes to reduce number of draw calls (performance improvements!).
  • Added pull request for usage of Icons. Thanks @Dude9177!
  • Allow hierarchical view to be set in setOptions.
  • Fixed manipulation bar for mobile.
  • Fixed #670: Bug when updating data in a DataSet, when Network is connected to the DataSet via a DataView.
  • Fixed #688: Added a css class to be able to distinguish buttons "Edit node" and "Edit edge".

Timeline

  • Implemented orientation option `'both'`, displaying a time axis both on top and bottom (#665).
  • Implemented creating new range items by dragging in an empty space with the ctrl key down.
  • Implemented configuration option `order: function` to define a custom ordering for the items (see #538, #234).
  • Implemented events `click`, `doubleClick`, and `contextMenu`.
  • Implemented method `getEventProperties(event)`.
  • Fixed not property initializing with a DataView for groups.
  • Merged add custom timebar functionality, thanks @aytech!
  • Fixed #664: end of item not restored when canceling a move event.
  • Fixed #609: reduce the left/right dragarea when an item range is very small, so you can still move it as a whole.
  • Fixed #676: misalignment of background items when using subgroups and the group label's height is larger than the contents.

Graph2d

  • Implemented events `click`, `doubleClick`, and `contextMenu`.
  • Implemented method `getEventProperties(event)`.

DataSet/DataView

  • Implemented support for mapping field names. Thanks @spatialillusions.
  • Fixed #670: DataView not passing a data property on update events (see #670)
Released version 3.10.0

Version 3.10.0 has been released. Lots of improvements in Network, and some smaller bug fixes and improvements in Timeline and DataSet.

Changelog:

Network

  • Added option bindToWindow (default true) to choose whether the keyboard binds are global or to the network div.
  • Improved images handling so broken images are shown on all references of images that are broken.
  • Added getConnectedNodes method.
  • Added fontSizeMin, fontSizeMax, fontSizeMaxVisible, scaleFontWithValue, fontDrawThreshold to Nodes.
  • Added fade in of labels (on nodes) near the fontDrawThreshold.
  • Added nodes option to zoomExtent to zoom in on specific set of nodes.
  • Added stabilizationIterationsDone event which fires at the end of the internal stabilization run. Does not imply that the network is stabilized.
  • Added freezeSimulation method.
  • Added clusterByZoom option.
  • Added class name 'network-tooltip' to the tooltip, allowing custom styling.
  • Fixed bug when redrawing was not right on zoomed-out browsers.
  • Added opacity option to edges. Opacity is only used for the unselected state.
  • Fixed bug where selections from removed data elements persisted.

Timeline

  • `Timeline.redraw()` now also recalculates the size of items.
  • Implemented option `snap: function` to customize snapping to nice date when dragging items.
  • Implemented option `timeAxis: {scale: string, step: number}` to set fixed scale.
  • Fixed width of range items not always being maintained when moving due to snapping to nice dates.
  • Fixed not being able to drag items to an other group on mobile devices.
  • Fixed `setWindow` not working when applying an interval larger than the configured `zoomMax`.

DataSet/DataView

  • Added property `length` holding the total number of items to the `DataSet and `DataView`.
  • Added a method `refresh()` to the `DataView`, to update filter results.
  • 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.
Released version 3.9.0

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!

Changelog:

Network

  • Reverted change in image class, fixed bug #552
  • Improved the fontFill offset between different browsers. #365
  • Fixed dashed lines on firefox on Unix systems
  • Altered the Manipulation Mixin to be succesfully destroyed from memory when calling destroy();
  • Improved drawing of arrowheads on smooth curves. #349
  • Caught case where click originated on external DOM element and drag progressed to vis.
  • Added label stroke support to Nodes, Edges & Groups as per-object or global settings. Thank you @klmdb!
  • 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.
  • Made the node/edge selected by the popup system the same as selected by the click-to-select system. Thank you @pavlos256!
  • Improved edit edge control nodes positions, altered style a little.
  • Fixed issue #564 by resetting state to initial when no callback is performed in the return function.
  • Added condition to Repulsion similar to BarnesHut to ensure nodes do not overlap.
  • Added labelAlignment option to edges. Thanks @T-rav!
  • Close active sessions in dataManipulation when calling setData().

Timeline

  • Added byUser flag to options of the rangechange and rangechanged event.
The 2015 roadmap for vis.js

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, take a look at the post below this one first.

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 Jos′s great online JSON editor. 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!

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.

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.

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.

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.

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!

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.

To wrap up, there are a few things I did not mention here but I'd like to add to the post anyway.

  • 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.
  • Examples will be split in simple option/configuration examples and larger, feature demonstration/exploration examples.
  • Graph2d will be expanded.
  • We will move to hammer.js 2.0.
  • We will add features from the list when we can
  • We hope to keep up the cation with our community!
Let's make 2015 as good as last year!

A look back on vis.js

In April 2013, the initial commit was made for vis.js by Jos 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.

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.

On the 16th of April 2014, exactly a year after the initial commit, a twitterbot with a lot of followers 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.

The 14th of October, we have altered the license of vis.js to MIT or APACHE 2.0. This allowed Tiddlywiki 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!

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!

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.

Have fun using vis!

New website for vis.js!

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 show off great projects that make use of vis.js in our showcase.

If you have made something and would like it featured, please make an issue on Github with your project and how you'd like to be credited.

The new website is in beta so if anyone spots a typo or other mistake, please let us know on our Github page.

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.

A big change introduced with our new website, is the feature request page. 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 here.

Once a feature is added to the list, 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.

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.

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!

Here's to a great 2015!

Released version 3.8.0

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 Github. 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 the roadmap post.

Changelog:

Network

  • Fixed flipping of hierarchical network on update when using RL and DU.
  • Added zoomExtentOnStabilize option to network.
  • Improved destroy function, added them to the examples.
  • Nodes now have bounding boxes that are used for zoomExtent.
  • Made physics more stable (albeit a little slower).
  • Added a check so only one 'activator' overlay is created on clickToUse.
  • Made global color options for edges overrule the inheritColors.
  • Improved cleaning up of the physics configuration on destroy and in options.
  • Made nodes who lost their group revert back to default color.
  • Changed group behaviour, groups now extend the options, not replace. This allows partial defines of color.
  • Fixed bug where box shaped nodes did not use hover color.
  • Fixed Locales docs.
  • 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.
  • Fixed error in repulsion physics model.
  • Improved physics handling for smoother network simulation.
  • Fixed infinite loop when an image can not be found and no brokenImage is provided.
  • Added getBoundingBox method.
  • Community fix for SVG images in IE11, thanks @dponch!
  • Fixed repeating stabilized event when the network is already stabilized.
  • Added circularImages, thanks for the contribution @brendon1982!

Graph2d

  • Fixed round-off errors of zero on the y-axis.
  • added show major/minor lines options to dataAxis.
  • Fixed adapting to width and height changes.
  • Added a check so only one 'activator' overlay is created on clickToUse.
  • DataAxis width option now draws correctly.

Timeline

  • Implemented support for styling of the vertical grid.
  • Support for custom date formatting of the labels on the time axis.
  • added show major/minor lines options to timeline.
  • Added a check so only one 'activator' overlay is created on clickToUse.

Graph3d

  • Fixed mouse coordinates for tooltips.