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

[Lens] Improve color stop UI #119165

Merged
merged 114 commits into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
a56b23e
First very draft version
VladLasitsa Nov 19, 2021
9e7715b
Added validation, clean up code
VladLasitsa Nov 24, 2021
7029192
Some fixes
VladLasitsa Nov 24, 2021
e10e350
Adapt components to the new UI design
VladLasitsa Nov 26, 2021
924efe3
Some fixes
VladLasitsa Nov 29, 2021
bc9d87f
Fix validation
VladLasitsa Nov 29, 2021
be37180
Fix lint errors
VladLasitsa Nov 30, 2021
c3d0786
Fix metric vis for new color stop UI
VladLasitsa Nov 30, 2021
fea83b3
Fix problems with keeping state of auto detecting max/min value
VladLasitsa Dec 2, 2021
35ad9b3
Add tests
VladLasitsa Dec 3, 2021
2f9b2f1
Fix CI
VladLasitsa Dec 6, 2021
a9017f8
Fix tests
VladLasitsa Dec 6, 2021
212dd76
Fix some lint problems
VladLasitsa Dec 6, 2021
ebc6a3a
Fix CI
VladLasitsa Dec 7, 2021
4ea7daa
Merge remote-tracking branch 'upstream/main' into 116422
VladLasitsa Dec 7, 2021
5765073
Fix min/max behavior for heatmap
VladLasitsa Dec 7, 2021
c863aa4
Fix checks.
VladLasitsa Dec 7, 2021
956b3ba
Fix auto value when we add new color range
VladLasitsa Dec 7, 2021
084461e
Fix check task
VladLasitsa Dec 7, 2021
7dd40d0
Fix some issues
VladLasitsa Dec 7, 2021
93927da
Some fixes
VladLasitsa Dec 8, 2021
a5c6430
Fix functional tests
VladLasitsa Dec 8, 2021
e6a5b25
small fix for heatmap
VladLasitsa Dec 9, 2021
8581e8e
Fix test
VladLasitsa Dec 9, 2021
e21bf05
Update comment-description
VladLasitsa Dec 9, 2021
33ed775
Merge branch 'main' into 116422
kibanamachine Dec 14, 2021
72c8e05
fix PR comments
alexwizp Dec 14, 2021
ae7fedc
Merge remote-tracking branch 'upstream/main' into 116422
alexwizp Dec 15, 2021
3cce2dc
Merge remote-tracking branch 'upstream/main' into 116422
alexwizp Dec 16, 2021
7e5265a
do some refactoring (work in progress)
alexwizp Dec 16, 2021
9f124be
do some refactoring (work in progress)
alexwizp Dec 16, 2021
857e79e
some cleanup
alexwizp Dec 16, 2021
fa174eb
some cleanup
alexwizp Dec 16, 2021
1ac0c85
wp: fix validation
alexwizp Dec 20, 2021
2c5daf3
wip: fix validation
alexwizp Dec 20, 2021
fcaba4d
push some refactoring
alexwizp Dec 20, 2021
2d45297
do some refactoring
alexwizp Dec 20, 2021
495ca70
add useDebounce
alexwizp Dec 20, 2021
9775347
add useReducer
alexwizp Dec 21, 2021
dddd143
Merge remote-tracking branch 'upstream/main' into 116422
alexwizp Dec 21, 2021
b61bcbc
remove autoValue
alexwizp Dec 21, 2021
e3cfa20
fix validation
alexwizp Dec 21, 2021
aced21d
update validation logic
alexwizp Dec 21, 2021
e0fbdb6
revert getStopsForFixedMode
alexwizp Dec 21, 2021
65f8cef
some updates
alexwizp Dec 21, 2021
43968da
Merge branch 'main' into 116422
kibanamachine Dec 22, 2021
a209e56
update EuiColorPaletteDisplay palette arg
alexwizp Dec 22, 2021
70276c9
push some logic
alexwizp Dec 22, 2021
ac911a8
push some logic
alexwizp Dec 22, 2021
1c86832
update validation messages
alexwizp Dec 23, 2021
a1d0584
push some updates
alexwizp Dec 23, 2021
5d75740
fix some logic
alexwizp Dec 24, 2021
833db8d
fix some cases
alexwizp Dec 24, 2021
5912c27
fix JES
alexwizp Dec 27, 2021
9f5e407
Merge branch 'main' into 116422
kibanamachine Dec 27, 2021
66fb5ed
fix CI
alexwizp Dec 27, 2021
88f460b
Merge branch 'main' into 116422
kibanamachine Dec 27, 2021
86b5c5f
reset continuity
alexwizp Dec 28, 2021
91ecc15
fix functional tests
alexwizp Dec 28, 2021
7bf0b6f
fix issue with -infinite/+infinite
alexwizp Dec 28, 2021
0fcd666
fix CI
alexwizp Dec 29, 2021
64f6ec4
push some updates
alexwizp Dec 29, 2021
7d0e872
Update x-pack/plugins/lens/public/shared_components/coloring/color_ra…
alexwizp Dec 29, 2021
6792ee9
Update x-pack/plugins/lens/public/shared_components/coloring/color_ra…
alexwizp Dec 29, 2021
32a9539
fix some comments
alexwizp Dec 29, 2021
04a9c16
make color ranges crud methods "immutable"
alexwizp Dec 30, 2021
a15d351
fix Max. value input size
alexwizp Dec 30, 2021
73ae6c7
Merge branch 'main' into 116422
kibanamachine Dec 30, 2021
806b1a8
fix PR comment
alexwizp Dec 30, 2021
57d89f8
fix tests
alexwizp Dec 30, 2021
45c4ebb
Merge branch 'main' into 116422
kibanamachine Jan 3, 2022
97b1eb2
Merge branch 'main' into 116422
kibanamachine Jan 4, 2022
676396f
Fix edit/min/max buttons behavior
VladLasitsa Jan 5, 2022
cd5d5c1
Fix entering decimal values and max/min value behavior
VladLasitsa Jan 10, 2022
5fa1e1b
Fix lint
VladLasitsa Jan 10, 2022
63aeaa8
Fix getNormalizedValueByRange for case when min == max
VladLasitsa Jan 10, 2022
7663daf
Fix table cell coloring
VladLasitsa Jan 11, 2022
1260e3f
add warning messages
alexwizp Jan 12, 2022
c66d811
Move color ranges reducer upper to palette_configuration (#3)
VladLasitsa Jan 13, 2022
ca4684f
Fix lint
VladLasitsa Jan 13, 2022
7a6013c
Merge remote-tracking branch 'upstream/main' into 116422
alexwizp Jan 13, 2022
a4ef93d
Merge branch 'main' into 116422
kibanamachine Jan 14, 2022
ef5f658
use one dataBounds type across palette configuration
alexwizp Jan 14, 2022
a51b833
cleanup
alexwizp Jan 14, 2022
08f4454
Fix some behavior
VladLasitsa Jan 14, 2022
45a17d9
Fix checks
VladLasitsa Jan 14, 2022
d303747
Some clean up
VladLasitsa Jan 14, 2022
0b22b92
Some fixes
VladLasitsa Jan 14, 2022
e057bb9
Some fixes
VladLasitsa Jan 14, 2022
6474301
Fix validation
VladLasitsa Jan 17, 2022
f22826c
Fix CI
VladLasitsa Jan 17, 2022
2e3436c
Add unit tests for color_ranges_crud util
VladLasitsa Jan 17, 2022
0c0e8f6
Fix unit test
VladLasitsa Jan 17, 2022
bad0ecb
Merge branch 'main' into 116422
kibanamachine Jan 17, 2022
9ea3af8
Add unit tests for color ranges utils.ts
VladLasitsa Jan 17, 2022
463b8bf
Add allowEditMinMaxValues props and fix validation
VladLasitsa Jan 17, 2022
fb909e9
Fix CI
VladLasitsa Jan 18, 2022
b711798
Rename allowEditMinMaxValues to disableSwitchingContinuity
VladLasitsa Jan 18, 2022
006a714
Add unit tests for color_ranges_validation
VladLasitsa Jan 18, 2022
e551e8e
Merge remote-tracking branch 'upstream/main' into 116422
VladLasitsa Jan 18, 2022
b90c368
Add unit tests for updateRangeType and changeColorPalette functions
VladLasitsa Jan 18, 2022
9fea8a4
Add unit tests for color_ranges_extra_actions
VladLasitsa Jan 19, 2022
0d23316
Fix checks
VladLasitsa Jan 19, 2022
29662c1
Clean up code
VladLasitsa Jan 19, 2022
2eb5ca9
Some fixes
VladLasitsa Jan 19, 2022
2a11580
Fix unit-tests
VladLasitsa Jan 19, 2022
daa5aaa
Fix comments
VladLasitsa Jan 21, 2022
67194be
Some changes
VladLasitsa Jan 21, 2022
6aa3aa8
Fix tests
VladLasitsa Jan 21, 2022
9e0ddd9
Merge branch 'main' into 116422
kibanamachine Jan 21, 2022
fc02977
Fix all comments
VladLasitsa Jan 21, 2022
262a2ea
Fix Checks
VladLasitsa Jan 21, 2022
84bbe33
Fix CI
VladLasitsa Jan 22, 2022
1b323d3
Merge branch 'main' into 116422
kibanamachine Jan 24, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ describe('HeatmapComponent', function () {
expect(component.find(Heatmap).prop('colorScale')).toEqual({
bands: [
{ color: 'rgb(0, 0, 0)', end: 0, start: 0 },
{ color: 'rgb(112, 38, 231)', end: 150, start: 0 },
{ color: 'rgb(112, 38, 231)', end: 150.00000001, start: 0 },
],
type: 'bands',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ const HeatmapComponent: FC<HeatmapRenderProps> = ({

// adds a very small number to the max value to make sure the max value will be included
const endValue =
paletteParams && paletteParams.range === 'number' ? paletteParams.rangeMax : max + 0.00000001;
(paletteParams && paletteParams.range === 'number' ? paletteParams.rangeMax : max) + 0.00000001;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we give a name for 'magic number' 0.00000001 for better understanding?


const overwriteColors = uiState?.get('vis.colors') ?? null;

const bands = ranges.map((start, index, array) => {
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/charts/public/services/palettes/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function findColorsByStops(
colors: string[],
stops: number[]
) {
const index = stops.findIndex((s) => comparison(value, s) < 0);
const index = stops.findIndex((s) => comparison(value, s) <= 0);
return colors[index] || colors[0];
}

Expand Down Expand Up @@ -77,13 +77,13 @@ export function workoutColorForValue(
const minRange = stops.length ? rangeMin : dataRangeArguments[0];

// in case of shorter rangers, extends the steps on the sides to cover the whole set
if (comparisonFn(normalizedValue, maxRange) > 0) {
if (comparisonFn(normalizedValue, isFinite(maxRange) ? maxRange : stops[stops.length - 1]) > 0) {
if (continuity === 'above' || continuity === 'all') {
return colors[colors.length - 1];
}
return;
}
if (comparisonFn(normalizedValue, minRange) < 0) {
if (comparisonFn(normalizedValue, isFinite(minRange) ? minRange : stops[0]) < 0) {
if (continuity === 'below' || continuity === 'all') {
return colors[0];
}
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/lens/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface CustomPaletteParams {
reverse?: boolean;
rangeType?: 'number' | 'percent';
continuity?: 'above' | 'below' | 'all' | 'none';
autoValue?: 'max' | 'min' | 'all' | 'none';
progression?: 'fixed';
rangeMin?: number;
rangeMax?: number;
Expand Down
22 changes: 22 additions & 0 deletions x-pack/plugins/lens/public/assets/distribute_equally.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React from 'react';
import { EuiIconProps } from '@elastic/eui';

export const DistributeEquallyIcon = (props: Omit<EuiIconProps, 'type'>) => (
<svg
width="15"
height="12"
viewBox="0 0 15 12"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path d="M4 .5a.5.5 0 0 1 1 0v11a.5.5 0 0 1-1 0V.5ZM0 3a1 1 0 0 1 1-1h2v8H1a1 1 0 0 1-1-1V3ZM10.5 0a.5.5 0 0 0-.5.5v11a.5.5 0 0 0 1 0V.5a.5.5 0 0 0-.5-.5ZM6 2h3v8H6V2ZM14 2h-2v8h2a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1Z" />
</svg>
);
15 changes: 15 additions & 0 deletions x-pack/plugins/lens/public/assets/related.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React from 'react';
import { EuiIconProps } from '@elastic/eui';

export const RelatedIcon = (props: Omit<EuiIconProps, 'type'>) => (
<svg width="24" height="24" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" {...props}>
<path d="M6 .5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5V8h4V6.5a.5.5 0 0 1 .82-.384l3 2.5a.5.5 0 0 1 0 .768l-3 2.5A.5.5 0 0 1 12 11.5V10H6.5a.5.5 0 0 1-.5-.5v-9Z" />
</svg>
);
21 changes: 21 additions & 0 deletions x-pack/plugins/lens/public/assets/value_max.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React from 'react';
import { EuiIconProps } from '@elastic/eui';

export const ValueMaxIcon = (props: Omit<EuiIconProps, 'type'>) => (
<svg width="16" height="14" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
<path d="M8 0a.5.5 0 0 1 .384.18l2.5 3A.5.5 0 0 1 10.5 4h-5a.5.5 0 0 1-.384-.82l2.5-3A.5.5 0 0 1 8 0ZM.916 5.223A.5.5 0 0 0 0 5.5v5a.5.5 0 0 0 1 0V7.151l1.084 1.626a.5.5 0 0 0 .832 0L4 7.151V10.5a.5.5 0 0 0 1 0v-5a.5.5 0 0 0-.916-.277L2.5 7.599.916 5.223Z" />
<path
fillRule="evenodd"
clipRule="evenodd"
d="M9.5 5h-.545l-.098.006a3.572 3.572 0 0 0-1.33.36 2.693 2.693 0 0 0-1.052.911C6.18 6.72 6 7.287 6 8v2.5a.5.5 0 0 0 1 0V9h2v1.5a.5.5 0 0 0 1 0v-5a.5.5 0 0 0-.5-.5Zm-.5.5V5v.5ZM7 8h2V6h-.011a2.57 2.57 0 0 0-.297.032c-.202.034-.463.1-.718.228a1.695 1.695 0 0 0-.667.572C7.133 7.092 7 7.462 7 8Z"
/>
<path d="M11.188 5.11a.5.5 0 0 1 .702.078L13.5 7.2l1.61-2.012a.5.5 0 1 1 .78.624L14.14 8l1.75 2.188a.5.5 0 1 1-.78.624L13.5 8.8l-1.61 2.012a.5.5 0 0 1-.78-.624L12.86 8l-1.75-2.188a.5.5 0 0 1 .078-.702Z" />
</svg>
);
15 changes: 15 additions & 0 deletions x-pack/plugins/lens/public/assets/value_min.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React from 'react';
import { EuiIconProps } from '@elastic/eui';

export const ValueMinIcon = (props: Omit<EuiIconProps, 'type'>) => (
<svg width="16" height="14" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
<path d="M10.367.018a.5.5 0 0 1 .562.225L13 3.695V.5a.5.5 0 0 1 1 0v5a.5.5 0 0 1-.929.257L11 2.305V5.5a.5.5 0 0 1-1 0v-5a.5.5 0 0 1 .367-.482ZM.916.223A.5.5 0 0 0 0 .5v5a.5.5 0 0 0 1 0V2.151l1.084 1.626a.5.5 0 0 0 .832 0L4 2.151V5.5a.5.5 0 0 0 1 0v-5a.5.5 0 0 0-.916-.277L2.5 2.599.916.223ZM7 11a.5.5 0 0 0 .384-.18l2.5-3A.5.5 0 0 0 9.5 7h-5a.5.5 0 0 0-.384.82l2.5 3A.5.5 0 0 0 7 11ZM6.5 0a.5.5 0 0 0 0 1H7v4h-.5a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1H8V1h.5a.5.5 0 0 0 0-1h-2Z" />
</svg>
);
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type {
import { LensIconChartDatatable } from '../assets/chart_datatable';
import { TableDimensionEditor } from './components/dimension_editor';
import { CUSTOM_PALETTE } from '../shared_components/coloring/constants';
import { getStopsForFixedMode } from '../shared_components';
import { getStopsForFixedMode, getColorPaletteParams } from '../shared_components';
import { LayerType, layerTypes } from '../../common';
import { getDefaultSummaryLabel, PagingState } from '../../common/expressions';
import type { ColumnState, SortingState } from '../../common/expressions';
Expand Down Expand Up @@ -385,7 +385,11 @@ export const getDatatableVisualization = ({
],
alignment: typeof column.alignment === 'undefined' ? [] : [column.alignment],
colorMode: [column.colorMode ?? 'none'],
palette: [paletteService.get(CUSTOM_PALETTE).toExpression(paletteParams)],
palette: [
paletteService
.get(CUSTOM_PALETTE)
.toExpression(getColorPaletteParams(paletteParams)),
],
summaryRow: hasNoSummaryRow ? [] : [column.summaryRow!],
summaryLabel: hasNoSummaryRow
? []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export function HeatmapDimensionEditor(
palettes={props.paletteService}
activePalette={activePalette}
dataBounds={currentMinMax}
showContinuity={false}
setPalette={(newPalette) => {
// make sure to always have a list of stops
if (newPalette.params && !newPalette.params.stops) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ describe('heatmap', () => {
],
},
],
lastRangeIsRightOpen: [true],
legend: [
{
type: 'expression',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ export const getHeatmapVisualization = ({
xAccessor: [state.xAccessor ?? ''],
yAccessor: [state.yAccessor ?? ''],
valueAccessor: [state.valueAccessor ?? ''],
lastRangeIsRightOpen: [
state.palette?.params?.autoValue
? ['max', 'all'].includes(state.palette?.params?.autoValue || '')
: true,
],
palette: state.palette?.params
? [
paletteService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ describe('metric_expression', () => {
);
});

test('it renders no color styling for numeric value if value is higher than rangeMax and continuity is "none"', () => {
test('it renders no color styling for numeric value if value is higher than rangeMax', () => {
const { data, args } = sampleArgs();

data.tables.l1.rows[0].c = 500;
Expand All @@ -430,7 +430,6 @@ describe('metric_expression', () => {
gradient: false,
range: 'number',
colors: ['red', 'yellow', 'green'],
continuity: 'none',
};

const instance = shallow(
Expand All @@ -451,7 +450,7 @@ describe('metric_expression', () => {
);
});

test('it renders no color styling for numeric value if value is lower than rangeMin and continuity is "none"', () => {
test('it renders no color styling for numeric value if value is lower than rangeMin', () => {
const { data, args } = sampleArgs();

data.tables.l1.rows[0].c = -1;
Expand All @@ -463,7 +462,6 @@ describe('metric_expression', () => {
gradient: false,
range: 'number',
colors: ['red', 'yellow', 'green'],
continuity: 'none',
};

const instance = shallow(
Expand All @@ -484,19 +482,18 @@ describe('metric_expression', () => {
);
});

test('it renders the color styling for numeric value if value is higher than rangeMax and continuity is "all"', () => {
test('it renders the correct color styling for numeric value if user select auto detect max value', () => {
const { data, args } = sampleArgs();

data.tables.l1.rows[0].c = 500;
args.colorMode = ColorMode.Labels;
args.palette.params = {
rangeMin: 0,
rangeMax: 400,
rangeMin: 20,
rangeMax: Infinity,
stops: [100, 200, 400],
gradient: false,
range: 'number',
colors: ['red', 'yellow', 'green'],
continuity: 'all',
};

const instance = shallow(
Expand All @@ -515,19 +512,18 @@ describe('metric_expression', () => {
);
});

test('it renders the color styling for numeric value if value is lower than rangeMin and continuity is "all"', () => {
test('it renders the correct color styling for numeric value if user select auto detect min value', () => {
const { data, args } = sampleArgs();

data.tables.l1.rows[0].c = -1;
args.colorMode = ColorMode.Labels;
args.palette.params = {
rangeMin: 0,
rangeMin: -Infinity,
rangeMax: 400,
stops: [100, 200, 400],
stops: [-Infinity, 200, 400],
gradient: false,
range: 'number',
colors: ['red', 'yellow', 'green'],
continuity: 'all',
};

const instance = shallow(
Expand Down
25 changes: 12 additions & 13 deletions x-pack/plugins/lens/public/metric_visualization/expression.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,29 +69,28 @@ function getColorStyling(
return {};
}

const { continuity = 'above', rangeMin, stops, colors } = palette.params;
const penultimateStop = stops[stops.length - 2];
const { rangeMin, rangeMax, stops, colors } = palette.params;

if (continuity === 'none' && (value < rangeMin || value > penultimateStop)) {
if (value > rangeMax) {
return {};
}
if (continuity === 'below' && value > penultimateStop) {
return {};
}
if (continuity === 'above' && value < rangeMin) {
if (value < rangeMin) {
return {};
}
const cssProp = colorMode === ColorMode.Background ? 'backgroundColor' : 'color';
const rawIndex = stops.findIndex((v) => v > value);
let rawIndex = stops.findIndex((v) => v > value);

let colorIndex = rawIndex;
if (['all', 'below'].includes(continuity) && value < rangeMin && colorIndex < 0) {
colorIndex = 0;
if (!isFinite(rangeMax) && value > stops[stops.length - 1]) {
rawIndex = stops.length - 1;
}
if (['all', 'above'].includes(continuity) && value > penultimateStop && colorIndex < 0) {
colorIndex = stops.length - 1;

// in this case first stop is -Infinity
if (!isFinite(rangeMin) && value < stops[1]) {
rawIndex = 0;
}

const colorIndex = rawIndex;

const color = colors[colorIndex];
const styling = {
[cssProp]: color,
Expand Down
Loading