Skip to content

Data-bound chart components 7/8: demo app on the new API - #467

Open
FarhanAliRaza wants to merge 2 commits into
stack/6-compile-probefrom
stack/7-demos-and-gallery
Open

Data-bound chart components 7/8: demo app on the new API#467
FarhanAliRaza wants to merge 2 commits into
stack/6-compile-probefrom
stack/7-demos-and-gallery

Conversation

@FarhanAliRaza

@FarhanAliRaza FarhanAliRaza commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Stacked on #466. Base is stack/6-compile-probe. Top of the stack — check this branch out to see the whole feature.

Change

Ports examples/reflex to the tier the stack built, so the showcase is the API we recommend rather than the one it replaces:

  • a composed 1M drillable scatter with hover/click/select;
  • an on_view_change data var republishing in-view columns into a fixed histogram plan;
  • a flat scatter whose slider republishes columns under a stable handle;
  • an rx.cond toggle between a composed board and rx.foreach small multiples over a list[DataHandle] var.

The escape hatch stays represented on purpose. The cross-filtered histogram whose structure reads state keeps @reflex_xy.figure, alongside both fixed-data tiers and the FastAPI cross-host A/B — so the example shows where each tier is the right answer rather than implying the new one subsumes them.

reflex_ws_smoke.py drives the ported app; test_example_apps.py compiles it.

Spec

reflex-integration.md file map (examples/reflex inventory).

Test plan

  • uv run pytest tests/reflex_adapter tests/test_validation_timing.py tests/test_example_apps.py — 250 passed, 1 skipped
  • pre-commit run --all-files, ruff check, ruff format --check, ty check — clean
  • Browser E2E (scripts/reflex_ws_smoke.py) against the running demo not re-run in this session — worth doing before merge.

Review in cubic

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 164c7e7b-63bd-4e7c-9b04-eae221e4de03

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

The PR ports the Reflex showcase to the data-bound chart API while retaining the figure, streaming, inline, and static tiers where appropriate.

  • Adds composed and flat data-bound charts backed by typed @reflex_xy.data methods.
  • Demonstrates view-driven republishing and conditional rx.foreach charts over typed handles.
  • Updates the browser smoke probe, compile tests, documentation, and integration inventory for the expanded demo.
  • Adds server-side validation and clamping for slider values that control allocation sizes.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the prior unbounded allocation issue is closed because the only event-driven assignment clamps the point count before the data builder allocates its arrays.

Important Files Changed

Filename Overview
examples/reflex/xy_reflex_demo/xy_reflex_demo.py Ports the demo to typed data-bound components, adds conditional small multiples, and closes the previously reported unbounded allocation path with server-side clamping.
scripts/reflex_ws_smoke.py Extends the live-browser smoke probe to cover the additional subscriptions, bound chart, and conditional foreach mounts.
tests/test_example_apps.py Updates source and composition assertions to cover the new data-bound API examples and renamed inline handles.
spec/design/reflex-integration.md Documents composite-token hydration, bounded resynchronization, and the updated Reflex example inventory.
README.md Adds a state-driven data-bound chart example using typed column data.
examples/reflex/README.md Updates the showcase guide and interaction checks for the nine-section data-bound demo.

Reviews (4): Last reviewed commit: "fix(reflex): clamp demo slider events se..." | Re-trigger Greptile

Comment thread examples/reflex/xy_reflex_demo/xy_reflex_demo.py Outdated
@codspeed-hq

codspeed-hq Bot commented Aug 5, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 109 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing stack/7-demos-and-gallery (7c555e4) with stack/6-compile-probe (b3ebb05)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread examples/reflex/xy_reflex_demo/xy_reflex_demo.py
Comment thread examples/reflex/xy_reflex_demo/xy_reflex_demo.py Outdated
@FarhanAliRaza
FarhanAliRaza force-pushed the stack/7-demos-and-gallery branch from dfcf3fd to f48df99 Compare August 5, 2026 14:51
@FarhanAliRaza
FarhanAliRaza force-pushed the stack/7-demos-and-gallery branch from f48df99 to 24569d2 Compare August 6, 2026 13:40
@FarhanAliRaza FarhanAliRaza changed the title Data-bound chart components 7/7: demo app on the new API Data-bound chart components 7/8: demo app on the new API Aug 6, 2026
@FarhanAliRaza

Copy link
Copy Markdown
Contributor Author

Review addressed in 24569d2: the §2 set_bins and §8 set_bound_points events now validate the payload's list shape and clamp the number to the slider's min/max server-side (_clamped_slider_value) before assignment — slider limits are UI hints, not a security boundary, and both values size server allocations. The module docstring's section count is corrected.

Also, the /kinds page (stacked on top in 8/8) now has browser render coverage: scripts/reflex_ws_smoke.py step 7 navigates there and pixel-probes all 26 kind cells; the full smoke passes end to end against the running app (all 26 cells paint, one shared websocket, drill/stream/cond steps green).

@masenf
masenf force-pushed the stack/7-demos-and-gallery branch from 24569d2 to 86e8772 Compare August 6, 2026 22:07
FarhanAliRaza and others added 2 commits August 7, 2026 00:58
Ports examples/reflex to the tier the stack built, so the showcase is the
API we recommend rather than the one it replaces: a composed 1M drillable
scatter, an on_view_change data var republishing in-view columns into a
fixed histogram plan, a flat scatter whose slider republishes columns under
a stable handle, and an rx.cond toggle between a composed board and
rx.foreach small multiples over a list[DataHandle] var.

The escape hatch stays represented on purpose — the cross-filtered
histogram whose *structure* reads state keeps @reflex_xy.figure — alongside
both fixed-data tiers and the FastAPI cross-host A/B, so the example shows
where each tier is the right answer rather than implying the new one
subsumes them.

reflex_ws_smoke.py drives the ported app; test_example_apps.py compiles it.

Spec: reflex-integration.md file map (examples/reflex inventory).
Slider min/max are UI hints, not a security boundary: the §2 bins and
§8 bound_points events size server allocations, so the demo now
validates the event's list shape and clamps the number to the slider's
range before assignment (_clamped_slider_value). Also corrects the
section count in the module docstring.
@masenf
masenf force-pushed the stack/7-demos-and-gallery branch from 86e8772 to 7c555e4 Compare August 7, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant