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] Multi metric partition charts #143966

Merged
merged 99 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from 86 commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
f07e24e
partitionByColumn at the expression level
drewdaemon Sep 1, 2022
53bbcb4
pie expression supports multiple metrics
drewdaemon Sep 6, 2022
4920044
test metric collapsing
drewdaemon Sep 7, 2022
ced6a23
add defaulting to function signature
drewdaemon Sep 7, 2022
b4dab19
handle no bucket columns case
drewdaemon Sep 7, 2022
3ec7089
integrate multiple metrics at the lens vis level
drewdaemon Sep 7, 2022
b9e2a43
collapseMetricColumns gets own module
drewdaemon Sep 7, 2022
6c65fd2
restore inspector
drewdaemon Sep 7, 2022
90a7706
add metric collapse to other partition types
drewdaemon Sep 7, 2022
30309a7
Merge branch 'main' of github.com:elastic/kibana into 8143/support-fi…
drewdaemon Sep 7, 2022
5a5b039
apply field formatting to bucket values during collapse
drewdaemon Sep 9, 2022
8b3e0ca
use already-provided format service
drewdaemon Sep 9, 2022
545d732
update tests
drewdaemon Sep 9, 2022
1ea78a6
support consolidated tables for filtering
drewdaemon Sep 9, 2022
bbf2a4f
update tests and names
drewdaemon Sep 9, 2022
eec55e6
update state generation code
drewdaemon Sep 12, 2022
da38b59
test multi-metric filtering logic
drewdaemon Sep 12, 2022
b0461d8
fix aggs-based
drewdaemon Sep 12, 2022
3818e21
update pie_vis element expression
drewdaemon Sep 12, 2022
493d8cf
Merge branch 'main' of github.com:elastic/kibana into 8143/support-fi…
drewdaemon Sep 12, 2022
0c59453
update snapshot
drewdaemon Sep 13, 2022
a41e035
suggestions
drewdaemon Sep 13, 2022
eb3c77e
one more suggestion test
drewdaemon Sep 13, 2022
4c3305b
rename secondary group
drewdaemon Sep 13, 2022
1c78548
handle case when column is not found
drewdaemon Sep 13, 2022
c6002d2
remove unused translations
drewdaemon Sep 13, 2022
6147797
add migration
drewdaemon Sep 14, 2022
0304f96
Merge branch 'main' of github.com:elastic/kibana into 8143/support-fi…
drewdaemon Sep 22, 2022
17069fd
Merge branch 'main' into 8143/support-field-groups-in-partition-chart…
kibanamachine Sep 22, 2022
89b80e1
Merge branch 'main' of github.com:elastic/kibana into 8143/support-fi…
drewdaemon Sep 23, 2022
6a38ac9
Merge branch '8143/support-field-groups-in-partition-charts-same-inte…
drewdaemon Sep 23, 2022
aece498
add layer actions toggle
drewdaemon Sep 23, 2022
78d1c99
Merge branch 'main' of github.com:elastic/kibana into 8143/support-fi…
drewdaemon Sep 26, 2022
98746c5
Merge branch 'main' of github.com:elastic/kibana into 8143/support-fi…
drewdaemon Oct 4, 2022
ddb2d8a
unify layer action strategies
drewdaemon Oct 4, 2022
0f43752
clear layer when disabling multiple metrics
drewdaemon Oct 4, 2022
66eab5a
update filtering logic
drewdaemon Oct 6, 2022
25b3307
fake dimension signifier
drewdaemon Oct 14, 2022
78766f4
remove support for multiple metrics in mosaic
drewdaemon Oct 14, 2022
2b1c566
Merge branch 'main' of github.com:elastic/kibana into test-branch1
drewdaemon Oct 25, 2022
c8c57a1
fix unit tests and types
drewdaemon Oct 24, 2022
4637250
fix filtering on small multiples with no bucket column
drewdaemon Oct 24, 2022
25f6e44
show the palette in the right places
drewdaemon Oct 25, 2022
11a9b30
fix types and unit tests
drewdaemon Oct 25, 2022
e84d2ab
fix unit test
drewdaemon Oct 26, 2022
9086a9f
fix ast generation for agg-based
drewdaemon Oct 26, 2022
f4bb4ce
Merge branch 'main' into multi-metric-partition-charts
mbondyra Oct 27, 2022
065e2c6
don't show visualization when no bucket dimensions and not multi-metric
drewdaemon Oct 27, 2022
ebac888
Merge github.com:andrewctate/kibana into multi-metric-partition-charts
drewdaemon Oct 27, 2022
ab9b0de
Merge branch 'multi-metric-partition-charts' of github.com:andrewctat…
drewdaemon Oct 27, 2022
54323eb
filter generation optimization
drewdaemon Oct 27, 2022
17000f7
update comment
drewdaemon Oct 27, 2022
5bb9230
make metrics arg required for pie vis chart expression renderer
drewdaemon Oct 27, 2022
001e78d
Merge branch 'multi-metric-partition-charts' of github.com:andrewctat…
drewdaemon Oct 27, 2022
fb250ab
unskip inspector test
drewdaemon Oct 27, 2022
79b2651
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Oct 27, 2022
ea623cd
style change
drewdaemon Oct 27, 2022
0d63f4f
Merge branch 'main' of github.com:elastic/kibana into multi-metric-pa…
drewdaemon Oct 27, 2022
a80e75e
move multi-metric setting to layer settings
drewdaemon Oct 27, 2022
2f5ac85
Merge branch 'multi-metric-partition-charts' of github.com:andrewctat…
drewdaemon Oct 27, 2022
4c602e2
add layer settings
drewdaemon Oct 27, 2022
e85c3fb
fix import
drewdaemon Oct 27, 2022
25ac5fe
ignore extra metrics but do not delete
drewdaemon Oct 27, 2022
ca04dc6
Merge branch 'main' into multi-metric-partition-charts
flash1293 Oct 31, 2022
fd67bac
unify migration order
drewdaemon Nov 1, 2022
c419dcf
remove unused variables
drewdaemon Nov 1, 2022
71f95fa
move metric group to top
drewdaemon Nov 1, 2022
7cb9f14
Merge branch 'multi-metric-partition-charts' of github.com:andrewctat…
drewdaemon Nov 1, 2022
761d6c6
mosaic transition
drewdaemon Nov 2, 2022
d5b711c
Merge branch 'main' into multi-metric-partition-charts
kibanamachine Nov 2, 2022
cf27c66
improve styling and structure of faux dimension
drewdaemon Nov 2, 2022
2979103
Merge branch 'multi-metric-partition-charts' of github.com:andrewctat…
drewdaemon Nov 2, 2022
cffbb51
no longer surfacing palette on multi-metric dimensions
drewdaemon Nov 3, 2022
83a85df
only show fake dimension when multiple metrics are allowed
drewdaemon Nov 3, 2022
1480e3f
allow visualization to render whether or not there's a slice-by
drewdaemon Nov 3, 2022
34d35a9
change label to plural when multiple metrics are enabled
drewdaemon Nov 7, 2022
4e880d4
Merge branch 'main' of github.com:elastic/kibana into multi-metric-pa…
drewdaemon Nov 9, 2022
177fb00
revert group order change
drewdaemon Nov 9, 2022
fd10c4a
fix lens attributes
drewdaemon Nov 9, 2022
6c56190
use operation labels in chart
drewdaemon Nov 9, 2022
53c3888
update visualization state in journey dashboard
drewdaemon Nov 9, 2022
28bcc7f
update i18n string
drewdaemon Nov 9, 2022
ffd3a52
update tests and types
drewdaemon Nov 9, 2022
7060340
fix typings
drewdaemon Nov 9, 2022
706fd5d
Merge branch 'main' into multi-metric-partition-charts
kibanamachine Nov 10, 2022
12445de
Merge branch 'main' into multi-metric-partition-charts
kibanamachine Nov 10, 2022
51041e7
don't pass metricsToLabels to mosiac expression
drewdaemon Nov 10, 2022
ece02e8
Merge branch 'multi-metric-partition-charts' of github.com:andrewctat…
drewdaemon Nov 10, 2022
ab4f82c
add section to docs
drewdaemon Nov 10, 2022
097f556
show collapse setting
drewdaemon Nov 10, 2022
ff8a49f
Merge branch 'main' into multi-metric-partition-charts
kibanamachine Nov 10, 2022
b240615
resolve types
drewdaemon Nov 10, 2022
6d373a9
Merge branch 'main' into multi-metric-partition-charts
kibanamachine Nov 10, 2022
26275bd
Merge branch 'main' into multi-metric-partition-charts
kibanamachine Nov 12, 2022
7c575ab
Merge branch 'main' into multi-metric-partition-charts
stratoula Nov 14, 2022
ff7d700
change fleet server version to fix OSQuery tests
drewdaemon Nov 14, 2022
fa064a8
Merge branch 'multi-metric-partition-charts' of github.com:andrewctat…
drewdaemon Nov 14, 2022
4152ecc
Merge branch 'main' of github.com:elastic/kibana into multi-metric-pa…
drewdaemon Nov 14, 2022
3a326a4
move layer settings action to layer panel
drewdaemon Nov 14, 2022
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

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

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

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

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
Expand Up @@ -17,6 +17,10 @@ export const strings = {
i18n.translate('expressionPartitionVis.reusable.function.args.metricHelpText', {
defaultMessage: 'Metric dimensions config',
}),
getMetricToLabelHelp: () =>
i18n.translate('expressionPartitionVis.metricToLabel.help', {
defaultMessage: 'JSON key-value pairs of column ID to label',
}),
getBucketsArgHelp: () =>
i18n.translate('expressionPartitionVis.reusable.function.args.bucketsHelpText', {
defaultMessage: 'Buckets dimensions config',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,14 @@ export const mosaicVisFunction = (): MosaicVisExpressionFunctionDefinition => ({

const visConfig: PartitionVisParams = {
...args,
metricsToLabels: {},
ariaLabel:
args.ariaLabel ??
(handlers.variables?.embeddableTitle as string) ??
handlers.getExecutionContext?.()?.description,
palette: args.palette,
dimensions: {
metric: args.metric,
metrics: [args.metric],
buckets: args.buckets,
splitColumn: args.splitColumn,
splitRow: args.splitRow,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe('interpreter/functions#pieVis', () => {

const visConfig: PieVisConfig = {
addTooltip: true,
metricsToLabels: JSON.stringify({}),
legendDisplay: LegendDisplay.SHOW,
legendPosition: 'right',
legendSize: LegendSize.SMALL,
Expand All @@ -53,14 +54,16 @@ describe('interpreter/functions#pieVis', () => {
truncate: 100,
last_level: false,
},
metric: {
type: 'vis_dimension',
accessor: 0,
format: {
id: 'number',
params: {},
metrics: [
{
type: 'vis_dimension',
accessor: 0,
format: {
id: 'number',
params: {},
},
},
},
],
buckets: [
{
type: 'vis_dimension',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ export const pieVisFunction = (): PieVisExpressionFunctionDefinition => ({
inputTypes: ['datatable'],
help: strings.getPieVisFunctionName(),
args: {
metric: {
metrics: {
types: ['vis_dimension', 'string'],
help: strings.getMetricArgHelp(),
required: true,
drewdaemon marked this conversation as resolved.
Show resolved Hide resolved
multi: true,
},
metricsToLabels: {
types: ['string'],
help: strings.getMetricToLabelHelp(),
},
buckets: {
types: ['vis_dimension', 'string'],
Expand Down Expand Up @@ -137,9 +142,10 @@ export const pieVisFunction = (): PieVisExpressionFunctionDefinition => ({
throw new Error(errors.splitRowAndSplitColumnAreSpecifiedError());
}

validateAccessor(args.metric, context.columns);
args.metrics.forEach((accessor) => validateAccessor(accessor, context.columns));

if (args.buckets) {
args.buckets.forEach((bucket) => validateAccessor(bucket, context.columns));
args.buckets.forEach((accessor) => validateAccessor(accessor, context.columns));
}
if (args.splitColumn) {
args.splitColumn.forEach((splitColumn) => validateAccessor(splitColumn, context.columns));
Expand All @@ -150,13 +156,14 @@ export const pieVisFunction = (): PieVisExpressionFunctionDefinition => ({

const visConfig: PartitionVisParams = {
...args,
metricsToLabels: args.metricsToLabels ? JSON.parse(args.metricsToLabels) : {},
ariaLabel:
args.ariaLabel ??
(handlers.variables?.embeddableTitle as string) ??
handlers.getExecutionContext?.()?.description,
palette: args.palette,
dimensions: {
metric: args.metric,
metrics: args.metrics,
buckets: args.buckets,
splitColumn: args.splitColumn,
splitRow: args.splitRow,
Expand All @@ -170,7 +177,7 @@ export const pieVisFunction = (): PieVisExpressionFunctionDefinition => ({
const logTable = prepareLogTable(
context,
[
[[args.metric], strings.getSliceSizeHelp()],
[args.metrics, strings.getSliceSizeHelp()],
[args.buckets, strings.getSliceHelp()],
[args.splitColumn, strings.getColumnSplitHelp()],
[args.splitRow, strings.getRowSplitHelp()],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('interpreter/functions#treemapVis', () => {

const visConfig: TreemapVisConfig = {
addTooltip: true,
metricsToLabels: JSON.stringify({}),
legendDisplay: LegendDisplay.SHOW,
legendPosition: 'right',
nestedLegend: true,
Expand All @@ -53,14 +54,16 @@ describe('interpreter/functions#treemapVis', () => {
truncate: 100,
last_level: false,
},
metric: {
type: 'vis_dimension',
accessor: 0,
format: {
id: 'number',
params: {},
metrics: [
{
type: 'vis_dimension',
accessor: 0,
format: {
id: 'number',
params: {},
},
},
},
],
buckets: [
{
type: 'vis_dimension',
Expand Down
Loading