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] add new metric visualization #136567

Merged
merged 148 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from 145 commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
6245c12
rename existing metric vis function
drewdaemon Jun 16, 2022
ebc32eb
rename existing metric vis function
drewdaemon Jun 16, 2022
c640ed5
First stab at a new expression fn
drewdaemon Jun 16, 2022
064fa45
renders single metric visualization
drewdaemon Jun 20, 2022
24d3666
add extra text and subtitle
drewdaemon Jun 21, 2022
976e1f0
support breakdown
drewdaemon Jun 21, 2022
cf2faaa
naming adjustments
drewdaemon Jun 21, 2022
c174ff9
separate metric vis into a component
drewdaemon Jun 21, 2022
1061878
add container height and width
drewdaemon Jun 22, 2022
e4c05f0
support custom palettes
drewdaemon Jun 22, 2022
5fa0cdb
include secondary metric dimension in inspector table
drewdaemon Jun 22, 2022
7addd3f
fix default color and secondary metrics in breakdown situation
drewdaemon Jun 22, 2022
996a396
support minTiles, no progress bar if no min or no max
drewdaemon Jun 22, 2022
37e5fc9
fixing palette interpretation
drewdaemon Jun 22, 2022
b4afb4c
limit decimals
drewdaemon Jun 23, 2022
d954ffb
test single metric
drewdaemon Jun 23, 2022
c6d0ad1
add currency formatter
drewdaemon Jun 24, 2022
0d7dcc3
more tests
drewdaemon Jun 24, 2022
86f0269
initial formatting attempts
drewdaemon Jun 27, 2022
a2aaee1
look up currency from numeralJS locale
drewdaemon Jun 28, 2022
37f2adb
introduce duration formatting
drewdaemon Jun 28, 2022
9057cc6
a little refactor
drewdaemon Jun 28, 2022
bbe6573
add bytes formatting
drewdaemon Jun 28, 2022
e16dc89
update tests
drewdaemon Jun 28, 2022
cd04c09
test numbers, percentages, bytes formatting
drewdaemon Jun 28, 2022
cd7b9ea
test formatting currency
drewdaemon Jun 28, 2022
bc2145b
test duration formatting
drewdaemon Jun 29, 2022
c6b57f8
testing another locale
drewdaemon Jun 29, 2022
acada43
use legacy metric vis for existing chart type
drewdaemon Jun 29, 2022
3803f06
newMetric -> metricVis
drewdaemon Jun 29, 2022
6a0f765
Merge branch 'main' of github.com:elastic/kibana into 134242/new-metr…
drewdaemon Jun 29, 2022
e25c935
[CI] Auto-commit changed files from 'node scripts/build_plugin_list_d…
kibanamachine Jun 29, 2022
e8bf070
Fix some tests
drewdaemon Jun 29, 2022
9a914b4
Merge branch '134242/new-metrics-vis-expression' of github.com:andrew…
drewdaemon Jun 29, 2022
331a172
wrap up some outstanding chores
drewdaemon Jun 29, 2022
ccd1007
Add bundle limit
drewdaemon Jun 30, 2022
6602403
clean up i18n
drewdaemon Jun 30, 2022
225e646
more test corrections
drewdaemon Jun 30, 2022
2281d55
wrap in render complete reporting changes
drewdaemon Jun 30, 2022
9615ed9
Merge branch 'main' of github.com:elastic/kibana into 134242/new-metr…
drewdaemon Jun 30, 2022
483ff61
ugh merge conflicts
drewdaemon Jun 30, 2022
4c5ff0d
Merge branch 'main' into 134242/new-metrics-vis-expression
kibanamachine Jun 30, 2022
23ce265
Merge branch 'main' into 134242/new-metrics-vis-expression
kibanamachine Jun 30, 2022
718bcfc
update interpreter functional tests
drewdaemon Jun 30, 2022
cc5d619
fix render complete reporting
drewdaemon Jul 5, 2022
32c0a9e
using arrow function for handlers.done()
drewdaemon Jul 5, 2022
37f2967
Merge branch 'main' into 134242/new-metrics-vis-expression
kibanamachine Jul 5, 2022
2b65814
revert vega snapshot
drewdaemon Jul 5, 2022
c2ad8de
Merge branch '134242/new-metrics-vis-expression' of github.com:andrew…
drewdaemon Jul 5, 2022
3280d5c
update snapshot
drewdaemon Jul 5, 2022
7be8dc4
use emotion instead of scss
drewdaemon Jul 6, 2022
9f6e862
set max value by dimension
drewdaemon Jul 6, 2022
64ca32a
test currency code mapping
drewdaemon Jul 6, 2022
5526083
rename unit test
drewdaemon Jul 6, 2022
3c9c094
remove progressMin argument
drewdaemon Jul 6, 2022
9a62a7d
code style improvements
drewdaemon Jul 6, 2022
c87b5c3
Merge branch 'main' into 134242/new-metrics-vis-expression
kibanamachine Jul 7, 2022
268cffd
add palette test
drewdaemon Jul 7, 2022
666844d
Merge branch '134242/new-metrics-vis-expression' of github.com:andrew…
drewdaemon Jul 7, 2022
7bfb852
get locale from UI settings service
drewdaemon Jul 7, 2022
c8b532c
sort of kind of working
drewdaemon Jul 11, 2022
48040dd
Add dimension editor with color palette picking
drewdaemon Jul 12, 2022
6ed95a5
Add dimension constraints
drewdaemon Jul 12, 2022
91dcc6a
add toolbar
drewdaemon Jul 13, 2022
b2da6cd
only support numeric dimensions
drewdaemon Jul 13, 2022
0f0c3c6
datasource reports maximum possible number of values for a column
drewdaemon Jul 13, 2022
ef34026
Merge branch 'main' of github.com:elastic/kibana into 134242/new-metr…
drewdaemon Jul 13, 2022
59ee2cc
color kind of sort of working
drewdaemon Jul 14, 2022
3143e22
allow disable color-by-value
drewdaemon Jul 14, 2022
9efc3ac
Merge branch 'main' of github.com:elastic/kibana into 134242/new-metr…
drewdaemon Jul 14, 2022
f45d3f1
finish palette support
drewdaemon Jul 14, 2022
4e25fd8
support collapse-by in breakdown dimension
drewdaemon Jul 15, 2022
bb35588
allow max dimension to be a static value
drewdaemon Jul 15, 2022
ecbab44
exclude breakdownby from collapse
drewdaemon Jul 16, 2022
133a2ef
prepopulate the static max dimension
drewdaemon Jul 18, 2022
dc529a4
turning off field formats for now
drewdaemon Jul 18, 2022
ae4a9ba
constrain width and height only in edit mode
drewdaemon Jul 18, 2022
e3b4bd4
implement custom dashboard panel display
drewdaemon Jul 18, 2022
6c3920b
clean up translations
drewdaemon Jul 18, 2022
a59ca94
typo
drewdaemon Jul 18, 2022
797b0fd
fix some typings
drewdaemon Jul 18, 2022
223bbd3
test dimension groups config
drewdaemon Jul 18, 2022
8db33ba
typing fix
drewdaemon Jul 19, 2022
819245e
update lens bundle size limit
drewdaemon Jul 19, 2022
94f7b41
suggestions mostly working
drewdaemon Jul 19, 2022
09d34d4
Merge branch 'main' of github.com:elastic/kibana into 134242/new-metr…
drewdaemon Jul 19, 2022
27c406d
Mark as experimental
drewdaemon Jul 19, 2022
45c15a2
allow max-column and progress direction editing
drewdaemon Jul 20, 2022
412e4e5
don't pass breakdown dimension when collapsing
drewdaemon Jul 20, 2022
61944d9
just use icon for suggestions
drewdaemon Jul 20, 2022
c54a7d7
correct unit test
drewdaemon Jul 20, 2022
7c8ef85
complete visualization unit tests
drewdaemon Jul 20, 2022
de1632f
Add prefix for secondary dimension
drewdaemon Jul 20, 2022
f7ada3a
remove unused variable
drewdaemon Jul 20, 2022
faad21c
update test
drewdaemon Jul 20, 2022
50a4cd3
update unit test
drewdaemon Jul 21, 2022
69dae43
Merge branch 'main' into 134242/new-metrics-vis-lens
flash1293 Jul 21, 2022
ffb339b
Removing secondary metric clears prefix
drewdaemon Jul 21, 2022
443728f
Match max column default with default breakdown
drewdaemon Jul 21, 2022
379d9cf
test toolbar display UI
drewdaemon Jul 21, 2022
0b2c189
Merge branch '134242/new-metrics-vis-lens' of github.com:andrewctate/…
drewdaemon Jul 21, 2022
8d7a2b6
a test would help
drewdaemon Jul 21, 2022
b20d124
Apply breakdown dimension formatter
drewdaemon Jul 21, 2022
b7b7e89
compute data bounds for palette picker (no collapse-by support)
drewdaemon Jul 21, 2022
c6935b9
Debounce secondary prefix editor
drewdaemon Jul 21, 2022
f467c9d
debounce subtitle input
drewdaemon Jul 21, 2022
058ce3a
Merge branch 'main' into 134242/new-metrics-vis-lens
flash1293 Jul 22, 2022
a5eecff
support static color picking
drewdaemon Jul 22, 2022
2cc2cdc
Merge branch '134242/new-metrics-vis-lens' of github.com:andrewctate/…
drewdaemon Jul 22, 2022
072eafd
remove render guard
drewdaemon Jul 22, 2022
9c7c6ff
add unit test for empty data in breakdown
drewdaemon Jul 22, 2022
bc46036
use colorblind swatch
drewdaemon Jul 22, 2022
276859d
reject 2-column suggestions on initial field drag
drewdaemon Jul 22, 2022
f2e8f29
force chart to re-render on new data
drewdaemon Jul 25, 2022
aaf7e87
update default color and fix color clearing
drewdaemon Jul 25, 2022
fd72956
filtering on a breakdown
drewdaemon Jul 25, 2022
f00585f
finish filtering logic
drewdaemon Jul 25, 2022
00b2d88
Merge branch 'main' of github.com:elastic/kibana into 134242/new-metr…
drewdaemon Jul 25, 2022
24a61a8
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Jul 25, 2022
ac3e2bd
move max-cols and progress bar direction to dimension editor
drewdaemon Jul 25, 2022
19abb41
Merge branch '134242/new-metrics-vis-lens' of github.com:andrewctate/…
drewdaemon Jul 25, 2022
b6b3860
move color picker to primary metric dimension
drewdaemon Jul 25, 2022
48c432a
update snap
drewdaemon Jul 25, 2022
565f5e5
hide text options when subtitle unavailable
drewdaemon Jul 25, 2022
454b1e6
dimension name updates
drewdaemon Jul 25, 2022
b43e3e9
update snapshot
drewdaemon Jul 26, 2022
d0017fe
Merge remote-tracking branch 'upstream/main' into 134242/new-metrics-…
flash1293 Jul 26, 2022
9330a02
fix suggestion bug
flash1293 Jul 26, 2022
dbf98d6
fix color palette init logic
flash1293 Jul 26, 2022
f0c4028
fix color palette logic part 2
flash1293 Jul 26, 2022
2dfa9b5
adjust test
flash1293 Jul 26, 2022
f681381
add tooltip
flash1293 Jul 26, 2022
3f1bed9
Update visualization.tsx
mbondyra Jul 26, 2022
e455428
finite palette range for number palettes
drewdaemon Jul 26, 2022
ec5df66
Merge branch '134242/new-metrics-vis-lens' of github.com:andrewctate/…
drewdaemon Jul 26, 2022
107a710
move max cols to breakdown dimension
drewdaemon Jul 26, 2022
49b6736
Update x-pack/plugins/lens/public/visualizations/metric/toolbar.tsx
drewdaemon Jul 26, 2022
7953fa3
restore infinite number palette
drewdaemon Jul 26, 2022
f86f3a3
Merge branch '134242/new-metrics-vis-lens' of github.com:andrewctate/…
drewdaemon Jul 26, 2022
8364eb0
discard max and secondary dimensions in suggestions
drewdaemon Jul 26, 2022
14e4494
fix colors in light and dark mode
flash1293 Jul 26, 2022
0d7f030
Merge branch '134242/new-metrics-vis-lens' of github.com:andrewctate/…
flash1293 Jul 26, 2022
6187157
fix tests
flash1293 Jul 26, 2022
38f39bd
remove isreference check in getMaxPossibleNumValues
drewdaemon Jul 26, 2022
02aa776
Merge branch '134242/new-metrics-vis-lens' of github.com:andrewctate/…
drewdaemon Jul 26, 2022
dc19403
string changes
drewdaemon Jul 26, 2022
75c4632
use slightly shaded colors by default
drewdaemon Jul 26, 2022
f68760f
correct functional test
drewdaemon Jul 26, 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
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pageLoadAssetSize:
inputControlVis: 172675
inspector: 148711
kibanaOverview: 56279
lens: 35000
lens: 36000
licenseManagement: 41817
licensing: 29004
lists: 22900
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,20 @@ export const metricVisFunction = (): MetricVisExpressionFunctionDefinition => ({
help: i18n.translate('expressionMetricVis.function.metric.help', {
defaultMessage: 'The primary metric.',
}),
required: true,
},
secondaryMetric: {
types: ['vis_dimension', 'string'],
help: i18n.translate('expressionMetricVis.function.secondaryMetric.help', {
defaultMessage: 'The secondary metric (shown above the primary).',
}),
},
max: {
types: ['vis_dimension', 'string'],
help: i18n.translate('expressionMetricVis.function.max.help.', {
defaultMessage: 'The dimension containing the maximum value.',
}),
},
breakdownBy: {
types: ['vis_dimension', 'string'],
help: i18n.translate('expressionMetricVis.function.breakdownBy.help', {
Expand All @@ -50,16 +57,10 @@ export const metricVisFunction = (): MetricVisExpressionFunctionDefinition => ({
defaultMessage: 'The subtitle for a single metric. Overridden if breakdownBy is supplied.',
}),
},
extraText: {
secondaryPrefix: {
types: ['string'],
help: i18n.translate('expressionMetricVis.function.extra.help', {
defaultMessage: 'Text to be shown above metric value. Overridden by secondaryMetric.',
}),
},
progressMax: {
types: ['vis_dimension', 'string'],
help: i18n.translate('expressionMetricVis.function.progressMax.help.', {
defaultMessage: 'The dimension containing the maximum value.',
help: i18n.translate('expressionMetricVis.function.secondaryPrefix.help', {
defaultMessage: 'Optional text to be show before secondaryMetric.',
}),
},
progressDirection: {
Expand All @@ -71,6 +72,12 @@ export const metricVisFunction = (): MetricVisExpressionFunctionDefinition => ({
}),
strict: true,
},
color: {
types: ['string'],
help: i18n.translate('expressionMetricVis.function.color.help', {
defaultMessage: 'Provides a static visualization color. Overridden by palette.',
}),
},
palette: {
types: ['palette'],
help: i18n.translate('expressionMetricVis.function.palette.help', {
Expand All @@ -79,7 +86,7 @@ export const metricVisFunction = (): MetricVisExpressionFunctionDefinition => ({
},
maxCols: {
types: ['number'],
help: i18n.translate('expressionMetricVis.function.maxCols.help', {
help: i18n.translate('expressionMetricVis.function.numCols.help', {
defaultMessage: 'Specifies the max number of columns in the metric grid.',
}),
default: 5,
Expand Down Expand Up @@ -128,9 +135,9 @@ export const metricVisFunction = (): MetricVisExpressionFunctionDefinition => ({
]);
}

if (args.progressMax) {
if (args.max) {
argsTable.push([
[args.progressMax],
[args.max],
i18n.translate('expressionMetricVis.function.dimension.maximum', {
defaultMessage: 'Maximum',
}),
Expand All @@ -150,7 +157,8 @@ export const metricVisFunction = (): MetricVisExpressionFunctionDefinition => ({
visConfig: {
metric: {
subtitle: args.subtitle,
extraText: args.extraText,
secondaryPrefix: args.secondaryPrefix,
color: args.color,
palette: args.palette?.params,
progressDirection: args.progressDirection,
maxCols: args.maxCols,
Expand All @@ -159,8 +167,8 @@ export const metricVisFunction = (): MetricVisExpressionFunctionDefinition => ({
dimensions: {
metric: args.metric,
secondaryMetric: args.secondaryMetric,
max: args.max,
breakdownBy: args.breakdownBy,
progressMax: args.progressMax,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ import { EXPRESSION_METRIC_NAME } from '../constants';
export interface MetricArguments {
metric: ExpressionValueVisDimension | string;
secondaryMetric?: ExpressionValueVisDimension | string;
max?: ExpressionValueVisDimension | string;
breakdownBy?: ExpressionValueVisDimension | string;
subtitle?: string;
extraText?: string;
progressMax?: ExpressionValueVisDimension | string;
secondaryPrefix?: string;
progressDirection: LayoutDirection;
color?: string;
palette?: PaletteOutput<CustomPaletteState>;
maxCols: number;
minTiles?: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ export const visType = 'metric';
export interface DimensionsVisParam {
metric: ExpressionValueVisDimension | string;
secondaryMetric?: ExpressionValueVisDimension | string;
max?: ExpressionValueVisDimension | string;
breakdownBy?: ExpressionValueVisDimension | string;
progressMax?: ExpressionValueVisDimension | string;
}

export interface MetricVisParam {
subtitle?: string;
extraText?: string;
secondaryPrefix?: string;
color?: string;
palette?: CustomPaletteState;
progressDirection: LayoutDirection;
maxCols: number;
Expand Down

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

Loading