d3plus-common
A starter environment for D3plus modules.
Installation Options
NPM
npm install d3plus-common
Browser
In a vanilla environment, a d3plus_common
global is exported. To use a compiled version hosted on d3plus.org that includes all dependencies:
<script src="https://d3plus.org/js/d3plus-common.v0.1.min.js"></script>
Otherwise, click here to download the latest release.
AMD and CommonJS
The released bundle natively supports both AMD and CommonJS, and vanilla environments.
Custom Builds
The source code is written using standard import
and export
statements. Create a custom build using Rollup or your preferred bundler. Take a look at the index.js file to see the modules exported.
API Reference
constant(value)
Wraps non-function variables in a simple return function.
Kind: global function
Param | Type | Description |
---|
value | Array | Number | Object | String | The value to be returned from the function. |
Example (this)
constant(42);
Example (returns this)
function() {
return 42;
}