GithubHelp home page GithubHelp logo

react-d3's Introduction

D3 for React Developers

https://coursehunters.net/course/vizualizaciya-dannyh-dlya-react-razrabotchikov

https://slides.com/shirleywu/deck-11#/

https://observablehq.com/@sxywu/data-visualization-for-react-developers-starter

https://observablehq.com/@sxywu/data-visualization-for-react-developers-full

https://github.com/sxywu/react-d3-example

Other

https://observablehq.com

https://bl.ocks.org

https://blockbuilder.org

https://github.com/square/crossfilter

https://github.com/crossfilter/crossfilter

https://github.com/hshoff/vx

https://github.com/emeeks/semiotic

https://github.com/nteract/semiotic

https://github.com/susielu/d3-legend

https://github.com/susielu/d3-annotation

https://github.com/susielu/react-annotation

Tips:

  1. For example, we have a link http://bl.ocks.org/d3noob/8952219. We can change part of the URL bl.ocks to blockbuilder, to make the output http://blockbuilder.org/d3noob/8952219 and then we can edit the example code.

  2. Never ever let D3 and React manage same parts of the DOM! OR BUGS!!

  3. Transitions:

    In componentDidUpdate:

  • Select elements to transition
  • Bind data
  • Call transition
  • Set the attributes to transition
  • Make sure React doesn't manage the attributes D3 is transitioning!
// in componentDidUpdate
d3.select(this.refs.bars)
  .selectAll("rect")
  .data(this.state.bars)
  .transition()
  .attr("y", (d) => d.y) // manage D3
  .attr("height", (d) => d.height) // manage D3
  .attr("fill", (d) => d.fill); // manage D3

// in render {/* manage React */}
<g ref="bars">
  {this.state.bars.map((d, i) => (
    <rect key={i} x={d.x} width="2" />
  ))}
</g>;

react-d3's People

Contributors

kirill255 avatar

Watchers

James Cloos 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.