Plot cell: allow async, multiple inputs, one output #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates Plot cells to work as more fully-featured JS cells.
(dep1, dep2) => ...
or no inputs,() => ...
.await import(...)
:async dep => (await import('https://esm.sh/...'))(dep)
.resultName = () => [{ x: 1 }, { x: 2 }]
. Currently this emits one relation, not a set of relations like code cells. A future change could use syntax like{ table1, table2 } = () => ...
to emit multiple relation outputs.outerHTML
are rendered as HTML (as before). Array outputs are rendered as relations. Otherwise, the output is rendered as JSON. If Debug button to show Datalog AST #16 is merged, I'll replace the simple JSON renderer with the JSON tree inspector used there.After these changes "plot" vs "code" seem like misnomers - perhaps we should rename these concepts to "datalog" and "js". However, that's a bigger policy/design change.