d3js


Description

This extension is a helper for loading d3 javascript framework (d3v3). 

Usage

There are 2 ways to load d3js.

Using the wiki macro:
{{d3js minify="false"/}}

Or using directly the JavascriptExtension:
{{velocity}}
$!xwiki.jsx.use('Macros.d3js', {'minify':false})
{{/velocity}}

After loading the d3js there is an event triggered in javascript that signals d3 loaded.
Best practice to use it in javascript:
document.observe('d3:loaded', function(){
 // here is your javascript code that uses the d3 javascript framework.
  console.log("d3js loaded");
});

Release Notes

v1.0

Cache macro used in JavascriptExtension to load contents from attachment once.

v1.1

Added request param to jsx action to get either d3.v3.min.js or d3.v3.js, ignoring minification done by jsx plugin to keep caching.
Several request to jsx use halts loading the javascript. Avoid using $xwiki.jsx.use() several times.