Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
This Ember Addon acts as a loader for consuming D3.js within your Ember application or Addon. It works by applying a lightweight AMD transform around the D3 UMD builds which can be consumed by Ember CLI, making it possible to import any individual D3 package or the entire bundle as "d3" from NPM.
ember install ember-d3
Requirements:
npm version
)node --version
)ember version
)You can upgrade NPM by running:
npm i -g npm@3
If you're looking for the ember-d3
for d3@3.x
, see the v3
branch.
If you want to use 3rd party plugins, like d3-selection-multi
or d3-flame-graph
, simply add them to your project and the module loader will automatically detect them, and any other packages beginning with d3-
in the name.
You can specify any d3
version on the v4 release by adding it to your project:
npm install --save-dev d3@4.9.1
There's two ways to use this library in your project, you can either load just the APIs you desire, or you can import the entire D3 object (similar to version 3).
Option 1:
import { line } from 'd3-shape'
import { scaleOrdinal } from 'd3-scale'
import { extent } from 'd3-array'
Option 2:
See Global D3 section below for configuration
import D3 from 'd3'
We've put together a complete demo component which you can use to really get a feel for how to use the different packages provided by this addon.
We don't support the global window.d3
object, as this is viewed as an anti-pattern. However,
you can expose a bundled import of d3 by enabling the bundle
config flag:
module.exports = function() {
return {
'ember-d3': {
bundle: true
}
}
}
This will allow you to do:
import d3 from 'd3'
Note: This will disable support for using the dependency whitelist/blacklist.
In case you do not want to include all of d3's dependencies, you may whitelist
the packages that you want to include in your project's config/environment.js
file.
For example, if you only wanted to use d3-scale
, you would do:
// config/environment.js
module.exports = function() {
return {
'ember-d3': {
only: ['d3-scale']
}
}
}
Or if you want to exclude a package:
// config/environment.js
module.exports = function() {
return {
'ember-d3': {
except: ['d3-scale']
}
}
}
Note: Even though you only add d3-scale
, it has a few transitive d3 dependencies.
You will need to add these to the whitelist as needed.
yarn test
(Runs ember try:each
to test your addon against multiple Ember versions)ember test
ember test --server
This addon is developed by the community and is maintained by Ivan Vanderbyl.
All contributions are welcome by opening an issue or Pull Request.
FAQs
Loads D3.js into your Ember application
The npm package ember-d3 receives a total of 1,361 weekly downloads. As such, ember-d3 popularity was classified as popular.
We found that ember-d3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.