code.pyret.org icon indicating copy to clipboard operation
code.pyret.org copied to clipboard

upgrade and fix pie chart rendering

Open schanzer opened this issue 1 year ago • 1 comments

Based on a bug report from a teacher

It turns out that unlike scatter plots, histograms, and all manner of bar charts, the order of SVG pie slices does not follow the order of the rows in the table! This PR makes the following changes:

  • Compute the correct ordering of SVG slices before drawing the new ones
  • Draw the new slices at a better location in the DOM, which fixes a number of display issues regarding interactive labels
  • Draw tiny versions of the images in the legend as well

schanzer avatar Apr 04 '24 22:04 schanzer

Thanks, @sorawee ! I've pushed fixes for these.

schanzer avatar Apr 04 '24 23:04 schanzer

@blerner I've added tests (all of which pass when run in the browser), but I wasn't able to run npm run test from my command line due to missing packages.

schanzer avatar Apr 19 '24 17:04 schanzer

I'm going to assume that this PR does what @schanzer needs it to do, and that the remaining branch CI failure is because this branch doesn't yet have @jpolitz 's fix from #horizon.

blerner avatar Apr 29 '24 13:04 blerner