Skip to content

Commit

Permalink
Add to_url documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease committed Nov 5, 2023
1 parent 962e593 commit 7ece883
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions doc/user_guide/saving_charts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,26 @@ size at the default resolution of 72 ppi::

chart.save('chart.png', scale_factor=2)

Sharable URL
~~~~~~~~~~~~
The :meth:`Chart.to_url` method can be used to build a sharable URL that opens the chart
specification in the online Vega editor_.

.. altair-plot::
:output: repr

import altair as alt
from vega_datasets import data

chart = alt.Chart(data.cars.url).mark_point().encode(
x='Horsepower:Q',
y='Miles_per_Gallon:Q',
color='Origin:N'
)

chart.to_url()

.. _vl-convert: https://github.com/vega/vl-convert
.. _altair_saver: http://github.com/altair-viz/altair_saver/
.. _vegaEmbed: https://github.com/vega/vega-embed
.. _editor: https://vega.github.io/editor/

0 comments on commit 7ece883

Please sign in to comment.