Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
39181d8
set up marks index page
mattijn Apr 25, 2022
cfd8374
add geoshape for marks
mattijn Apr 25, 2022
0bffe61
Add geopandas dependency
joelostblom Apr 27, 2022
fd89b9a
chloropleth classification
mattijn Apr 29, 2022
9d22a99
repeat a map
mattijn Apr 29, 2022
2aa10f4
facet a map
mattijn Apr 29, 2022
1729f01
expression
mattijn Apr 29, 2022
d8ad736
Example of a line chart with a label annotating the final value
palewire Jun 29, 2022
d966645
DOCS: Revamp docs for the 5.0 release (#2566)
joelostblom Jun 30, 2022
21387f9
Remove broken Wikipedia donations chart
palewire Jun 30, 2022
ab9fce3
Tidy Falkensee case study
palewire Jun 30, 2022
678e872
Tidy up U.S. Population by Age and Sex
palewire Jun 30, 2022
4da4df1
Pin selenium to avoid doctest breakage from deprecation (#2624)
joelostblom Jun 30, 2022
a30e51c
Move bar chart with highlighted segment chart into the bar charts sec…
palewire Jun 30, 2022
0343dfc
No need to say "Example" in the example headline
palewire Jun 30, 2022
0475ac2
Update parallel_coordinates.py
palewire Jun 30, 2022
c2ffe3e
Update normed_parallel_coordinates.py
palewire Jun 30, 2022
34d7d07
Update comet_chart.py
palewire Jun 30, 2022
0fa6c3b
Update select_detail.py
palewire Jun 30, 2022
b20ebc6
Update interval_selection.py
palewire Jun 30, 2022
eb6e4ec
Isotype charts aren't case studies and should go in the other category
palewire Jun 30, 2022
816882a
Update isotype_emoji.py
palewire Jun 30, 2022
8f44df4
Top k charts aren't case studies and should go with in other charts
palewire Jun 30, 2022
2f04bcf
Update top_k_letters.py
palewire Jun 30, 2022
f01dd9d
Update top_k_with_others.py
palewire Jun 30, 2022
cbf7ee2
Merge branch 'altair-viz:master' into patch-1
palewire Jun 30, 2022
32c1177
Merge branch 'altair-viz:master' into patch-2
palewire Jun 30, 2022
e93b31a
Merge branch 'altair-viz:master' into patch-4
palewire Jun 30, 2022
583d6ed
Merge branch 'altair-viz:master' into patch-5
palewire Jun 30, 2022
792e8aa
Clean up airport maps
palewire Jul 1, 2022
271a963
Delete airports_count.py
palewire Jul 1, 2022
4acb08f
Create airport_connections.py
palewire Jul 1, 2022
d76617a
Update falkensee.py
palewire Jul 1, 2022
a7c016c
Merge branch 'altair-viz:master' into two-airports
palewire Jul 1, 2022
29a7934
Add pyramid pie chart to case studies
palewire Jul 1, 2022
24f1fe1
Move image tooltip example to interactive charts section
palewire Jul 1, 2022
ffdd377
Move window rank technique to other section
palewire Jul 1, 2022
2edc90f
Update point_map.py
palewire Jul 1, 2022
59b2019
Style fix to chart headline
palewire Jul 1, 2022
a0999f6
Move scatter with histogram into scatter plots section
palewire Jul 1, 2022
87ae4d8
Update window_rank.py
palewire Jul 1, 2022
3fbd09e
Merge pull request #2625 from palewire/patch-2
mattijn Jul 2, 2022
6ba7990
Merge pull request #2626 from palewire/patch-4
mattijn Jul 2, 2022
3870241
Merge pull request #2628 from palewire/patch-5
mattijn Jul 2, 2022
bb5c132
Merge pull request #2630 from palewire/patch-6
mattijn Jul 2, 2022
1a8deb0
Merge pull request #2631 from palewire/patch-7
mattijn Jul 2, 2022
677b00f
Merge pull request #2632 from palewire/patch-9
mattijn Jul 2, 2022
9665525
Merge pull request #2633 from palewire/patch-10
mattijn Jul 2, 2022
6dbac8f
Merge pull request #2635 from palewire/patch-11
mattijn Jul 2, 2022
4d7f5c8
Merge pull request #2636 from palewire/patch-12
mattijn Jul 2, 2022
fdd4b20
Merge pull request #2637 from palewire/patch-13
mattijn Jul 2, 2022
b1a4ced
Merge pull request #2639 from palewire/patch-14
mattijn Jul 2, 2022
5a24759
Merge pull request #2641 from palewire/patch-16
mattijn Jul 2, 2022
eecf021
Create groupby-map.py
palewire Jul 3, 2022
b39dc76
Update line_with_last_value_labeled
palewire Jul 3, 2022
8f55464
Update line_with_last_value_labeled
palewire Jul 3, 2022
c510c88
Update ranged_dot_plot.py
palewire Jul 3, 2022
3379771
Update ranged_dot_plot.py
palewire Jul 3, 2022
3936840
Update natural_disasters.py
palewire Jul 3, 2022
822db5a
Update natural_disasters.py
palewire Jul 3, 2022
6648a3b
Merge pull request #2634 from palewire/two-airports
mattijn Jul 3, 2022
756e4de
Merge pull request #2623 from palewire/patch-1
mattijn Jul 3, 2022
f0b8a7c
Merge pull request #2642 from palewire/patch-17
mattijn Jul 3, 2022
073ac2a
Update altair/examples/natural_disasters.py
palewire Jul 3, 2022
5a63d33
Update altair/examples/natural_disasters.py
palewire Jul 3, 2022
35025cd
Update altair/examples/natural_disasters.py
palewire Jul 3, 2022
bd5042d
Update altair/examples/natural_disasters.py
palewire Jul 3, 2022
f06a406
Update altair/examples/natural_disasters.py
palewire Jul 3, 2022
cb7a109
Update altair/examples/natural_disasters.py
palewire Jul 3, 2022
433d9fa
Update altair/examples/natural_disasters.py
palewire Jul 3, 2022
cea5636
Merge pull request #2643 from palewire/patch-18
mattijn Jul 4, 2022
72bfb76
Create a new tables section in the gallery (#2646)
palewire Jul 5, 2022
74f24b1
Include clearer examples of how to customize points for lineplots (#2…
palewire Jul 5, 2022
64a423e
docs: Fix a few typos (#2649)
timgates42 Jul 5, 2022
029bc5a
Create a new advanced calculations section of the example gallery (#2…
palewire Jul 5, 2022
160ab03
Add monotone interpolation example (#2644)
palewire Jul 5, 2022
18250ad
MAINT: Update examples and tests to VL5 syntax (#2576)
joelostblom Jul 6, 2022
4b644ca
formatted rst list correctly
tempdata73 Jul 6, 2022
b7cf627
Merge pull request #2652 from tempdata73/fix-doc-list
mattijn Jul 7, 2022
18d8094
Add argmax example (#2653)
tempdata73 Jul 10, 2022
6b6cbd9
Change naming to alt.param and alt.add_params
ChristopherDavisUCI Jul 11, 2022
7088eed
Fix formatting
ChristopherDavisUCI Jul 11, 2022
b26e9be
Replace parameter with param
ChristopherDavisUCI Jul 11, 2022
2bb4ac5
Merge pull request #2656 from ChristopherDavisUCI/master
mattijn Jul 12, 2022
1c7db1b
minor: update readme code
Ckend Aug 7, 2022
137a6e5
Merge pull request #2667 from Ckend/master
mattijn Aug 16, 2022
3e60c99
More Vega-Altair disambiguation
jakevdp Aug 23, 2022
db7c8c3
Merge branch 'joelostblom:docs-revamp-5.0' into docs-revamp-5.0
mattijn Oct 7, 2022
e137500
Rebase 'docs-revamp-5.0' of
mattijn Oct 7, 2022
f313eae
more rebase
mattijn Oct 7, 2022
ec0d74b
one more rebase
mattijn Oct 7, 2022
08683ae
omission during rebase
mattijn Oct 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install .[dev]
pip install "selenium<4.3.0"
pip install altair_saver
pip install git+https://github.com/altair-viz/altair_viewer.git
- name: Test with pytest
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install .[dev]
pip install "selenium<4.3.0"
pip install altair_saver
pip install -r doc/requirements.txt
pip install git+https://github.com/altair-viz/altair_viewer.git
Expand Down
53 changes: 26 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Altair <a href="https://altair-viz.github.io/"><img align="right" src="https://altair-viz.github.io/_static/altair-logo-light.png" height="50"></img></a>
# Vega-Altair <a href="https://altair-viz.github.io/"><img align="right" src="https://altair-viz.github.io/_static/altair-logo-light.png" height="50"></img></a>

*The Vega-Altair open source project is not affiliated with Altair Engineering, Inc.*

Expand All @@ -12,21 +12,21 @@

[https://altair-viz.github.io](https://altair-viz.github.io)

**Altair** is a declarative statistical visualization library for Python. With Altair, you can spend more time understanding your data and its meaning. Altair's
**Vega-Altair** is a declarative statistical visualization library for Python. With Vega-Altair, you can spend more time understanding your data and its meaning. Vega-Altair's
API is simple, friendly and consistent and built on top of the powerful
[Vega-Lite](https://github.com/vega/vega-lite) JSON specification. This elegant
simplicity produces beautiful and effective visualizations with a minimal amount of code. *Altair was originally developed by [Jake Vanderplas](https://github.com/jakevdp) and [Brian
simplicity produces beautiful and effective visualizations with a minimal amount of code. *Vega-Altair was originally developed by [Jake Vanderplas](https://github.com/jakevdp) and [Brian
Granger](https://github.com/ellisonbg) in close collaboration with the [UW
Interactive Data Lab](https://idl.cs.washington.edu/).*

## Altair Documentation
## Vega-Altair Documentation

See [Altair's Documentation Site](https://altair-viz.github.io),
as well as Altair's [Tutorial Notebooks](https://github.com/altair-viz/altair_notebooks).
See [Vega-Altair's Documentation Site](https://altair-viz.github.io),
as well as Vega-Altair's [Tutorial Notebooks](https://github.com/altair-viz/altair_notebooks).

## Example

Here is an example using Altair to quickly visualize and display a dataset with the native Vega-Lite renderer in the JupyterLab:
Here is an example using Vega-Altair to quickly visualize and display a dataset with the native Vega-Lite renderer in the JupyterLab:

```python
import altair as alt
Expand All @@ -42,9 +42,9 @@ alt.Chart(cars).mark_point().encode(
)
```

![Altair Visualization](https://raw.githubusercontent.com/altair-viz/altair/master/images/cars.png)
![Vega-Altair Visualization](https://raw.githubusercontent.com/altair-viz/altair/master/images/cars.png)

One of the unique features of Altair, inherited from Vega-Lite, is a declarative grammar of not just visualization, but _interaction_.
One of the unique features of Vega-Altair, inherited from Vega-Lite, is a declarative grammar of not just visualization, but _interaction_.
With a few modifications to the example above we can create a linked histogram that is filtered based on a selection of the scatter plot.

```python
Expand Down Expand Up @@ -74,7 +74,7 @@ bars = alt.Chart(source).mark_bar().encode(
points & bars
```

![Altair Visualization Gif](https://raw.githubusercontent.com/altair-viz/altair/master/images/cars_scatter_bar.gif)
![Vega-Altair Visualization Gif](https://raw.githubusercontent.com/altair-viz/altair/master/images/cars_scatter_bar.gif)


## Getting your Questions Answered
Expand All @@ -83,13 +83,13 @@ If you have a question that is not addressed in the documentation, there are sev

- open a [Github Issue](https://github.com/altair-viz/altair/issues)
- post a [StackOverflow Question](https://stackoverflow.com/questions/tagged/altair) (be sure to use the `altair` tag)
- ask on the [Altair Google Group](https://groups.google.com/forum/#!forum/altair-viz)
- ask on the [Vega-Altair Google Group](https://groups.google.com/forum/#!forum/altair-viz)

We'll do our best to get your question answered

## A Python API for statistical visualizations

Altair provides a Python API for building statistical visualizations in a declarative
Vega-Altair provides a Python API for building statistical visualizations in a declarative
manner. By statistical visualization we mean:

* The **data source** is a `DataFrame` that consists of columns of different data types (quantitative, ordinal, nominal and date/time).
Expand All @@ -98,7 +98,7 @@ manner. By statistical visualization we mean:
* The data is mapped to the **visual properties** (position, color, size, shape,
faceting, etc.) using the group-by data transformation.

The Altair API contains no actual visualization rendering code but instead
The Vega-Altair API contains no actual visualization rendering code but instead
emits JSON data structures following the
[Vega-Lite](https://github.com/vega/vega-lite) specification. The resulting
Vega-Lite JSON data can be rendered in the following user-interfaces:
Expand All @@ -114,24 +114,23 @@ Vega-Lite JSON data can be rendered in the following user-interfaces:
* Auto-generated internal Python API that guarantees visualizations are type-checked and
in full conformance with the [Vega-Lite](https://github.com/vega/vega-lite)
specification.
* Auto-generate Altair Python code from a Vega-Lite JSON spec.
* Display visualizations in the live Jupyter Notebook, JupyterLab, nteract, on GitHub and
[nbviewer](https://nbviewer.jupyter.org/).
* Export visualizations to PNG/SVG images, stand-alone HTML pages and the
[Online Vega-Lite Editor](https://vega.github.io/editor/#/).
* Serialize visualizations as JSON files.
* Explore Altair with dozens of examples in the [Example Gallery](https://altair-viz.github.io/gallery/index.html)
* Explore Vega-Altair with dozens of examples in the [Example Gallery](https://altair-viz.github.io/gallery/index.html)

## Installation

To use Altair for visualization, you need to install two sets of tools
To use Vega-Altair for visualization, you need to install two sets of tools

1. The core Altair Package and its dependencies
1. The core Vega-Altair Package and its dependencies

2. The renderer for the frontend you wish to use (i.e. `Jupyter Notebook`,
`JupyterLab`, or `nteract`)

Altair can be installed with either ``pip`` or with ``conda``.
Vega-Altair can be installed with either ``pip`` or with ``conda``.
For full installation instructions, please see
https://altair-viz.github.io/getting_started/installation.html

Expand Down Expand Up @@ -193,11 +192,11 @@ Lab's](https://idl.cs.washington.edu/)

We believe that these challenges can be addressed without the creation of yet
another visualization library that has a programmatic API and built-in
rendering. Altair's approach to building visualizations uses a layered design
rendering. Vega-Altair's approach to building visualizations uses a layered design
that leverages the full capabilities of existing visualization libraries:

1. Create a constrained, simple Python API (Altair) that is purely declarative
2. Use the API (Altair) to emit JSON output that follows the Vega-Lite spec
1. Create a constrained, simple Python API (Vega-Altair) that is purely declarative
2. Use the API (Vega-Altair) to emit JSON output that follows the Vega-Lite spec
3. Render that spec using existing visualization libraries

This approach enables users to perform exploratory visualizations with a much
Expand All @@ -212,7 +211,7 @@ visualization.

## Development install

Altair requires the following dependencies:
Vega-Altair requires the following dependencies:

* [pandas](https://pandas.pydata.org/)
* [traitlets](https://github.com/ipython/traitlets)
Expand Down Expand Up @@ -244,11 +243,11 @@ py.test --pyargs altair

See [`CONTRIBUTING.md`](https://github.com/altair-viz/altair/blob/master/CONTRIBUTING.md)

## Citing Altair
## Citing Vega-Altair

[![JOSS Paper](https://joss.theoj.org/papers/10.21105/joss.01057/status.svg)](https://joss.theoj.org/papers/10.21105/joss.01057)

If you use Altair in academic work, please consider citing https://joss.theoj.org/papers/10.21105/joss.01057 as
If you use Vega-Altair in academic work, please consider citing https://joss.theoj.org/papers/10.21105/joss.01057 as

```bib
@article{VanderPlas2018,
Expand All @@ -264,7 +263,7 @@ If you use Altair in academic work, please consider citing https://joss.theoj.or
journal = {Journal of Open Source Software}
}
```
Please additionally consider citing the [vega-lite](https://vega.github.io/vega-lite/) project, which Altair is based on: https://dl.acm.org/doi/10.1109/TVCG.2016.2599030
Please additionally consider citing the [vega-lite](https://vega.github.io/vega-lite/) project, which Vega-Altair is based on: https://dl.acm.org/doi/10.1109/TVCG.2016.2599030
```bib
@article{Satyanarayan2017,
author={Satyanarayan, Arvind and Moritz, Dominik and Wongsuphasawat, Kanit and Heer, Jeffrey},
Expand All @@ -278,6 +277,6 @@ Please additionally consider citing the [vega-lite](https://vega.github.io/vega-
}
```

## Whence Altair?
## Whence Vega-Altair?

Altair is the [brightest star](https://en.wikipedia.org/wiki/Altair) in the constellation Aquila, and along with Deneb and Vega forms the northern-hemisphere asterism known as the [Summer Triangle](https://en.wikipedia.org/wiki/Summer_Triangle).
The Vega project was named after the brightest star in the constellation Lyra; nearby Altair is the [brightest star](https://en.wikipedia.org/wiki/Altair) in the constellation Aquila, and along with Deneb and Vega forms the northern-hemisphere asterism known as the [Summer Triangle](https://en.wikipedia.org/wiki/Summer_Triangle).
6 changes: 3 additions & 3 deletions altair/examples/airport_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
states = alt.topo_feature(data.us_10m.url, feature="states")

# Create mouseover selection
select_city = alt.selection_single(
on="mouseover", nearest=True, fields=["origin"], empty="none"
select_city = alt.selection_point(
on="mouseover", nearest=True, fields=["origin"], empty=False
)

# Define which attributes to lookup from airports.csv
Expand Down Expand Up @@ -63,7 +63,7 @@
from_=lookup_data
).transform_filter(
(alt.datum.state != "PR") & (alt.datum.state != "VI")
).add_selection(
).add_params(
select_city
)

Expand Down
1 change: 1 addition & 0 deletions altair/examples/bar_chart_with_highlighted_segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
----------------------------------
This example shows a bar chart that highlights values beyond a threshold.
"""
# category: bar charts
import altair as alt
import pandas as pd
from vega_datasets import data
Expand Down
2 changes: 1 addition & 1 deletion altair/examples/bar_rounded.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Bar Chart with rounded edges
Bar Chart with Rounded Edges
----------------------------
This example shows how to create a bar chart with rounded edges.
"""
Expand Down
2 changes: 1 addition & 1 deletion altair/examples/beckers_barley_wrapped_facet.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
This is the Altair replicate of `the VegaLite version <https://vega.github.io/vega-lite/docs/facet.html#facet-full>`_
demonstrating the usage of `columns` argument to create wrapped facet.
"""
# category: other charts
# category: advanced calculations
import altair as alt
from vega_datasets import data

Expand Down
2 changes: 1 addition & 1 deletion altair/examples/binned_heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--------------
This example shows how to make a heatmap from binned quantitative data.
"""
# category: other charts
# category: tables
import altair as alt
from vega_datasets import data

Expand Down
2 changes: 1 addition & 1 deletion altair/examples/boxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
which represents the convention of extending the whiskers
to the furthest points within 1.5 * IQR from the first and third quartile.
"""
# category: other charts
# category: advanced calculations
import altair as alt
from vega_datasets import data

Expand Down
2 changes: 1 addition & 1 deletion altair/examples/candlestick_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
in the summer of 2009. The thick bar represents the opening and closing prices,
while the thin bar shows intraday high and low prices; if the index closed higher on a given day, the bars are colored green rather than red.
"""
# category: other charts
# category: advanced calculations
import altair as alt
from vega_datasets import data

Expand Down
6 changes: 3 additions & 3 deletions altair/examples/comet_chart.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""
Comet Chart Example
----------------------------
Comet Chart
-----------
Inspired by `Zan Armstrong's comet chart <https://www.zanarmstrong.com/infovisresearch>`_
this plot uses ``mark_trail`` to visualize change of grouped data over time.
A more elaborate example and explanation of creating comet charts in Altair
is shown in `this blogpost <https://medium.com/de-dataverbinders/comet-charts-in-python-visualizing-statistical-mix-effects-and-simpsons-paradox-with-altair-6cd51fb58b7c>`_.
"""
# category: other charts
# category: advanced calculations

import altair as alt
import vega_datasets
Expand Down
17 changes: 0 additions & 17 deletions altair/examples/cumulative_wiki_donations.py

This file was deleted.

2 changes: 1 addition & 1 deletion altair/examples/dot_dash_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# Configure the options common to all layers
brush = alt.selection(type='interval')
base = alt.Chart(source).add_selection(brush)
base = alt.Chart(source).add_params(brush)

# Configure the points
points = base.mark_point().encode(
Expand Down
2 changes: 1 addition & 1 deletion altair/examples/errorbars_with_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
The confidence intervals are computed internally in vega by a non-parametric
`bootstrap of the mean <https://github.com/vega/vega-statistics/blob/master/src/bootstrapCI.js>`_.
"""
# category: other charts
# category: advanced calculations
import altair as alt
from vega_datasets import data

Expand Down
2 changes: 1 addition & 1 deletion altair/examples/errorbars_with_std.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
This example shows how to show error bars with standard deviation using crop yields data of different
in the years of 1930s.
"""
# category: other charts
# category:advanced calculations
import altair as alt
from vega_datasets import data

Expand Down
Loading