Summary
reflex_xy.chart(chart_object) crashes during Reflex page compilation when the installed xy core Figure does not expose dom_class_strings(), while the reflex-xy adapter calls it unconditionally.
This prevents using the documented static-payload fallback when live state-backed charts are unavailable or undesirable.
Reproduction
import reflex as rx
import reflex_xy
import xy
chart = xy.scatter_chart(
xy.scatter([1, 2, 3], [3, 2, 1]),
width="100%",
height=400,
)
def index():
return reflex_xy.chart(chart, height="400px")
app = rx.App()
app.add_page(index)
Run:
Observed
AttributeError: 'Figure' object has no attribute 'dom_class_strings'
File "reflex_xy/component.py", line 138, in chart
class_manifest = _tailwind_class_manifest(figure)
File "reflex_xy/component.py", line 109, in _tailwind_class_manifest
return " ".join(figure.dom_class_strings())
Expected
The adapter should either:
- declare/enforce a compatible minimum
xy version;
- feature-detect
dom_class_strings() and treat a missing method as an empty optional class manifest; or
- provide a clear version-compatibility error before page compilation.
A static chart with no Tailwind class inventory should still compile and render.
Context
This appeared while switching a Reflex dashboard from state-backed chart tokens to documented direct Chart sources. The page shell rendered, but live charts were blank due to a separate frontend/backend version mismatch. Static payload mode was the intended resilient fallback, but compilation then failed on this missing method.
Environment
reflex-xy 0.1.0 (editable repository package)
- installed
xy core exposing Figure without dom_class_strings()
- Reflex 0.9.7
- macOS Apple Silicon
Summary
reflex_xy.chart(chart_object)crashes during Reflex page compilation when the installedxycoreFiguredoes not exposedom_class_strings(), while thereflex-xyadapter calls it unconditionally.This prevents using the documented static-payload fallback when live state-backed charts are unavailable or undesirable.
Reproduction
Run:
reflex export --no-zipObserved
Expected
The adapter should either:
xyversion;dom_class_strings()and treat a missing method as an empty optional class manifest; orA static chart with no Tailwind class inventory should still compile and render.
Context
This appeared while switching a Reflex dashboard from state-backed chart tokens to documented direct
Chartsources. The page shell rendered, but live charts were blank due to a separate frontend/backend version mismatch. Static payload mode was the intended resilient fallback, but compilation then failed on this missing method.Environment
reflex-xy0.1.0 (editable repository package)xycore exposingFigurewithoutdom_class_strings()