Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Canvas] XY. Step 3. Move XY functions and renderer from vis_types to chart_expressions. #112425

Closed
Closed
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
9dfab8a
Added comments for places I wished to refactor.
Kuznietsov Aug 12, 2021
76b1f5d
Merge branch 'master' into xy_chart
Kuznietsov Aug 23, 2021
8a6b502
Fixed comments.
Kuznietsov Aug 23, 2021
f74fc28
Removed logic, related to BUCKET_TYPES.
Kuznietsov Sep 1, 2021
87fd22f
removed aggType connected code.
Kuznietsov Sep 1, 2021
df2e3db
Added `id` to `xy_dimension` to avoid direct comparison with aggId
Kuznietsov Sep 2, 2021
6093e96
Removed all checks of seriesParams at chart.
Kuznietsov Sep 2, 2021
80eb59f
removed aggId and aggType from chart
Kuznietsov Sep 2, 2021
74867c6
Merge branch 'master' into xy_chart
kibanamachine Sep 2, 2021
807a8eb
removed all aggId/aggTypes from tests/mocks.
Kuznietsov Sep 2, 2021
c803841
Fixed comment.
Kuznietsov Sep 2, 2021
ce5c1d4
moved `get_agg_id.ts` util to the vislib
Kuznietsov Sep 2, 2021
8276a66
clearified the code, related to isSimpleField logic.
Kuznietsov Sep 2, 2021
ef3dcef
added comment.
Kuznietsov Sep 2, 2021
9909715
Fixed error at percentile agg.
Kuznietsov Sep 2, 2021
4b34965
Fixed render_all_series failure of tests.
Kuznietsov Sep 2, 2021
7dd186a
Added tests for new behavior.
Kuznietsov Sep 2, 2021
a325fe4
changed the way of handling `enableHistogramMode`.
Kuznietsov Sep 3, 2021
6a70424
updated snapshots.
Kuznietsov Sep 3, 2021
defbf4f
Merge branch 'master' into xy_chart
Kuznietsov Sep 3, 2021
4fe713e
remove not used lib.
Kuznietsov Sep 3, 2021
bc7f819
Merge branch 'master' into xy_chart_step_2
Kuznietsov Sep 6, 2021
9803617
added XDomain function.
Kuznietsov Sep 6, 2021
86dd481
Added timezone.
Kuznietsov Sep 7, 2021
bfe428b
removed all code, connected to 'interval'
Kuznietsov Sep 7, 2021
5ff3a00
Fixed types at to_ast.ts.
Kuznietsov Sep 7, 2021
f4ea45c
updated tests.
Kuznietsov Sep 7, 2021
38d066c
Fixed types errors.
Kuznietsov Sep 7, 2021
10d17a3
updated code of x_domain.
Kuznietsov Sep 8, 2021
5b0fd1c
Applied enableHistogramMode for single bars.
Kuznietsov Sep 10, 2021
c7f7f9d
Merge branch 'presentation/feature-xy' into xy_chart_step_2
kibanamachine Sep 10, 2021
33dc89f
Merge branch 'presentation/feature-xy' into xy_chart
kibanamachine Sep 10, 2021
aa6e158
Merge branch 'presentation/feature-xy' into xy_chart
kibanamachine Sep 10, 2021
84fe9a9
Merge branch 'presentation/feature-xy' into xy_chart
kibanamachine Sep 10, 2021
bea0dbd
added fix for histogram mode.
Kuznietsov Sep 13, 2021
fa9bc9d
Merge branch 'master' into xy_chart
Kuznietsov Sep 13, 2021
42dba8d
Merge branch 'xy_chart' into xy_chart_step_2
Kuznietsov Sep 13, 2021
566c1d1
Fixed types error at `x_domain`.
Kuznietsov Sep 13, 2021
308a84e
Merge branch 'master' into xy_chart
kibanamachine Sep 13, 2021
7139a71
Removed references to xy types at vislib.
Kuznietsov Sep 13, 2021
e0aca67
Merge branch 'master' into xy_chart
kibanamachine Sep 13, 2021
b4f3f2f
Fixed bug.
Kuznietsov Sep 13, 2021
b897712
Merge branch 'master' into xy_chart_step_2
kibanamachine Sep 14, 2021
6072669
Fixed tests.
Kuznietsov Sep 14, 2021
bbe4077
Merge branch 'master' into xy_chart
kibanamachine Sep 14, 2021
7714247
Fixed shard_delay test.
Kuznietsov Sep 14, 2021
4c283a2
Merge branch 'xy_chart' into xy_chart_step_2
Kuznietsov Sep 14, 2021
2a9b3f7
Merge branch 'presentation/feature-xy' into xy_chart_step_2
kibanamachine Sep 14, 2021
0bcd574
generated skeleton of the expression_xy plugin.
Kuznietsov Sep 16, 2021
c24e6e4
splitted xy for vis_editor and expression.
Kuznietsov Sep 16, 2021
7e5e4e8
changed translations
Kuznietsov Sep 16, 2021
7e01344
Added fixes of export.
Kuznietsov Sep 16, 2021
a965e6e
Merge branch 'presentation/feature-xy' into xy_chart_step_3
kibanamachine Sep 17, 2021
a2532ae
Merge branch 'presentation/feature-xy' into xy_chart_step_3
kibanamachine Sep 17, 2021
a7e5dc2
Added check fixes.
Kuznietsov Sep 17, 2021
e72b51c
updated dependencies.
Kuznietsov Sep 17, 2021
84ce852
fixed translations and plugin-list.
Kuznietsov Sep 17, 2021
72c3f3b
added missing data plugin to vis_types/xy.
Kuznietsov Sep 17, 2021
9d06227
Merge branch 'presentation/feature-xy' into xy_chart
Kuznietsov Sep 20, 2021
e24fec5
Merge branch 'xy_chart_step_2' into xy_chart_step_3
Kuznietsov Sep 20, 2021
2f2396a
fixed linter errors.
Kuznietsov Sep 21, 2021
2390697
removed all todos from xy.
Kuznietsov Sep 21, 2021
679edc3
Merge branch 'xy_chart_step_2' into xy_chart_step_3
Kuznietsov Sep 21, 2021
4538d49
removed latest @todo.
Kuznietsov Sep 21, 2021
c7d9ad2
Merge branch 'xy_chart_step_2' into xy_chart_step_3
Kuznietsov Sep 21, 2021
d00c6a9
removed latest todos.
Kuznietsov Sep 21, 2021
884bc38
Changed the type of tickFormatter.
Kuznietsov Sep 21, 2021
db434f3
Merge branch 'xy_chart' into xy_chart_step_2
Kuznietsov Sep 21, 2021
354e8d2
Merge branch 'xy_chart_step_2' into xy_chart_step_3
Kuznietsov Sep 21, 2021
1512f9b
types fixed.
Kuznietsov Sep 21, 2021
218f2dc
Merge remote-tracking branch 'upstream/presentation/feature-xy' into …
Kuznietsov Sep 22, 2021
0e05d24
Merge branch 'xy_chart_step_2' into xy_chart_step_3
Kuznietsov Sep 22, 2021
e615369
fixed duplicated fn.
Kuznietsov Sep 22, 2021
5ba5a2e
Merge branch 'xy_chart_step_2' into xy_chart_step_3
Kuznietsov Sep 22, 2021
6ab5eca
fixed bugs with split series.
Kuznietsov Sep 22, 2021
bf1197c
Moved `getNextToAccessorColumn` to accessor.ts
Kuznietsov Sep 24, 2021
27457e2
Added tests to accessor.ts.
Kuznietsov Sep 24, 2021
dd9b6d6
added tests for accessors at xy.
Kuznietsov Sep 24, 2021
ca9d514
added tests for getXAccessor.
Kuznietsov Sep 24, 2021
c9e7dcb
added test for force applying formatter.
Kuznietsov Sep 24, 2021
952d78e
added tests for isPercentileIdEqualToSeriesId
Kuznietsov Sep 24, 2021
d8bc348
Merge branch 'presentation/feature-xy' into xy_chart_step_2
kibanamachine Sep 24, 2021
49924ee
Removed not used Accessor type import.
Kuznietsov Sep 24, 2021
2ca1874
Small refactor of code.
Kuznietsov Sep 24, 2021
a61fee6
Merge branch 'presentation/feature-xy' into xy_chart_step_2
kibanamachine Sep 27, 2021
c659447
Merge branch 'xy_chart_step_2' into xy_chart_step_3
Kuznietsov Sep 27, 2021
45a97cb
Merge branch 'presentation/feature-xy' into xy_chart_step_3
kibanamachine Sep 27, 2021
3511c9b
Added description to the x_domain expression.
Kuznietsov Sep 28, 2021
4bd6b39
Merge branch 'xy_chart_step_2' into xy_chart_step_3
Kuznietsov Sep 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"expressionRevealImage": "src/plugins/expression_reveal_image",
"expressionShape": "src/plugins/expression_shape",
"expressionTagcloud": "src/plugins/chart_expressions/expression_tagcloud",
"expressionXy": "src/plugins/chart_expressions/expression_xy",
"inputControl": "src/plugins/input_control_vis",
"inspector": "src/plugins/inspector",
"inspectorViews": "src/legacy/core_plugins/inspector_views",
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ for use in their own application.
|Expression Tagcloud plugin adds a tagcloud renderer and function to the expression plugin. The renderer will display the Wordcloud chart.


|{kib-repo}blob/{branch}/src/plugins/chart_expressions/expression_xy/README.md[expressionXy]
|Expression XY plugin adds a xy renderer and function to the expression plugin. The renderer will display the xy-axis chart.


|{kib-repo}blob/{branch}/src/plugins/field_formats/README.md[fieldFormats]
|Index pattern fields formatters

Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ pageLoadAssetSize:
visTypeTimeseries: 55203
visTypeVega: 153573
visTypeVislib: 242838
visTypeXy: 113478
visualizations: 90000
visualize: 57431
watcher: 43598
Expand All @@ -115,3 +114,5 @@ pageLoadAssetSize:
expressionTagcloud: 27505
expressions: 239290
securitySolution: 231753
expressionXy: 56824
visTypeXy: 38728
9 changes: 9 additions & 0 deletions src/plugins/chart_expressions/expression_xy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# expressionXY

Expression XY plugin adds a `xy` renderer and function to the expression plugin. The renderer will display the xy-axis chart.

---

## Development

See the [kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) for instructions setting up your development environment.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export const EXPRESSION_NAME = 'xy_vis';
Original file line number Diff line number Diff line change
Expand Up @@ -7,91 +7,64 @@
*/

import { i18n } from '@kbn/i18n';
import type {
ExpressionFunctionDefinition,
Datatable,
ExpressionValueBoxed,
} from '../../../../expressions/public';
import type { CategoryAxis } from '../types';
import type { ExpressionValueScale } from './vis_scale';
import type { ExpressionValueLabel } from './label';

