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

Change how modelArgs work, make them an optional filter #28962

Closed
w33ble opened this issue Jan 17, 2019 · 4 comments
Closed

Change how modelArgs work, make them an optional filter #28962

w33ble opened this issue Jan 17, 2019 · 4 comments
Assignees
Labels
enhancement New value added to drive a business result PR sent Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas

Comments

@w33ble
Copy link
Contributor

w33ble commented Jan 17, 2019

Describe the feature:

Some Canvas expression types (the UI in the sidebar for various functions) have the concept of "modelArgs". The idea was to allow "view functions" to control which part of "model function" would show up. For example, if you use pointseries and pipe the output to plot, you'll see all the arguments in the sidebar, since it uses them all. However, if you pipe to pie, you don't see x or y, since the pie view does not use those dimensions.

Currently, if the output of a model function is piped to another function that does not have modelArgs, the user sees an error message, like so:

screenshot 2019-01-17 14 44 39

This is a bad experience, since the expression is totally valid, and there's nothing the user can do to make the error go away (aside from add more functions they don't really need). Worse, it's not really an error, nothing is really wrong.

Additionally, if there is no next expression, none of the model's arguments show up in the sidebar, which is also wrong:

screenshot 2019-01-17 14 46 26

Again, valid expression and a horrible user experience.

The original intention was to try to help users when they are piping to functions that don't understand data modeling. This seems undesirable given the two conditions above.

Instead, I think we should treat modelArgs as an optional argument filter, and if none exist (either in the expression type definition or because there is no next function in the expression), we should just show all of the arguments. This way users may end up with a little less tailored experience, but they can at least use the sidebar like normal. For comparison, here's what I think we should see in the two examples above:

screenshot 2019-01-17 14 50 27

screenshot 2019-01-17 14 50 09

And of course, functions should still be able to control the model's arguments that show up in the sidebar:

screenshot 2019-01-17 14 54 09

But adding a transform in the middle should work, and just degrade the experience a little (in this case, but showing arguments that don't make sense for the visualization type):

screenshot 2019-01-17 14 54 36

@w33ble w33ble added enhancement New value added to drive a business result Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas labels Jan 17, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas

@cqliu1
Copy link
Contributor

cqliu1 commented Jan 17, 2019

++ I totally agree with treating modelArgs as optional. I run into that error message all the time on perfectly valid expressions, and to a new Canvas user playing around with Canvas expressions, this might be a jarring UX when they haven't necessarily done anything wrong. The UI in the sidebar for each function shouldn't have to rely on the following function to define what options are available to the user.

@w33ble w33ble changed the title Change how modelArgs work Change how modelArgs work, make them an optional filter Jan 17, 2019
@w33ble
Copy link
Contributor Author

w33ble commented Jan 17, 2019

I run into that error message all the time on perfectly valid expressions

You're not alone, it comes up a lot, and now that a datatable can be cast to a pointseries, it'll only get worse.

@monfera
Copy link
Contributor

monfera commented Jan 28, 2019

Totally agree with this issue. The user forms a mental model around pipeline expressions and with the requested change, the behavior will be more consistent with this internal picture. Though infinitely more limited in impact, we could enable empty expressions on similar grounds: #28796

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result PR sent Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas
Projects
None yet
Development

No branches or pull requests

4 participants