[Canvas] TagCloud arguments. (#107729)

* Added arguments to Tagcloud at Canvas.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Yaroslav Kuznietsov 2021-09-17 14:34:15 +03:00 committed by GitHub
parent f8d03a5d4f
commit c63fff99a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 490 additions and 126 deletions

View file

@ -71,10 +71,7 @@ Object {
},
"minFontSize": 18,
"orientation": "single",
"palette": Object {
"name": "default",
"type": "palette",
},
"palette": "{palette}",
"scale": "linear",
"showLabel": true,
},
@ -142,10 +139,7 @@ Object {
},
"minFontSize": 18,
"orientation": "single",
"palette": Object {
"name": "default",
"type": "palette",
},
"palette": "{palette}",
"scale": "linear",
"showLabel": true,
},

View file

@ -110,9 +110,9 @@ export const tagcloudFunction: ExpressionTagcloudFunction = () => {
help: argHelp.showLabel,
},
palette: {
types: ['string'],
types: ['palette', 'system_palette'],
help: argHelp.palette,
default: 'default',
default: '{palette}',
},
metric: {
types: ['vis_dimension'],
@ -135,10 +135,7 @@ export const tagcloudFunction: ExpressionTagcloudFunction = () => {
...(args.bucket && {
bucket: args.bucket,
}),
palette: {
type: 'palette',
name: args.palette,
},
palette: args.palette,
};
if (handlers?.inspectorAdapters?.tables) {

View file

@ -41,7 +41,7 @@ export interface TagcloudRendererConfig {
}
interface Arguments extends TagCloudVisConfig {
palette: string;
palette: PaletteOutput;
}
export type ExpressionTagcloudFunction = () => ExpressionFunctionDefinition<

View file

@ -11,7 +11,7 @@ import { FormattedMessage } from '@kbn/i18n/react';
import { throttle } from 'lodash';
import { EuiIconTip, EuiResizeObserver } from '@elastic/eui';
import { Chart, Settings, Wordcloud, RenderChangeListener } from '@elastic/charts';
import type { PaletteRegistry } from '../../../../charts/public';
import type { PaletteRegistry, PaletteOutput } from '../../../../charts/public';
import {
Datatable,
DatatableColumn,
@ -36,12 +36,12 @@ const calculateWeight = (value: number, x1: number, y1: number, x2: number, y2:
const getColor = (
palettes: PaletteRegistry,
activePalette: string,
activePalette: PaletteOutput,
text: string,
values: string[],
syncColors: boolean
) => {
return palettes?.get(activePalette).getCategoricalColor(
return palettes?.get(activePalette?.name)?.getCategoricalColor(
[
{
name: text,
@ -54,7 +54,8 @@ const getColor = (
totalSeries: values.length || 1,
behindText: false,
syncColors,
}
},
activePalette?.params ?? { colors: [] }
);
};
@ -113,14 +114,14 @@ export const TagCloudChart = ({
tag === 'all' || visData.rows.length <= 1
? 1
: calculateWeight(row[metricColumn], minValue, maxValue, 0, 1) || 0,
color: getColor(palettesRegistry, palette.name, tag, values, syncColors) || 'rgba(0,0,0,0)',
color: getColor(palettesRegistry, palette, tag, values, syncColors) || 'rgba(0,0,0,0)',
};
});
}, [
bucket,
bucketFormatter,
metric.accessor,
palette.name,
palette,
palettesRegistry,
syncColors,
visData.columns,

View file

@ -35,11 +35,12 @@ export interface SystemPaletteArguments {
name: string;
}
export interface PaletteOutput<T = unknown> {
type: 'palette';
export interface PaletteOutput<T = { [key: string]: unknown }> {
type: 'palette' | 'system_palette';
name: string;
params?: T;
}
export const defaultCustomColors = [
// This set of defaults originated in Canvas, which, at present, is the primary
// consumer of this function. Changing this default requires a change in Canvas

View file

@ -8,10 +8,12 @@
import React from 'react';
import { PaletteOutput, PaletteRegistry } from 'src/plugins/charts/public';
import { EuiColorPalettePicker } from '@elastic/eui';
import { EuiColorPalettePicker, EuiColorPalettePickerPaletteProps } from '@elastic/eui';
import { EuiFormRow } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
const DEFAULT_PALETTE = 'default';
export interface PalettePickerProps<ParamName extends string> {
activePalette?: PaletteOutput;
palettes: PaletteRegistry;
@ -25,6 +27,21 @@ export function PalettePicker<ParamName extends string>({
paramName,
setPalette,
}: PalettePickerProps<ParamName>) {
const palettesList: EuiColorPalettePickerPaletteProps[] = palettes
.getAll()
.filter(({ internal }) => !internal)
.map(({ id, title, getCategoricalColors }) => {
return {
value: id,
title,
type: 'fixed',
palette: getCategoricalColors(
10,
id === activePalette?.name ? activePalette?.params : undefined
),
};
});
return (
<EuiFormRow
fullWidth
@ -36,27 +53,15 @@ export function PalettePicker<ParamName extends string>({
fullWidth
data-test-subj="visEditorPalettePicker"
compressed
palettes={palettes
.getAll()
.filter(({ internal }) => !internal)
.map(({ id, title, getCategoricalColors }) => {
return {
value: id,
title,
type: 'fixed',
palette: getCategoricalColors(
10,
id === activePalette?.name ? activePalette?.params : undefined
),
};
})}
palettes={palettesList}
onChange={(newPalette) => {
const palette = palettesList.find((item) => item.value === newPalette);
setPalette(paramName, {
type: 'palette',
name: newPalette,
name: palette?.value ?? DEFAULT_PALETTE,
});
}}
valueOfSelected={activePalette?.name || 'default'}
valueOfSelected={activePalette?.name || DEFAULT_PALETTE}
selectionDisplay={'palette'}
/>
</EuiFormRow>

View file

@ -85,7 +85,20 @@ Object {
"single",
],
"palette": Array [
"default",
Object {
"chain": Array [
Object {
"arguments": Object {
"name": Array [
"default",
],
},
"function": "system_palette",
"type": "function",
},
],
"type": "expression",
},
],
"scale": Array [
"linear",
@ -187,7 +200,20 @@ Object {
"single",
],
"palette": Array [
"default",
Object {
"chain": Array [
Object {
"arguments": Object {
"name": Array [
"default",
],
},
"function": "system_palette",
"type": "function",
},
],
"type": "expression",
},
],
"scale": Array [
"linear",
@ -279,6 +305,18 @@ Object {
"type": "expression",
},
],
"palette": Array [
Object {
"chain": Array [
Object {
"arguments": Object {},
"function": "system_palette",
"type": "function",
},
],
"type": "expression",
},
],
"showLabel": Array [
false,
],

View file

@ -14,66 +14,68 @@ import { getTagCloudOptions } from './components/get_tag_cloud_options';
import { toExpressionAst } from './to_ast';
import { TagCloudVisDependencies } from './plugin';
export const getTagCloudVisTypeDefinition = ({ palettes }: TagCloudVisDependencies) => ({
name: 'tagcloud',
title: i18n.translate('visTypeTagCloud.vis.tagCloudTitle', { defaultMessage: 'Tag cloud' }),
icon: 'visTagCloud',
getSupportedTriggers: () => {
return [VIS_EVENT_TO_TRIGGER.filter];
},
description: i18n.translate('visTypeTagCloud.vis.tagCloudDescription', {
defaultMessage: 'Display word frequency with font size.',
}),
visConfig: {
defaults: {
scale: 'linear',
orientation: 'single',
minFontSize: 18,
maxFontSize: 72,
showLabel: true,
palette: {
name: 'default',
type: 'palette',
export const getTagCloudVisTypeDefinition = ({ palettes }: TagCloudVisDependencies) => {
return {
name: 'tagcloud',
title: i18n.translate('visTypeTagCloud.vis.tagCloudTitle', { defaultMessage: 'Tag cloud' }),
icon: 'visTagCloud',
getSupportedTriggers: () => {
return [VIS_EVENT_TO_TRIGGER.filter];
},
description: i18n.translate('visTypeTagCloud.vis.tagCloudDescription', {
defaultMessage: 'Display word frequency with font size.',
}),
visConfig: {
defaults: {
scale: 'linear',
orientation: 'single',
minFontSize: 18,
maxFontSize: 72,
showLabel: true,
palette: {
name: 'default',
type: 'palette',
},
},
},
},
toExpressionAst,
editorConfig: {
optionsTemplate: getTagCloudOptions({
palettes,
}),
schemas: [
{
group: AggGroupNames.Metrics,
name: 'metric',
title: i18n.translate('visTypeTagCloud.vis.schemas.metricTitle', {
defaultMessage: 'Tag size',
}),
min: 1,
max: 1,
aggFilter: [
'!std_dev',
'!percentiles',
'!percentile_ranks',
'!derivative',
'!geo_bounds',
'!geo_centroid',
'!filtered_metric',
'!single_percentile',
],
defaults: [{ schema: 'metric', type: 'count' }],
},
{
group: AggGroupNames.Buckets,
name: 'segment',
title: i18n.translate('visTypeTagCloud.vis.schemas.segmentTitle', {
defaultMessage: 'Tags',
}),
min: 1,
max: 1,
aggFilter: ['terms', 'significant_terms'],
},
],
},
requiresSearch: true,
});
toExpressionAst,
editorConfig: {
optionsTemplate: getTagCloudOptions({
palettes,
}),
schemas: [
{
group: AggGroupNames.Metrics,
name: 'metric',
title: i18n.translate('visTypeTagCloud.vis.schemas.metricTitle', {
defaultMessage: 'Tag size',
}),
min: 1,
max: 1,
aggFilter: [
'!std_dev',
'!percentiles',
'!percentile_ranks',
'!derivative',
'!geo_bounds',
'!geo_centroid',
'!filtered_metric',
'!single_percentile',
],
defaults: [{ schema: 'metric', type: 'count' }],
},
{
group: AggGroupNames.Buckets,
name: 'segment',
title: i18n.translate('visTypeTagCloud.vis.schemas.segmentTitle', {
defaultMessage: 'Tags',
}),
min: 1,
max: 1,
aggFilter: ['terms', 'significant_terms'],
},
],
},
requiresSearch: true,
};
};

View file

@ -6,6 +6,7 @@
* Side Public License, v 1.
*/
import { PaletteOutput } from 'src/plugins/charts/common';
import {
EsaggsExpressionFunctionDefinition,
IndexPatternLoadExpressionFunctionDefinition,
@ -25,6 +26,13 @@ const prepareDimension = (params: SchemaConfig) => {
return buildExpression([visdimension]);
};
const preparePalette = (palette?: PaletteOutput) => {
const paletteExpressionFunction = buildExpressionFunction('system_palette', {
name: palette?.name,
});
return buildExpression([paletteExpressionFunction]);
};
export const toExpressionAst: VisToExpressionAst<TagCloudVisParams> = (vis, params) => {
const esaggs = buildExpressionFunction<EsaggsExpressionFunctionDefinition>('esaggs', {
index: buildExpression([
@ -47,7 +55,7 @@ export const toExpressionAst: VisToExpressionAst<TagCloudVisParams> = (vis, para
maxFontSize,
showLabel,
metric: prepareDimension(schemas.metric[0]),
palette: palette?.name,
palette: preparePalette(palette),
});
if (schemas.segment) {

View file

@ -1 +1 @@
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"default","type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":100,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}

View file

@ -1 +1 @@
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"bucket":{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"default","type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"bucket":{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":100,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}

View file

@ -1 +1 @@
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[],"type":"datatable"},"visParams":{"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"default","type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[],"type":"datatable"},"visParams":{"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":100,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}

View file

@ -1 +1 @@
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"bucket":{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":40,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":20,"orientation":"single","palette":{"name":"default","type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"bucket":{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":40,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":20,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":100,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}

View file

@ -1 +1 @@
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"default","type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":100,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}

View file

@ -1 +1 @@
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"bucket":{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"multiple","palette":{"name":"default","type":"palette"},"scale":"log","showLabel":true},"visType":"tagcloud"}}
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"bucket":{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"multiple","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":100,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"log","showLabel":true},"visType":"tagcloud"}}

View file

@ -0,0 +1 @@
{"as":"metric_vis","type":"render","value":{"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":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"},{"id":"col-2-1","meta":{"field":"bytes","index":"logstash-*","params":{"id":"bytes","params":null},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{"field":"bytes"},"schema":"metric","type":"max"},"type":"number"},"name":"Max bytes"}],"rows":[],"type":"datatable"},"visType":"metric"}}

View file

@ -1 +1 @@
{"as":"metric_vis","type":"render","value":{"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":[],"meta":{},"rows":[],"type":"datatable"},"visType":"metric"}}
"[metricVis] > [visdimension] > Column name or index provided is invalid"

View file

@ -0,0 +1 @@
{"as":"metric_vis","type":"render","value":{"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":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"},{"id":"col-2-1","meta":{"field":"bytes","index":"logstash-*","params":{"id":"bytes","params":null},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{"field":"bytes"},"schema":"metric","type":"max"},"type":"number"},"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":"datatable"},"visType":"metric"}}

View file

@ -0,0 +1 @@
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":100,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}

View file

@ -1 +1 @@
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"bucket":{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"default","type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"bucket":{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":100,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}

View file

@ -1 +1 @@
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[],"type":"datatable"},"visParams":{"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"default","type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[],"type":"datatable"},"visParams":{"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":100,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}

View file

@ -1 +1 @@
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"bucket":{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":40,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":20,"orientation":"single","palette":{"name":"default","type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"bucket":{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":40,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":20,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":100,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}

View file

@ -1 +1 @@
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"default","type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":100,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}}

View file

@ -1 +1 @@
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"bucket":{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"multiple","palette":{"name":"default","type":"palette"},"scale":"log","showLabel":true},"visType":"tagcloud"}}
{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"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":"datatable"},"visParams":{"bucket":{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"multiple","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":100,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"log","showLabel":true},"visType":"tagcloud"}}

View file

@ -13,9 +13,9 @@ export const tagCloud: ElementFactory = () => ({
help: 'Tagcloud visualization',
icon: 'visTagCloud',
expression: `filters
| demodata
| head 150
| ply by="country" expression={math "count(country)" | as "Count"}
| demodata
| ply by="country" fn={math "count(country)" | as "Count"}
| filterrows fn={getCell "Count" | gte 10}
| tagcloud metric={visdimension "Count"} bucket={visdimension "country"}
| render`,
});

View file

@ -31,6 +31,7 @@ import { string } from './string';
import { textarea } from './textarea';
// @ts-expect-error untyped local
import { toggle } from './toggle';
import { visdimension } from './vis_dimension';
import { SetupInitializer } from '../../plugin';
@ -48,6 +49,7 @@ export const args = [
string,
textarea,
toggle,
visdimension,
];
export const initializers = [dateFormatInitializer, numberFormatInitializer];

View file

@ -43,6 +43,12 @@ SelectArgInput.propTypes = {
}),
}),
argId: PropTypes.string.isRequired,
choices: PropTypes.arrayOf(
PropTypes.shape({
name: PropTypes.string.isRequired,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]).isRequired,
})
),
};
export const select = () => ({

View file

@ -0,0 +1,99 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import React, { useState, useEffect, useCallback } from 'react';
import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSelect } from '@elastic/eui';
import { DatatableColumn, ExpressionAstExpression } from 'src/plugins/expressions';
import { templateFromReactComponent } from '../../../public/lib/template_from_react_component';
import { ArgumentStrings } from '../../../i18n';
const { VisDimension: strings } = ArgumentStrings;
interface VisDimensionArgInputProps {
onValueChange: (value: ExpressionAstExpression) => void;
argValue: ExpressionAstExpression;
argId?: string;
columns: DatatableColumn[];
typeInstance: {
options?: {
confirm?: string;
};
};
}
const VisDimensionArgInput: React.FC<VisDimensionArgInputProps> = ({
argValue,
typeInstance,
onValueChange,
argId,
columns,
}: {
// @todo define types
[key: string]: any;
}) => {
const [value, setValue] = useState(argValue);
const confirm = typeInstance?.options?.confirm;
useEffect(() => {
setValue(argValue);
}, [argValue]);
const onChange = useCallback(
(ev) => {
const onChangeFn = confirm ? setValue : onValueChange;
const astObj: ExpressionAstExpression = {
type: 'expression',
chain: [
{
type: 'function',
function: 'visdimension',
arguments: {
_: [ev.target.value],
},
},
],
};
onChangeFn(astObj);
},
[confirm, onValueChange]
);
const options = [
{ value: '', text: strings.getDefaultOptionName(), disabled: true },
...columns.map((column: DatatableColumn) => ({ value: column.name, text: column.name })),
];
const selectedValue = value.chain[0].arguments._?.[0];
const column =
columns
.map((col: DatatableColumn) => col.name)
.find((colName: string) => colName === selectedValue) || '';
return (
<EuiFlexGroup gutterSize="s" direction="column">
<EuiFlexItem>
<EuiSelect options={options} value={column} onChange={onChange} />
</EuiFlexItem>
{confirm && (
<EuiFlexItem grow={false}>
<EuiButton size="s" onClick={() => onValueChange(value)}>
{confirm}
</EuiButton>
</EuiFlexItem>
)}
</EuiFlexGroup>
);
};
export const visdimension = () => ({
name: 'vis_dimension',
displayName: strings.getDisplayName(),
help: strings.getHelp(),
simpleTemplate: templateFromReactComponent(VisDimensionArgInput),
});

View file

@ -7,5 +7,6 @@
import { pointseries } from './point_series';
import { math } from './math';
import { tagcloud } from './tagcloud';
export const modelSpecs = [pointseries, math];
export const modelSpecs = [pointseries, math, tagcloud];

View file

@ -0,0 +1,91 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { get } from 'lodash';
import { ViewStrings } from '../../../i18n';
import { getState, getValue } from '../../../public/lib/resolved_arg';
const { Tagcloud: strings } = ViewStrings;
export const tagcloud = () => ({
name: 'tagcloud',
displayName: strings.getDisplayName(),
args: [
{
name: 'metric',
displayName: strings.getMetricColumnDisplayName(),
help: strings.getMetricColumnHelp(),
argType: 'vis_dimension',
},
{
name: 'bucket',
displayName: strings.getBucketColumnDisplayName(),
help: strings.getBucketColumnHelp(),
argType: 'vis_dimension',
},
{
name: 'palette',
argType: 'palette',
},
{
name: 'orientation',
displayName: strings.getOrientationColumnDisplayName(),
help: strings.getOrientationColumnHelp(),
argType: 'select',
default: 'single',
options: {
choices: [
{ value: 'single', name: strings.getOrientationSingle() },
{ value: 'right angled', name: strings.getOrientationRightAngled() },
{ value: 'multiple', name: strings.getOrientationMultiple() },
],
},
},
{
name: 'scale',
displayName: strings.getScaleColumnDisplayName(),
help: strings.getScaleColumnHelp(),
argType: 'select',
default: 'linear',
options: {
choices: [
{ value: 'linear', name: strings.getScaleLinear() },
{ value: 'log', name: strings.getScaleLog() },
{ value: 'square root', name: strings.getScaleSquareRoot() },
],
},
},
{
name: 'minFontSize',
displayName: strings.getMinFontHeightColumnDisplayName(),
help: strings.getMinFontHeightColumnHelp(),
argType: 'number',
default: 18,
},
{
name: 'maxFontSize',
displayName: strings.getMaxFontHeightColumnDisplayName(),
help: strings.getMaxFontHeightColumnHelp(),
argType: 'number',
default: 72,
},
{
name: 'showLabel',
displayName: strings.getShowLabelColumnDisplayName(),
help: strings.getShowLabelColumnHelp(),
argType: 'toggle',
default: true,
},
],
resolve({ context }: any) {
if (getState(context) !== 'ready') {
return { columns: [] };
}
return { columns: get(getValue(context), 'columns', []) };
},
});

View file

@ -32,7 +32,6 @@ import { shape } from './shape';
import { table } from './table';
// @ts-expect-error untyped local
import { timefilterControl } from './timefilterControl';
import { SetupInitializer } from '../../plugin';
export const viewSpecs = [

View file

@ -314,6 +314,20 @@ export const ArgumentStrings = {
defaultMessage: 'A true/false toggle switch',
}),
},
VisDimension: {
getDisplayName: () =>
i18n.translate('xpack.canvas.uis.arguments.visDimensionTitle', {
defaultMessage: 'Column',
}),
getHelp: () =>
i18n.translate('xpack.canvas.uis.arguments.visDimensionLabel', {
defaultMessage: 'Generates visConfig dimension object',
}),
getDefaultOptionName: () =>
i18n.translate('xpack.canvas.uis.arguments.visDimensionDefaultOptionName', {
defaultMessage: 'Select column',
}),
},
};
export const DataSourceStrings = {
@ -1173,4 +1187,90 @@ export const ViewStrings = {
"Apply the selected group name to an element's filters function to target this filter",
}),
},
Tagcloud: {
getDisplayName: () =>
i18n.translate('xpack.canvas.uis.views.tagcloudTitle', {
defaultMessage: 'Tag Cloud',
}),
getScaleColumnDisplayName: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.scaleDisplayName', {
defaultMessage: 'Scale',
}),
getScaleColumnHelp: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.scaleHelp', {
defaultMessage: 'Scale to determine font size of a word',
}),
getScaleLinear: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.scaleLinearLabel', {
defaultMessage: 'Linear',
}),
getScaleLog: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.scaleLogLabel', {
defaultMessage: 'Log',
}),
getScaleSquareRoot: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.scaleSquareRootLabel', {
defaultMessage: 'Square root',
}),
getOrientationColumnDisplayName: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.orientationDisplayName', {
defaultMessage: 'Orientation',
}),
getOrientationColumnHelp: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.orientationHelp', {
defaultMessage: 'Orientation of words inside tagcloud',
}),
getOrientationSingle: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.orientationSingleLabel', {
defaultMessage: 'Single',
}),
getOrientationRightAngled: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.orientationRightAngledLabel', {
defaultMessage: 'Right angled',
}),
getOrientationMultiple: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.orientationMultipleLabel', {
defaultMessage: 'Multiple',
}),
getMinFontHeightColumnDisplayName: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.minFontHeightDisplayName', {
defaultMessage: 'Minimum font height',
}),
getMinFontHeightColumnHelp: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.minFontHeightHelp', {
defaultMessage: 'Minimum height of the element font',
}),
getMaxFontHeightColumnDisplayName: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.maxFontHeightDisplayName', {
defaultMessage: 'Maximum font height',
}),
getMaxFontHeightColumnHelp: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.maxFontHeightHelp', {
defaultMessage: 'Maximum height of the element font',
}),
getShowLabelColumnDisplayName: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.showLabelDisplayName', {
defaultMessage: 'Show label',
}),
getShowLabelColumnHelp: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.showLabelHelp', {
defaultMessage: 'Show label of the chart',
}),
getMetricColumnDisplayName: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.metricDisplayName', {
defaultMessage: 'Metric',
}),
getMetricColumnHelp: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.metricHelp', {
defaultMessage: 'Metric dimension configuration',
}),
getBucketColumnDisplayName: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.bucketDisplayName', {
defaultMessage: 'Bucket',
}),
getBucketColumnHelp: () =>
i18n.translate('xpack.canvas.uis.views.tagcloud.args.bucketHelp', {
defaultMessage: 'Bucket dimension configuration',
}),
},
};

View file

@ -7,6 +7,7 @@
import React, { FC } from 'react';
import PropTypes from 'prop-types';
import { isEqual } from 'lodash';
import { EuiColorPalettePicker, EuiColorPalettePickerPaletteProps } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
@ -39,6 +40,15 @@ interface ClearableProps {
type Props = RequiredProps | ClearableProps;
const findPalette = (colorPalette: ColorPalette | null, colorPalettes: ColorPalette[] = []) => {
const palette = colorPalettes.filter((cp) => cp.id === colorPalette?.id)[0] ?? null;
if (palette === null) {
return colorPalettes.filter((cp) => isEqual(cp.colors, colorPalette?.colors))[0] ?? null;
}
return palette;
};
export const PalettePicker: FC<Props> = (props) => {
const colorPalettes: EuiColorPalettePickerPaletteProps[] = palettes.map((item) => ({
value: item.id,
@ -61,13 +71,15 @@ export const PalettePicker: FC<Props> = (props) => {
onChange(canvasPalette || null);
};
const foundPalette = findPalette(palette, palettes);
return (
<EuiColorPalettePicker
id={props.id}
compressed={true}
palettes={colorPalettes}
onChange={onPickerChange}
valueOfSelected={palette ? palette.id : 'clear'}
valueOfSelected={foundPalette?.id ?? 'clear'}
/>
);
}
@ -84,13 +96,15 @@ export const PalettePicker: FC<Props> = (props) => {
onChange(canvasPalette);
};
const foundPalette = findPalette(palette, palettes);
return (
<EuiColorPalettePicker
id={props.id}
compressed={true}
palettes={colorPalettes}
onChange={onPickerChange}
valueOfSelected={palette.id}
valueOfSelected={foundPalette?.id}
/>
);
};

View file

@ -73,6 +73,9 @@ $canvasLayoutFontSize: $euiFontSizeS;
.euiPanel {
margin-bottom: $euiSizeS;
}
.euiPanel.euiSplitPanel__inner {
margin-bottom: 0;
}
}
.canvasLayout__footer {

View file

@ -125,7 +125,7 @@ export const HeatmapComponent: FC<HeatmapRenderProps> = ({
const tableId = Object.keys(data.tables)[0];
const table = data.tables[tableId];
const paletteParams = args.palette?.params as CustomPaletteState;
const paletteParams = args.palette?.params;
const xAxisColumnIndex = table.columns.findIndex((v) => v.id === args.xAccessor);
const yAxisColumnIndex = table.columns.findIndex((v) => v.id === args.yAccessor);

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import type { PaletteOutput } from '../../../../../src/plugins/charts/common';
import type { CustomPaletteState, PaletteOutput } from '../../../../../src/plugins/charts/common';
import type { LensBrushEvent, LensFilterEvent } from '../types';
import type { LensMultiTable, FormatFactory, CustomPaletteParams, LayerType } from '../../common';
import type { HeatmapGridConfigResult, HeatmapLegendConfigResult } from '../../common/expressions';
@ -36,7 +36,7 @@ export type HeatmapVisualizationState = HeatmapLayerState & {
export type HeatmapExpressionArgs = SharedHeatmapLayerState & {
title?: string;
description?: string;
palette: PaletteOutput;
palette: PaletteOutput<CustomPaletteState>;
};
export interface HeatmapRender {