Change how modelArgs work, make them an optional filter #28962
Labels
enhancement
New value added to drive a business result
PR sent
Team:Presentation
Presentation Team for Dashboard, Input Controls, and Canvas
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 toplot
, you'll see all the arguments in the sidebar, since it uses them all. However, if you pipe topie
, you don't seex
ory
, 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:
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:
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:
And of course, functions should still be able to control the model's arguments that show up in the sidebar:
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):
The text was updated successfully, but these errors were encountered: