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
I'm trying to plot an altair chart with a large amount of datapoints which makes it throw a MaxRowsError.
raise MaxRowsError(
altair.utils.data.MaxRowsError: The number of rows in your dataset is greater than the maximum allowed (20000).
Try enabling the VegaFusion data transformer which raises this limit by pre-evaluating data
transformations in Python.
>> import altair as alt
>> alt.data_transformers.enable("vegafusion")
Or, see https://altair-viz.github.io/user_guide/large_datasets.html for additional information
on how to plot large datasets.
Following the URL in the error I have installed and enabled the vegafusion data transformer, but then I run into
File "<snip>/.venv/lib/python3.11/site-packages/panel/pane/vega.py", line 79, in _get_schema_version
schema = obj.to_dict().get('$schema', '')
^^^^^^^^^^^^^
File "<snip>/.venv/lib/python3.11/site-packages/altair/vegalite/v5/api.py", line 984, in to_dict
raise ValueError(
ValueError: When the "vegafusion" data transformer is enabled, the
to_dict() and to_json() chart methods must be called with format="vega".
For example:
>>> chart.to_dict(format="vega")
>>> chart.to_json(format="vega")
Describe the solution you'd like
I would like the Vega widget in Panel to detect whether the VegaFusion data transformer is enabled, and pass the required format="vega" parameter to the to_dict calls.
Is your feature request related to a problem? Please describe.
https://panel.holoviz.org/reference/panes/Vega.html#altair
I'm trying to plot an altair chart with a large amount of datapoints which makes it throw a
MaxRowsError
.Following the URL in the error I have installed and enabled the vegafusion data transformer, but then I run into
Describe the solution you'd like
I would like the Vega widget in Panel to detect whether the VegaFusion data transformer is enabled, and pass the required
format="vega"
parameter to theto_dict
calls.https://github.com/holoviz/panel/blob/main/panel/pane/vega.py#L82
https://github.com/holoviz/panel/blob/main/panel/pane/vega.py#L127
This might be used as inspiration: https://github.com/vega/altair/blob/main/altair/utils/_vegafusion_data.py#L282,L287
Describe alternatives you've considered
Reducing the amount of datapoints is a possibility, but reduces usability.
The text was updated successfully, but these errors were encountered: