magland / figurl-franklab-views

0 stars 0 forks source link

Color controls #12

Closed jsoules closed 1 year ago

jsoules commented 1 year ago

This PR institutes a couple of big changes to how the color scales are handled for the 1d and 2d decoded-position visualizations.

For the 1D visualization, see https://figurl.org/f?v=gs://figurl/franklab-views-dev2a&d=sha1://5ce6bd6dfce3932d2bde1a79b2a51ef39fab8e14&label=03f1-acausal-posterior&s=%7B%7D

For the 2D visualization, see https://www.figurl.org/f?v=gs://figurl/franklab-views-dev2a&d=sha1://7251ae9794d4dfd783fabd9b84826c86b1982f74&label=2D%20Decode%20Example&s=%7B%7D

(The latter is a composite view, so not the greatest sample, but it was a recent one I could find. Note that these choices should be synced between 1d and 2d views when both are present on the screen, and there is logic to suppress display of the color controls in composite views when multiple components might want to display a color control, but this hasn't been tested.)

The user-facing changes are as follows:

Under the hood, many more extensive changes have been made:

I also added a package or two for UI components (slider).

Outstanding:

It'd probably be a good idea to add support for writing the current style settings to the URL query string, but I haven't actually implemented this yet.

jsoules commented 1 year ago

If accepted, will address or resolve SpikeSortingView issues #77, #128, #151.

magland commented 1 year ago

Looks great!

To be more intuitive, I think the dynamic range control should be inverted so that moving to the right corresponds to increasing the brightness.

If two or more views exist in the same layout with the color/dynamic range options be synchronized? I think the user would want and expect that. Not sure how much of a difficulty that poses.

jsoules commented 1 year ago

Thanks! I agree it feels a little counterintuitive; I'm not sure that the slider component supports flipping the direction though. They do support inverting the track (so that it'd be the stuff to the right of the control that is highlighted); I'm not sure this is much better.

I may be able to invert the sort or something. I'll see if I can manipulate the data so that it sorts the way we'd like.

Regarding multiple views, while I don't have a view prepared that would test this, the intention is that they would be synchronized. (That's why I made the style settings a context rather than something local to the component.) We should check this out.

jsoules commented 1 year ago

Added a commit that uses a right-to-left theme so the max slider value goes on the left side. Hopefully this is more intuitive?

magland commented 1 year ago

I'm going to merge it. @jsoules could you then publish to npm from the main branch? Then I'll deploy the new spikesortingview-10