Skip to main content
100%

MatrixGrid Function for D3 Dashboards

✓ Published0🌍 Public
TTommyCoin80
Last edited Nov 6, 2017
Created on Nov 3, 2017

A dashboard layout helper divides an SVG canvas into cells based on a matrix of unique values, enabling straightforward arrangement of multiple charts. The example renders five line charts, each plotting y = x raised to the power of the cell ID, with axes and colored strokes. The matrixGrid function computes cell dimensions and margins, while animated transitions support zooming interactions on double-click.

AI-generated description

I don't like constantly doing math to figure out dimensions when I'm building a dashboard of charts, so I made this helper function. It takes a matrix (array of arrays) as an argument, and divides the svg in the same manner as the matrix is divided by unique cell values.

Built with blockbuilder.org

mit Licensed

Similar vizzes