adds metric_vis_renderer (#57694)
This commit is contained in:
parent
4b46316395
commit
28df9266a0
|
@ -79,6 +79,11 @@ describe('buildExpressionFunction()', () => {
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('ignores any args in initial state which value is undefined', () => {
|
||||||
|
const fn = buildExpressionFunction('hello', { world: undefined });
|
||||||
|
expect(fn.arguments).not.toHaveProperty('world');
|
||||||
|
});
|
||||||
|
|
||||||
test('returns all expected properties', () => {
|
test('returns all expected properties', () => {
|
||||||
const fn = buildExpressionFunction('hello', { world: [true] });
|
const fn = buildExpressionFunction('hello', { world: [true] });
|
||||||
expect(Object.keys(fn)).toMatchInlineSnapshot(`
|
expect(Object.keys(fn)).toMatchInlineSnapshot(`
|
||||||
|
@ -264,6 +269,18 @@ describe('buildExpressionFunction()', () => {
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('does not add new argument if the value is undefined', () => {
|
||||||
|
const fn = buildExpressionFunction('hello', { world: [true] });
|
||||||
|
fn.addArgument('foo', undefined);
|
||||||
|
expect(fn.toAst().arguments).toMatchInlineSnapshot(`
|
||||||
|
Object {
|
||||||
|
"world": Array [
|
||||||
|
true,
|
||||||
|
],
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
});
|
||||||
|
|
||||||
test('mutates a function already associated with an expression', () => {
|
test('mutates a function already associated with an expression', () => {
|
||||||
const fn = buildExpressionFunction('hello', { world: [true] });
|
const fn = buildExpressionFunction('hello', { world: [true] });
|
||||||
const exp = buildExpression([fn]);
|
const exp = buildExpression([fn]);
|
||||||
|
|
|
@ -183,8 +183,10 @@ export function buildExpressionFunction<
|
||||||
acc[key] = value.map((v) => {
|
acc[key] = value.map((v) => {
|
||||||
return isExpressionAst(v) ? buildExpression(v) : v;
|
return isExpressionAst(v) ? buildExpression(v) : v;
|
||||||
});
|
});
|
||||||
} else {
|
} else if (value !== undefined) {
|
||||||
acc[key] = isExpressionAst(value) ? [buildExpression(value)] : [value];
|
acc[key] = isExpressionAst(value) ? [buildExpression(value)] : [value];
|
||||||
|
} else {
|
||||||
|
delete acc[key];
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
}, initialArgs as FunctionBuilderArguments<FnDef>);
|
}, initialArgs as FunctionBuilderArguments<FnDef>);
|
||||||
|
@ -195,10 +197,12 @@ export function buildExpressionFunction<
|
||||||
arguments: args,
|
arguments: args,
|
||||||
|
|
||||||
addArgument(key, value) {
|
addArgument(key, value) {
|
||||||
|
if (value !== undefined) {
|
||||||
if (!args.hasOwnProperty(key)) {
|
if (!args.hasOwnProperty(key)) {
|
||||||
args[key] = [];
|
args[key] = [];
|
||||||
}
|
}
|
||||||
args[key].push(value);
|
args[key].push(value);
|
||||||
|
}
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
exports[`interpreter/functions#metric returns an object with the correct structure 1`] = `
|
exports[`interpreter/functions#metric returns an object with the correct structure 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"as": "visualization",
|
"as": "metric_vis",
|
||||||
"type": "render",
|
"type": "render",
|
||||||
"value": Object {
|
"value": Object {
|
||||||
"params": Object {
|
"params": Object {
|
||||||
|
|
73
src/plugins/vis_type_metric/public/__snapshots__/to_ast.test.ts.snap
generated
Normal file
73
src/plugins/vis_type_metric/public/__snapshots__/to_ast.test.ts.snap
generated
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`metric vis toExpressionAst function with percentage mode should have percentage format 1`] = `
|
||||||
|
Object {
|
||||||
|
"chain": Array [
|
||||||
|
Object {
|
||||||
|
"arguments": Object {
|
||||||
|
"aggConfigs": Array [
|
||||||
|
"[]",
|
||||||
|
],
|
||||||
|
"includeFormatHints": Array [
|
||||||
|
false,
|
||||||
|
],
|
||||||
|
"index": Array [
|
||||||
|
"123",
|
||||||
|
],
|
||||||
|
"metricsAtAllLevels": Array [
|
||||||
|
false,
|
||||||
|
],
|
||||||
|
"partialRows": Array [
|
||||||
|
false,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"function": "esaggs",
|
||||||
|
"type": "function",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"arguments": Object {
|
||||||
|
"percentageMode": Array [
|
||||||
|
true,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"function": "metricVis",
|
||||||
|
"type": "function",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"type": "expression",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`metric vis toExpressionAst function without params 1`] = `
|
||||||
|
Object {
|
||||||
|
"chain": Array [
|
||||||
|
Object {
|
||||||
|
"arguments": Object {
|
||||||
|
"aggConfigs": Array [
|
||||||
|
"[]",
|
||||||
|
],
|
||||||
|
"includeFormatHints": Array [
|
||||||
|
false,
|
||||||
|
],
|
||||||
|
"index": Array [
|
||||||
|
"123",
|
||||||
|
],
|
||||||
|
"metricsAtAllLevels": Array [
|
||||||
|
false,
|
||||||
|
],
|
||||||
|
"partialRows": Array [
|
||||||
|
false,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"function": "esaggs",
|
||||||
|
"type": "function",
|
||||||
|
},
|
||||||
|
Object {
|
||||||
|
"arguments": Object {},
|
||||||
|
"function": "metricVis",
|
||||||
|
"type": "function",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"type": "expression",
|
||||||
|
}
|
||||||
|
`;
|
|
@ -1,9 +1,7 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`MetricVisComponent should render correct structure for multi-value metrics 1`] = `
|
exports[`MetricVisComponent should render correct structure for multi-value metrics 1`] = `
|
||||||
<div
|
Array [
|
||||||
className="mtrVis"
|
|
||||||
>
|
|
||||||
<MetricVisValue
|
<MetricVisValue
|
||||||
key="0"
|
key="0"
|
||||||
metric={
|
metric={
|
||||||
|
@ -17,7 +15,7 @@ exports[`MetricVisComponent should render correct structure for multi-value metr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
showLabel={true}
|
showLabel={true}
|
||||||
/>
|
/>,
|
||||||
<MetricVisValue
|
<MetricVisValue
|
||||||
key="1"
|
key="1"
|
||||||
metric={
|
metric={
|
||||||
|
@ -31,14 +29,11 @@ exports[`MetricVisComponent should render correct structure for multi-value metr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
showLabel={true}
|
showLabel={true}
|
||||||
/>
|
/>,
|
||||||
</div>
|
]
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`MetricVisComponent should render correct structure for single metric 1`] = `
|
exports[`MetricVisComponent should render correct structure for single metric 1`] = `
|
||||||
<div
|
|
||||||
className="mtrVis"
|
|
||||||
>
|
|
||||||
<MetricVisValue
|
<MetricVisValue
|
||||||
key="0"
|
key="0"
|
||||||
metric={
|
metric={
|
||||||
|
@ -53,5 +48,4 @@ exports[`MetricVisComponent should render correct structure for single metric 1`
|
||||||
}
|
}
|
||||||
showLabel={true}
|
showLabel={true}
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -21,7 +21,6 @@ import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
|
|
||||||
import { MetricVisComponent, MetricVisComponentProps } from './metric_vis_component';
|
import { MetricVisComponent, MetricVisComponentProps } from './metric_vis_component';
|
||||||
import { ExprVis } from '../../../visualizations/public';
|
|
||||||
|
|
||||||
jest.mock('../services', () => ({
|
jest.mock('../services', () => ({
|
||||||
getFormatService: () => ({
|
getFormatService: () => ({
|
||||||
|
@ -41,8 +40,10 @@ const baseVisData = {
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
describe('MetricVisComponent', function () {
|
describe('MetricVisComponent', function () {
|
||||||
const vis: ExprVis = {
|
const visParams = {
|
||||||
params: {
|
type: 'metric',
|
||||||
|
addTooltip: false,
|
||||||
|
addLegend: false,
|
||||||
metric: {
|
metric: {
|
||||||
colorSchema: 'Green to Red',
|
colorSchema: 'Green to Red',
|
||||||
colorsRange: [{ from: 0, to: 1000 }],
|
colorsRange: [{ from: 0, to: 1000 }],
|
||||||
|
@ -52,18 +53,17 @@ describe('MetricVisComponent', function () {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
dimensions: {
|
dimensions: {
|
||||||
metrics: [{ accessor: 0 }],
|
metrics: [{ accessor: 0 } as any],
|
||||||
bucket: null,
|
bucket: undefined,
|
||||||
},
|
},
|
||||||
},
|
};
|
||||||
} as any;
|
|
||||||
|
|
||||||
const getComponent = (propOverrides: Partial<Props> = {} as Partial<Props>) => {
|
const getComponent = (propOverrides: Partial<Props> = {} as Partial<Props>) => {
|
||||||
const props: Props = {
|
const props: Props = {
|
||||||
vis,
|
visParams: visParams as any,
|
||||||
visParams: vis.params as any,
|
|
||||||
visData: baseVisData,
|
visData: baseVisData,
|
||||||
renderComplete: jest.fn(),
|
renderComplete: jest.fn(),
|
||||||
|
fireEvent: jest.fn(),
|
||||||
...propOverrides,
|
...propOverrides,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -88,9 +88,9 @@ describe('MetricVisComponent', function () {
|
||||||
rows: [{ 'col-0': 182, 'col-1': 445842.4634666484 }],
|
rows: [{ 'col-0': 182, 'col-1': 445842.4634666484 }],
|
||||||
},
|
},
|
||||||
visParams: {
|
visParams: {
|
||||||
...vis.params,
|
...visParams,
|
||||||
dimensions: {
|
dimensions: {
|
||||||
...vis.params.dimensions,
|
...visParams.dimensions,
|
||||||
metrics: [{ accessor: 0 }, { accessor: 1 }],
|
metrics: [{ accessor: 0 }, { accessor: 1 }],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -27,13 +27,13 @@ import { KibanaDatatable } from '../../../expressions/public';
|
||||||
import { getHeatmapColors } from '../../../charts/public';
|
import { getHeatmapColors } from '../../../charts/public';
|
||||||
import { VisParams, MetricVisMetric } from '../types';
|
import { VisParams, MetricVisMetric } from '../types';
|
||||||
import { getFormatService } from '../services';
|
import { getFormatService } from '../services';
|
||||||
import { SchemaConfig, ExprVis } from '../../../visualizations/public';
|
import { SchemaConfig } from '../../../visualizations/public';
|
||||||
import { Range } from '../../../expressions/public';
|
import { Range } from '../../../expressions/public';
|
||||||
|
|
||||||
export interface MetricVisComponentProps {
|
export interface MetricVisComponentProps {
|
||||||
visParams: VisParams;
|
visParams: VisParams;
|
||||||
visData: Input;
|
visData: Input;
|
||||||
vis: ExprVis;
|
fireEvent: (event: any) => void;
|
||||||
renderComplete: () => void;
|
renderComplete: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,10 +166,17 @@ export class MetricVisComponent extends Component<MetricVisComponentProps> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const table = this.props.visData;
|
const table = this.props.visData;
|
||||||
this.props.vis.API.events.filter({
|
this.props.fireEvent({
|
||||||
|
name: 'filterBucket',
|
||||||
|
data: {
|
||||||
|
data: [
|
||||||
|
{
|
||||||
table,
|
table,
|
||||||
column: dimensions.bucket.accessor,
|
column: dimensions.bucket.accessor,
|
||||||
row: metric.rowIndex,
|
row: metric.rowIndex,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -199,6 +206,6 @@ export class MetricVisComponent extends Component<MetricVisComponentProps> {
|
||||||
const metrics = this.processTableGroups(this.props.visData);
|
const metrics = this.processTableGroups(this.props.visData);
|
||||||
metricsHtml = metrics.map(this.renderMetric);
|
metricsHtml = metrics.map(this.renderMetric);
|
||||||
}
|
}
|
||||||
return <div className="mtrVis">{metricsHtml}</div>;
|
return metricsHtml;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,12 +53,14 @@ interface RenderValue {
|
||||||
params: any;
|
params: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createMetricVisFn = (): ExpressionFunctionDefinition<
|
export type MetricVisExpressionFunctionDefinition = ExpressionFunctionDefinition<
|
||||||
'metricVis',
|
'metricVis',
|
||||||
Input,
|
Input,
|
||||||
Arguments,
|
Arguments,
|
||||||
Render<RenderValue>
|
Render<RenderValue>
|
||||||
> => ({
|
>;
|
||||||
|
|
||||||
|
export const createMetricVisFn = (): MetricVisExpressionFunctionDefinition => ({
|
||||||
name: 'metricVis',
|
name: 'metricVis',
|
||||||
type: 'render',
|
type: 'render',
|
||||||
inputTypes: ['kibana_datatable'],
|
inputTypes: ['kibana_datatable'],
|
||||||
|
@ -175,7 +177,7 @@ export const createMetricVisFn = (): ExpressionFunctionDefinition<
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: 'render',
|
type: 'render',
|
||||||
as: 'visualization',
|
as: 'metric_vis',
|
||||||
value: {
|
value: {
|
||||||
visData: input,
|
visData: input,
|
||||||
visType,
|
visType,
|
||||||
|
|
54
src/plugins/vis_type_metric/public/metric_vis_renderer.tsx
Normal file
54
src/plugins/vis_type_metric/public/metric_vis_renderer.tsx
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
/*
|
||||||
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
|
* license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright
|
||||||
|
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||||
|
* the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
* not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { render, unmountComponentAtNode } from 'react-dom';
|
||||||
|
import { MetricVisComponent } from './components/metric_vis_component';
|
||||||
|
import { getI18n } from './services';
|
||||||
|
import { VisualizationContainer } from '../../visualizations/public';
|
||||||
|
import { ExpressionRenderDefinition } from '../../expressions/common/expression_renderers';
|
||||||
|
|
||||||
|
export const metricVisRenderer: () => ExpressionRenderDefinition = () => ({
|
||||||
|
name: 'metric_vis',
|
||||||
|
displayName: 'metric visualization',
|
||||||
|
reuseDomNode: true,
|
||||||
|
render: async (domNode: HTMLElement, config: any, handlers: any) => {
|
||||||
|
const { visData, visConfig } = config;
|
||||||
|
|
||||||
|
const I18nContext = getI18n().Context;
|
||||||
|
|
||||||
|
handlers.onDestroy(() => {
|
||||||
|
unmountComponentAtNode(domNode);
|
||||||
|
});
|
||||||
|
|
||||||
|
render(
|
||||||
|
<I18nContext>
|
||||||
|
<VisualizationContainer className="mtrVis">
|
||||||
|
<MetricVisComponent
|
||||||
|
visData={visData}
|
||||||
|
visParams={visConfig}
|
||||||
|
renderComplete={handlers.done}
|
||||||
|
fireEvent={handlers.event}
|
||||||
|
/>
|
||||||
|
</VisualizationContainer>
|
||||||
|
</I18nContext>,
|
||||||
|
domNode
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
|
@ -18,12 +18,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { i18n } from '@kbn/i18n';
|
import { i18n } from '@kbn/i18n';
|
||||||
|
|
||||||
import { MetricVisComponent } from './components/metric_vis_component';
|
|
||||||
import { MetricVisOptions } from './components/metric_vis_options';
|
import { MetricVisOptions } from './components/metric_vis_options';
|
||||||
import { ColorSchemas, colorSchemas, ColorModes } from '../../charts/public';
|
import { ColorSchemas, colorSchemas, ColorModes } from '../../charts/public';
|
||||||
import { AggGroupNames } from '../../data/public';
|
import { AggGroupNames } from '../../data/public';
|
||||||
import { Schemas } from '../../vis_default_editor/public';
|
import { Schemas } from '../../vis_default_editor/public';
|
||||||
|
import { toExpressionAst } from './to_ast';
|
||||||
|
|
||||||
export const createMetricVisTypeDefinition = () => ({
|
export const createMetricVisTypeDefinition = () => ({
|
||||||
name: 'metric',
|
name: 'metric',
|
||||||
|
@ -32,8 +31,8 @@ export const createMetricVisTypeDefinition = () => ({
|
||||||
description: i18n.translate('visTypeMetric.metricDescription', {
|
description: i18n.translate('visTypeMetric.metricDescription', {
|
||||||
defaultMessage: 'Display a calculation as a single number',
|
defaultMessage: 'Display a calculation as a single number',
|
||||||
}),
|
}),
|
||||||
|
toExpressionAst,
|
||||||
visConfig: {
|
visConfig: {
|
||||||
component: MetricVisComponent,
|
|
||||||
defaults: {
|
defaults: {
|
||||||
addTooltip: true,
|
addTooltip: true,
|
||||||
addLegend: false,
|
addLegend: false,
|
||||||
|
|
|
@ -25,8 +25,9 @@ import { createMetricVisFn } from './metric_vis_fn';
|
||||||
import { createMetricVisTypeDefinition } from './metric_vis_type';
|
import { createMetricVisTypeDefinition } from './metric_vis_type';
|
||||||
import { ChartsPluginSetup } from '../../charts/public';
|
import { ChartsPluginSetup } from '../../charts/public';
|
||||||
import { DataPublicPluginStart } from '../../data/public';
|
import { DataPublicPluginStart } from '../../data/public';
|
||||||
import { setFormatService } from './services';
|
import { setFormatService, setI18n } from './services';
|
||||||
import { ConfigSchema } from '../config';
|
import { ConfigSchema } from '../config';
|
||||||
|
import { metricVisRenderer } from './metric_vis_renderer';
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export interface MetricVisPluginSetupDependencies {
|
export interface MetricVisPluginSetupDependencies {
|
||||||
|
@ -53,10 +54,12 @@ export class MetricVisPlugin implements Plugin<void, void> {
|
||||||
{ expressions, visualizations, charts }: MetricVisPluginSetupDependencies
|
{ expressions, visualizations, charts }: MetricVisPluginSetupDependencies
|
||||||
) {
|
) {
|
||||||
expressions.registerFunction(createMetricVisFn);
|
expressions.registerFunction(createMetricVisFn);
|
||||||
visualizations.createReactVisualization(createMetricVisTypeDefinition());
|
expressions.registerRenderer(metricVisRenderer);
|
||||||
|
visualizations.createBaseVisualization(createMetricVisTypeDefinition());
|
||||||
}
|
}
|
||||||
|
|
||||||
public start(core: CoreStart, { data }: MetricVisPluginStartDependencies) {
|
public start(core: CoreStart, { data }: MetricVisPluginStartDependencies) {
|
||||||
|
setI18n(core.i18n);
|
||||||
setFormatService(data.fieldFormats);
|
setFormatService(data.fieldFormats);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,12 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { I18nStart } from 'kibana/public';
|
||||||
import { createGetterSetter } from '../../kibana_utils/common';
|
import { createGetterSetter } from '../../kibana_utils/common';
|
||||||
import { DataPublicPluginStart } from '../../data/public';
|
import { DataPublicPluginStart } from '../../data/public';
|
||||||
|
|
||||||
export const [getFormatService, setFormatService] = createGetterSetter<
|
export const [getFormatService, setFormatService] = createGetterSetter<
|
||||||
DataPublicPluginStart['fieldFormats']
|
DataPublicPluginStart['fieldFormats']
|
||||||
>('metric data.fieldFormats');
|
>('metric data.fieldFormats');
|
||||||
|
|
||||||
|
export const [getI18n, setI18n] = createGetterSetter<I18nStart>('I18n');
|
||||||
|
|
54
src/plugins/vis_type_metric/public/to_ast.test.ts
Normal file
54
src/plugins/vis_type_metric/public/to_ast.test.ts
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
/*
|
||||||
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
|
* license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright
|
||||||
|
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||||
|
* the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
* not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { toExpressionAst } from './to_ast';
|
||||||
|
import { Vis } from '../../visualizations/public';
|
||||||
|
|
||||||
|
describe('metric vis toExpressionAst function', () => {
|
||||||
|
let vis: Vis;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
vis = {
|
||||||
|
isHierarchical: () => false,
|
||||||
|
type: {},
|
||||||
|
params: {
|
||||||
|
percentageMode: false,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
indexPattern: { id: '123' } as any,
|
||||||
|
aggs: {
|
||||||
|
getResponseAggs: () => [],
|
||||||
|
aggs: [],
|
||||||
|
} as any,
|
||||||
|
},
|
||||||
|
} as any;
|
||||||
|
});
|
||||||
|
|
||||||
|
it('without params', () => {
|
||||||
|
vis.params = { metric: {} };
|
||||||
|
const actual = toExpressionAst(vis, {});
|
||||||
|
expect(actual).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('with percentage mode should have percentage format', () => {
|
||||||
|
vis.params = { metric: { percentageMode: true } };
|
||||||
|
const actual = toExpressionAst(vis, {});
|
||||||
|
expect(actual).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
});
|
103
src/plugins/vis_type_metric/public/to_ast.ts
Normal file
103
src/plugins/vis_type_metric/public/to_ast.ts
Normal file
|
@ -0,0 +1,103 @@
|
||||||
|
/*
|
||||||
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
|
* license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright
|
||||||
|
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||||
|
* the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
* not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { get } from 'lodash';
|
||||||
|
import { getVisSchemas, SchemaConfig, Vis } from '../../visualizations/public';
|
||||||
|
import { buildExpression, buildExpressionFunction } from '../../expressions/public';
|
||||||
|
import { MetricVisExpressionFunctionDefinition } from './metric_vis_fn';
|
||||||
|
import { EsaggsExpressionFunctionDefinition } from '../../data/common/search/expressions';
|
||||||
|
|
||||||
|
const prepareDimension = (params: SchemaConfig) => {
|
||||||
|
const visdimension = buildExpressionFunction('visdimension', { accessor: params.accessor });
|
||||||
|
|
||||||
|
if (params.format) {
|
||||||
|
visdimension.addArgument('format', params.format.id);
|
||||||
|
visdimension.addArgument('formatParams', JSON.stringify(params.format.params));
|
||||||
|
}
|
||||||
|
|
||||||
|
return buildExpression([visdimension]);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const toExpressionAst = (vis: Vis, params: any) => {
|
||||||
|
// soon this becomes: const esaggs = vis.data.aggs!.toExpressionAst();
|
||||||
|
const esaggs = buildExpressionFunction<EsaggsExpressionFunctionDefinition>('esaggs', {
|
||||||
|
index: vis.data.indexPattern!.id!,
|
||||||
|
metricsAtAllLevels: vis.isHierarchical(),
|
||||||
|
partialRows: vis.type.requiresPartialRows || vis.params.showPartialRows || false,
|
||||||
|
aggConfigs: JSON.stringify(vis.data.aggs!.aggs),
|
||||||
|
includeFormatHints: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const schemas = getVisSchemas(vis, params);
|
||||||
|
|
||||||
|
const {
|
||||||
|
percentageMode,
|
||||||
|
useRanges,
|
||||||
|
colorSchema,
|
||||||
|
metricColorMode,
|
||||||
|
colorsRange,
|
||||||
|
labels,
|
||||||
|
invertColors,
|
||||||
|
style,
|
||||||
|
} = vis.params.metric;
|
||||||
|
|
||||||
|
// fix formatter for percentage mode
|
||||||
|
if (get(vis.params, 'metric.percentageMode') === true) {
|
||||||
|
schemas.metric.forEach((metric: SchemaConfig) => {
|
||||||
|
metric.format = { id: 'percent' };
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
|
const metricVis = buildExpressionFunction<MetricVisExpressionFunctionDefinition>('metricVis', {
|
||||||
|
percentageMode,
|
||||||
|
colorSchema,
|
||||||
|
colorMode: metricColorMode,
|
||||||
|
useRanges,
|
||||||
|
invertColors,
|
||||||
|
showLabels: labels && labels.show,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (style) {
|
||||||
|
metricVis.addArgument('bgFill', style.bgFill);
|
||||||
|
metricVis.addArgument('font', buildExpression(`font size=${style.fontSize}`));
|
||||||
|
metricVis.addArgument('subText', style.subText);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (colorsRange) {
|
||||||
|
colorsRange.forEach((range: any) => {
|
||||||
|
metricVis.addArgument(
|
||||||
|
'colorRange',
|
||||||
|
buildExpression(`range from=${range.from} to=${range.to}`)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (schemas.group) {
|
||||||
|
metricVis.addArgument('bucket', prepareDimension(schemas.group[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
schemas.metric.forEach((metric) => {
|
||||||
|
metricVis.addArgument('metric', prepareDimension(metric));
|
||||||
|
});
|
||||||
|
|
||||||
|
const ast = buildExpression([esaggs, metricVis]);
|
||||||
|
|
||||||
|
return ast.toAst();
|
||||||
|
};
|
|
@ -18,3 +18,5 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export { Visualization } from './visualization';
|
export { Visualization } from './visualization';
|
||||||
|
export { VisualizationContainer } from './visualization_container';
|
||||||
|
export { VisualizationNoResults } from './visualization_noresults';
|
||||||
|
|
|
@ -17,13 +17,14 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { createMetricVisTypeDefinition } from './metric_vis_type';
|
import React, { ReactNode } from 'react';
|
||||||
import { MetricVisComponent } from './components/metric_vis_component';
|
|
||||||
|
|
||||||
describe('metric_vis - createMetricVisTypeDefinition', () => {
|
interface VisualizationContainerProps {
|
||||||
it('has metric vis component set', () => {
|
className?: string;
|
||||||
const def = createMetricVisTypeDefinition();
|
children: ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
expect(def.visConfig.component).toBe(MetricVisComponent);
|
export const VisualizationContainer = (props: VisualizationContainerProps) => {
|
||||||
});
|
const classes = `visualization ${props.className}`;
|
||||||
});
|
return <div className={classes}>{props.children}</div>;
|
||||||
|
};
|
|
@ -31,6 +31,8 @@ export function plugin(initializerContext: PluginInitializerContext) {
|
||||||
export { Vis } from './vis';
|
export { Vis } from './vis';
|
||||||
export { TypesService } from './vis_types/types_service';
|
export { TypesService } from './vis_types/types_service';
|
||||||
export { VISUALIZE_EMBEDDABLE_TYPE, VIS_EVENT_TO_TRIGGER } from './embeddable';
|
export { VISUALIZE_EMBEDDABLE_TYPE, VIS_EVENT_TO_TRIGGER } from './embeddable';
|
||||||
|
export { VisualizationContainer, VisualizationNoResults } from './components';
|
||||||
|
export { getSchemas as getVisSchemas } from './legacy/build_pipeline';
|
||||||
|
|
||||||
/** @public types */
|
/** @public types */
|
||||||
export { VisualizationsSetup, VisualizationsStart };
|
export { VisualizationsSetup, VisualizationsStart };
|
||||||
|
|
|
@ -1,17 +1,11 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`visualize loader pipeline helpers: build pipeline buildPipeline calls toExpression on vis_type if it exists 1`] = `"kibana | kibana_context | testing custom expressions"`;
|
exports[`visualize loader pipeline helpers: build pipeline buildPipeline calls toExpression on vis_type if it exists 1`] = `"kibana | kibana_context | test"`;
|
||||||
|
|
||||||
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles input_control_vis function 1`] = `"input_control_vis visConfig='{\\"some\\":\\"nested\\",\\"data\\":{\\"here\\":true}}' "`;
|
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles input_control_vis function 1`] = `"input_control_vis visConfig='{\\"some\\":\\"nested\\",\\"data\\":{\\"here\\":true}}' "`;
|
||||||
|
|
||||||
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles markdown function 1`] = `"markdownvis '## hello _markdown_' font={font size=12} openLinksInNewTab=true "`;
|
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles markdown function 1`] = `"markdownvis '## hello _markdown_' font={font size=12} openLinksInNewTab=true "`;
|
||||||
|
|
||||||
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles metric function with buckets 1`] = `"metricvis metric={visdimension 0 } metric={visdimension 1 } "`;
|
|
||||||
|
|
||||||
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles metric function with percentage mode should have percentage format 1`] = `"metricvis percentageMode=true metric={visdimension 0 format='percent' } "`;
|
|
||||||
|
|
||||||
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles metric function without buckets 1`] = `"metricvis metric={visdimension 0 } metric={visdimension 1 } "`;
|
|
||||||
|
|
||||||
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles metrics/tsvb function 1`] = `"tsvb params='{\\"foo\\":\\"bar\\"}' uiState='{}' "`;
|
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles metrics/tsvb function 1`] = `"tsvb params='{\\"foo\\":\\"bar\\"}' uiState='{}' "`;
|
||||||
|
|
||||||
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles pie function 1`] = `"kibana_pie visConfig='{\\"dimensions\\":{\\"metric\\":{\\"accessor\\":0,\\"label\\":\\"\\",\\"format\\":{},\\"params\\":{},\\"aggType\\":\\"\\"},\\"buckets\\":[1,2]}}' "`;
|
exports[`visualize loader pipeline helpers: build pipeline buildPipelineVisFunction handles pie function 1`] = `"kibana_pie visConfig='{\\"dimensions\\":{\\"metric\\":{\\"accessor\\":0,\\"label\\":\\"\\",\\"format\\":{},\\"params\\":{},\\"aggType\\":\\"\\"},\\"buckets\\":[1,2]}}' "`;
|
||||||
|
|
|
@ -29,6 +29,7 @@ import {
|
||||||
import { Vis } from '..';
|
import { Vis } from '..';
|
||||||
import { dataPluginMock } from '../../../../plugins/data/public/mocks';
|
import { dataPluginMock } from '../../../../plugins/data/public/mocks';
|
||||||
import { IndexPattern, IAggConfigs } from '../../../../plugins/data/public';
|
import { IndexPattern, IAggConfigs } from '../../../../plugins/data/public';
|
||||||
|
import { parseExpression } from '../../../expressions/common';
|
||||||
|
|
||||||
describe('visualize loader pipeline helpers: build pipeline', () => {
|
describe('visualize loader pipeline helpers: build pipeline', () => {
|
||||||
describe('prepareJson', () => {
|
describe('prepareJson', () => {
|
||||||
|
@ -217,42 +218,6 @@ describe('visualize loader pipeline helpers: build pipeline', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('handles metric function', () => {
|
|
||||||
it('without buckets', () => {
|
|
||||||
const params = { metric: {} };
|
|
||||||
const schemas = {
|
|
||||||
...schemasDef,
|
|
||||||
metric: [
|
|
||||||
{ ...schemaConfig, accessor: 0 },
|
|
||||||
{ ...schemaConfig, accessor: 1 },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
const actual = buildPipelineVisFunction.metric(params, schemas, uiState);
|
|
||||||
expect(actual).toMatchSnapshot();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('with buckets', () => {
|
|
||||||
const params = { metric: {} };
|
|
||||||
const schemas = {
|
|
||||||
...schemasDef,
|
|
||||||
metric: [
|
|
||||||
{ ...schemaConfig, accessor: 0 },
|
|
||||||
{ ...schemaConfig, accessor: 1 },
|
|
||||||
],
|
|
||||||
group: [{ accessor: 2 }],
|
|
||||||
};
|
|
||||||
const actual = buildPipelineVisFunction.metric(params, schemas, uiState);
|
|
||||||
expect(actual).toMatchSnapshot();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('with percentage mode should have percentage format', () => {
|
|
||||||
const params = { metric: { percentageMode: true } };
|
|
||||||
const schemas = { ...schemasDef };
|
|
||||||
const actual = buildPipelineVisFunction.metric(params, schemas, uiState);
|
|
||||||
expect(actual).toMatchSnapshot();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('handles tagcloud function', () => {
|
describe('handles tagcloud function', () => {
|
||||||
it('without buckets', () => {
|
it('without buckets', () => {
|
||||||
const actual = buildPipelineVisFunction.tagcloud({}, schemasDef, uiState);
|
const actual = buildPipelineVisFunction.tagcloud({}, schemasDef, uiState);
|
||||||
|
@ -331,7 +296,7 @@ describe('visualize loader pipeline helpers: build pipeline', () => {
|
||||||
},
|
},
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
type: {
|
type: {
|
||||||
toExpression: () => 'testing custom expressions',
|
toExpressionAst: () => parseExpression('test'),
|
||||||
},
|
},
|
||||||
} as unknown) as Vis;
|
} as unknown) as Vis;
|
||||||
const expression = await buildPipeline(vis, {
|
const expression = await buildPipeline(vis, {
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
import { get } from 'lodash';
|
import { get } from 'lodash';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { SerializedFieldFormat } from '../../../../plugins/expressions/public';
|
import { formatExpression, SerializedFieldFormat } from '../../../../plugins/expressions/public';
|
||||||
import { IAggConfig, search, TimefilterContract } from '../../../../plugins/data/public';
|
import { IAggConfig, search, TimefilterContract } from '../../../../plugins/data/public';
|
||||||
import { Vis, VisParams } from '../types';
|
import { Vis, VisParams } from '../types';
|
||||||
const { isDateHistogramBucketAggConfig } = search.aggs;
|
const { isDateHistogramBucketAggConfig } = search.aggs;
|
||||||
|
@ -80,7 +80,7 @@ const vislibCharts: string[] = [
|
||||||
'line',
|
'line',
|
||||||
];
|
];
|
||||||
|
|
||||||
const getSchemas = (
|
export const getSchemas = (
|
||||||
vis: Vis,
|
vis: Vis,
|
||||||
opts: {
|
opts: {
|
||||||
timeRange?: any;
|
timeRange?: any;
|
||||||
|
@ -287,52 +287,6 @@ export const buildPipelineVisFunction: BuildPipelineVisFunction = {
|
||||||
};
|
};
|
||||||
return `kibana_table ${prepareJson('visConfig', visConfig)}`;
|
return `kibana_table ${prepareJson('visConfig', visConfig)}`;
|
||||||
},
|
},
|
||||||
metric: (params, schemas) => {
|
|
||||||
const {
|
|
||||||
percentageMode,
|
|
||||||
useRanges,
|
|
||||||
colorSchema,
|
|
||||||
metricColorMode,
|
|
||||||
colorsRange,
|
|
||||||
labels,
|
|
||||||
invertColors,
|
|
||||||
style,
|
|
||||||
} = params.metric;
|
|
||||||
const { metrics, bucket } = buildVisConfig.metric(schemas).dimensions;
|
|
||||||
|
|
||||||
// fix formatter for percentage mode
|
|
||||||
if (get(params, 'metric.percentageMode') === true) {
|
|
||||||
metrics.forEach((metric: SchemaConfig) => {
|
|
||||||
metric.format = { id: 'percent' };
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
let expr = `metricvis `;
|
|
||||||
expr += prepareValue('percentageMode', percentageMode);
|
|
||||||
expr += prepareValue('colorSchema', colorSchema);
|
|
||||||
expr += prepareValue('colorMode', metricColorMode);
|
|
||||||
expr += prepareValue('useRanges', useRanges);
|
|
||||||
expr += prepareValue('invertColors', invertColors);
|
|
||||||
expr += prepareValue('showLabels', labels && labels.show);
|
|
||||||
if (style) {
|
|
||||||
expr += prepareValue('bgFill', style.bgFill);
|
|
||||||
expr += prepareValue('font', `{font size=${style.fontSize}}`, true);
|
|
||||||
expr += prepareValue('subText', style.subText);
|
|
||||||
expr += prepareDimension('bucket', bucket);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (colorsRange) {
|
|
||||||
colorsRange.forEach((range: any) => {
|
|
||||||
expr += prepareValue('colorRange', `{range from=${range.from} to=${range.to}}`, true);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
metrics.forEach((metric: SchemaConfig) => {
|
|
||||||
expr += prepareDimension('metric', metric);
|
|
||||||
});
|
|
||||||
|
|
||||||
return expr;
|
|
||||||
},
|
|
||||||
tagcloud: (params, schemas) => {
|
tagcloud: (params, schemas) => {
|
||||||
const { scale, orientation, minFontSize, maxFontSize, showLabel } = params;
|
const { scale, orientation, minFontSize, maxFontSize, showLabel } = params;
|
||||||
const { metric, bucket } = buildVisConfig.tagcloud(schemas);
|
const { metric, bucket } = buildVisConfig.tagcloud(schemas);
|
||||||
|
@ -390,14 +344,6 @@ const buildVisConfig: BuildVisConfigFunction = {
|
||||||
}
|
}
|
||||||
return visConfig;
|
return visConfig;
|
||||||
},
|
},
|
||||||
metric: (schemas) => {
|
|
||||||
const visConfig = { dimensions: {} } as any;
|
|
||||||
visConfig.dimensions.metrics = schemas.metric;
|
|
||||||
if (schemas.group) {
|
|
||||||
visConfig.dimensions.bucket = schemas.group[0];
|
|
||||||
}
|
|
||||||
return visConfig;
|
|
||||||
},
|
|
||||||
tagcloud: (schemas) => {
|
tagcloud: (schemas) => {
|
||||||
const visConfig = {} as any;
|
const visConfig = {} as any;
|
||||||
visConfig.metric = schemas.metric[0];
|
visConfig.metric = schemas.metric[0];
|
||||||
|
@ -507,6 +453,10 @@ export const buildPipeline = async (
|
||||||
}
|
}
|
||||||
pipeline += '| ';
|
pipeline += '| ';
|
||||||
|
|
||||||
|
if (vis.type.toExpressionAst) {
|
||||||
|
const visAst = await vis.type.toExpressionAst(vis, params);
|
||||||
|
pipeline += formatExpression(visAst);
|
||||||
|
} else {
|
||||||
// request handler
|
// request handler
|
||||||
if (vis.type.requestHandler === 'courier') {
|
if (vis.type.requestHandler === 'courier') {
|
||||||
pipeline += `esaggs
|
pipeline += `esaggs
|
||||||
|
@ -521,14 +471,16 @@ export const buildPipeline = async (
|
||||||
timefilter: params.timefilter,
|
timefilter: params.timefilter,
|
||||||
});
|
});
|
||||||
if (buildPipelineVisFunction[vis.type.name]) {
|
if (buildPipelineVisFunction[vis.type.name]) {
|
||||||
pipeline += buildPipelineVisFunction[vis.type.name]({ title, ...vis.params }, schemas, uiState);
|
pipeline += buildPipelineVisFunction[vis.type.name](
|
||||||
|
{ title, ...vis.params },
|
||||||
|
schemas,
|
||||||
|
uiState
|
||||||
|
);
|
||||||
} else if (vislibCharts.includes(vis.type.name)) {
|
} else if (vislibCharts.includes(vis.type.name)) {
|
||||||
const visConfig = { ...vis.params };
|
const visConfig = { ...vis.params };
|
||||||
visConfig.dimensions = await buildVislibDimensions(vis, params);
|
visConfig.dimensions = await buildVislibDimensions(vis, params);
|
||||||
|
|
||||||
pipeline += `vislib type='${vis.type.name}' ${prepareJson('visConfig', visConfig)}`;
|
pipeline += `vislib type='${vis.type.name}' ${prepareJson('visConfig', visConfig)}`;
|
||||||
} else if (vis.type.toExpression) {
|
|
||||||
pipeline += await vis.type.toExpression(vis, params);
|
|
||||||
} else {
|
} else {
|
||||||
const visConfig = { ...vis.params };
|
const visConfig = { ...vis.params };
|
||||||
visConfig.dimensions = schemas;
|
visConfig.dimensions = schemas;
|
||||||
|
@ -543,6 +495,7 @@ export const buildPipeline = async (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return pipeline;
|
return pipeline;
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,7 +18,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { SavedObject } from '../../../plugins/saved_objects/public';
|
import { SavedObject } from '../../../plugins/saved_objects/public';
|
||||||
import { AggConfigOptions, SearchSourceFields } from '../../../plugins/data/public';
|
import {
|
||||||
|
AggConfigOptions,
|
||||||
|
SearchSourceFields,
|
||||||
|
TimefilterContract,
|
||||||
|
} from '../../../plugins/data/public';
|
||||||
import { SerializedVis, Vis, VisParams } from './vis';
|
import { SerializedVis, Vis, VisParams } from './vis';
|
||||||
|
|
||||||
export { Vis, SerializedVis, VisParams };
|
export { Vis, SerializedVis, VisParams };
|
||||||
|
@ -60,3 +64,11 @@ export interface VisResponseValue {
|
||||||
visConfig: object;
|
visConfig: object;
|
||||||
params?: object;
|
params?: object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface VisToExpressionAstParams {
|
||||||
|
timefilter: TimefilterContract;
|
||||||
|
timeRange?: any;
|
||||||
|
abortSignal?: AbortSignal;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type VisToExpressionAst = (vis: Vis, params: VisToExpressionAstParams) => string;
|
||||||
|
|
|
@ -202,8 +202,8 @@ export class Vis {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
toAST() {
|
toExpressionAst() {
|
||||||
return this.type.toAST(this.params);
|
return this.type.toExpressionAst(this.params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// deprecated
|
// deprecated
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { VisualizationControllerConstructor } from '../types';
|
import { VisToExpressionAst, VisualizationControllerConstructor } from '../types';
|
||||||
import { TriggerContextMapping } from '../../../ui_actions/public';
|
import { TriggerContextMapping } from '../../../ui_actions/public';
|
||||||
import { Adapters } from '../../../inspector/public';
|
import { Adapters } from '../../../inspector/public';
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ export interface BaseVisTypeOptions {
|
||||||
image?: string;
|
image?: string;
|
||||||
stage?: 'experimental' | 'beta' | 'production';
|
stage?: 'experimental' | 'beta' | 'production';
|
||||||
options?: Record<string, any>;
|
options?: Record<string, any>;
|
||||||
visualization: VisualizationControllerConstructor;
|
visualization: VisualizationControllerConstructor | undefined;
|
||||||
visConfig?: Record<string, any>;
|
visConfig?: Record<string, any>;
|
||||||
editor?: any;
|
editor?: any;
|
||||||
editorConfig?: Record<string, any>;
|
editorConfig?: Record<string, any>;
|
||||||
|
@ -42,6 +42,7 @@ export interface BaseVisTypeOptions {
|
||||||
setup?: unknown;
|
setup?: unknown;
|
||||||
useCustomNoDataScreen?: boolean;
|
useCustomNoDataScreen?: boolean;
|
||||||
inspectorAdapters?: Adapters | (() => Adapters);
|
inspectorAdapters?: Adapters | (() => Adapters);
|
||||||
|
toExpressionAst?: VisToExpressionAst;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class BaseVisType {
|
export class BaseVisType {
|
||||||
|
@ -54,7 +55,7 @@ export class BaseVisType {
|
||||||
stage: 'experimental' | 'beta' | 'production';
|
stage: 'experimental' | 'beta' | 'production';
|
||||||
isExperimental: boolean;
|
isExperimental: boolean;
|
||||||
options: Record<string, any>;
|
options: Record<string, any>;
|
||||||
visualization: VisualizationControllerConstructor;
|
visualization: VisualizationControllerConstructor | undefined;
|
||||||
visConfig: Record<string, any>;
|
visConfig: Record<string, any>;
|
||||||
editor: any;
|
editor: any;
|
||||||
editorConfig: Record<string, any>;
|
editorConfig: Record<string, any>;
|
||||||
|
@ -66,6 +67,7 @@ export class BaseVisType {
|
||||||
setup?: unknown;
|
setup?: unknown;
|
||||||
useCustomNoDataScreen: boolean;
|
useCustomNoDataScreen: boolean;
|
||||||
inspectorAdapters?: Adapters | (() => Adapters);
|
inspectorAdapters?: Adapters | (() => Adapters);
|
||||||
|
toExpressionAst?: VisToExpressionAst;
|
||||||
|
|
||||||
constructor(opts: BaseVisTypeOptions) {
|
constructor(opts: BaseVisTypeOptions) {
|
||||||
if (!opts.icon && !opts.image) {
|
if (!opts.icon && !opts.image) {
|
||||||
|
@ -102,6 +104,7 @@ export class BaseVisType {
|
||||||
this.hierarchicalData = opts.hierarchicalData || false;
|
this.hierarchicalData = opts.hierarchicalData || false;
|
||||||
this.useCustomNoDataScreen = opts.useCustomNoDataScreen || false;
|
this.useCustomNoDataScreen = opts.useCustomNoDataScreen || false;
|
||||||
this.inspectorAdapters = opts.inspectorAdapters;
|
this.inspectorAdapters = opts.inspectorAdapters;
|
||||||
|
this.toExpressionAst = opts.toExpressionAst;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get schemas() {
|
public get schemas() {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"as":"visualization","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"kibana_datatable"},"visType":"metric"}}
|
{"as":"metric_vis","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"kibana_datatable"},"visType":"metric"}}
|
|
@ -1 +1 @@
|
||||||
{"as":"visualization","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"kibana_datatable"},"visType":"metric"}}
|
{"as":"metric_vis","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"kibana_datatable"},"visType":"metric"}}
|
|
@ -1 +1 @@
|
||||||
{"as":"visualization","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":2,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"},{"id":"col-2-1","meta":{"aggConfigParams":{"field":"bytes"},"indexPatternId":"logstash-*","type":"max"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"kibana_datatable"},"visType":"metric"}}
|
{"as":"metric_vis","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":2,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"},{"id":"col-2-1","meta":{"aggConfigParams":{"field":"bytes"},"indexPatternId":"logstash-*","type":"max"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"kibana_datatable"},"visType":"metric"}}
|
|
@ -1 +1 @@
|
||||||
{"as":"visualization","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"},{"id":"col-2-1","meta":{"aggConfigParams":{"field":"bytes"},"indexPatternId":"logstash-*","type":"max"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"kibana_datatable"},"visType":"metric"}}
|
{"as":"metric_vis","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"},{"id":"col-2-1","meta":{"aggConfigParams":{"field":"bytes"},"indexPatternId":"logstash-*","type":"max"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"kibana_datatable"},"visType":"metric"}}
|
|
@ -1 +1 @@
|
||||||
{"as":"visualization","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":1000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":true,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"},{"id":"col-2-1","meta":{"aggConfigParams":{"field":"bytes"},"indexPatternId":"logstash-*","type":"max"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"kibana_datatable"},"visType":"metric"}}
|
{"as":"metric_vis","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":1000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":true,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"},{"id":"col-2-1","meta":{"aggConfigParams":{"field":"bytes"},"indexPatternId":"logstash-*","type":"max"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"kibana_datatable"},"visType":"metric"}}
|
|
@ -1 +1 @@
|
||||||
{"as":"visualization","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"},{"id":"col-2-1","meta":{"aggConfigParams":{"field":"bytes"},"indexPatternId":"logstash-*","type":"max"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"kibana_datatable"},"visType":"metric"}}
|
{"as":"metric_vis","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"},{"id":"col-2-1","meta":{"aggConfigParams":{"field":"bytes"},"indexPatternId":"logstash-*","type":"max"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"kibana_datatable"},"visType":"metric"}}
|
|
@ -1 +1 @@
|
||||||
{"as":"visualization","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"kibana_datatable"},"visType":"metric"}}
|
{"as":"metric_vis","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"kibana_datatable"},"visType":"metric"}}
|
|
@ -1 +1 @@
|
||||||
{"as":"visualization","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"kibana_datatable"},"visType":"metric"}}
|
{"as":"metric_vis","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"kibana_datatable"},"visType":"metric"}}
|
|
@ -1 +1 @@
|
||||||
{"as":"visualization","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"kibana_datatable"},"visType":"metric"}}
|
{"as":"metric_vis","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"kibana_datatable"},"visType":"metric"}}
|
|
@ -1 +1 @@
|
||||||
{"as":"visualization","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"kibana_datatable"},"visType":"metric"}}
|
{"as":"metric_vis","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"kibana_datatable"},"visType":"metric"}}
|
|
@ -1 +1 @@
|
||||||
{"as":"visualization","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":2,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"},{"id":"col-2-1","meta":{"aggConfigParams":{"field":"bytes"},"indexPatternId":"logstash-*","type":"max"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"kibana_datatable"},"visType":"metric"}}
|
{"as":"metric_vis","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":2,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"},{"id":"col-2-1","meta":{"aggConfigParams":{"field":"bytes"},"indexPatternId":"logstash-*","type":"max"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"kibana_datatable"},"visType":"metric"}}
|
|
@ -1 +1 @@
|
||||||
{"as":"visualization","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"},{"id":"col-2-1","meta":{"aggConfigParams":{"field":"bytes"},"indexPatternId":"logstash-*","type":"max"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"kibana_datatable"},"visType":"metric"}}
|
{"as":"metric_vis","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"},{"id":"col-2-1","meta":{"aggConfigParams":{"field":"bytes"},"indexPatternId":"logstash-*","type":"max"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"kibana_datatable"},"visType":"metric"}}
|
|
@ -1 +1 @@
|
||||||
{"as":"visualization","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":1000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":true,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"},{"id":"col-2-1","meta":{"aggConfigParams":{"field":"bytes"},"indexPatternId":"logstash-*","type":"max"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"kibana_datatable"},"visType":"metric"}}
|
{"as":"metric_vis","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":1000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":true,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"},{"id":"col-2-1","meta":{"aggConfigParams":{"field":"bytes"},"indexPatternId":"logstash-*","type":"max"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"kibana_datatable"},"visType":"metric"}}
|
|
@ -1 +1 @@
|
||||||
{"as":"visualization","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"},{"id":"col-2-1","meta":{"aggConfigParams":{"field":"bytes"},"indexPatternId":"logstash-*","type":"max"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"kibana_datatable"},"visType":"metric"}}
|
{"as":"metric_vis","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"},{"id":"col-2-1","meta":{"aggConfigParams":{"field":"bytes"},"indexPatternId":"logstash-*","type":"max"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"kibana_datatable"},"visType":"metric"}}
|
|
@ -1 +1 @@
|
||||||
{"as":"visualization","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"kibana_datatable"},"visType":"metric"}}
|
{"as":"metric_vis","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"kibana_datatable"},"visType":"metric"}}
|
|
@ -1 +1 @@
|
||||||
{"as":"visualization","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"kibana_datatable"},"visType":"metric"}}
|
{"as":"metric_vis","type":"render","value":{"params":{"listenOnChange":true},"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"aggConfigParams":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"indexPatternId":"logstash-*","type":"terms"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"aggConfigParams":{},"indexPatternId":"logstash-*","type":"count"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"kibana_datatable"},"visType":"metric"}}
|
Loading…
Reference in a new issue