-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into rebalanceXpackGroups
- Loading branch information
Showing
90 changed files
with
1,889 additions
and
2,848 deletions.
There are no files selected for viewing
463 changes: 0 additions & 463 deletions
463
docs/developer/visualize/development-create-visualization.asciidoc
This file was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
docs/developer/visualize/development-embedding-visualizations.asciidoc
This file was deleted.
Oops, something went wrong.
27 changes: 16 additions & 11 deletions
27
docs/developer/visualize/development-visualize-index.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
[[development-visualize-index]] | ||
== Developing Visualizations | ||
|
||
Kibana Visualizations are the easiest way to add additional functionality to Kibana. | ||
This part of documentation is split into two parts. | ||
The first part tells you all you need to know on how to embed existing Kibana Visualizations in your plugin. | ||
The second step explains how to create your own custom visualization. | ||
|
||
[IMPORTANT] | ||
============================================== | ||
These pages document internal APIs and are not guaranteed to be supported across future versions of Kibana. | ||
However, these docs will be kept up-to-date to reflect the current implementation of Visualization plugins in Kibana. | ||
These pages document internal APIs and are not guaranteed to be supported across future versions of Kibana. | ||
============================================== | ||
|
||
* <<development-embedding-visualizations>> | ||
* <<development-create-visualization>> | ||
The internal APIs for creating custom visualizations are in a state of heavy churn as | ||
they are being migrated to the new Kibana platform, and large refactorings have been | ||
happening across minor releases in the `7.x` series. In particular, in `7.5` and later | ||
we have made significant changes to the legacy APIs as we work to gradually replace them. | ||
|
||
As a result, starting in `7.5` we have removed the documentation for the legacy APIs | ||
to prevent confusion. We expect to be able to create new documentation later in `7.x` | ||
when the visualizations plugin has been completed. | ||
|
||
include::development-embedding-visualizations.asciidoc[] | ||
We would recommend waiting until later in `7.x` to upgrade your plugins if possible. | ||
If you would like to keep up with progress on the visualizations plugin in the meantime, | ||
here are a few resources: | ||
|
||
include::development-create-visualization.asciidoc[] | ||
* The <<breaking-changes,breaking changes>> documentation, where we try to capture any changes to the APIs as they occur across minors. | ||
* link:https://github.com/elastic/kibana/issues/44121[Meta issue] which is tracking the move of the plugin to the new Kibana platform | ||
* Our link:https://www.elastic.co/blog/join-our-elastic-stack-workspace-on-slack[Elastic Stack workspace on Slack]. | ||
* The {repo}blob/{branch}/src/plugins/visualizations[source code], which will continue to be | ||
the most accurate source of information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
x-pack/legacy/plugins/maps/common/style_property_descriptor_types.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
/* eslint-disable @typescript-eslint/consistent-type-definitions */ | ||
|
||
import { FIELD_ORIGIN, LABEL_BORDER_SIZES, SYMBOLIZE_AS_TYPES } from './constants'; | ||
|
||
// Non-static/dynamic options | ||
export type SymbolizeAsOptions = { | ||
value: SYMBOLIZE_AS_TYPES; | ||
}; | ||
|
||
export type LabelBorderSizeOptions = { | ||
size: LABEL_BORDER_SIZES; | ||
}; | ||
|
||
// Static/dynamic options | ||
|
||
export type FieldMetaOptions = { | ||
isEnabled: boolean; | ||
sigma?: number; | ||
}; | ||
|
||
export type StylePropertyField = { | ||
name: string; | ||
origin: FIELD_ORIGIN; | ||
}; | ||
|
||
export type OrdinalColorStop = { | ||
stop: number; | ||
color: string; | ||
}; | ||
|
||
export type CategoryColorStop = { | ||
stop: string | null; | ||
color: string; | ||
}; | ||
|
||
export type IconStop = { | ||
stop: string | null; | ||
icon: string; | ||
}; | ||
|
||
export type ColorDynamicOptions = { | ||
// ordinal color properties | ||
color: string; // TODO move color category ramps to constants and make ENUM type | ||
customColorRamp?: OrdinalColorStop[]; | ||
useCustomColorRamp?: boolean; | ||
|
||
// category color properties | ||
colorCategory?: string; // TODO move color category palettes to constants and make ENUM type | ||
customColorPalette?: CategoryColorStop[]; | ||
useCustomColorPalette?: boolean; | ||
|
||
field?: StylePropertyField; | ||
fieldMetaOptions: FieldMetaOptions; | ||
}; | ||
|
||
export type ColorStaticOptions = { | ||
color: string; | ||
}; | ||
|
||
export type IconDynamicOptions = { | ||
iconPaletteId?: string; | ||
customIconStops?: IconStop[]; | ||
useCustomIconMap?: boolean; | ||
field?: StylePropertyField; | ||
fieldMetaOptions: FieldMetaOptions; | ||
}; | ||
|
||
export type IconStaticOptions = { | ||
value: string; // icon id | ||
}; | ||
|
||
export type LabelDynamicOptions = { | ||
field: StylePropertyField; // field containing label value | ||
}; | ||
|
||
export type LabelStaticOptions = { | ||
value: string; // static label text | ||
}; | ||
|
||
export type OrientationDynamicOptions = { | ||
field?: StylePropertyField; | ||
fieldMetaOptions: FieldMetaOptions; | ||
}; | ||
|
||
export type OrientationStaticOptions = { | ||
orientation: number; | ||
}; | ||
|
||
export type SizeDynamicOptions = { | ||
minSize: number; | ||
maxSize: number; | ||
field?: StylePropertyField; | ||
fieldMetaOptions: FieldMetaOptions; | ||
}; | ||
|
||
export type SizeStaticOptions = { | ||
size: number; | ||
}; | ||
|
||
export type StylePropertyOptions = | ||
| LabelBorderSizeOptions | ||
| SymbolizeAsOptions | ||
| DynamicStylePropertyOptions | ||
| StaticStylePropertyOptions; | ||
|
||
export type StaticStylePropertyOptions = | ||
| ColorStaticOptions | ||
| IconStaticOptions | ||
| LabelStaticOptions | ||
| OrientationStaticOptions | ||
| SizeStaticOptions; | ||
|
||
export type DynamicStylePropertyOptions = | ||
| ColorDynamicOptions | ||
| IconDynamicOptions | ||
| LabelDynamicOptions | ||
| OrientationDynamicOptions | ||
| SizeDynamicOptions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...maps/public/layers/styles/vector/components/field_meta/categorical_field_meta_popover.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
/* eslint-disable @typescript-eslint/consistent-type-definitions */ | ||
|
||
import _ from 'lodash'; | ||
import React from 'react'; | ||
import { EuiFormRow, EuiSwitch, EuiSwitchEvent } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { FieldMetaPopover } from './field_meta_popover'; | ||
import { IDynamicStyleProperty } from '../../properties/dynamic_style_property'; | ||
import { FieldMetaOptions } from '../../../../../../common/style_property_descriptor_types'; | ||
|
||
type Props = { | ||
styleProperty: IDynamicStyleProperty; | ||
onChange: (fieldMetaOptions: FieldMetaOptions) => void; | ||
}; | ||
|
||
export function CategoricalFieldMetaPopover(props: Props) { | ||
const onIsEnabledChange = (event: EuiSwitchEvent) => { | ||
props.onChange({ | ||
...props.styleProperty.getFieldMetaOptions(), | ||
isEnabled: event.target.checked, | ||
}); | ||
}; | ||
|
||
return ( | ||
<FieldMetaPopover> | ||
<EuiFormRow display="columnCompressedSwitch"> | ||
<EuiSwitch | ||
label={i18n.translate('xpack.maps.styles.fieldMetaOptions.isEnabled.categoricalLabel', { | ||
defaultMessage: 'Get categories from indices', | ||
})} | ||
checked={props.styleProperty.getFieldMetaOptions().isEnabled} | ||
onChange={onIsEnabledChange} | ||
compressed | ||
/> | ||
</EuiFormRow> | ||
</FieldMetaPopover> | ||
); | ||
} |
64 changes: 64 additions & 0 deletions
64
...acy/plugins/maps/public/layers/styles/vector/components/field_meta/field_meta_popover.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
/* eslint-disable @typescript-eslint/consistent-type-definitions */ | ||
|
||
import React, { Component, ReactElement } from 'react'; | ||
import { EuiButtonIcon, EuiPopover } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
type Props = { | ||
children: ReactElement<any>; | ||
}; | ||
|
||
type State = { | ||
isPopoverOpen: boolean; | ||
}; | ||
|
||
export class FieldMetaPopover extends Component<Props, State> { | ||
state = { | ||
isPopoverOpen: false, | ||
}; | ||
|
||
_togglePopover = () => { | ||
this.setState({ | ||
isPopoverOpen: !this.state.isPopoverOpen, | ||
}); | ||
}; | ||
|
||
_closePopover = () => { | ||
this.setState({ | ||
isPopoverOpen: false, | ||
}); | ||
}; | ||
|
||
_renderButton() { | ||
return ( | ||
<EuiButtonIcon | ||
onClick={this._togglePopover} | ||
size="s" | ||
iconType="gear" | ||
aria-label={i18n.translate('xpack.maps.styles.fieldMetaOptions.popoverToggle', { | ||
defaultMessage: 'Field meta options popover toggle', | ||
})} | ||
/> | ||
); | ||
} | ||
|
||
render() { | ||
return ( | ||
<EuiPopover | ||
id="fieldMetaOptionsPopover" | ||
anchorPosition="leftCenter" | ||
button={this._renderButton()} | ||
isOpen={this.state.isPopoverOpen} | ||
closePopover={this._closePopover} | ||
ownFocus | ||
> | ||
{this.props.children} | ||
</EuiPopover> | ||
); | ||
} | ||
} |
Oops, something went wrong.