Description
In the heatmap example in the paper, we use the following code to render the label of each heatmap rectangle.
Vt = p.label(T3, { x:0, y:0,
text: ({cp, slope}) => Chest: ${cp} Stress: ${slope}
,
fontSize: Vs.get("id", ([{text, w,h}])=> getfontsize(text,w,h))})
Note how fontSize requires an argument called text, which is really the visual attribute right above it. fontSize depends on text because the callback function to fontSize requires text as an argument. This is actually ok to run for the current state of the library, but it is pretty brittle because it depends on the ordering of the visual attributes. Because the mapping for text is before fontSize, the library always runs the callback function for text before running the callback function for fontSize. This ensures that the text argument to fontSize is always valid.
The library should NOT be dependent on the ordering of visual attributes. As such we need some way of resolving dependencies between visual attributes of a mark. One possible solution is to inspect the arguments of each callback function if present to create some dependency graph.