From 8071fd8e734754a84faf7be918648a2162bda2d9 Mon Sep 17 00:00:00 2001 From: Nick Crews Date: Fri, 18 Aug 2023 19:24:56 -0800 Subject: [PATCH] docs: examples: remove connected_scatterplot Caused by https://github.com/altair-viz/altair/pull/3156#issuecomment-1684684458 I move over the reference to the NYTimes article because I think that is valuable. --- .../connected_scatterplot.py | 18 ------------------ .../line_custom_order.py | 5 ++++- .../connected_scatterplot.py | 18 ------------------ .../line_custom_order.py | 5 ++++- tests/test_transformed_data.py | 2 +- 5 files changed, 9 insertions(+), 39 deletions(-) delete mode 100644 tests/examples_arguments_syntax/connected_scatterplot.py delete mode 100644 tests/examples_methods_syntax/connected_scatterplot.py diff --git a/tests/examples_arguments_syntax/connected_scatterplot.py b/tests/examples_arguments_syntax/connected_scatterplot.py deleted file mode 100644 index 8528fb86f..000000000 --- a/tests/examples_arguments_syntax/connected_scatterplot.py +++ /dev/null @@ -1,18 +0,0 @@ -""" -Connected Scatter Plot (Lines with Custom Paths) ------------------------------------------------- - -This example show how the order encoding can be used to draw a custom path. The dataset tracks miles driven per capita along with gas prices annually from 1956 to 2010. -It is based on Hannah Fairfield's article 'Driving Shifts Into Reverse'. See https://archive.nytimes.com/www.nytimes.com/imagepages/2010/05/02/business/02metrics.html for the original. -""" -# category: scatter plots -import altair as alt -from vega_datasets import data - -source = data.driving() - -alt.Chart(source).mark_line(point=True).encode( - alt.X('miles', scale=alt.Scale(zero=False)), - alt.Y('gas', scale=alt.Scale(zero=False)), - order='year' -) diff --git a/tests/examples_arguments_syntax/line_custom_order.py b/tests/examples_arguments_syntax/line_custom_order.py index d961e5d45..c564c3349 100644 --- a/tests/examples_arguments_syntax/line_custom_order.py +++ b/tests/examples_arguments_syntax/line_custom_order.py @@ -1,7 +1,7 @@ """ Line Chart with Custom Order ---------------------------- -By default, the line’s path (order of points in the line) is +By default, the line's path (order of points in the line) is determined by data values on the temporal/ordinal field. However, a field can be mapped to the order channel for a custom path. @@ -10,6 +10,9 @@ order channel to sort the points in the line by time field (year). The earliest year (1956) is one endpoint and the latest year (2010) is the other endpoint. + +This is based on Hannah Fairfield's article 'Driving Shifts Into Reverse'. +See https://archive.nytimes.com/www.nytimes.com/imagepages/2010/05/02/business/02metrics.html. """ # category: line charts import altair as alt diff --git a/tests/examples_methods_syntax/connected_scatterplot.py b/tests/examples_methods_syntax/connected_scatterplot.py deleted file mode 100644 index a5902841c..000000000 --- a/tests/examples_methods_syntax/connected_scatterplot.py +++ /dev/null @@ -1,18 +0,0 @@ -""" -Connected Scatter Plot (Lines with Custom Paths) ------------------------------------------------- - -This example show how the order encoding can be used to draw a custom path. The dataset tracks miles driven per capita along with gas prices annually from 1956 to 2010. -It is based on Hannah Fairfield's article 'Driving Shifts Into Reverse'. See https://archive.nytimes.com/www.nytimes.com/imagepages/2010/05/02/business/02metrics.html for the original. -""" -# category: scatter plots -import altair as alt -from vega_datasets import data - -source = data.driving() - -alt.Chart(source).mark_line(point=True).encode( - alt.X('miles').scale(zero=False), - alt.Y('gas').scale(zero=False), - order='year' -) diff --git a/tests/examples_methods_syntax/line_custom_order.py b/tests/examples_methods_syntax/line_custom_order.py index 4ff2f7274..4681c2aee 100644 --- a/tests/examples_methods_syntax/line_custom_order.py +++ b/tests/examples_methods_syntax/line_custom_order.py @@ -1,7 +1,7 @@ """ Line Chart with Custom Order ---------------------------- -By default, the line’s path (order of points in the line) is +By default, the line's path (order of points in the line) is determined by data values on the temporal/ordinal field. However, a field can be mapped to the order channel for a custom path. @@ -10,6 +10,9 @@ order channel to sort the points in the line by time field (year). The earliest year (1956) is one endpoint and the latest year (2010) is the other endpoint. + +This is based on Hannah Fairfield's article 'Driving Shifts Into Reverse'. +See https://archive.nytimes.com/www.nytimes.com/imagepages/2010/05/02/business/02metrics.html. """ # category: line charts import altair as alt diff --git a/tests/test_transformed_data.py b/tests/test_transformed_data.py index 64675486e..c79b96964 100644 --- a/tests/test_transformed_data.py +++ b/tests/test_transformed_data.py @@ -22,7 +22,6 @@ ("beckers_barley_wrapped_facet.py", 120, ["site", "median_yield"]), ("bump_chart.py", 100, ["rank", "yearmonth_date"]), ("comet_chart.py", 120, ["variety", "delta"]), - ("connected_scatterplot.py", 55, ["miles", "gas"]), ("diverging_stacked_bar_chart.py", 40, ["value", "percentage_start"]), ("donut_chart.py", 6, ["value_start", "value_end"]), ("gapminder_bubble_plot.py", 187, ["income", "population"]), @@ -39,6 +38,7 @@ ("layered_bar_chart.py", 51, ["source", "net_generation"]), ("layered_histogram.py", 113, ["bin_maxbins_100_Measurement"]), ("line_chart_with_cumsum.py", 52, ["cumulative_wheat"]), + ("line_custom_order.py", 55, ["miles", "gas"]), ("line_percent.py", 30, ["sex", "perc"]), ("line_with_log_scale.py", 15, ["year", "sum_people"]), ("multifeature_scatter_plot.py", 150, ["petalWidth", "species"]),