Socket
Book a DemoInstallSign in
Socket

angular-d3-promise

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

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

1.1.0
latest
Source
npmnpm
Version published
Weekly downloads
1
-83.33%
Maintainers
1
Weekly downloads
 
Created
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

  • Add "d3.promise" as the module dependency.
  • 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

angular-d3-promise

FAQs

Package last updated on 26 Nov 2015

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.