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

Add new "middle-out" order prop option to `OuiPaletteColorBlind' #856

Conversation

joshuarrrr
Copy link
Member

@joshuarrrr joshuarrrr commented Jun 27, 2023

Description

When dealing with a large number of rotations, you may not always want to start with the darkest variations. This order makes sure the darkest and lightest variants come last.
Screen Shot 2023-06-27 at 4 29 18 PM
Screen Shot 2023-06-27 at 4 29 03 PM

Issues Resolved

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • All tests pass
    • yarn lint
    • yarn test-unit
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@BSFishy
Copy link
Contributor

BSFishy commented Jun 28, 2023

Would like to get @KrooshalUX opinion on this

@joshuarrrr
Copy link
Member Author

To provide a little more context - there are some legacy vis color utils in OpenSearch Dashboards that try to generate an arbitrary/infinite number of categorical colors. In practice, this generation is not done very well, and very quickly it starts generating very similar colors that are not differentiable:
Screen Shot 2023-06-28 at 5 34 51 PM (from #601)

I believe that the long term solution is to focus on differentiability for categorical colors, and to simply repeat/re-use categorical colors rather than using technically distinct ones.

But for now, the easiest way to at least use OUI colors as a source of truth was to leverage the rotation ability of OuiPaletteColorBlind to generate arbitrarily large palettes. The problem, however, is that by default, using the append order, the first 10 colors assigned would be those from the darkest rotation and the last would be those from the lightest rotation, which we know to be the "worst" colors in the total palette. Because order of assignment matters, we want a way to start with the best colors (non-rotated), and use the worst colors last.

@joshuarrrr joshuarrrr self-assigned this Jun 30, 2023
@BSFishy
Copy link
Contributor

BSFishy commented Aug 15, 2023

The more I'm seeing super dark or super light colors on Dashboards, the more I'm thinking I'd like this

@joshuarrrr
Copy link
Member Author

I'll leave this as a possibility, but leaning more toward opensearch-project/OpenSearch-Dashboards#4697

@joshuarrrr
Copy link
Member Author

I'm taking this out of draft, because I'm still convinced it's useful for visualizations with >10 series. Particularly when stacking bar or area charts, it's common to sort the series so that the series with the largest magnitude come first. In this common scenario, you want the primary vis colors to come first and then start using variants.

@joshuarrrr joshuarrrr marked this pull request as ready for review August 30, 2023 19:43
@joshuarrrr joshuarrrr added the 1.3 label Aug 30, 2023
…joshuarrrr/oui into feat/add-middle-out-color-palette-order
@ashwin-pc ashwin-pc merged commit c9d0d62 into opensearch-project:main Aug 31, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 31, 2023
* Add new "middle-out" order prop option to `OuiPaletteColorBlind'

Signed-off-by: Josh Romero <[email protected]>

* update changelog

Signed-off-by: Josh Romero <[email protected]>

---------

Signed-off-by: Josh Romero <[email protected]>
(cherry picked from commit c9d0d62)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
ashwin-pc pushed a commit that referenced this pull request Sep 1, 2023
… (#1010)

* Add new "middle-out" order prop option to `OuiPaletteColorBlind'

Signed-off-by: Josh Romero <[email protected]>

* update changelog

Signed-off-by: Josh Romero <[email protected]>

---------

Signed-off-by: Josh Romero <[email protected]>
(cherry picked from commit c9d0d62)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants