Skip to main content
100%

Fullsize.js Prototype

✓ Published0🌍 Public
CCurran Kelleher
Last edited Jan 25, 2017
Created on Jan 24, 2017

This prototype demonstrates a minimal reusable utility for creating full-screen D3 visualizations that respond to browser resize events. The `fullsize` function appends a fixed-position div, adds an SVG child, and on every resize extracts the div’s dimensions to update the SVG’s width and height attributes, then calls a user-supplied render function. The example renders two diagonal lines forming an X, with coordinates recomputed from the current width and height, using D3 v4’s data join and merge pattern.

AI-generated description

I noticed that if you search Google for "responding to resize", the first result is this <a href='http://bl.ocks.org/curran/3a68b0c81991e2e94b19'>Responding to Resize</a> example I made some time back.

So, I wondered, do many people find this useful? Might there be an opportinuty to create a useful library that makes it easier to get started with "full size" graphics that respond to resize?

This example is a prototype of such a library. Would this be useful to you? If so, let me know!

forked from <a href='http://bl.ocks.org/curran/'>curran</a>'s block: <a href='http://bl.ocks.org/curran/3a68b0c81991e2e94b19'>Responding to Resize</a>

mit Licensed

Similar vizzes