FieldColor: Adds new standard color option for color (#28039)

* FieldColor: Added field color option

* Progress

* FieldColor: Added custom schemes

* move to fieldColor

* move to fieldColor

* add back the standard color picker

* FieldColor: Added registry for field color modes

* wip refactor

* Seperate scale from color mode

* Progress

* schemes working

* Stuff is working

* Added fallback

* Updated threshold tests

* Added unit tests

* added more tests

* Made it work with new graph panel

* Use scale calculator from graph panel

* Updates

* Updated test

* Renaming things

* Update packages/grafana-data/src/field/displayProcessor.ts

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* updated according to feedback, added docs

* Updated docs

* Updated

* Update docs/sources/panels/field-options/standard-field-options.md

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Update docs/sources/panels/field-options/standard-field-options.md

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Updated docs according to feedback

* fixed test

* Updated

* Updated wording

* Change to fieldState.seriesIndex

* Updated tests

* Updates

* New names

* More work needed to support bar gauge and showing the color modes in the picker

* Now correct gradients work in bar gauge

* before rename

* Unifying the concept

* Updates

* review feedback

* Updated

* Skip minification

* Updated

* UI improvements

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
This commit is contained in:
Torkel Ödegaard
2020-10-09 09:34:57 +02:00
committed by GitHub
parent c052abed87
commit d181782943
36 changed files with 767 additions and 541 deletions

View File

@ -5,7 +5,7 @@ import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
import { GraphWithLegend, GraphWithLegendProps } from './GraphWithLegend';
import { LegendPlacement, LegendDisplayMode } from '../Legend/Legend';
import { GraphSeriesXY, FieldType, ArrayVector, dateTime, FieldColorMode } from '@grafana/data';
import { GraphSeriesXY, FieldType, ArrayVector, dateTime, FieldColorModeId } from '@grafana/data';
export default {
title: 'Visualizations/Graph',
@ -36,7 +36,7 @@ const series: GraphSeriesXY[] = [
values: new ArrayVector([10, 20, 10]),
config: {
color: {
mode: FieldColorMode.Fixed,
mode: FieldColorModeId.Fixed,
fixedColor: 'red',
},
},
@ -68,7 +68,7 @@ const series: GraphSeriesXY[] = [
values: new ArrayVector([20, 30, 40]),
config: {
color: {
mode: FieldColorMode.Fixed,
mode: FieldColorModeId.Fixed,
fixedColor: 'blue',
},
},