[MetricVis] Removed the rule of color applying. (#131128)

* Removed the rule of color applying.

* Added check on the level of to_ast.
This commit is contained in:
Yaroslav Kuznietsov 2022-04-28 14:46:10 +03:00 committed by GitHub
parent 88eaa3e738
commit 29650b2bc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -81,7 +81,7 @@ class MetricVisComponent extends Component<MetricVisComponentProps> {
title = `${bucketValue} - ${title}`;
}
const shouldBrush = stops.length > 1 && shouldApplyColor(color ?? '');
const shouldBrush = shouldApplyColor(color ?? '');
return {
label: title,
value: formattedValue,

View file

@ -83,7 +83,7 @@ export const toExpressionAst: VisToExpressionAst<VisParams> = (vis, params) => {
)
);
if (colorsRange && colorsRange.length) {
if (colorsRange && colorsRange.length > 1) {
const stopsWithColors = getStopsWithColorsFromRanges(colorsRange, colorSchema, invertColors);
const palette = buildExpressionFunction('palette', {
...stopsWithColors,