Conversation
Addresses the review on holoviz#1985 ("best to have a Mosaic pane in Panel first"). MosaicView previously rendered Mosaic's own anywidget through pn.pane.IPyWidget + ipywidgets_bokeh; it now renders through `Mosaic`, a Panel component written with no Lumen imports so it can be contributed upstream to close holoviz/panel#7358. Panel's `AnyWidgetComponent` cannot run Mosaic's anywidget as-is, which is why that issue has stalled: `AnyWidgetModelAdapter` exposes no `send`, so the browser cannot request data, and its `msg:custom` callback receives the message without the Arrow buffers Mosaic replies with. `JSComponent` supports both directions, so the ESM module here is a Panel-native reimplementation of Mosaic's render loop. It imports only `@uwdata/mosaic-spec`, keeping vgplot and mosaic-core in one module graph, and gives each pane its own coordinator rather than the module-wide singleton, so several panes can share a page. Arrow IPC results are base64-encoded into the JSON message since `JSComponent` has no binary channel; Mosaic only ships query results, so payloads stay small. Verified in a headless browser: a scatter and a linked bar chart render, and brushing the scatter re-queries DuckDB and refilters the bars, with the selection's SQL predicate syncing back to Python via `params`. This drops the `ai-mosaic` extra entirely -- duckdb and pyarrow are already core dependencies, so the pane needs no new ones, and mosaic-widget and ipywidgets_bokeh are no longer required. MosaicAgent is now registered alongside VegaLiteAgent rather than replacing it, with conditions scoped to cross-filtered and linked views, and its prompt updated to main's template style rules.
Follow-up from holoviz#1985: MosaicView handed the pane a materialized DataFrame, which defeats the reason to use Mosaic at all -- it pushes its SQL down to DuckDB so only aggregates reach the browser, no matter how large the table is. When the pipeline is DuckDB-backed and its result is expressible entirely in SQL, the pane is now given a cursor on that connection plus a temp view over the pipeline's own query, rebuilt the way DuckDBSource.get does: the filter conditions followed by the declared SQL transforms. The guard matters more than the optimization. Anything Lumen computes in pandas *after* the query -- Python transforms, a ParamFilter, a chained pipeline, or a source that filters outside SQL -- is absent from that SQL, so pushing down would silently chart unfiltered data. Those cases fall back to sending the computed frame, which also keeps every non-DuckDB Source working. Two details worth keeping: the view is created on a cursor, a separate session on the same database, so it cannot collide with another chart's view or mutate the schema the rest of Lumen sees; and it is deliberately not named after the table, because a temp view shadows the base table of the same name and DuckDB rejects `VIEW "t" AS SELECT * FROM "t"` as infinite recursion. Tests assert the pushdown charts the same rows as the pandas path for plain, filtered and SQL-transformed pipelines, that each fallback case is taken, and that the empty-result error fires on both paths so the agent's retry loop behaves the same either way. Verified in a browser: the pushdown path renders and cross-filters through the temp view.
SuMayaBee
force-pushed
the
mosaic-agent
branch
from
September 12, 2026 11:20
a300443 to
bd131bd
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2090 +/- ##
==========================================
+ Coverage 76.96% 77.19% +0.23%
==========================================
Files 216 218 +2
Lines 40674 41201 +527
==========================================
+ Hits 31303 31805 +502
- Misses 9371 9396 +25 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@ahuang11 I have run the lumen with mosaic with the classic iris dataset, with those qns: 1. Create a scatter plot of sepal length versus sepal width, colored by species.
2. Make a box plot of petal length for each species.
3. Show a histogram of petal width, split by species.
4. Create a correlation heatmap for all numeric columns.
5. Make a pair plot of sepal and petal measurements, colored by species.
6. Show the average sepal length and petal length for each species as a grouped bar chart.
|
SuMayaBee
marked this pull request as ready for review
September 16, 2026 16:24
Contributor
SuMayaBee
marked this pull request as draft
September 16, 2026 17:09
Contributor
Author
|
@ahuang11 There is some usage with mosaic's interactivity on iris dataset.
2026-09-17.17-49-10.mp4
2026-09-17.17-52-01.mp4
2026-09-17.17-45-37.mp4 |
SuMayaBee
marked this pull request as ready for review
September 17, 2026 12:21
Contributor
|
Nice! Any way to stretch the container so it takes up the whole space? |
Contributor
Author
Let me see, what can be done to achieve that. |
Collaborator
|
Damn!! This is cool.. |
SuMayaBee
marked this pull request as draft
September 18, 2026 11:57
Contributor
|
Is this ready now? |
Contributor
Author
It's not ready yet, I am working on it |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.








Description
Adds Mosaic visualization support to Lumen through the published
panel-mosaic-vizPanel extension.@philippjfr suggested creating the Panel extension first, so this PR integrates that extension into Lumen and lets Lumen render Mosaic charts.
Fixes #1985
AI Disclosure
Tool & Model: OpenAI Codex (GPT-5)
Usage: Used to help implement, test, and document the integration. I reviewed and tested all changes.
Checklist