-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Lens] Math using TinyMath #68969
Comments
Pinging @elastic/kibana-app (Team:KibanaApp) |
cc @elastic/kibana-gis @wylieconlon this is a really interesting. We would also like to expose calculations in maps #28265 with tiny math. Let us which direction you go so we can expose something similar in maps |
@wylieconlon Do you have an idea already what it would take to solve this with auto-complete? It would be really cool to strip the naming step out, but it doesn't seem trivial (changing column labels, special characters that would have to be escaped, ...) |
@nreese Might be worth setting up some time to talk about the potential overlap! @flash1293 Yes, I have thought about it a bit. There are a few parts that I know we would need for a good autocomplete system, and a few that require more work. In terms of the interaction, we can either:
I prefer the second option, compiling to TinyMath, because it's beneficial for the user. For example, we can compile the expression
|
One of the new concepts that we're exploring in code is auto-generating IDs for each configured function, so that they can be referenced easily when typing. This approach is not perfect, but it has a low learning curve and is also fast to implement. Other approaches haven't been prototyped yet because they have a higher cost to implement. |
Implemented by formula #99297 |
Because math is one of the most requested calculations, and also hard to express using a form-based system, I am proposing that we get users to type their math using TinyMath. This approach is different from the Painless-based system used in TSVB because of the syntax and different set of supported features.
I am basing this off my spacetime proof of concept.
How is TinyMath used?
TinyMath expects a context object to be provided with each expression, allowing it to execute expressions against named variables. Lens would provide TinyMath with either row-oriented or column-oriented data as context. From the docs:
This would let users perform highly-requested tasks like:
How will users enter TinyMath?
We only have two options here: Typing without autocomplete, and typing with autocomplete. While autocomplete is preferable, it's a lot harder to get right than the simplest approach where we ask the user to type variable names for each input, and then to type their math:
Why not do this using bucket scripts?
The main reason is that bucket scripts can't handle the architecture for calculations in Lens.
The text was updated successfully, but these errors were encountered: