-
Notifications
You must be signed in to change notification settings - Fork 760
Add reactive notebook minimap for navigating and visualizing dataflow #5707
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
What do the dot sizes mean? (Some are big, some are small) |
frontend/src/components/editor/chrome/wrapper/floating-minimap.tsx
Outdated
Show resolved
Hide resolved
I followed this description of the feature from the Observable docs as closely as I could: https://observablehq.com/documentation/debugging/minimap#connection-types
small dot == independent, not in dependency tree. large dot == in dependency tree |
This introduces a reactive notebook minimap (similar in spirit to Observable), but adapted marimo model where multiple variables can be declared across cells. It lists all cells in order and lets you click to focus any one. Selecting a cell highlights its upstream and downstream connections, making variable flow across the notebook easier to understand without jumping between cells manually.
The updated logic now correctly handles four distinct cases: variables used by the selected cell, variables declared by the selected cell, variables flowing through from ancestors, and variables in downstream cells that will be re-executed. This provides more precise visual feedback about which variables are actually affected by cell selection in the minimap.
The `focusCell` action previously used a boolean `before` parameter to determine whether to focus the cell before or after the current one. This change replaces the boolean with an explicit `mode` parameter that can be "before", "after", or "exact".
increase focus state to include currently focused and last focused
|
I'm happy where this is at. I added a launcher to the bottom. I'm wondering if a hot key for toggling (ctrl + shift + m) could be preferable to the command pallete. I was experimenting with it locally but we could add in a second PR. |

This PR introduces a reactive notebook minimap (similar in spirit to Observable), but adapted marimo where multiple variables can be declared across cells. Selecting a cell highlights its upstream and downstream connections, visualizing data flow through the notebook.
For now, it's rendered as a floating window for testing. The current goal is to refine the UX and determine its final placement in the UI. I'd like to avoid burying it in the left panel and instead possibly have a floating window triggered either by button or keyboard shortcut.
Some nuance with Observable's minimap: Since our cells can declare multiple variables, our dataflow tracing is asymmetric. For upstream variabes, we can trace granularly which variables used by the selected cell and find where they were declared. For downstream tracing, we coarsely mark all variables that are in a dependent cell as connected (since they are all dependents).
TODO:
Handle unselected state. Right now, the minimap always shows a focused cell. We should have a state for when nothing is focused.This state is handled, but never shows up becauselastFocusedCellis always defined. Would be nice to have some way to select/deselect items in the minimap. Wondering how it should play with command/edit modes.Fix click selection behavior. We're currently usingUpdatedactions.focusCell({ cellId, before: false }), which causes the next/previous cell to be focused depending on cell state. Instead, we want to focus exactly the clicked cell regardless of position.actions.focusCell({ cellId, mode: "before" | "after" | "exact" }).minimap.mp4