From 4137162145f3f92e843a70481e797eab4f4e94a4 Mon Sep 17 00:00:00 2001 From: Ben Welsh Date: Mon, 4 Jul 2022 07:34:36 -0700 Subject: [PATCH 1/6] Move parallel coordinates to line charts section --- altair/examples/parallel_coordinates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/altair/examples/parallel_coordinates.py b/altair/examples/parallel_coordinates.py index 2ba24a8db..ecbff380e 100644 --- a/altair/examples/parallel_coordinates.py +++ b/altair/examples/parallel_coordinates.py @@ -8,7 +8,7 @@ suitable representation. This example shows a parallel coordinates chart with the Iris dataset. """ -# category: other charts +# category: line charts import altair as alt from vega_datasets import data From 83cd7884ce23d0d6bc4def0c06f0fdaae2309d3b Mon Sep 17 00:00:00 2001 From: Ben Welsh Date: Mon, 4 Jul 2022 07:35:35 -0700 Subject: [PATCH 2/6] Update normed_parallel_coordinates.py --- altair/examples/normed_parallel_coordinates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/altair/examples/normed_parallel_coordinates.py b/altair/examples/normed_parallel_coordinates.py index fbf1a8cc4..5a1705dcd 100644 --- a/altair/examples/normed_parallel_coordinates.py +++ b/altair/examples/normed_parallel_coordinates.py @@ -12,7 +12,7 @@ where the y-axis shows the value after min-max rather than the raw value. It's a simplified Altair version of `the VegaLite version `_ """ -# category: other charts +# category: line charts import altair as alt from vega_datasets import data from altair import datum From d9afade9e0e83e48826796b70497bfc8ce524b7d Mon Sep 17 00:00:00 2001 From: Ben Welsh Date: Tue, 5 Jul 2022 07:46:13 -0700 Subject: [PATCH 3/6] Update line_chart_with_points.py --- altair/examples/line_chart_with_points.py | 24 +++++++++-------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/altair/examples/line_chart_with_points.py b/altair/examples/line_chart_with_points.py index 26bd54310..6ba813b5c 100644 --- a/altair/examples/line_chart_with_points.py +++ b/altair/examples/line_chart_with_points.py @@ -1,24 +1,18 @@ """ -Line Chart with Points ----------------------- -This chart shows a simple line chart with points marking each value. Use -``point=True`` for points with default appearance or customize it with -``OverlayMarkDef()``. +Line Chart with Point Markers +----------------------------- +This chart shows a simple line chart with points marking each value. """ # category: line charts import altair as alt -import numpy as np -import pandas as pd +from vega_datasets import data -x = np.arange(100) -source = pd.DataFrame({ - 'x': x, - 'f(x)': np.sin(x / 5) -}) +source = data.stocks() alt.Chart(source).mark_line( - point=alt.OverlayMarkDef(color="red") + point=True ).encode( - x='x', - y='f(x)' + x='date:T', + y='price:Q', + color='symbol:N' ) From 96a3967270e5f37e39f9e2c7af6f9f2114df14b8 Mon Sep 17 00:00:00 2001 From: palewire Date: Tue, 5 Jul 2022 08:11:04 -0700 Subject: [PATCH 4/6] Move other charts into new advanced calculations section --- altair/examples/beckers_barley_wrapped_facet.py | 2 +- altair/examples/binned_heatmap.py | 2 +- altair/examples/boxplot.py | 2 +- altair/examples/candlestick_chart.py | 2 +- altair/examples/comet_chart.py | 2 +- altair/examples/errorbars_with_ci.py | 2 +- altair/examples/errorbars_with_std.py | 2 +- altair/examples/gantt_chart.py | 2 +- altair/examples/isotype.py | 2 +- altair/examples/isotype_emoji.py | 2 +- altair/examples/isotype_grid.py | 2 +- altair/examples/layered_chart_with_dual_axis.py | 2 +- altair/examples/layered_heatmap_text.py | 2 +- altair/examples/multiple_marks.py | 2 +- altair/examples/normed_parallel_coordinates.py | 2 +- altair/examples/parallel_coordinates.py | 2 +- altair/examples/ranged_dot_plot.py | 2 +- altair/examples/ridgeline_plot.py | 2 +- altair/examples/sorted_error_bars_with_ci.py | 2 +- altair/examples/stem_and_leaf.py | 2 +- altair/examples/top_k_items.py | 2 +- altair/examples/top_k_letters.py | 2 +- altair/examples/top_k_with_others.py | 2 +- altair/examples/violin_plot.py | 2 +- altair/examples/wilkinson-dot-plot.py | 2 +- altair/sphinxext/altairgallery.py | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/altair/examples/beckers_barley_wrapped_facet.py b/altair/examples/beckers_barley_wrapped_facet.py index e379a7fea..fbe10adc6 100644 --- a/altair/examples/beckers_barley_wrapped_facet.py +++ b/altair/examples/beckers_barley_wrapped_facet.py @@ -5,7 +5,7 @@ This is the Altair replicate of `the VegaLite version `_ 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 diff --git a/altair/examples/binned_heatmap.py b/altair/examples/binned_heatmap.py index ecdaab813..d3df06879 100644 --- a/altair/examples/binned_heatmap.py +++ b/altair/examples/binned_heatmap.py @@ -3,7 +3,7 @@ -------------- This example shows how to make a heatmap from binned quantitative data. """ -# category: other charts +# category: advanced calculations import altair as alt from vega_datasets import data diff --git a/altair/examples/boxplot.py b/altair/examples/boxplot.py index 31cd62f42..3a5d30565 100644 --- a/altair/examples/boxplot.py +++ b/altair/examples/boxplot.py @@ -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 diff --git a/altair/examples/candlestick_chart.py b/altair/examples/candlestick_chart.py index 1997cda3d..23b338b8e 100644 --- a/altair/examples/candlestick_chart.py +++ b/altair/examples/candlestick_chart.py @@ -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 diff --git a/altair/examples/comet_chart.py b/altair/examples/comet_chart.py index 9c6fa7abc..32dd9392c 100644 --- a/altair/examples/comet_chart.py +++ b/altair/examples/comet_chart.py @@ -6,7 +6,7 @@ A more elaborate example and explanation of creating comet charts in Altair is shown in `this blogpost `_. """ -# category: other charts +# category: advanced calculations import altair as alt import vega_datasets diff --git a/altair/examples/errorbars_with_ci.py b/altair/examples/errorbars_with_ci.py index ec70b27b4..b30ee7937 100644 --- a/altair/examples/errorbars_with_ci.py +++ b/altair/examples/errorbars_with_ci.py @@ -5,7 +5,7 @@ The confidence intervals are computed internally in vega by a non-parametric `bootstrap of the mean `_. """ -# category: other charts +# category: advanced calculations import altair as alt from vega_datasets import data diff --git a/altair/examples/errorbars_with_std.py b/altair/examples/errorbars_with_std.py index 1864e0ece..a1e6d9e31 100644 --- a/altair/examples/errorbars_with_std.py +++ b/altair/examples/errorbars_with_std.py @@ -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 diff --git a/altair/examples/gantt_chart.py b/altair/examples/gantt_chart.py index 6368890a1..f64bb4b86 100644 --- a/altair/examples/gantt_chart.py +++ b/altair/examples/gantt_chart.py @@ -3,7 +3,7 @@ ----------------- This example shows how to make a simple Gantt chart. """ -# category: other charts +# category: advanced calculations import altair as alt import pandas as pd diff --git a/altair/examples/isotype.py b/altair/examples/isotype.py index f5a3ab502..23da6f4b3 100644 --- a/altair/examples/isotype.py +++ b/altair/examples/isotype.py @@ -5,7 +5,7 @@ Inspired by `Only An Ocean Between, 1943 `_. Population Live Stock, p.13. This is adapted from Vega-Lite example https://vega.github.io/editor/#/examples/vega-lite/isotype_bar_chart ''' -# category: other charts +# category: advanced calculations import altair as alt import pandas as pd diff --git a/altair/examples/isotype_emoji.py b/altair/examples/isotype_emoji.py index a8f143c95..92ab0f3ef 100644 --- a/altair/examples/isotype_emoji.py +++ b/altair/examples/isotype_emoji.py @@ -5,7 +5,7 @@ marks rather than custom SVG paths (see https://altair-viz.github.io/gallery/isotype.html). This is adapted from Vega-Lite example https://vega.github.io/vega-lite/examples/isotype_bar_chart_emoji.html. ''' -# category: other charts +# category:advanced calculations import altair as alt import pandas as pd diff --git a/altair/examples/isotype_grid.py b/altair/examples/isotype_grid.py index fd446e4bc..f90e9e8a8 100644 --- a/altair/examples/isotype_grid.py +++ b/altair/examples/isotype_grid.py @@ -3,7 +3,7 @@ ------------ This example is a grid of isotype figures. """ -# category: other charts +# category: advanced calculations import altair as alt import pandas as pd diff --git a/altair/examples/layered_chart_with_dual_axis.py b/altair/examples/layered_chart_with_dual_axis.py index f01b94a43..8ef8f099b 100644 --- a/altair/examples/layered_chart_with_dual_axis.py +++ b/altair/examples/layered_chart_with_dual_axis.py @@ -3,7 +3,7 @@ ---------------------------- This example shows how to create a second independent y axis. """ -# category: other charts +# category: advanced calculations import altair as alt from vega_datasets import data diff --git a/altair/examples/layered_heatmap_text.py b/altair/examples/layered_heatmap_text.py index 396f50b61..d7cad0377 100644 --- a/altair/examples/layered_heatmap_text.py +++ b/altair/examples/layered_heatmap_text.py @@ -4,7 +4,7 @@ An example of a layered chart of text over a heatmap using the cars dataset. """ -# category: other charts +# category: advanced calculations import altair as alt from vega_datasets import data diff --git a/altair/examples/multiple_marks.py b/altair/examples/multiple_marks.py index e262dd306..69b53fa73 100644 --- a/altair/examples/multiple_marks.py +++ b/altair/examples/multiple_marks.py @@ -4,7 +4,7 @@ This example demonstrates creating a single chart with multiple markers representing the same data. """ -# category: other charts +# category: line charts import altair as alt from vega_datasets import data diff --git a/altair/examples/normed_parallel_coordinates.py b/altair/examples/normed_parallel_coordinates.py index fbf1a8cc4..594aac7af 100644 --- a/altair/examples/normed_parallel_coordinates.py +++ b/altair/examples/normed_parallel_coordinates.py @@ -12,7 +12,7 @@ where the y-axis shows the value after min-max rather than the raw value. It's a simplified Altair version of `the VegaLite version `_ """ -# category: other charts +# category: advanced calculations import altair as alt from vega_datasets import data from altair import datum diff --git a/altair/examples/parallel_coordinates.py b/altair/examples/parallel_coordinates.py index 2ba24a8db..c46bc0129 100644 --- a/altair/examples/parallel_coordinates.py +++ b/altair/examples/parallel_coordinates.py @@ -8,7 +8,7 @@ suitable representation. This example shows a parallel coordinates chart with the Iris dataset. """ -# category: other charts +# category: advanced calculations import altair as alt from vega_datasets import data diff --git a/altair/examples/ranged_dot_plot.py b/altair/examples/ranged_dot_plot.py index 124ce59d8..d7efcf77c 100644 --- a/altair/examples/ranged_dot_plot.py +++ b/altair/examples/ranged_dot_plot.py @@ -3,7 +3,7 @@ --------------- This example shows a ranged dot plot to convey changing life expectancy for the five most populous countries (between 1955 and 2000). """ -# category: other charts +# category: advanced calculations import altair as alt from vega_datasets import data diff --git a/altair/examples/ridgeline_plot.py b/altair/examples/ridgeline_plot.py index e60db1ef6..c033f0f6e 100644 --- a/altair/examples/ridgeline_plot.py +++ b/altair/examples/ridgeline_plot.py @@ -9,7 +9,7 @@ suitable representation. """ -# category: other charts +# category: advanced calculations import altair as alt from vega_datasets import data diff --git a/altair/examples/sorted_error_bars_with_ci.py b/altair/examples/sorted_error_bars_with_ci.py index 8dd582124..2baac1e1d 100644 --- a/altair/examples/sorted_error_bars_with_ci.py +++ b/altair/examples/sorted_error_bars_with_ci.py @@ -3,7 +3,7 @@ ============================================= This example shows how to show error bars using confidence intervals, while also sorting the y-axis based on x-axis values. """ -# category: other charts +# category: advanced calculations import altair as alt from vega_datasets import data diff --git a/altair/examples/stem_and_leaf.py b/altair/examples/stem_and_leaf.py index ad24edaea..cd8f7179e 100644 --- a/altair/examples/stem_and_leaf.py +++ b/altair/examples/stem_and_leaf.py @@ -3,7 +3,7 @@ ------------------ This example shows how to make a stem and leaf plot. """ -# category: other charts +# category: advanced calculations import altair as alt import pandas as pd import numpy as np diff --git a/altair/examples/top_k_items.py b/altair/examples/top_k_items.py index 98e3e2e03..0c8ade36c 100644 --- a/altair/examples/top_k_items.py +++ b/altair/examples/top_k_items.py @@ -5,7 +5,7 @@ the Top items of a long list of items in decreasing order. Here we sort the top 10 highest ranking movies of IMDB. """ -# category: other charts +# category: advanced calculations import altair as alt from vega_datasets import data diff --git a/altair/examples/top_k_letters.py b/altair/examples/top_k_letters.py index ce3050a89..b08fcc309 100644 --- a/altair/examples/top_k_letters.py +++ b/altair/examples/top_k_letters.py @@ -5,7 +5,7 @@ top K categories by number of entries. In this case, we rank the characters in the first paragraph of Dickens' *A Tale of Two Cities* by number of occurances. """ -# category: other charts +# category: advanced calculations import altair as alt import pandas as pd import numpy as np diff --git a/altair/examples/top_k_with_others.py b/altair/examples/top_k_with_others.py index 4444696cb..97b3738cd 100644 --- a/altair/examples/top_k_with_others.py +++ b/altair/examples/top_k_with_others.py @@ -5,7 +5,7 @@ to display the top-k directors by average worldwide gross while grouping the remaining directors as 'All Others'. """ -# category: other charts +# category: advanced calculations import altair as alt from vega_datasets import data diff --git a/altair/examples/violin_plot.py b/altair/examples/violin_plot.py index 66cab4700..e24f4d8cd 100644 --- a/altair/examples/violin_plot.py +++ b/altair/examples/violin_plot.py @@ -3,7 +3,7 @@ ----------- This example shows how to make a Violin Plot using Altair's density transform. """ -# category: other charts +# category: advanced calculations import altair as alt from vega_datasets import data diff --git a/altair/examples/wilkinson-dot-plot.py b/altair/examples/wilkinson-dot-plot.py index 05a5786d0..d8a9889f0 100644 --- a/altair/examples/wilkinson-dot-plot.py +++ b/altair/examples/wilkinson-dot-plot.py @@ -3,7 +3,7 @@ ------------------ An example of a `Wilkinson Dot Plot `_ """ -# category: other charts +# category: advanced calculations import altair as alt import pandas as pd diff --git a/altair/sphinxext/altairgallery.py b/altair/sphinxext/altairgallery.py index 7c8dea866..87cd9868b 100644 --- a/altair/sphinxext/altairgallery.py +++ b/altair/sphinxext/altairgallery.py @@ -271,8 +271,8 @@ def main(app): "Histograms": [], "Maps": [], "Interactive Charts": [], + "Advanced calculations": [], "Case Studies": [], - "Other Charts": [], } ) for d in examples: From d374e13d9d6465f7c38f5229cf1b4367dbe0e7d3 Mon Sep 17 00:00:00 2001 From: palewire Date: Tue, 5 Jul 2022 08:14:08 -0700 Subject: [PATCH 5/6] Big C --- altair/sphinxext/altairgallery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/altair/sphinxext/altairgallery.py b/altair/sphinxext/altairgallery.py index 87cd9868b..f7f61421d 100644 --- a/altair/sphinxext/altairgallery.py +++ b/altair/sphinxext/altairgallery.py @@ -271,7 +271,7 @@ def main(app): "Histograms": [], "Maps": [], "Interactive Charts": [], - "Advanced calculations": [], + "Advanced Calculations": [], "Case Studies": [], } ) From d305a2c712b4b94b795420819ec6cde254ea04f5 Mon Sep 17 00:00:00 2001 From: Joel Ostblom Date: Tue, 5 Jul 2022 13:56:45 -0700 Subject: [PATCH 6/6] Add back other charts --- altair/sphinxext/altairgallery.py | 1 + 1 file changed, 1 insertion(+) diff --git a/altair/sphinxext/altairgallery.py b/altair/sphinxext/altairgallery.py index f7f61421d..cc381bf67 100644 --- a/altair/sphinxext/altairgallery.py +++ b/altair/sphinxext/altairgallery.py @@ -273,6 +273,7 @@ def main(app): "Interactive Charts": [], "Advanced Calculations": [], "Case Studies": [], + "Other Charts": [], } ) for d in examples: