Socket
Socket
Sign inDemoInstall

angular-d3-promise

Package Overview
Dependencies
80
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    angular-d3-promise

Convert a chart created using d3Kit into an angular directive in one command


Version published
Maintainers
1
Created

Readme

Source

angular-d3-promise

Make d3 data functions use promises instead of callbacks

This library uses Angular's $q for the implementation of promises.

Installation

bower install angular-d3-promise --save

or

npm install angular-d3-promise --save

This library can be imported using standard <script> as well as CommonJS (node.js/browserify) and AMD (such as RequireJS).

Note: Since v1.0.0, the minified output was move from src/ to dist/.

Example Usage

  1. Add "d3.promise" as the module dependency.
  2. Inject service "d3Promise" into any scope you want to use.
angular.module('app', ['d3.promise'])
  .controller('mainCtrl', ['d3Promise', function(d3Promise){
    var promise = d3Promise.csv('test.csv');
    promise.then(function(data){}, function(error){});

    var promise = d3Promise.tsv('test.tsv');
    promise.then(function(data){}, function(error){});

    var promise = d3Promise.json('test.json')
    promise.then(function(data){}, function(error){});

    var promise = d3Promise.html('test.html')
    promise.then(function(data){}, function(error){});

    var promise = d3Promise.text('test.txt')
    promise.then(function(data){}, function(error){});

    var promise = d3Promise.xml('test.xml')
    promise.then(function(data){}, function(error){});
  }]);

Keywords

FAQs

Last updated on 26 Nov 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc