Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extension: Ensure program output from Plot matches dimensions in extension interface. #18

Merged
merged 4 commits into from
Aug 8, 2023

Conversation

parkerziegler
Copy link
Owner

@parkerziegler parkerziegler commented Aug 4, 2023

Previously, the Plot program generated to render the retargeted visualization did not specify the width and height 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.

Before After
Program output from the reviz Chrome extension before the changes in this PR. Program output from the reviz Chrome extension after the changes in this PR.

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 dimensions

Finally, 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 in d3.autoType to perform the type coercion for us during data upload.

@vercel
Copy link

vercel bot commented Aug 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
reviz ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2023 5:58am

@parkerziegler parkerziegler merged commit fc46ab6 into main Aug 8, 2023
2 checks passed
@parkerziegler parkerziegler deleted the fix/program-output-dimensions branch August 8, 2023 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant