extension: Ensure program output from Plot matches dimensions in extension interface. #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the Plot program generated to render the retargeted visualization did not specify the
width
andheight
of the visualization. This led to scenarios where the visualization was obscured due to having default dimensions larger than its allotted space in the interface. With this PR, visualizations now fit exactly within their allotted space.In addition, we use a
ResizeObserver
to update the visualization dimensions when the DevTools panel is resized. This lends a bit of craft to the interface; visualizations fill their allotted space in the interface regardless of the dimensionsFinally, this PR fixes a subtle bug hidden in our CSV upload code. Because
csvParseRows
does no type coercion, numeric data in uploaded CSVs were being treated as strings. This lead to interpretation of the scales as ordinal / categorical—causing heavy overannotation on axes—and rendered flat out incorrect visualizations. This PR brings ind3.autoType
to perform the type coercion for us during data upload.