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

[Lens] Heatmap / Swim lane integration #97978

Merged
merged 83 commits into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
d67fad6
heatmap wip
darnautov Mar 29, 2021
381240e
format values on X axis
darnautov Mar 30, 2021
415b567
format values for cells
darnautov Mar 30, 2021
9fbca6a
show labels
darnautov Mar 30, 2021
c25cf3e
support legend configuration
darnautov Mar 31, 2021
2c65a8d
render preview
darnautov Apr 1, 2021
54e96a0
add icon
darnautov Apr 2, 2021
38a5a6d
Merge remote-tracking branch 'upstream/master' into lens-heatmap-chart
darnautov Apr 22, 2021
cd912c2
[ML] update visualization
darnautov Apr 22, 2021
c5d02d0
[ML] init suggestions
darnautov Apr 22, 2021
2b40fe3
Merge remote-tracking branch 'upstream/master' into lens-heatmap-chart
darnautov May 5, 2021
7aaeccd
[ML] fix preview
darnautov May 5, 2021
bb4910c
[ML] fix groupPosition for the legend control
darnautov May 5, 2021
48bbad0
[ML] add formatter for Y-axis
darnautov May 5, 2021
398b92f
[ML] filterOperations for cell value
darnautov May 5, 2021
d25f7e9
[ML] fill all available height
darnautov May 5, 2021
1e6d858
[ML] delete unused file
darnautov May 6, 2021
a8b3be4
[ML] fix suggestion state
darnautov May 6, 2021
3d89c72
Merge remote-tracking branch 'upstream/master' into lens-heatmap-chart
darnautov May 10, 2021
62db0f2
[ML] update suggestion, add hiding logic
darnautov May 11, 2021
d7b6d01
[ML] suggestions unit tests
darnautov May 11, 2021
c252224
[ML] rename legend interface
darnautov May 11, 2021
5583f3b
[ML] unit tests for visualization, add error messages
darnautov May 11, 2021
b8ac2d3
[ML] fix typos in xy visualization tests
darnautov May 11, 2021
ab10566
[ML] support click event
darnautov May 12, 2021
1b9d09f
[ML] add xDomain for time series data
darnautov May 12, 2021
f7b53ce
[ML] support empty Y axis
darnautov May 12, 2021
75d3440
[ML] change legend default position
darnautov May 12, 2021
f402b58
[ML] getTimeZone util
darnautov May 12, 2021
7b57130
[ML] hide suggestions for reorder
darnautov May 12, 2021
4f32606
[ML] support brush event
darnautov May 12, 2021
b9faf1c
[ML] update unit tests
darnautov May 12, 2021
deb0436
Merge remote-tracking branch 'upstream/master' into lens-heatmap-chart
darnautov May 12, 2021
ed0bee2
Merge remote-tracking branch 'upstream/master' into lens-heatmap-chart
darnautov May 19, 2021
b581f1c
[ML] render grid lines in preview
darnautov May 19, 2021
c31d336
[ML] don't display errors on init
darnautov May 20, 2021
4548731
[ML] utilize chartsThemeService
darnautov May 20, 2021
e236ff1
[ML] support histogram for the vertical axis
darnautov May 20, 2021
6283fb0
[ML] fix clearLayer
darnautov May 20, 2021
cf62bc8
Merge remote-tracking branch 'upstream/master' into lens-heatmap-chart
darnautov May 25, 2021
5ed1d2e
[ML] show empty placeholder on no data
darnautov May 25, 2021
356109c
[ML] fix X domain min
darnautov May 25, 2021
2cde585
[ML] reject suggestions for 3 or more buckets
darnautov May 25, 2021
60c0caa
[ML] suggestions for histograms and histogram for Y-axis
darnautov May 25, 2021
1c4ba88
[ML] fix unit tests
darnautov May 25, 2021
9c0c0ff
[ML] update suggestions for active heatmap
darnautov May 26, 2021
abab529
[ML] chart data test for heatmap
darnautov May 26, 2021
9c97eae
[ML] test for transitioning from heatmap to barchart
darnautov May 26, 2021
bbb088e
Merge remote-tracking branch 'upstream/master' into lens-heatmap-chart
darnautov May 27, 2021
1477b7d
[ML] disable xDomain
darnautov May 27, 2021
f684b0a
[ML] support intervals in axes configurations
darnautov May 27, 2021
721c9d8
[ML] hide label on the vertical axis when there is only a horizontal …
darnautov May 27, 2021
9e0ac07
[ML] set min cell height for better suggestions preview rendering
darnautov May 27, 2021
4f4cb04
[ML] fix tooltip for empty vertical axis config
darnautov May 27, 2021
1d1c387
[ML] fix click and brushing for empty Y axis
darnautov May 27, 2021
9853d29
[ML] update functional test
darnautov May 27, 2021
e7d2637
Merge remote-tracking branch 'upstream/master' into lens-heatmap-chart
darnautov May 28, 2021
faf208c
Merge remote-tracking branch 'upstream/master' into lens-heatmap-chart
darnautov May 31, 2021
fce4288
[ML] show beta label
darnautov May 31, 2021
017fc97
[ML] fix legend control
darnautov May 31, 2021
67e52b4
[ML] dataIndex sort by default for the X axis
darnautov May 31, 2021
e8da895
[ML] use euiPaletteForTemperature with quantize color scale
darnautov May 31, 2021
d26f954
[ML] hide all suggestions
darnautov May 31, 2021
224c792
[ML] fix chart data extension issue
darnautov May 31, 2021
41523c5
[ML] fix the caret symbol positioning
darnautov May 31, 2021
067d782
[ML] update unit tests for the heatmap suggestions
darnautov Jun 1, 2021
3c645c5
Merge remote-tracking branch 'upstream/master' into lens-heatmap-chart
darnautov Jun 2, 2021
f90fe8f
[ML] replace EuiBetaBadge with EuiBadge
darnautov Jun 2, 2021
685a5bf
[ML] update functional test
darnautov Jun 2, 2021
edd83a3
[ML] fix chart switch styles
darnautov Jun 2, 2021
1021d1c
[ML] fix functional test
darnautov Jun 3, 2021
c7b46b2
[ML] return null instead of expression with a missing value accessor
darnautov Jun 3, 2021
cc47903
[ML] use table id as a chart id
darnautov Jun 3, 2021
645e34f
[ML] fix scale type for a single row of data
darnautov Jun 3, 2021
feb2b45
[ML] filter out undefined values
darnautov Jun 3, 2021
3a4443f
Merge branch 'master' into lens-heatmap-chart
kibanamachine Jun 3, 2021
3cb6b14
[ML] fix isXAxisLabelVisible
darnautov Jun 3, 2021
d699e9e
[ML] update chart_switch styles
darnautov Jun 4, 2021
4cb2f40
show warning message for the array values
darnautov Jun 4, 2021
9bb03df
remove unused code
darnautov Jun 4, 2021
ef95471
replace ts-ignore with manual type casting
darnautov Jun 4, 2021
5a25c36
add unit tests for error and warning messages
darnautov Jun 4, 2021
6d35fb7
add css class for append, conditional flex group
darnautov Jun 4, 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
31 changes: 31 additions & 0 deletions x-pack/plugins/lens/public/assets/chart_heatmap.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* 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 { EuiIconProps } from '@elastic/eui';
import React from 'react';

