You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Relates to #313. For layered and multi-view charts, Altair takes a bit of a shortcut and does not use the exact classes which map to the Vega-Lite schema but instead uses the API convenience classes such as alt.Chart, alt.LayerChart, etc. For example for the layered chart below, the elements of layer are alt.Chart instances:
When calling transformed_data on the reconstructed chart, it fails as the isinstance checks do not accept UnitSpec as an equivalent to alt.Chart although it should be:
All classes which I think can be treated as equivalent to the first one mentioned in every bullet:
Chart: TopLevelUnitSpec (parent class of Chart), FacetedUnitSpec, UnitSpec, UnitSpecWithFrame, NonNormalizedSpec (used in concat charts for chart objects in e.g. hconcat attribute)
LayerChart: TopLevelLayerSpec (parent class of LayerChart), LayerSpec
RepeatChart: TopLevelRepeatSpec (parent class of RepeatChart), RepeatSpec
ConcatChart: TopLevelConcatSpec (parent class of ConcatChart), ConcatSpecGenericSpec
HConcatChart: TopLevelHConcatSpec (parent class of HConcatChart), HConcatSpecGenericSpec
VConcatChart: TopLevelVConcatSpec (parent class of VConcatChart), VConcatSpecGenericSpec
FacetChart: TopLevelFacetSpec (parent class of FacetChart), FacetSpec
Spec classes which I'm not sure about but we can probably ignore as repeat charts are not supported yet by transformed_data anyway:
Btw, my use case for the above is that a frontend sends the chart specifications as a JSON to a backend API which executes vf.transformed_data(alt.Chart.from_dict(spec)) and then returns the extracted data as an Excel file to the user of the web application.
The text was updated successfully, but these errors were encountered:
I don't have a working development setup for VegaFusion right now. Is it easy to set it up to work purely on the Python part without Rust or do I need to compile the Rust code anyway? I assume the later. Let me know if I should land a hand on implementing the changes in Altair.
Let me know if I should land a hand on implementing the changes in Altair.
You can develop the Python part of VegaFusion on its own. But if you want to work on fixing it in the Altair implementation of chart.transformed_data (which doesn't use the vf.transformed_data implementation), I could pretty easily copy the fixes into the VegaFusion implementation afterward.
Relates to #313. For layered and multi-view charts, Altair takes a bit of a shortcut and does not use the exact classes which map to the Vega-Lite schema but instead uses the API convenience classes such as
alt.Chart
,alt.LayerChart
, etc. For example for the layered chart below, the elements oflayer
arealt.Chart
instances:However, when reconstructing this chart from a dictionary, the layers are of type
UnitSpec
which is the correct class following the VL schema:When calling
transformed_data
on the reconstructed chart, it fails as theisinstance
checks do not acceptUnitSpec
as an equivalent toalt.Chart
although it should be:All classes which I think can be treated as equivalent to the first one mentioned in every bullet:
hconcat
attribute)Spec classes which I'm not sure about but we can probably ignore as repeat charts are not supported yet by
transformed_data
anyway:Just a reminder that the same changes would need to be applied to https://github.com/altair-viz/altair/blob/master/altair/utils/_transformed_data.py.
Btw, my use case for the above is that a frontend sends the chart specifications as a JSON to a backend API which executes
vf.transformed_data(alt.Chart.from_dict(spec))
and then returns the extracted data as an Excel file to the user of the web application.The text was updated successfully, but these errors were encountered: