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

[canvas] [docs] Canvas docs assume knowledge of the syntax/grammar of the expression language #47358

Closed
wylieconlon opened this issue Oct 4, 2019 · 4 comments
Labels
Feature:Canvas Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Docs Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas

Comments

@wylieconlon
Copy link
Contributor

As I've been looking through the Canvas docs, I've been trying to contextualize the various functions and finding it difficult. Specifically, the Function Reference page is great for understanding what should be possible, but not for combining these into a useful whole.

My proposal is to:

  • Include a few paragraphs or examples to define the Expression Grammar
  • Show examples based on the default Canvas elements in use

So for example, the first paragraph right now is:

Behind the scenes, Canvas is driven by a powerful expression language, with dozens of functions and other capabilities, including table transforms, type casting, and sub-expressions.

I think this page should also document what a simple Canvas expression looks like:

filters
| essql 
  query="...."
| pointseries x="Var1" y="KEY1" color="LIC"
| plot defaultStyle={seriesStyle bars=0.75 horizontalBars=true} legend="se"
| render

It should use that simple expression to point out:

  • It's evaluated top down
  • There's a nested expression with {} syntax
  • There aren't any multi fields, but there should be an example that supports it
  • There are two types of expressions, functions and renderers

Along the same lines, each function explanation is very hard to understand as a non-expert. For example, this is the current documentation for math:

Interprets a TinyMath math expression using a number or datatable as context. The datatable columns are available by their column name. If the context is a number, it is available as value.

Argument | Type | Description
Unnamed * Alias: expression | string

So how do I actually use it?

@wylieconlon wylieconlon added Team:Docs Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) labels Oct 4, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-docs (Team:Docs)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas (Team:Canvas)

@ryankeairns
Copy link
Contributor

Thanks @wylieconlon ! The good news is that we have doc with a number of examples code blocks already in it. In my opinion, this is currently our most significant adoption blocker.

I'm closing my issue in favor of this one which has much more detail - #47455

@ryankeairns ryankeairns added the impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. label Oct 9, 2019
@KOTungseth KOTungseth added v7.6.0 and removed v7.6.0 labels Oct 25, 2019
@timductive
Copy link
Member

Closed with merge of #51494

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Canvas Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Docs Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas
Projects
None yet
Development

No branches or pull requests

6 participants