From cfca9bcc08d8f501f3a088ea4ffa08eb42f72a61 Mon Sep 17 00:00:00 2001 From: Toph Tucker Date: Tue, 6 Jun 2023 21:13:11 -0400 Subject: [PATCH 1/3] given bar, use cell over rect when no reducer --- src/marks/auto.js | 4 +++- test/plots/autoplot.ts | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/marks/auto.js b/src/marks/auto.js index 0cb576a25b..b53c632ef0 100644 --- a/src/marks/auto.js +++ b/src/marks/auto.js @@ -131,7 +131,9 @@ export function autoSpec(data, options) { ? rectX : yReduce != null ? rectY - : rect; + : colorReduce != null + ? rect + : cell; colorMode = "fill"; break; default: diff --git a/test/plots/autoplot.ts b/test/plots/autoplot.ts index a5a63c169c..9fee019138 100644 --- a/test/plots/autoplot.ts +++ b/test/plots/autoplot.ts @@ -259,3 +259,8 @@ export async function autoChannels() { const athletes = await d3.csv("data/athletes.csv", d3.autoType); return Plot.auto(athletes, {x: Plot.valueof(athletes, "height"), y: Plot.valueof(athletes, "sport")}).plot(); } + +export async function autoBarNoReducer() { + const simpsons = await d3.csv("data/simpsons.csv", d3.autoType); + return Plot.auto(simpsons, {x: "season", y: "number_in_season", color: "imdb_rating", mark: "bar"}).plot() +} From d251fe638d7210ef0074395f4c5c116b3e13d566 Mon Sep 17 00:00:00 2001 From: Toph Tucker Date: Tue, 6 Jun 2023 21:20:51 -0400 Subject: [PATCH 2/3] lint --- test/plots/autoplot.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/plots/autoplot.ts b/test/plots/autoplot.ts index 9fee019138..0b876f3326 100644 --- a/test/plots/autoplot.ts +++ b/test/plots/autoplot.ts @@ -262,5 +262,5 @@ export async function autoChannels() { export async function autoBarNoReducer() { const simpsons = await d3.csv("data/simpsons.csv", d3.autoType); - return Plot.auto(simpsons, {x: "season", y: "number_in_season", color: "imdb_rating", mark: "bar"}).plot() + return Plot.auto(simpsons, {x: "season", y: "number_in_season", color: "imdb_rating", mark: "bar"}).plot(); } From 685440ed7dcb6d5956591f03b4119673a4e93806 Mon Sep 17 00:00:00 2001 From: Toph Tucker Date: Tue, 6 Jun 2023 21:24:12 -0400 Subject: [PATCH 3/3] test output --- test/output/autoBarNoReducer.svg | 736 +++++++++++++++++++++++++++++++ 1 file changed, 736 insertions(+) create mode 100644 test/output/autoBarNoReducer.svg diff --git a/test/output/autoBarNoReducer.svg b/test/output/autoBarNoReducer.svg new file mode 100644 index 0000000000..81e595ffbc --- /dev/null +++ b/test/output/autoBarNoReducer.svg @@ -0,0 +1,736 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + + + number_in_season + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + + + season + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file