dc-js / dc.js

Multi-Dimensional charting built to work natively with crossfilter rendered with d3.js
Apache License 2.0
7.41k stars 1.81k forks source link

Auto resizing using ResizeObserver #1858

Closed kum-deepak closed 2 years ago

kum-deepak commented 2 years ago

This implementation picks from #1853. The key points:

Future considerations:

kum-deepak commented 2 years ago

@gordonwoodhull, I am merging this as I need it for one of the subsequent changes. Please review, I will create a new PR with your feedback.

gordonwoodhull commented 2 years ago

Nice changes, really cleans things up to work with width and height this way.

I'm sure you're on it, but please continue to update the codemodes as the API changes.

kum-deepak commented 2 years ago

Thanks for your review! Codemods is configuration-driven, adding width and height to the configuration was all that it needed (https://github.com/dc-js/dc-codemods/commit/d5eb6cac4e594ae033719e13414344d4f75468bc).

I am considering removing explicit width and height from examples. Still thinking about that.

gordonwoodhull commented 2 years ago

Do you mean setting the width and height on the elements using CSS instead? Seems like it still needs to be set somewhere.

kum-deepak commented 2 years ago

Yes, that way the examples will be responsive.

I realize that people pick code from examples (like I did when I started using dc), so, if the examples are as per what we would recommend, it will help users.

gordonwoodhull commented 2 years ago

Oh, you mean making all of them responsive instead of having separate resizing/ examples? That sounds good. I guess we should keep one or two non-responsive for ppl who still want to do that, but I agree responsive is probably the more popular & impressive case.