kibana/docs/canvas/canvas-expressions.asciidoc
2019-08-22 11:17:36 -05:00

39 lines
No EOL
1.1 KiB
Text

[[canvas-expression-editor]]
=== Customize your element with the expression editor
Each element is backed by an expression that represents the element style and data. To further define the appearance and behavior of the element, use the expression editor.
. In the lower right corner, click *Expression editor*.
. Edit the style and data parts of the expression that you want to change.
. Click *Run*.
. If you like what you see, click *Close*.
For information about the Canvas expression language, see <<canvas-function-reference,Canvas function reference>>.
//Insert expression video.
[float]
[[canvas-expression-editor-example]]
=== Example: Using the expression editor
Build a complex element using expressions.
```
image mode="contain" dataurl={
asset {
filters | essql
query="SELECT host,response
FROM kibana_sample_data_logs
WHERE host='artifacts.elastic.co'
ORDER BY timestamp DESC
LIMIT 1"|
alterColumn "response" type="number" |
getCell "response" |
if {compare lt to=400} then="asset-0a807073-d056-4c7b-9bf4-225b71e47243" else="asset-1343672d-7c02-4402-929e-0f8fef69cddd"
}
} | render
```