-
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.
* Added defaults to expressions. * Fixed error on number passed as a name. * One more fix. * Added Heatmap element to Canvas. * Added support of nested expressions. * Added support of the adding models/views as arguments of the expressions. * Added support of the name from parent configuration. * Added support of removing nested models. * Added heatmap legend description) * Replaced help and displayName of legend. * Added heatmap_grid. * Fixed label. * Added context of nested expressions support. * Fixed bugs with updating of elements. * Added color picker. * Make color compressed * Added usable inputs with good user experience. * Reduced number of props, passing to the arg.. * Percentage and range args with debounce/ * Removed not used args from heatmap_grid * fixed arg name. * Fixed storybooks. * Fixed one more story. * Fixed unused args from lens. * Added comments to the recursive function. * Added docs to the transformNestedFunctionsToUIConfig * Removed not used translations. * Fixed tests. * Added rest of arguments. * Fixed args defaults generating. * Fixed tests of lens. * Changed '@kbn/interpreter/common' to '@kbn/interpreter'. * Changed names of setArgumentAtIndex and addArgumentValueAtIndex and changed comments. Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
0493f00
commit dd9d846
Showing
51 changed files
with
1,258 additions
and
376 deletions.
There are no files selected for viewing
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
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
20 changes: 20 additions & 0 deletions
20
x-pack/plugins/canvas/canvas_plugin_src/elements/heatmap/index.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,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; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import { ElementFactory } from '../../../types'; | ||
|
||
export const heatmap: ElementFactory = () => ({ | ||
name: 'heatmap', | ||
displayName: 'Heatmap', | ||
type: 'chart', | ||
help: 'Heatmap visualization', | ||
icon: 'heatmap', | ||
expression: `filters | ||
| demodata | ||
| head 10 | ||
| heatmap xAccessor={visdimension "age"} yAccessor={visdimension "project"} valueAccessor={visdimension "cost"} | ||
| render`, | ||
}); |
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
56 changes: 56 additions & 0 deletions
56
x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/color_picker/color_picker.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,56 @@ | ||
/* | ||
* 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 React, { FC } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { | ||
EuiColorPicker, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiSetColorMethod, | ||
useColorPickerState, | ||
} from '@elastic/eui'; | ||
import { templateFromReactComponent } from '../../../../public/lib/template_from_react_component'; | ||
import { withDebounceArg } from '../../../../public/components/with_debounce_arg'; | ||
import { ArgumentStrings } from '../../../../i18n'; | ||
|
||
const { Color: strings } = ArgumentStrings; | ||
|
||
interface Props { | ||
onValueChange: (value: string) => void; | ||
argValue: string; | ||
} | ||
|
||
const ColorPicker: FC<Props> = ({ onValueChange, argValue }) => { | ||
const [color, setColor, errors] = useColorPickerState(argValue); | ||
|
||
const pickColor: EuiSetColorMethod = (value, meta) => { | ||
setColor(value, meta); | ||
onValueChange(value); | ||
}; | ||
|
||
return ( | ||
<EuiFlexGroup gutterSize="s"> | ||
<EuiFlexItem grow={false}> | ||
<EuiColorPicker compressed onChange={pickColor} color={color} isInvalid={!!errors} /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); | ||
}; | ||
|
||
ColorPicker.propTypes = { | ||
argValue: PropTypes.any.isRequired, | ||
onValueChange: PropTypes.func.isRequired, | ||
}; | ||
|
||
export const colorPicker = () => ({ | ||
name: 'color_picker', | ||
displayName: strings.getDisplayName(), | ||
help: strings.getHelp(), | ||
simpleTemplate: templateFromReactComponent(withDebounceArg(ColorPicker)), | ||
default: '"#000"', | ||
}); |
8 changes: 8 additions & 0 deletions
8
x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/color_picker/index.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,8 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export { colorPicker } from './color_picker'; |
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
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
Oops, something went wrong.