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

Refactor hardcoded color to use OUI in region_map #4299

Merged
merged 5 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Remove unused Sass in `tile_map` plugin ([#4110](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4110))
- [Table Visualization] Remove custom styling for text-align:center in favor of OUI utility class. ([#4164](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4164))
- Replace the use of `bluebird` in `saved_objects` plugin ([#4026](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4026))
- [Vis Colors] [Region Maps] Replace hardcode color to OUI color in `region_map` plugin ([#4299](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4299))
- [Vis Colors] Replace color maps with OUI color palettes ([#4293](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4293))
- [Vis Colors] [Maps] Replace hardcoded color to OUI color in `maps_legacy` plugin ([#4294](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4294))
- [Vis Colors] [TSVB] Update default color in `vis_type_timeseries` to use `ouiPaletteColorBlind()[0]`([#4363](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4363))
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/region_map/public/choropleth_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import $ from 'jquery';
import _ from 'lodash';
import d3 from 'd3';
import { i18n } from '@osd/i18n';
import { euiThemeVars } from '@osd/ui-shared-deps/theme';
import * as topojson from 'topojson-client';
import { getNotifications } from './opensearch_dashboards_services';
import { colorUtil, OpenSearchDashboardsMapLayer } from '../../maps_legacy/public';
Expand All @@ -46,7 +47,7 @@ import {
const EMPTY_STYLE = {
weight: 1,
opacity: 0.6,
color: 'rgb(200,200,200)',
color: euiThemeVars.euiColorMediumShade,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of an interesting case. From the sample screenshots, I'd also make the leap to guess that it's used for both the outline and fill color (but would need a deeper dive into the code to verify), and is intended to be a neutral default. However, given it's usage, I think something like ouiPaletteColorBlind()[1] (or a seed color from one of the quantitative palettes, like ouiPaletteGray()) may be more appropriate for cohesion with other visualizations.

To help us decide, @BSFishy can you provide more info about how/when this EMPTY_STYLE is used? And confirm whether the color prop is only used for strokes or also for fill?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This style is simply passed to leaflet, and I can now confirm it is only used as the stroke color: https://leafletjs.com/reference.html#path-color

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the context, that's helpful.

fillOpacity: 0,
};

Expand Down
Loading