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

Colors issue on State transitions panel #271

Open
shaeqahmed opened this issue Nov 21, 2019 · 14 comments
Open

Colors issue on State transitions panel #271

shaeqahmed opened this issue Nov 21, 2019 · 14 comments

Comments

@shaeqahmed
Copy link

When the value for a topic is -1, seems that the color is a greyed out very hard to see color. Also for some topics say the message goes from 'AUTONOMY' to 'NAVIGATE' for a single message, the color remains the same. Would be nice if we could improve the the colors to make sure it is always good enough contrast and also to make sure that the color changes whenever the message value is different.

@jtbandes
Copy link
Contributor

Can you post screenshots of the problems you're seeing, especially for the second issue you mentioned where it doesn't change colors when there's a new value in the message?

@shaeqahmed
Copy link
Author

pic for second issue:
image

@janpaul123
Copy link
Contributor

This should be an easy fix. I'll look into it.

@shaeqahmed
Copy link
Author

Thanks! Would be nice to adjust the color scheme as well to make sure it is easy to see for everyone including those with disabilities.

See: https://webaim.org/resources/contrastchecker/

@janpaul123
Copy link
Contributor

We did use a colour scheme that should be pretty distinctive for vision disabilities, see https://github.com/cruise-automation/webviz/blob/master/packages/webviz-core/src/util/plotColors.js#L14 but of course we're always open to improvements!

@shaeqahmed
Copy link
Author

Great to hear. Looks like it is a bug then in the code that determines color for value, as when the value is -1 it is very hard to see:

image

@janpaul123
Copy link
Contributor

Yeah it's a bug. I have a fix incoming! 😄

janpaul123 pushed a commit that referenced this issue Nov 21, 2019
Changelog:
- Added a new "Flat" mode to the 3D panel topic picker. Now when playing multiple bags in the "Flat" mode, bag1 topics are grouped under `Bag` and bag2 topics are grouped under `Bag 2 /webviz_bag_2`. In the "Flat" mode, you can temporarily toggle the topic's visibility by clicking the eye icon next to the edit icon. This is the first step in the ongoing work to improve multi-bag comparison in the 3D panel.
- Sped up local bag reading by decompressing bag chunks ahead of playback.
- Added support for negative slices in the topic path syntax, e.g. to get the last element of an array.
- Added the ability to plot numerical values in Diagnostics - Detail panel.
- Added ability to pan, zoom and do auto zoom in imageView panel.
- Clicking on stacked objects is now automatically turned on in the 3D panel when playback is paused. If there are multiple clicked objects, the object id will be displayed in the context menu if available.
- Added ability to toggle visibility of Plot panel's legends.
- Implemented a workaround to runaway disk usage due to a Chrome bug, which has been causing very slow Webviz start up times. If possible, please clear out your local instance of IndexedDB on Webviz.
- Fixed image panel with synchronized markers not loading data when seeking, by increasing the amount of data we load when seeking.
- Fixed a `Time should never move backwards` error when seeking.
- Fixed negative numbers showing incorrect colors in the State Transitions panel. #271
janpaul123 added a commit that referenced this issue Nov 21, 2019
Changelog:
- Added a new "Flat" mode to the 3D panel topic picker. Now when playing multiple bags in the "Flat" mode, bag1 topics are grouped under `Bag` and bag2 topics are grouped under `Bag 2 /webviz_bag_2`. In the "Flat" mode, you can temporarily toggle the topic's visibility by clicking the eye icon next to the edit icon. This is the first step in the ongoing work to improve multi-bag comparison in the 3D panel.
- Sped up local bag reading by decompressing bag chunks ahead of playback.
- Added support for negative slices in the topic path syntax, e.g. to get the last element of an array.
- Added the ability to plot numerical values in Diagnostics - Detail panel.
- Added ability to pan, zoom and do auto zoom in imageView panel.
- Clicking on stacked objects is now automatically turned on in the 3D panel when playback is paused. If there are multiple clicked objects, the object id will be displayed in the context menu if available.
- Added ability to toggle visibility of Plot panel's legends.
- Implemented a workaround to runaway disk usage due to a Chrome bug, which has been causing very slow Webviz start up times. If possible, please clear out your local instance of IndexedDB on Webviz.
- Fixed image panel with synchronized markers not loading data when seeking, by increasing the amount of data we load when seeking.
- Fixed a `Time should never move backwards` error when seeking.
- Fixed negative numbers showing incorrect colors in the State Transitions panel. #271
@shaeqahmed
Copy link
Author

Pulled in latest changes, and the issue with the transparent color for -1 is fixed but the color still stays same when the value changes, just as shown in the first picture.

@janpaul123
Copy link
Contributor

We cycle through a fixed number of colours so you can get unlucky with which value is assigned to which colour.

@shaeqahmed
Copy link
Author

I think the most important part even if colors are to be reused, is to ensure that no two consecutive state messages, within the same topic, will have the same color unless they are of the same value. That shouldn't be too difficult, would be a good enough solution.

@janpaul123
Copy link
Contributor

Right now we went for the constraint that each value will always have the same colour, so you can easily recognise them. This works nicely if you don't have too many values. Those two objectives are fundamentally incompatible though. I'm not sure which one I'd pick honestly, they both seem like reasonable approaches. Maybe we should just add a bunch more colours to pick from?

@shaeqahmed
Copy link
Author

Yes I think expanding the color space would mitigate the problem. But for a proper fix, then, i'm thinking a approach similar to this would work https://medium.com/apollo-data-solutions-blog/mapping-words-to-colors-cfa23a65d8c4, where the word space has a mapping to the rgb space. I don't know how this works with the color scheme you have at Cruise though.

@janpaul123
Copy link
Contributor

Yeah. Another downside is visibility for colourblind folks. But anyway that sounds like a great approach for anything beyond our current colourscheme for the initial few values. Happy to take a PR on that if you want to give it a shot! 😄

@jtbandes
Copy link
Contributor

jtbandes commented Nov 22, 2019

Is there a publicly available bag file that demonstrates the issue you're running into? It sounds/looks from your screenshot like a real problem, not just similar colors, but it would help to have some example data to reproduce it.

Maybe you could create a PR that adds a StateTransitions story to demonstrate the problem? (You can run yarn storybook to serve up the stories and debug locally.)

surajhpatil pushed a commit to enwaytech/webviz that referenced this issue Dec 31, 2019
Changelog:
- Added a new "Flat" mode to the 3D panel topic picker. Now when playing multiple bags in the "Flat" mode, bag1 topics are grouped under `Bag` and bag2 topics are grouped under `Bag 2 /webviz_bag_2`. In the "Flat" mode, you can temporarily toggle the topic's visibility by clicking the eye icon next to the edit icon. This is the first step in the ongoing work to improve multi-bag comparison in the 3D panel.
- Sped up local bag reading by decompressing bag chunks ahead of playback.
- Added support for negative slices in the topic path syntax, e.g. to get the last element of an array.
- Added the ability to plot numerical values in Diagnostics - Detail panel.
- Added ability to pan, zoom and do auto zoom in imageView panel.
- Clicking on stacked objects is now automatically turned on in the 3D panel when playback is paused. If there are multiple clicked objects, the object id will be displayed in the context menu if available.
- Added ability to toggle visibility of Plot panel's legends.
- Implemented a workaround to runaway disk usage due to a Chrome bug, which has been causing very slow Webviz start up times. If possible, please clear out your local instance of IndexedDB on Webviz.
- Fixed image panel with synchronized markers not loading data when seeking, by increasing the amount of data we load when seeking.
- Fixed a `Time should never move backwards` error when seeking.
- Fixed negative numbers showing incorrect colors in the State Transitions panel. cruise-automation#271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants