Fix: expose widget_type and widget_location in hvplot params. Fixes #… - #2069
Fix: expose widget_type and widget_location in hvplot params. Fixes #…#2069Vamshi1404 wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2069 +/- ##
==========================================
+ Coverage 75.93% 75.95% +0.01%
==========================================
Files 215 215
Lines 40191 40211 +20
==========================================
+ Hits 30521 30542 +21
+ Misses 9670 9669 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@ahuang11 When you pointed at the IndicatorView / _get_params region and asked to add widget_type and widget_location, were you referring to the hvPlotBaseView param declarations (where groupby lives, right below IndicatorView)? If so, that's already addressed and pushed: both are declared as param attributes on hvPlotBaseView and forwarded through hvPlotView.get_plot to .hvplot(). Or did you specifically want these params added to the IndicatorView class itself — could you clarify so I make the right change?" |
|
Thanks for picking this up!! |
Video.Project.mp4Live demo of the new widget_type / widget_location params on Lumen's hvPlotView (grouped data + scrubber widget). This dashboard is driven entirely by a declarative YAML spec (demo_widget.yaml) served as a standalone Lumen dashboard — python -m lumen serve demo_widget.yaml. It is not wired to the chat interface; this is the plain classic-dashboard rendering path. Data: synthetic daily timeseries (demo_data.csv) — 1,096 rows spanning 2024-01-01 to 2026-12-31. Columns: time, value (a synthetic seasonal + trend + noise signal, rounded to 2 decimals), year, month. The plot groups by [year, month] and the scrubber steps through each year/month frame. |
Question:
|
|
Make the video on lumen ai serve actual platform instead of probe |
|
Status update on getting the scrubber working through the actual chat interface (not just
Both are pre-existing on Given the scope of this PR is |
Description
Fixes #1915
This PR exposes
widget_typeandwidget_locationas declared parameter attributes onhvPlotBaseView, which is shared by bothhvPlotViewandhvPlotUIView. These parameters are forwarded throughhvPlotView.get_plotto the underlying.hvplot(...)call, mirroring the existinggroupbyforwarding behavior.Both parameters default to
None, so existing behavior remains unchanged when they are not specified.This enables spec-based (
type: hvplot) plots to control the groupby widget. For example, a scrubber/player can be placed at the bottom:Tests
Tests were added in
lumen/tests/views/test_hvplot_datashade.py:test_widget_params_declared— verifies that both parameters exist onhvPlotBaseView, which is used by the AI agent schema.test_hvplot_view_forwards_widget_params— verifies thatwidget_type,widget_location, andgroupbyare correctly forwarded to.hvplot().test_hvplot_view_omits_unset_widget_params— verifies that unset widget parameters are not passed, preserving existing behavior.Verification
lumen/tests/views/: 83 passed, 11 skippedmainand are related to LLM routing, xarray zarr dtype, and the xarray upload handler.ruff checkpasses on both modified files.Known Limitation
The chat/AI path (
lumen-ai) routes throughhvPlotUIView, which uses hvPlot's explorer (hvDataFrameExplorer/hvGridExplorer). These explorers currently hard-code their internalpn.pane.HoloViewspane withwidget_location='bottom'and do not acceptwidget_type.As a result, although
widget_typeandwidget_locationare valid parameters onhvPlotUIView, they are not currently applied in the chat window.Supporting the scrubber in the chat path will require a follow-up change to hvPlot's explorer and additional forwarding from
hvPlotUIView.AI Disclosure
Tool & Model: Cursor + Claude (opencode assistant)
Usage:
Drafted the parameter additions, wired the forwarding in
hvPlotView.get_plot, and wrote the new tests. The changes were validated by reproducing the full test suite and runningrufflocally.Checklist