Generate a 3d model of data in a grid (great for "daily data for a year")
This script (daily-by-year-elevation-graph.scad
) generates a 3d model
consisting of a grid of cells (X and Y axes) The elevation (Z axis) of
each cell is defined by a value in an array of data.
-
Save a copy of the file
data-by-year__example.scad
with the namedata-by-year.scad
. This file will be ignored by git. It is where you can put the data for your chart. (Alternatively you can name the file whatever you want and just change theinclude
statement in the code.) -
Open the file
daily-by-year-elevation-graph.scad
using OpenSCAD. -
Run the script to see a chart. By default the data is organized into a grid (from the top-down view) somewhat like a GitHub contribution graph. Each "column" (y-axis) is a week, with days running down from Sunday to Saturday.
However, the code doesn't require a fixed number of values or specific grid dimensions. It could be used to show days in a month or even values where the x- and y-axis don't represent time at all.
-
You can change the data in
data-by-year.scad
. The format is documented there. You can also configure several parameters indaily-by-year-elevation-graph.scad
, to change (among other things) the dimensions of the grid, the scale, etc.
Note that this code was developed using OpenSCAD version 2018.10.13.ci145, and it uses some apis that are not available in earlier versions.
This could be used to make a 3d bar chart of any type of data. However, it was originally written to create a 3d graph of "daily by year" data -- that is, data containing one value per day, where an entire chart represents a year.
My employer, HireVue, Inc., provides an online job interview platform. The first version of this was created as a "hack week" project to create 3d-printed models of the daily number of interviews, broken out by year.
As mentioned above, the first implementation of this code was written as part of my employment with with HireVue, Inc. (@hirevue). Credit to @tomstroman for the idea. Thanks to HireVue for giving me permission to release this work as open source. It's a great place to work -- check us out!