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

[Visualize] New heatmap implementation with elastic-charts #118338

Merged
merged 53 commits into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
3eb8164
[WIP][Heatmap] Creates implementation with elastic-charts
stratoula Oct 26, 2021
ccacd81
Fix types and connection with vislib
stratoula Oct 26, 2021
6f34e16
Add coloring options
stratoula Oct 27, 2021
fcde81f
Merge branch 'elastic:main' into new-heatmap-implementation
stratoula Nov 3, 2021
5201475
Brush, click events, coloring etc
stratoula Nov 4, 2021
f65fcdc
Cleaning up the expression function
stratoula Nov 8, 2021
0394bd4
Merge branch 'main' into new-heatmap-implementation
stratoula Nov 8, 2021
9db7641
Add legend picker, fix sorting and other fixes
stratoula Nov 8, 2021
51d8b5a
Merge with main and resolve conflicts
stratoula Nov 8, 2021
4e2048e
Further fixes
stratoula Nov 8, 2021
722db2d
Use the shared expression to Lens and cleanup
stratoula Nov 10, 2021
1e0a5a7
PrepareLogTables for new expression function
stratoula Nov 10, 2021
4a3e6d8
Use common renderer and expression function with lens
stratoula Nov 10, 2021
b82e4ca
Fix i18n
stratoula Nov 10, 2021
d29bc79
Merge with master and resolve conflicts
stratoula Nov 11, 2021
e964a47
Small tweaks
stratoula Nov 11, 2021
91ef099
Add unit tests
stratoula Nov 11, 2021
57acd71
Adds a unit test to the heatmap component
stratoula Nov 11, 2021
d2c02e7
update plugin list
stratoula Nov 11, 2021
981a97e
Fix types
stratoula Nov 11, 2021
446e664
Fix types
stratoula Nov 11, 2021
ac0dd4a
update limits
stratoula Nov 12, 2021
173acb2
Change to the expression function
stratoula Nov 13, 2021
7284abd
Merge branch 'main' into new-heatmap-implementation
kibanamachine Nov 15, 2021
dabe1e7
Cleanup translations
stratoula Nov 15, 2021
4f5b082
Refactor to use vis
stratoula Nov 15, 2021
3c943b2
Fix types
stratoula Nov 15, 2021
d2ff5d0
further cleanup of the translations
stratoula Nov 15, 2021
ae4fd5d
register new setting
stratoula Nov 15, 2021
e7b53ad
Fix sorting for histogram
stratoula Nov 15, 2021
e90847b
Merge with master and resolve conflicts
stratoula Nov 15, 2021
5649ff2
Adds functional tests for the new nisualize heatmap
stratoula Nov 16, 2021
4d0ce5d
Cleanup
stratoula Nov 16, 2021
2d13412
Fix
stratoula Nov 17, 2021
8d10144
Merge branch 'main' into new-heatmap-implementation
kibanamachine Nov 17, 2021
c79f582
Apply PR comments
stratoula Nov 17, 2021
4721326
Address PR comments
stratoula Nov 17, 2021
4e63fdb
Fix i18n
stratoula Nov 17, 2021
a519867
Fix i18n
stratoula Nov 17, 2021
5bfa56f
Makes the <Heatmap /> id dynamic
stratoula Nov 18, 2021
17f4e53
reverse
stratoula Nov 18, 2021
5858be2
Merge with master and resolve conflicts
stratoula Nov 23, 2021
cac9873
fix translation file
stratoula Nov 23, 2021
fc0bfb4
Apply design PR comments
stratoula Nov 23, 2021
808856d
Merge with master and resolve conflicts
stratoula Nov 24, 2021
0bb4c7f
Merge branch 'main' into new-heatmap-implementation
kibanamachine Nov 24, 2021
8653a82
Merge with main, resolve conflicts, adds theme provider
stratoula Nov 24, 2021
473bb99
Merge with main and resolve conflicts
stratoula Nov 24, 2021
118abe1
Fix package
stratoula Nov 24, 2021
2865d3f
More fixes
stratoula Nov 24, 2021
bbd96e1
Fix brush problem
stratoula Nov 25, 2021
0db6c8b
Merge branch 'main' into new-heatmap-implementation
kibanamachine Nov 29, 2021
01d4ac9
Merge branch 'main' into new-heatmap-implementation
kibanamachine Nov 30, 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
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
/src/plugins/vis_types/vislib/ @elastic/kibana-vis-editors
/src/plugins/vis_types/xy/ @elastic/kibana-vis-editors
/src/plugins/vis_types/pie/ @elastic/kibana-vis-editors
/src/plugins/vis_types/heatmap/ @elastic/kibana-vis-editors
/src/plugins/visualize/ @elastic/kibana-vis-editors
/src/plugins/visualizations/ @elastic/kibana-vis-editors
/src/plugins/chart_expressions/expression_tagcloud/ @elastic/kibana-vis-editors
/src/plugins/chart_expressions/expression_metric/ @elastic/kibana-vis-editors
/src/plugins/chart_expressions/expression_heatmap/ @elastic/kibana-vis-editors
/src/plugins/url_forwarding/ @elastic/kibana-vis-editors
/packages/kbn-tinymath/ @elastic/kibana-vis-editors
/x-pack/test/functional/apps/lens @elastic/kibana-vis-editors
Expand Down
2 changes: 2 additions & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"expressionRepeatImage": "src/plugins/expression_repeat_image",
"expressionRevealImage": "src/plugins/expression_reveal_image",
"expressionShape": "src/plugins/expression_shape",
"expressionHeatmap": "src/plugins/chart_expressions/expression_heatmap",
"expressionTagcloud": "src/plugins/chart_expressions/expression_tagcloud",
"expressionMetricVis": "src/plugins/chart_expressions/expression_metric",
"inputControl": "src/plugins/input_control_vis",
Expand Down Expand Up @@ -69,6 +70,7 @@
"visTypeVislib": "src/plugins/vis_types/vislib",
"visTypeXy": "src/plugins/vis_types/xy",
"visTypePie": "src/plugins/vis_types/pie",
"visTypeHeatmap": "src/plugins/vis_types/heatmap",
"visualizations": "src/plugins/visualizations",
"visualize": "src/plugins/visualize",
"apmOss": "src/plugins/apm_oss",
Expand Down
8 changes: 8 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ This API doesn't support angular, for registering angular dev tools, bootstrap a
|Expression Error plugin adds an error renderer to the expression plugin. The renderer will display the error image.


