jsoules / othismos

New version of spike-front.
0 stars 0 forks source link

Heatmap configuration components #13

Closed jsoules closed 3 years ago

jsoules commented 3 years ago

This PR reimplements the components which control heatmap filtering criteria (which I've collectively termed the configuration cards and ConfigurationPanel). It also implements some unit tests for these components (with assertions on conditionally assigned CSS classes) and an example of a stateful wrapper for the configuration panel.

The configuration panel (ConfigurationPanel.tsx) combines the original HeatmapOptionsCol.js and HeatmapOptionsRow.js classes. The SliderCard.tsx, ModeCard.tsx, and MetricCard.tsx are functional component implementations of the similarly-named corresponding original cards. Type information for these has been implemented in ConfigurationTypes.ts. For the most part, lookup value functions in the original code have been replaced with data exported from ConfigurationTypes.

I have written up an example of this in ConfigPanelWrapper.tsx which is used in the app home page. (This is controlled using a row-vs-column checkbox, though there's also commented-out code testing the components individually.) Unfortunately, there appears to be some kind of issue with the CSS in this project vs. in live SpikeFront; I've confirmed that the generated HTML and classes are the same between the two, but the flexbox layout and the radio button styling (for metric selection) are not being styled properly in the sample.

Open items: