Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We should handle browser resizing #15

Closed
andyaiken opened this issue Nov 12, 2014 · 4 comments
Closed

We should handle browser resizing #15

andyaiken opened this issue Nov 12, 2014 · 4 comments

Comments

@andyaiken
Copy link
Contributor

Currently we can't resize the browser because the chart would need to redraw itself, along with any child elements.

@tlsim
Copy link
Contributor

tlsim commented Nov 27, 2014

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/

@ColinEberhardt
Copy link
Member

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!

@tlsim
Copy link
Contributor

tlsim commented Nov 27, 2014

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!

@jleft jleft self-assigned this Dec 1, 2014
@ColinEberhardt
Copy link
Member

See #188

chrisprice added a commit that referenced this issue Mar 2, 2018
chrisprice added a commit that referenced this issue Mar 2, 2018
chrisprice added a commit that referenced this issue Mar 2, 2018
chrisprice added a commit that referenced this issue Jul 30, 2018
chrisprice added a commit that referenced this issue Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants