Giter Site home page Giter Site logo

Comments (4)

tlsim avatar tlsim commented on May 19, 2024

My impression of how this might work is:

  • Outside of components, get resize event.
  • Set corresponding width and height of chartLayout
  • Call chartLayout again on existing selection.
  • The chart and related components resize.

chartLayout would need some modifications:

  • In the returned chartLayout function, in selection.each, adding the structural chart elements should be done with the d3 enter update exit pattern (only appending to enter() selections).
  • Need to either be able to register component instances (and the selections on which they have been called) with chartLayout. Then chartLayout can redraw the components.
  • Or, the components listen for chartLayout's resize, (using d3 events?) and redraw themselves (not sure how this would work, as the components don't know which elements they have been drawn on.

This might help: http://eyeseast.github.io/visible-data/2013/08/28/responsive-charts-with-d3/

from d3fc.

ColinEberhardt avatar ColinEberhardt commented on May 19, 2024

Thanks @tlsim for the ideas. I must admits is beyond my personal D3 capabilities. It's a tricky topic, so perhaps worth discussing on Friday? I'd love to know who this works!

from d3fc.

tlsim avatar tlsim commented on May 19, 2024

Definitely worth discussing (unfortunately I'm not here tomorrow), and will probably take a while to get right, but the prospect of getting responsive and zoomable charts for free by using our components is exciting!

from d3fc.

ColinEberhardt avatar ColinEberhardt commented on May 19, 2024

See #188

from d3fc.

Related Issues (20)

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.