Interactively inspect your workspace values and topology in a Pluto session.
Create the following cells:
import PlutoWorkspaceExplorer as PWEPWE.@workspace_explorer PlutoRunnerThat's it — a single cell shows the workspace explorer and updates it
automatically every time you run a cell (press Shift+Enter).
PlutoVariableExplorer.demo.mp4
For the keyword arguments accepted by the explorer
(show_type, exclude_dependencies, show_pluto_modules), use the explicit
two-cell setup, where the second cell calls workspace_explorer directly:
import PlutoWorkspaceExplorer as PWE@bind _update PWE.update_notebook()_update; PWE.workspace_explorer(PlutoRunner; show_type=false,
exclude_dependencies=[Base, Core], show_pluto_modules=false)If you dont create the _update variable, then the workspace explorer will only
be updated when you run the cell that defined it. The _update variable will
change every time that you press Shift+Enter.
@workspace_explorer PlutoRunner expands (roughly) to:
@bind _pwe_update begin
# a conditional self-reference: this makes the cell re-run whenever the
# bound value changes, while still working on the first run (before
# `_pwe_update` exists)
isdefined(@__MODULE__, :_pwe_update) ? _pwe_update : nothing
PlutoWorkspaceExplorer._workspace_explorer_with_trigger(PlutoRunner)
endThe returned widget listens for Shift+Enter and sets its own bound value,
which re-triggers the cell — a cell referencing its own bound variable is
allowed by Pluto — re-rendering the explorer with the current workspace state.
This bundles the trigger that previously required a separate @bind cell into
the explorer itself (see issue #3).
MIT license, see LICENSE
