Skip to content

Commit

Permalink
use green to red ramp
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed May 4, 2020
1 parent 1c0df45 commit c0d168e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('createLayerDescriptor', () => {
properties: {
fillColor: {
options: {
color: 'Yellow to Red',
color: 'Green to Red',
colorCategory: 'palette_0',
field: {
name: '__kbnjoin__avg_of_transaction.duration.us__12345',
Expand Down Expand Up @@ -239,7 +239,7 @@ describe('createLayerDescriptor', () => {
properties: {
fillColor: {
options: {
color: 'Yellow to Red',
color: 'Green to Red',
colorCategory: 'palette_0',
field: {
name: 'avg_of_transaction.duration.us',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ export const APM_INDEX_PATTERN_ID = 'apm_static_index_pattern_id';

const defaultDynamicProperties = getDefaultDynamicProperties();

function createDynamicFillColorDescriptor(field: StylePropertyField) {
function createDynamicFillColorDescriptor(
layer: OBSERVABILITY_LAYER_TYPE,
field: StylePropertyField
) {
return {
type: STYLE_TYPE.DYNAMIC,
options: {
...(defaultDynamicProperties[VECTOR_STYLES.FILL_COLOR]!.options as ColorDynamicOptions),
field,
color: 'Yellow to Red',
color:
layer === OBSERVABILITY_LAYER_TYPE.APM_RUM_PERFORMANCE ? 'Green to Red' : 'Yellow to Red',
type: COLOR_MAP_TYPE.ORDINAL,
},
};
Expand Down Expand Up @@ -145,8 +149,6 @@ function getGeoGridRequestType(display: DISPLAY): RENDER_AS {
return RENDER_AS.POINT;
}

function getLabelStyleDescriptor(metric: OBSERVABILITY_METRIC_TYPE): {};

export function createLayerDescriptor({
layer,
metric,
Expand Down Expand Up @@ -192,7 +194,7 @@ export function createLayerDescriptor({
tooltipProperties: ['name', 'iso2'],
}),
style: VectorStyle.createDescriptor({
[VECTOR_STYLES.FILL_COLOR]: createDynamicFillColorDescriptor({
[VECTOR_STYLES.FILL_COLOR]: createDynamicFillColorDescriptor(layer, {
name: joinKey,
origin: FIELD_ORIGIN.JOIN,
}),
Expand Down Expand Up @@ -232,7 +234,7 @@ export function createLayerDescriptor({
};

const styleProperties = {
[VECTOR_STYLES.FILL_COLOR]: createDynamicFillColorDescriptor(metricStyleField),
[VECTOR_STYLES.FILL_COLOR]: createDynamicFillColorDescriptor(layer, metricStyleField),
[VECTOR_STYLES.ICON_SIZE]: {
type: STYLE_TYPE.DYNAMIC,
options: {
Expand Down

0 comments on commit c0d168e

Please sign in to comment.