Widget Visualizations with multiple input expressions #6832
Unanswered
Frizi
asked this question in
Work In Progress - Engine
Replies: 1 comment 2 replies
-
An update to the discussion of the visualization API. The interface ExecutionContextExecuteExpressionParameters {
executionContextId: UUID;
visualizationId: UUID;
expressionId: UUID;
expression: string;
} Here the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, the data for dynamic node widgets is requested using language server's Visualization API. That allows us to resolve method annotations using the data from evaluated method call's target. That API presents some limitations that prevents us from implementing more complete widgets in some cases.
How IDE currently queries for widgets
When the IDE receives an expression update from the language server, it uses the received
methodPointer
to determine the method name and a set of arguments. Then it finds appropriate target expression AST ID (see #6715 (comment)) and attaches (or updates) a visualization using following request:The passed
expressionId
refers to the method target. In the above example that is the"-a-"
expression. ThepositionalArgumentsExpressions
contain the method name and a list of argument names to fetch the widgets for. Notably, that visualization preprocessor only ever has access to the evaluated data from the target expression, nothing else.Proposed extension
Due to the growing requirements for more complicated widgets, this API starts being a main limitation preventing us from implementing useful widgets for some methods. For example, for widgets of
Table.join
method we would like to be able to use data from both joined tables.Currently the visualization only sees the left-hand-side table, but has no access to the other one. The main culprit is that the visualization preprocessor can only ever access a single expression data as an input (the one passed via
expressionId
). We could lift that limitation by allowing the expression values to be queried with an enso expression, something along the lines of:Then I would be able to pass that expression as an argument to the visualization prerprocessor. That would allow us to construct widget queries such that the annotation is able to operate on the values of all method arguments.
An alternative approach would be to allow the visualization to explicitly receive both "expression ID" and "raw expression" arguments. We could also fold the
expressionId
into that list.A hypothetical proposed request params:
The issue with this approach is that now I can't easily specify an array of those expressions. Having to deal with different arities of the visualization preprocessor can quickly get pretty annoying.
Beta Was this translation helpful? Give feedback.
All reactions