export interface Arguments extends Omit<CategoryAxis, 'title' | 'scale' | 'labels'> {
title?: string;
scale: ExpressionValueScale;
labels: ExpressionValueLabel;
}

export type ExpressionValueCategoryAxis = ExpressionValueBoxed<
'category_axis',
{
id: CategoryAxis['id'];
show: CategoryAxis['show'];
position: CategoryAxis['position'];
axisType: CategoryAxis['type'];
title: {
text?: string;
};
labels: CategoryAxis['labels'];
scale: CategoryAxis['scale'];
}
>;
import type { ExpressionFunctionDefinition, Datatable } from '../../../../expressions/public';
import { ExpressionValueCategoryAxis, ExpressionValueCategoryAxisArguments } from '../types';

export const categoryAxis = (): ExpressionFunctionDefinition<
'categoryaxis',
Datatable | null,
Arguments,
ExpressionValueCategoryAxisArguments,
ExpressionValueCategoryAxis
> => ({
name: 'categoryaxis',
help: i18n.translate('visTypeXy.function.categoryAxis.help', {
help: i18n.translate('expressionXy.function.categoryAxis.help', {
defaultMessage: 'Generates category axis object',
}),
type: 'category_axis',
args: {
id: {
types: ['string'],
help: i18n.translate('visTypeXy.function.categoryAxis.id.help', {
help: i18n.translate('expressionXy.function.categoryAxis.id.help', {
defaultMessage: 'Id of category axis',
}),
required: true,
},
show: {
types: ['boolean'],
help: i18n.translate('visTypeXy.function.categoryAxis.show.help', {
help: i18n.translate('expressionXy.function.categoryAxis.show.help', {
defaultMessage: 'Show the category axis',
}),
required: true,
},
position: {
types: ['string'],
help: i18n.translate('visTypeXy.function.categoryAxis.position.help', {
help: i18n.translate('expressionXy.function.categoryAxis.position.help', {
defaultMessage: 'Position of the category axis',
}),
required: true,
},
type: {
types: ['string'],
help: i18n.translate('visTypeXy.function.categoryAxis.type.help', {
help: i18n.translate('expressionXy.function.categoryAxis.type.help', {
defaultMessage: 'Type of the category axis. Can be category or value',
}),
required: true,
},
title: {
types: ['string'],
help: i18n.translate('visTypeXy.function.categoryAxis.title.help', {
help: i18n.translate('expressionXy.function.categoryAxis.title.help', {
defaultMessage: 'Title of the category axis',
}),
},
scale: {
types: ['vis_scale'],
help: i18n.translate('visTypeXy.function.categoryAxis.scale.help', {
help: i18n.translate('expressionXy.function.categoryAxis.scale.help', {
defaultMessage: 'Scale config',
}),
},
labels: {
types: ['label'],
help: i18n.translate('visTypeXy.function.categoryAxis.labels.help', {
help: i18n.translate('expressionXy.function.categoryAxis.labels.help', {
defaultMessage: 'Axis label config',
}),
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export { visTypeXyVisFn } from './xy_vis_fn';
export { categoryAxis } from './category_axis';
export { timeMarker } from './time_marker';
export { valueAxis } from './value_axis';
export { seriesParam } from './series_param';
export { thresholdLine } from './threshold_line';
export { label } from './label';
export { visScale } from './vis_scale';
export { xDomain } from './x_domain';
Original file line number Diff line number Diff line change
Expand Up @@ -7,70 +7,54 @@
*/

import { i18n } from '@kbn/i18n';
import type { Labels } from '../../../../charts/public';
import type {
ExpressionFunctionDefinition,
Datatable,
ExpressionValueBoxed,
} from '../../../../expressions/public';

export type ExpressionValueLabel = ExpressionValueBoxed<
'label',
{
color?: Labels['color'];
filter?: Labels['filter'];
overwriteColor?: Labels['overwriteColor'];
rotate?: Labels['rotate'];
show?: Labels['show'];
truncate?: Labels['truncate'];
}
>;
import type { ExpressionFunctionDefinition, Datatable } from '../../../../expressions/public';
import { ExpressionValueLabel, ExpressionValueLabelArguments } from '../types';

export const label = (): ExpressionFunctionDefinition<
'label',
Datatable | null,
Labels,
ExpressionValueLabelArguments,
ExpressionValueLabel
> => ({
name: 'label',
help: i18n.translate('visTypeXy.function.label.help', {
help: i18n.translate('expressionXy.function.label.help', {
defaultMessage: 'Generates label object',
}),
type: 'label',
args: {
color: {
types: ['string'],
help: i18n.translate('visTypeXy.function.label.color.help', {
help: i18n.translate('expressionXy.function.label.color.help', {
defaultMessage: 'Color of label',
}),
},
filter: {
types: ['boolean'],
help: i18n.translate('visTypeXy.function.label.filter.help', {
help: i18n.translate('expressionXy.function.label.filter.help', {
defaultMessage: 'Hides overlapping labels and duplicates on axis',
}),
},
overwriteColor: {
types: ['boolean'],
help: i18n.translate('visTypeXy.function.label.overwriteColor.help', {
help: i18n.translate('expressionXy.function.label.overwriteColor.help', {
defaultMessage: 'Overwrite color',
}),
},
rotate: {
types: ['number'],
help: i18n.translate('visTypeXy.function.label.rotate.help', {
help: i18n.translate('expressionXy.function.label.rotate.help', {
defaultMessage: 'Rotate angle',
}),
},
show: {
types: ['boolean'],
help: i18n.translate('visTypeXy.function.label.show.help', {
help: i18n.translate('expressionXy.function.label.show.help', {
defaultMessage: 'Show label',
}),
},
truncate: {
types: ['number', 'null'],
help: i18n.translate('visTypeXy.function.label.truncate.help', {
help: i18n.translate('expressionXy.function.label.truncate.help', {
defaultMessage: 'The number of symbols before truncating',
}),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,113 +7,88 @@
*/

import { i18n } from '@kbn/i18n';
import type {
ExpressionFunctionDefinition,
Datatable,
ExpressionValueBoxed,
} from '../../../../expressions/public';
import type { SeriesParam } from '../types';

export interface Arguments extends Omit<SeriesParam, 'data'> {
label: string;
id: string;
}

export type ExpressionValueSeriesParam = ExpressionValueBoxed<
'series_param',
{
data: { label: string; id: string };
drawLinesBetweenPoints?: boolean;
interpolate?: SeriesParam['interpolate'];
lineWidth?: number;
mode: SeriesParam['mode'];
show: boolean;
showCircles: boolean;
circlesRadius: number;
seriesParamType: SeriesParam['type'];
valueAxis: string;
}
>;
import type { ExpressionFunctionDefinition, Datatable } from '../../../../expressions/public';
import { ExpressionValueSeriesParam, ExpressionValueSeriesParamArguments } from '../types';

export const seriesParam = (): ExpressionFunctionDefinition<
'seriesparam',
Datatable,
Arguments,
ExpressionValueSeriesParamArguments,
ExpressionValueSeriesParam
> => ({
name: 'seriesparam',
help: i18n.translate('visTypeXy.function.seriesparam.help', {
help: i18n.translate('expressionXy.function.seriesparam.help', {
defaultMessage: 'Generates series param object',
}),
type: 'series_param',
inputTypes: ['datatable'],
args: {
label: {
types: ['string'],
help: i18n.translate('visTypeXy.function.seriesParam.label.help', {
help: i18n.translate('expressionXy.function.seriesParam.label.help', {
defaultMessage: 'Name of series param',
}),
required: true,
},
id: {
types: ['string'],
help: i18n.translate('visTypeXy.function.seriesParam.id.help', {
help: i18n.translate('expressionXy.function.seriesParam.id.help', {
defaultMessage: 'Id of series param',
}),
required: true,
},
drawLinesBetweenPoints: {
types: ['boolean'],
help: i18n.translate('visTypeXy.function.seriesParam.drawLinesBetweenPoints.help', {
help: i18n.translate('expressionXy.function.seriesParam.drawLinesBetweenPoints.help', {
defaultMessage: 'Draw lines between points',
}),
},
interpolate: {
types: ['string'],
help: i18n.translate('visTypeXy.function.seriesParam.interpolate.help', {
help: i18n.translate('expressionXy.function.seriesParam.interpolate.help', {
defaultMessage: 'Interpolate mode. Can be linear, cardinal or step-after',
}),
},
show: {
types: ['boolean'],
help: i18n.translate('visTypeXy.function.seriesParam.show.help', {
help: i18n.translate('expressionXy.function.seriesParam.show.help', {
defaultMessage: 'Show param',
}),
required: true,
},
lineWidth: {
types: ['number'],
help: i18n.translate('visTypeXy.function.seriesParam.lineWidth.help', {
help: i18n.translate('expressionXy.function.seriesParam.lineWidth.help', {
defaultMessage: 'Width of line',
}),
},
mode: {
types: ['string'],
help: i18n.translate('visTypeXy.function.seriesParam.mode.help', {
help: i18n.translate('expressionXy.function.seriesParam.mode.help', {
defaultMessage: 'Chart mode. Can be stacked or percentage',
}),
},
showCircles: {
types: ['boolean'],
help: i18n.translate('visTypeXy.function.seriesParam.showCircles.help', {
help: i18n.translate('expressionXy.function.seriesParam.showCircles.help', {
defaultMessage: 'Show circles',
}),
},
circlesRadius: {
types: ['number'],
help: i18n.translate('visTypeXy.function.seriesParam.circlesRadius.help', {
help: i18n.translate('expressionXy.function.seriesParam.circlesRadius.help', {
defaultMessage: 'Defines the circles size (radius)',
}),
},
type: {
types: ['string'],
help: i18n.translate('visTypeXy.function.seriesParam.type.help', {
help: i18n.translate('expressionXy.function.seriesParam.type.help', {
defaultMessage: 'Chart type. Can be line, area or histogram',
}),
},
valueAxis: {
types: ['string'],
help: i18n.translate('visTypeXy.function.seriesParam.valueAxis.help', {
help: i18n.translate('expressionXy.function.seriesParam.valueAxis.help', {
defaultMessage: 'Name of value axis',
}),
},
Expand Down
Loading