Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getIconColor(type) {
switch (type) {
case 'field':
return theme.euiColorVis7;
case 'value':
return theme.euiColorVis0;
case 'operator':
return theme.euiColorVis1;
case 'conjunction':
return theme.euiColorVis3;
case 'recentSearch':
return theme.euiColorMediumShade;
}
}
function getIconColor(type) {
switch (type) {
case 'field':
return theme.euiColorVis7;
case 'value':
return theme.euiColorVis0;
case 'operator':
return theme.euiColorVis1;
case 'conjunction':
return theme.euiColorVis3;
case 'recentSearch':
return theme.euiColorMediumShade;
}
}
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import theme from '@elastic/eui/dist/eui_theme_light.json';
import { AggregationSearchResponse, AggregatedValue } from 'elasticsearch';
import { ChartBase } from './types';
const colors = [
theme.euiColorVis0,
theme.euiColorVis1,
theme.euiColorVis2,
theme.euiColorVis3,
theme.euiColorVis4,
theme.euiColorVis5,
theme.euiColorVis6
];
export type GenericMetricsChart = ReturnType<
typeof transformDataToMetricsChart
>;
interface AggregatedParams {
body: {
aggs: {
timeseriesData: {
date_histogram: any;
aggs: {
min?: any;
function getIconColor(type) {
switch (type) {
case 'field':
return theme.euiColorVis7;
case 'value':
return theme.euiColorVis0;
case 'operator':
return theme.euiColorVis1;
case 'conjunction':
return theme.euiColorVis3;
case 'recentSearch':
return theme.euiColorMediumShade;
}
}
function getColorByKey(keys: string[]) {
const assignedColors: StringMap = {
'HTTP 2xx': theme.euiColorVis0,
'HTTP 3xx': theme.euiColorVis5,
'HTTP 4xx': theme.euiColorVis7,
'HTTP 5xx': theme.euiColorVis2
};
const unknownKeys = difference(keys, Object.keys(assignedColors));
const unassignedColors: StringMap = zipObject(unknownKeys, [
theme.euiColorVis1,
theme.euiColorVis3,
theme.euiColorVis4,
theme.euiColorVis6,
theme.euiColorVis2,
theme.euiColorVis8
]);
return (key: string) => assignedColors[key] || unassignedColors[key];
}
function getColorByKey(keys: string[]) {
const assignedColors: StringMap = {
'HTTP 2xx': theme.euiColorVis0,
'HTTP 3xx': theme.euiColorVis5,
'HTTP 4xx': theme.euiColorVis7,
'HTTP 5xx': theme.euiColorVis2
};
const unknownKeys = difference(keys, Object.keys(assignedColors));
const unassignedColors: StringMap = zipObject(unknownKeys, [
theme.euiColorVis1,
theme.euiColorVis3,
theme.euiColorVis4,
theme.euiColorVis6,
theme.euiColorVis2,
theme.euiColorVis8
]);
return (key: string) => assignedColors[key] || unassignedColors[key];
}
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import theme from '@elastic/eui/dist/eui_theme_light.json';
import { AggregationSearchResponse, AggregatedValue } from 'elasticsearch';
import { idx } from '@kbn/elastic-idx';
import { ChartBase } from './types';
const colors = [
theme.euiColorVis0,
theme.euiColorVis1,
theme.euiColorVis2,
theme.euiColorVis3,
theme.euiColorVis4,
theme.euiColorVis5,
theme.euiColorVis6
];
export type GenericMetricsChart = ReturnType<
typeof transformDataToMetricsChart
>;
interface AggregatedParams {
body: {
aggs: {
timeseriesData: {
date_histogram: any;
aggs: {
min?: any;
function getIconColor(type) {
switch (type) {
case 'field':
return theme.euiColorVis7;
case 'value':
return theme.euiColorVis0;
case 'operator':
return theme.euiColorVis1;
case 'conjunction':
return theme.euiColorVis3;
case 'recentSearch':
return theme.euiColorMediumShade;
}
}