Skip to content

Commit

Permalink
Merge branch 'main' into revert-124310
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Feb 4, 2022
2 parents 7c39e51 + d9d3230 commit 0c67fd6
Show file tree
Hide file tree
Showing 151 changed files with 8,105 additions and 1,926 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
/src/plugins/chart_expressions/expression_metric/ @elastic/kibana-vis-editors
/src/plugins/chart_expressions/expression_heatmap/ @elastic/kibana-vis-editors
/src/plugins/chart_expressions/expression_gauge/ @elastic/kibana-vis-editors
/src/plugins/chart_expressions/expression_pie/ @elastic/kibana-vis-editors
/src/plugins/chart_expressions/expression_partition_vis/ @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: 1 addition & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"expressionImage": "src/plugins/expression_image",
"expressionMetric": "src/plugins/expression_metric",
"expressionMetricVis": "src/plugins/chart_expressions/expression_metric",
"expressionPie": "src/plugins/chart_expressions/expression_pie",
"expressionPartitionVis": "src/plugins/chart_expressions/expression_partition_vis",
"expressionRepeatImage": "src/plugins/expression_repeat_image",
"expressionRevealImage": "src/plugins/expression_reveal_image",
"expressions": "src/plugins/expressions",
Expand Down
4 changes: 2 additions & 2 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ This API doesn't support angular, for registering angular dev tools, bootstrap a
|Expression MetricVis plugin adds a metric renderer and function to the expression plugin. The renderer will display the metric chart.
|{kib-repo}blob/{branch}/src/plugins/chart_expressions/expression_pie/README.md[expressionPie]
|Expression Pie plugin adds a pie renderer and function to the expression plugin. The renderer will display the Pie chart.
|{kib-repo}blob/{branch}/src/plugins/chart_expressions/expression_partition_vis/README.md[expressionPartitionVis]
|Expression Partition Visualization plugin adds a partitionVis renderer and pieVis, mosaicVis, treemapVis, waffleVis functions to the expression plugin. The renderer will display the pie, waffle, treemap and mosaic charts.
|{kib-repo}blob/{branch}/src/plugins/expression_repeat_image/README.md[expressionRepeatImage]
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,6 @@ pageLoadAssetSize:
screenshotting: 17017
expressionGauge: 25000
controls: 34788
expressionPie: 26338
expressionPartitionVis: 26338
sharedUX: 16225
ux: 20784
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import { sortOrderSchema } from './common_schemas';
* - reverse_nested
* - terms
*
* Not fully supported:
* - filter
* - filters
*
* Not implemented:
* - adjacency_matrix
* - auto_date_histogram
Expand All @@ -27,7 +31,6 @@ import { sortOrderSchema } from './common_schemas';
* - date_histogram
* - date_range
* - diversified_sampler
* - filters
* - geo_distance
* - geohash_grid
* - geotile_grid
Expand All @@ -44,9 +47,26 @@ import { sortOrderSchema } from './common_schemas';
* - variable_width_histogram
*/

// TODO: it would be great if we could recursively build the schema since the aggregation have be nested
// For more details see how the types are defined in the elasticsearch javascript client:
// https://github.com/elastic/elasticsearch-js/blob/4ad5daeaf401ce8ebb28b940075e0a67e56ff9ce/src/api/typesWithBodyKey.ts#L5295
const termSchema = s.object({
term: s.recordOf(s.string(), s.oneOf([s.string(), s.boolean(), s.number()])),
});

// TODO: it would be great if we could recursively build the schema since the aggregation have be nested
// For more details see how the types are defined in the elasticsearch javascript client:
// https://github.com/elastic/elasticsearch-js/blob/4ad5daeaf401ce8ebb28b940075e0a67e56ff9ce/src/api/typesWithBodyKey.ts#L5295
const boolSchema = s.object({
bool: s.object({
must_not: s.oneOf([termSchema]),
}),
});

export const bucketAggsSchemas: Record<string, ObjectType> = {
filter: s.object({
term: s.recordOf(s.string(), s.oneOf([s.string(), s.boolean(), s.number()])),
filter: termSchema,
filters: s.object({
filters: s.recordOf(s.string(), s.oneOf([termSchema, boolSchema])),
}),
histogram: s.object({
field: s.maybe(s.string()),
Expand Down
2 changes: 1 addition & 1 deletion src/dev/storybook/aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const storybookAliases = {
expression_image: 'src/plugins/expression_image/.storybook',
expression_metric_vis: 'src/plugins/chart_expressions/expression_metric/.storybook',
expression_metric: 'src/plugins/expression_metric/.storybook',
expression_pie: 'src/plugins/chart_expressions/expression_pie/.storybook',
expression_partition_vis: 'src/plugins/chart_expressions/expression_partition_vis/.storybook',
expression_repeat_image: 'src/plugins/expression_repeat_image/.storybook',
expression_reveal_image: 'src/plugins/expression_reveal_image/.storybook',
expression_shape: 'src/plugins/expression_shape/.storybook',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# expressionPartitionVis

Expression Partition Visualization plugin adds a `partitionVis` renderer and `pieVis`, `mosaicVis`, `treemapVis`, `waffleVis` functions to the expression plugin. The renderer will display the `pie`, `waffle`, `treemap` and `mosaic` charts.

---

## Development

See the [kibana contributing guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for instructions setting up your development environment.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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 PLUGIN_ID = 'expressionPartitionVis';
export const PLUGIN_NAME = 'expressionPartitionVis';

export const PIE_VIS_EXPRESSION_NAME = 'pieVis';
export const TREEMAP_VIS_EXPRESSION_NAME = 'treemapVis';
export const MOSAIC_VIS_EXPRESSION_NAME = 'mosaicVis';
export const WAFFLE_VIS_EXPRESSION_NAME = 'waffleVis';
export const PARTITION_VIS_RENDERER_NAME = 'partitionVis';
export const PARTITION_LABELS_VALUE = 'partitionLabelsValue';
export const PARTITION_LABELS_FUNCTION = 'partitionLabels';

export const DEFAULT_PERCENT_DECIMALS = 2;

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

Loading

0 comments on commit 0c67fd6

Please sign in to comment.