https://github.com/kitware/trame-vega
Vega widget for trame
https://github.com/kitware/trame-vega
trame trame-maintenance-program
Last synced: about 1 year ago
JSON representation
Vega widget for trame
- Host: GitHub
- URL: https://github.com/kitware/trame-vega
- Owner: Kitware
- License: bsd-3-clause
- Created: 2022-05-11T15:51:21.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2025-01-09T21:14:58.000Z (over 1 year ago)
- Last Synced: 2025-03-26T08:22:54.544Z (about 1 year ago)
- Topics: trame, trame-maintenance-program
- Language: Python
- Homepage:
- Size: 502 KB
- Stars: 2
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
.. |pypi_download| image:: https://img.shields.io/pypi/dm/trame-vega
Vega visual grammar for trame |pypi_download|
===========================================================================
.. image:: https://github.com/Kitware/trame-vega/actions/workflows/test_and_release.yml/badge.svg
:target: https://github.com/Kitware/trame-vega/actions/workflows/test_and_release.yml
:alt: Test and Release
trame-vega extend trame **widgets** with a Figure component that is capable of rendering Vega grammars such as `Altair `__ plots.
Installing
-----------------------------------------------------------
trame-vega can be installed with `pip `_:
.. code-block:: bash
pip install --upgrade trame-vega
Usage
-----------------------------------------------------------
The `Trame Tutorial `_ is the place to go to learn how to use the library and start building your own application.
The `API Reference `_ documentation provides API-level documentation.
License
-----------------------------------------------------------
trame-vega is made available under the BSD-3 License. For more details, see `LICENSE `_
This license has been chosen to match the one use by `Vega `_ and `Altair `_
which are either used within that trame widget or will be use by the user to create the content for those Figures.
Community
-----------------------------------------------------------
`Trame `_ | `Discussions `_ | `Issues `_ | `RoadMap `_ | `Contact Us `_
.. image:: https://zenodo.org/badge/410108340.svg
:target: https://zenodo.org/badge/latestdoi/410108340
Enjoying trame?
-----------------------------------------------------------
Share your experience `with a testimonial `_ or `with a brand approval `_.
Example: Vega + Altair
-----------------------------------------------------------
The Python interface of `Altair provide examples `__ on how to create various visualization.
.. code-block:: python
import altair as alt
from vega_datasets import data
from trame.widgets import vega
# Generate chart
source = data.cars()
fig = (
alt.Chart(source)
.mark_circle()
.encode(
alt.X(alt.repeat("column"), type="quantitative"),
alt.Y(alt.repeat("row"), type="quantitative"),
color="Origin:N",
)
.properties(width=200, height=200)
.repeat(
row=["Horsepower", "Acceleration", "Miles_per_Gallon"],
column=["Miles_per_Gallon", "Acceleration", "Horsepower"],
)
.interactive()
)
# Display it
widget = vega.Figure(figure=None) # could pass fig at construction
widget.update(fig) # or update later
JavaScript dependency
-----------------------------------------------------------
This Python package bundle the ``vega@5.27.0``, ``vega-embed@6.24.0`` and ``vega-lite@5.16.3`` JavaScript libraries. If you would like us to upgrade it, `please reach out `_.