d3js
Last modified by Norbert Schwarz on 2022/10/31 00:00
Javascript Extension and Wiki macro to load the d3 javascript framework |
Type | XAR |
Category | |
Developed by | |
Active Installs | 10 |
Rating | |
License | GNU Lesser General Public License 2.1 |
Table of contents
Description
This extension is a helper for loading d3 javascript framework.
Usage
There are 2 ways to load d3js.
Using the wiki macro:
{{d3js minify="<true|false>"/}}
Or using directly the JavascriptExtension:
{{velocity}}
$!xwiki.jsx.use("Macros.d3js", {"minify":false})
{{/velocity}}
$!xwiki.jsx.use("Macros.d3js", {"minify":false})
{{/velocity}}
After loading d3js there is an event triggered in javascript that signals that d3 is 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");
});
// here is your javascript code that uses the d3 javascript framework.
console.log("d3js loaded");
});