fairnessforensics / wiggum

simpson's paradox inspired fairness forensics
https://fairnessforensics.github.io/wiggum/
MIT License
5 stars 3 forks source link

Illegal symbols (&, space) for class name #147

Closed Shine226 closed 4 years ago

brownsarahm commented 4 years ago

I see you pushed a solution to this, can you add more detail to how and why it happened so that we can check that the solution is robust?

Shine226 commented 4 years ago

I tested on the dataset having a group called "R&D", after clicking the cell for this group, get an error "SyntaxError: The string did not match the expected pattern."

Shine226 commented 4 years ago

The error occurs on this line code (subgroup: R&D): d3.selectAll('.sel-' + subgroup).transition().style('opacity', 1);

brownsarahm commented 4 years ago

and your solution is to switch & to _?

If it's possible, it would be better to escape the characters and display as provided.

Also, before we merge this, find the full disallowed list of characters and be sure to handle all of them

Shine226 commented 4 years ago

I add more invalid characters to the regular expression and escape those characters. For space ' ', just replace space with ''. These characters will be displayed as provided, only class names for the components will be replaced with '' if there is a space in the name. I pushed the new code.