GithubHelp home page GithubHelp logo

d3by5-transitions's Introduction

d3by5-transitions

The d3by5-transitions is part of the d3by5 graph tools, this specific package will apply tranitions to the visualisations created by a d3by5 graph

NOTE

This is an internal project, you are probably better off using somethin like C3. That said, just give it a try and contact us back (no capslock please).

DEPENDENCIES

Two dependencies in package.json

  • Underscore
  • d3
npm install

will get you all you need

API

This class extends the d3by5-base-graph with the following:

  • transition - String: a named transition to apply - shared - pie + fromSelection - transforms a pie by growing the selected pie segment until it covers the whole of the circle - bar
  • transitionSpeed - Number: the duration of a transition in ms

EXAMPLE

The transitions apply a set of new transitions that can be invoked directly using chart.apply() or being set with chart.transition()

chart.apply()

var piechart = piechart()
                    .width(500)
                    .height(400)
                    .data([{label:'coffee', values: 509}, {label:'tea', values: 1}])
                    .on('click', function (d) {
                        piechart.apply({transition: 'fromSelection',
                                        data: [{label: 'beer', values: 2}, {label:'wine', values: 4}],
                                        target: d});
                    })

d3.select('.js-pie-chart')
    .call(piechart.init());

chart.transition()

var piechart = piechart()
                    .width(500)
                    .height(400)
                    .transition('fromSelection')
                    .transitionSpeed(500)
                    .data([{label:'coffee', values: 509}, {label:'tea', values:

d3.select('.js-pie-chart')
    .call(piechart.init());

LICENCE

MIT

d3by5-transitions's People

Contributors

bardrotzer avatar

Watchers

James Cloos avatar Svale Fossåskaret avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.