export const LensIconChartHeatmap = ({ title, titleId, ...props }: Omit<EuiIconProps, 'type'>) => (
<svg
width={30}
height={22}
viewBox="0 0 30 22"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-labelledby={titleId}
{...props}
>
{title ? <title id={titleId}>{title}</title> : null}
<path
className="lensChartIcon__accent"
d="M16 1a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1V1zM0 17a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H1a1 1 0 01-1-1v-4zm17-9a1 1 0 00-1 1v4a1 1 0 001 1h4a1 1 0 001-1V9a1 1 0 00-1-1h-4zm-1 9a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4zm9-17a1 1 0 00-1 1v4a1 1 0 001 1h4a1 1 0 001-1V1a1 1 0 00-1-1h-4z"
/>
<path
className="lensChartIcon__subdued"
d="M0 1a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H1a1 1 0 01-1-1V1zm0 8a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H1a1 1 0 01-1-1V9zm9-9a1 1 0 00-1 1v4a1 1 0 001 1h4a1 1 0 001-1V1a1 1 0 00-1-1H9zM8 9a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H9a1 1 0 01-1-1V9zm1 7a1 1 0 00-1 1v4a1 1 0 001 1h4a1 1 0 001-1v-4a1 1 0 00-1-1H9zm15-7a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1V9zm1 7a1 1 0 00-1 1v4a1 1 0 001 1h4a1 1 0 001-1v-4a1 1 0 00-1-1h-4z"
/>
</svg>
);
1 change: 1 addition & 0 deletions x-pack/plugins/lens/public/async_services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export * from './datatable_visualization/datatable_visualization';
export * from './metric_visualization/metric_visualization';
export * from './pie_visualization/pie_visualization';
export * from './xy_visualization/xy_visualization';
export * from './heatmap_visualization/heatmap_visualization';