|{kib-repo}blob/{branch}/src/plugins/chart_expressions/expression_heatmap[expressionHeatmap]
|WARNING: Missing README.


|{kib-repo}blob/{branch}/src/plugins/expression_image/README.md[expressionImage]
|Expression Image plugin adds an image renderer to the expression plugin. The renderer will display the given image.

Expand Down Expand Up @@ -274,6 +278,10 @@ It acts as a container for a particular visualization and options tabs. Contains
The plugin exposes the static DefaultEditorController class to consume.


|{kib-repo}blob/{branch}/src/plugins/vis_types/heatmap[visTypeHeatmap]
|WARNING: Missing README.


|{kib-repo}blob/{branch}/src/plugins/vis_type_markdown/README.md[visTypeMarkdown]
|The markdown visualization that can be used to place text panels on dashboards.

Expand Down
5 changes: 4 additions & 1 deletion docs/management/advanced-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,10 @@ Enables the legacy time axis for charts in Lens, Discover, Visualize and TSVB
The maximum number of buckets a datasource can return. High numbers can have a negative impact on your browser rendering performance.

[[visualization-visualize-pieChartslibrary]]`visualization:visualize:legacyPieChartsLibrary`::
The visualize editor uses new pie charts with improved performance, color palettes, label positioning, and more. Enable this option if you prefer to use to the legacy charts library.
The visualize editor uses new pie charts with improved performance, color palettes, label positioning, and more. Enable this option if you prefer to use the legacy charts library.

[[visualization-visualize-heatmapChartslibrary]]`visualization:visualize:legacyHeatmapChartsLibrary`::
Disable this option if you prefer to use the new heatmap charts with improved performance, legend settings, and more..

[[visualize-enablelabs]]`visualize:enableLabs`::
Enables users to create, view, and edit experimental visualizations. When disabled,
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ pageLoadAssetSize:
securitySolution: 273763
customIntegrations: 28810
expressionMetricVis: 23121
expressionHeatmap: 27505
visTypeMetric: 23332
bfetch: 22837
kibanaUtils: 79713
Expand All @@ -115,3 +116,4 @@ pageLoadAssetSize:
dataViewFieldEditor: 20000
dataViewManagement: 5000
reporting: 57003
visTypeHeatmap: 25340
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* 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_HEATMAP_NAME = 'heatmap';
export const EXPRESSION_HEATMAP_LEGEND_NAME = 'heatmap_legend';
export const EXPRESSION_HEATMAP_GRID_NAME = 'heatmap_grid';
export const HEATMAP_FUNCTION_RENDERER_NAME = 'heatmap_renderer';

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* 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.
*/

import { heatmapFunction } from './heatmap_function';
import type { HeatmapArguments } from '../../common';
import { functionWrapper } from '../../../../expressions/common/expression_functions/specs/tests/utils';
import { Datatable } from '../../../../expressions/common/expression_types/specs';
import { EXPRESSION_HEATMAP_GRID_NAME, EXPRESSION_HEATMAP_LEGEND_NAME } from '../constants';

describe('interpreter/functions#heatmap', () => {
const fn = functionWrapper(heatmapFunction());
const context: Datatable = {
type: 'datatable',
rows: [{ 'col-0-1': 0 }],
columns: [
{ id: 'col-0-1', name: 'Count', meta: { type: 'number' } },
{ id: 'col-1-2', name: 'Dest', meta: { type: 'string' } },
],
};
const args: HeatmapArguments = {
percentageMode: false,
legend: {
isVisible: true,
position: 'top',
type: EXPRESSION_HEATMAP_LEGEND_NAME,
},
gridConfig: {
isCellLabelVisible: true,
isYAxisLabelVisible: true,
isXAxisLabelVisible: true,
type: EXPRESSION_HEATMAP_GRID_NAME,
},
palette: {
type: 'palette',
name: '',
params: {
colors: ['rgb(0, 0, 0, 0)', 'rgb(112, 38, 231)'],
stops: [0, 10000],
gradient: false,
rangeMin: 0,
rangeMax: 150,
range: 'number',
},
},
showTooltip: true,
highlightInHover: false,
xAccessor: 'col-1-2',
valueAccessor: 'col-0-1',
};

it('returns an object with the correct structure', () => {
const actual = fn(context, args, undefined);

expect(actual).toMatchSnapshot();
});

it('logs correct datatable to inspector', async () => {
let loggedTable: Datatable;
const handlers = {
inspectorAdapters: {
tables: {
logDatatable: (name: string, datatable: Datatable) => {
loggedTable = datatable;
},
},
},
};
await fn(context, args, handlers as any);

expect(loggedTable!).toMatchSnapshot();
});
});
Loading