chiasm-project / chiasm

A browser based environment for interactive data visualizations.
MIT License
184 stars 24 forks source link

Layout plugin should react to print #41

Open Hypercubed opened 9 years ago

Hypercubed commented 9 years ago

When printing the page width changes. It would be nice if the layout plugin could react and update the visualization.

curran commented 9 years ago

I'm not really sure where to start with this. Maybe there is some special CSS that applies in printing only? The layout plugin responds to resize events, perhaps there are other events that fire when printing? Please let me know if you have done anything like this in other projects, or have any examples to point to. Thank you.

Hypercubed commented 9 years ago

Yes: window.matchMedia('print').addListener(resizeCallback);

curran commented 9 years ago

Oh cool, thanks! I'll give it a try.