export * from './indexpattern_datasource/indexpattern';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
}
}

.lnsChartSwitch__options {
.euiSelectableListItem__append {
flex-grow: 1;
display: flex;
align-items: baseline;
}
}
MichaelMarcialis marked this conversation as resolved.
Show resolved Hide resolved

.lnsChartSwitch__summaryIcon {
margin-right: $euiSizeS;
transform: translateY(-1px);
Expand All @@ -19,4 +27,4 @@ img.lnsChartSwitch__chartIcon { // stylelint-disable-line selector-no-qualifying

.lnsChartSwitch__search {
width: 7 * $euiSizeXXL;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
EuiSelectable,
EuiIconTip,
EuiSelectableOption,
EuiBetaBadge,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
Expand Down Expand Up @@ -294,24 +295,53 @@ export const ChartSwitch = memo(function ChartSwitch(props: Props) {
prepend: (
<EuiIcon className="lnsChartSwitch__chartIcon" type={v.icon || 'empty'} />
),
append:
v.selection.dataLoss !== 'nothing' ? (
<EuiIconTip
aria-label={i18n.translate('xpack.lens.chartSwitch.dataLossLabel', {
defaultMessage: 'Warning',
})}
type="alert"
color="warning"
content={i18n.translate('xpack.lens.chartSwitch.dataLossDescription', {
defaultMessage:
'Selecting this chart type will result in a partial loss of currently applied configuration selections.',
})}
iconProps={{
className: 'lnsChartSwitch__chartIcon',
'data-test-subj': `lnsChartSwitchPopoverAlert_${v.id}`,
}}
/>
) : null,
append: (
<EuiFlexGroup gutterSize="xs">
MichaelMarcialis marked this conversation as resolved.
Show resolved Hide resolved
{v.showBetaBadge ? (
<EuiFlexItem grow={false}>
<EuiBetaBadge
label={
<FormattedMessage
id="xpack.lens.chartSwitch.betaLabel"
defaultMessage="Beta"
/>
}
title={i18n.translate('xpack.lens.chartSwitch.betaLabel', {
defaultMessage: 'Beta',
})}
tooltipContent={
<FormattedMessage
id="xpack.lens.chartSwitch.betaTooltipContent"
defaultMessage="This chart type is not GA."
/>
}
/>
MichaelMarcialis marked this conversation as resolved.
Show resolved Hide resolved
</EuiFlexItem>
) : null}
{v.selection.dataLoss !== 'nothing' ? (
<EuiFlexItem grow={false}>
<EuiIconTip
aria-label={i18n.translate('xpack.lens.chartSwitch.dataLossLabel', {
defaultMessage: 'Warning',
})}
type="alert"
color="warning"
content={i18n.translate(
'xpack.lens.chartSwitch.dataLossDescription',
{
defaultMessage:
'Selecting this chart type will result in a partial loss of currently applied configuration selections.',
}
)}
iconProps={{
className: 'lnsChartSwitch__chartIcon',
'data-test-subj': `lnsChartSwitchPopoverAlert_${v.id}`,
}}
/>
</EuiFlexItem>
) : null}
</EuiFlexGroup>
),
// Apparently checked: null is not valid for TS
...(subVisualizationId === v.id && { checked: 'on' }),
})
Expand Down Expand Up @@ -363,6 +393,7 @@ export const ChartSwitch = memo(function ChartSwitch(props: Props) {
</EuiFlexGroup>
</EuiPopoverTitle>
<EuiSelectable
className="lnsChartSwitch__options"
height={computeListHeight(visualizationTypes, MAX_LIST_HEIGHT)}
searchable
singleSelection
Expand Down
Loading