
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
angular-d3kit-adapter
Advanced tools
Convert a chart created using d3Kit into an angular directive in one command
Convert a chart created using d3Kit into an AngularJS directive in one command!
See demo
npm install angular-d3kit-adapter --save
or
bower install angular-d3kit-adapter --save
This module supports AMD, CommonJS and browser globals out of the box.
First, use the adapter to plug a chart to angular module.
// .plug(angularModule, chartName, chartConstructorFunction)
Globals
<script src="angular-d3kit-adapter.min.js"></script>
<script>
// global
var module = angular.module('something',[]);
angular.d3KitAdapter.plug(module, 'bubbleChart', BubbleChart);
</script>
AMD
define(['angular', 'angular-d3kit-adapter'], function(angular, d3KitAdapter){
var module = angular.module('something',[]);
d3KitAdapter.plug(module, 'bubbleChart', BubbleChart);
));
CommonJS
var d3KitAdapter = require('angular-d3kit-adapter');
var module = angular.module('something',[]);
d3KitAdapter.plug(module, 'bubbleChart', BubbleChart);
Then use the directive as you wish. Tag name is dasherized chartName
parameter that was passed to plug()
<bubble-chart
// $scope.data
chart-data="data"
// $scope.options
chart-options="options"
// string (optional)
chart-auto-resize="both"
// string (optional)
chart-auto-resize-detection="dom"
// This will be called after the chart is created, passing the chart as argument
chart-on-init="handleInit"
// If this chart has any custom event (defined in d3Kit style)
// Custom event listeners are available automatically as attributes.
// However, DON'T add () after function name.
// This is different from default angular listeners
// For example, for ng-click you have to add ()
chart-on-custom-event1="listener1"
chart-on-custom-event2="listener2"
>
</bubble-chart>
This tag, once compiled, will become a div that has class "bubble-chart" (dasherized chartName
), so you can use .bubble-chart
in css for styling.
To build, bump and publish
grunt publish
Build minified version
grunt build
Dry run bump version
grunt bump --dry-run
FAQs
Convert a chart created using d3Kit into an angular directive in one command
The npm package angular-d3kit-adapter receives a total of 0 weekly downloads. As such, angular-d3kit-adapter popularity was classified as not popular.
We found that angular-d3kit-adapter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.