From b5366f98ee118d415e05f85cc5df9a3b5f6af5c9 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Wed, 27 Dec 2023 11:24:17 -0800 Subject: [PATCH] preserve group input order (#1959) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * preserve group input order * sort: "z"; fix tests * reduce z docs * fix tests * Update docs/transforms/group.md Co-authored-by: Philippe Rivière --------- Co-authored-by: Philippe Rivière --- docs/transforms/bin.md | 1 + docs/transforms/group.md | 3 +- src/transforms/bin.d.ts | 4 +- src/transforms/bin.js | 8 +- src/transforms/group.d.ts | 3 +- src/transforms/group.js | 17 +- test/output/athletesBirthdays.svg | 32 +- test/output/athletesHeightWeightSex.svg | 1018 ++++++++--------- test/output/athletesSexWeight.svg | 48 +- test/output/athletesSortWeightLimit.svg | 14 +- test/output/athletesSportSex.svg | 40 +- test/output/autoBarMode.svg | 2 +- test/output/autoBarStackColor.svg | 12 +- test/output/autoBarTimeSeriesReduce.svg | 8 +- test/output/autoDotOrdinal.svg | 414 +++---- test/output/autoHeatmapOrdinal.svg | 2 +- test/output/autoHistogramGroup.svg | 2 +- test/output/autoLineMeanColor.svg | 2 +- test/output/autoRectStackColor.svg | 46 +- test/output/carsMpg.svg | 270 ++--- test/output/channelDomainAscending.svg | 22 +- test/output/channelDomainAscendingReverse.svg | 30 +- test/output/channelDomainComparator.svg | 32 +- .../output/channelDomainComparatorReverse.svg | 30 +- test/output/channelDomainDefault.svg | 22 +- test/output/channelDomainDefaultReverse.svg | 30 +- test/output/channelDomainDescending.svg | 30 +- .../output/channelDomainDescendingReverse.svg | 24 +- test/output/channelDomainMinus.svg | 30 +- test/output/channelDomainMinusReverse.svg | 24 +- test/output/diamondsBoxplot.svg | 24 +- test/output/fruitSales.svg | 4 +- test/output/gridReduceIdentity.svg | 6 +- test/output/hexbinSymbol.html | 200 ++-- test/output/internFacetNaN.svg | 30 +- test/output/intervalAwareBin.svg | 170 +-- test/output/intervalAwareGroup.svg | 12 +- test/output/likertSurvey.html | 20 +- test/output/mobyDickFaceted.svg | 60 +- test/output/mobyDickLetterFrequency.svg | 36 +- test/output/mobyDickLetterFrequencyFillX.svg | 36 +- test/output/mobyDickLetterPairs.svg | 492 ++++---- test/output/mobyDickLetterPosition.svg | 390 +++---- .../mobyDickLetterRelativeFrequency.svg | 36 +- test/output/moviesProfitByGenre.svg | 36 +- test/output/penguinAnnotated.svg | 14 +- test/output/penguinFacetAnnotated.svg | 14 +- test/output/penguinFacetAnnotatedX.svg | 14 +- test/output/penguinIslandUnknown.svg | 2 +- test/output/penguinSex.svg | 2 +- test/output/penguinSpeciesIslandSex.svg | 16 +- test/output/shorthandGroupBarY.svg | 2 +- test/output/tipBar.svg | 40 +- test/output/tipCell.svg | 90 +- test/output/tipCellFacet.svg | 76 +- test/output/tipGroupPrimitives.svg | 10 +- test/output/usPopulationStateAgeDots.svg | 26 +- test/output/wordCloud.svg | 496 ++++---- test/output/wordLengthMobyDick.svg | 14 +- test/plots/cars-mpg.ts | 2 +- test/plots/moby-dick-letter-pairs.ts | 3 +- test/plots/penguin-annotated.ts | 2 +- test/plots/penguin-facet-annotated-x.ts | 2 +- test/plots/penguin-facet-annotated.ts | 2 +- test/plots/penguin-island-unknown.ts | 2 +- test/plots/penguin-species-island-relative.ts | 2 +- test/plots/penguin-species-island.ts | 2 +- test/plots/sf-covid-deaths.ts | 3 +- test/plots/stargazers-hourly-group.ts | 2 +- test/plots/tip.ts | 2 +- 70 files changed, 2313 insertions(+), 2299 deletions(-) diff --git a/docs/transforms/bin.md b/docs/transforms/bin.md index 11f29fa19d..c70855e370 100644 --- a/docs/transforms/bin.md +++ b/docs/transforms/bin.md @@ -274,6 +274,7 @@ The following named reducers are supported: * *y* - the middle of the bin’s *y* extent (when binning on *y*) * *y1* - the lower bound of the bin’s *y* extent (when binning on *y*) * *y2* - the upper bound of the bin’s *y* extent (when binning on *y*) +* *z* - the bin’s *z* value (*z*, *fill*, or *stroke*) In addition, a reducer may be specified as: diff --git a/docs/transforms/group.md b/docs/transforms/group.md index 9108d4f7d8..9c368a73a3 100644 --- a/docs/transforms/group.md +++ b/docs/transforms/group.md @@ -329,7 +329,7 @@ Although barX applies an implicit stackX transform, [textX](../marks/text.md) do ## Group options -Given input *data* = [*d₀*, *d₁*, *d₂*, …], by default the resulting grouped data is an array of arrays where each inner array is a subset of the input data such as [[*d₁*, *d₂*, …], [*d₀*, …], …]. Each inner array is in input order. The outer array is in natural ascending order according to the associated dimension (*x* then *y*). +Given input *data* = [*d₀*, *d₁*, *d₂*, …], by default the resulting grouped data is an array of arrays where each inner array is a subset of the input data such as [[*d₁*, *d₂*, …], [*d₀*, …], …]. Each inner array is in input order. The outer array is in input order according to the first element of each group. By specifying a different reducer for the **data** output, as described below, you can change how the grouped data is computed. The outputs may also include **filter** and **sort** options specified as reducers, and a **reverse** option to reverse the order of generated groups. By default, empty groups are omitted, and non-empty groups are generated in ascending (natural) order. @@ -370,6 +370,7 @@ The following named reducers are supported: * *identity* - the array of values * *x* - the group’s *x* value (when grouping on *x*) * *y* - the group’s *y* value (when grouping on *y*) +* *z* - the group’s *z* value (*z*, *fill*, or *stroke*) In addition, a reducer may be specified as: diff --git a/src/transforms/bin.d.ts b/src/transforms/bin.d.ts index b630278af9..28e2b6ad8a 100644 --- a/src/transforms/bin.d.ts +++ b/src/transforms/bin.d.ts @@ -117,6 +117,7 @@ export interface BinOptions { * - *y* - the middle of the bin’s **y** extent (when binning on **y**) * - *y1* - the lower bound of the bin’s **y** extent (when binning on **y**) * - *y2* - the upper bound of the bin’s **y** extent (when binning on **y**) + * - *z* - the bin’s **z** value (when grouping on **z**, **fill**, or **stroke**) * - a function that takes an array of values and returns the reduced value * - an object that implements the *reduceIndex* method * @@ -132,7 +133,8 @@ export type BinReducer = | "x2" | "y" | "y1" - | "y2"; + | "y2" + | "z"; /** * A shorthand functional bin reducer implementation: given an array of input diff --git a/src/transforms/bin.js b/src/transforms/bin.js index dc42c06f8f..16abb9d883 100644 --- a/src/transforms/bin.js +++ b/src/transforms/bin.js @@ -41,7 +41,8 @@ import { maybeSubgroup, reduceCount, reduceFirst, - reduceIdentity + reduceIdentity, + reduceZ } from "./group.js"; import {maybeInsetX, maybeInsetY} from "./inset.js"; @@ -180,6 +181,7 @@ function binn( for (const [f, I] of maybeGroup(facet, G)) { for (const [k, g] of maybeGroup(I, K)) { for (const [b, extent] of bin(g)) { + if (G) extent.z = f; if (filter && !filter.reduce(b, extent)) continue; groupFacet.push(i++); groupData.push(reduceData.reduceIndex(b, data, extent)); @@ -190,7 +192,7 @@ function binn( if (BX1) BX1.push(extent.x1), BX2.push(extent.x2); if (BY1) BY1.push(extent.y1), BY2.push(extent.y2); for (const o of outputs) o.reduce(b, extent); - if (sort) sort.reduce(b); + if (sort) sort.reduce(b, extent); } } } @@ -355,6 +357,8 @@ function maybeBinReduceFallback(reduce) { return reduceY1; case "y2": return reduceY2; + case "z": + return reduceZ; } throw new Error(`invalid bin reduce: ${reduce}`); } diff --git a/src/transforms/group.d.ts b/src/transforms/group.d.ts index 1982c76e0e..c2d438420a 100644 --- a/src/transforms/group.d.ts +++ b/src/transforms/group.d.ts @@ -44,13 +44,14 @@ export interface GroupOutputOptions { * - a generic reducer name, such as *count* or *first* * - *x* - the group’s **x** value (when grouping on **x**) * - *y* - the group’s **y** value (when grouping on **y**) + * - *z* - the group’s **z** value (when grouping on **z**, **fill**, or **stroke**) * - a function that takes an array of values and returns the reduced value * - an object that implements the *reduceIndex* method * * When a reducer function or implementation is used with the group transform, * it is passed the group extent {x, y} as an additional argument. */ -export type GroupReducer = Reducer | GroupReducerFunction | GroupReducerImplementation | "x" | "y"; +export type GroupReducer = Reducer | GroupReducerFunction | GroupReducerImplementation | "x" | "y" | "z"; /** * A shorthand functional group reducer implementation: given an array of input diff --git a/src/transforms/group.js b/src/transforms/group.js index 4330c886a1..07ae348359 100644 --- a/src/transforms/group.js +++ b/src/transforms/group.js @@ -17,7 +17,6 @@ import { import {ascendingDefined} from "../defined.js"; import { column, - first, identity, isObject, isTemporal, @@ -137,6 +136,7 @@ function groupn( const extent = {data}; if (X) extent.x = x; if (Y) extent.y = y; + if (G) extent.z = f; if (filter && !filter.reduce(g, extent)) continue; groupFacet.push(i++); groupData.push(reduceData.reduceIndex(g, data, extent)); @@ -230,12 +230,7 @@ export function maybeEvaluator(name, reduce, inputs, asReduce = maybeReduce) { } export function maybeGroup(I, X) { - return X - ? sort( - grouper(I, (i) => X[i]), - first - ) - : [[, I]]; + return X ? grouper(I, (i) => X[i]) : [[, I]]; } export function maybeReduce(reduce, value, fallback = invalidReduce) { @@ -309,6 +304,8 @@ function maybeGroupReduceFallback(reduce) { return reduceX; case "y": return reduceY; + case "z": + return reduceZ; } throw new Error(`invalid group reduce: ${reduce}`); } @@ -437,6 +434,12 @@ const reduceY = { } }; +export const reduceZ = { + reduceIndex(I, X, {z}) { + return z; + } +}; + export function find(test) { if (typeof test !== "function") throw new Error(`invalid test function: ${test}`); return { diff --git a/test/output/athletesBirthdays.svg b/test/output/athletesBirthdays.svg index 5f2998066d..86ead317a8 100644 --- a/test/output/athletesBirthdays.svg +++ b/test/output/athletesBirthdays.svg @@ -61,32 +61,32 @@ Frequency → - - - - + + + + + + + + - - - - - 1,098 - 956 - 1,022 - 962 + 849 + 961 1,028 + 1,098 + 827 961 + 897 988 + 962 + 956 + 1,022 989 - 961 - 849 - 827 - 897 diff --git a/test/output/athletesHeightWeightSex.svg b/test/output/athletesHeightWeightSex.svg index fa1dc66a7b..a557f9ed8a 100644 --- a/test/output/athletesHeightWeightSex.svg +++ b/test/output/athletesHeightWeightSex.svg @@ -86,515 +86,6 @@ weight → - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1285,5 +776,514 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/output/athletesSexWeight.svg b/test/output/athletesSexWeight.svg index cedd02735e..4a00608978 100644 --- a/test/output/athletesSexWeight.svg +++ b/test/output/athletesSexWeight.svg @@ -77,30 +77,6 @@ weight → - - - - - - - - - - - - - - - - - - - - - - - - @@ -128,6 +104,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/output/athletesSortWeightLimit.svg b/test/output/athletesSortWeightLimit.svg index ca97eb8b45..3f437f0ada 100644 --- a/test/output/athletesSortWeightLimit.svg +++ b/test/output/athletesSortWeightLimit.svg @@ -159,15 +159,15 @@ - - + + + + - - - - - + + + \ No newline at end of file diff --git a/test/output/athletesSportSex.svg b/test/output/athletesSportSex.svg index 92f5d9fd29..6d79c08398 100644 --- a/test/output/athletesSportSex.svg +++ b/test/output/athletesSportSex.svg @@ -116,33 +116,33 @@ Women (%) → - - - - - - - - + + + + + + + - - + + + + + + - - - - - - - - - + + + + - + + + \ No newline at end of file diff --git a/test/output/autoBarMode.svg b/test/output/autoBarMode.svg index 7a0bfcd2f3..444cc1e82b 100644 --- a/test/output/autoBarMode.svg +++ b/test/output/autoBarMode.svg @@ -40,9 +40,9 @@ island + - \ No newline at end of file diff --git a/test/output/autoBarStackColor.svg b/test/output/autoBarStackColor.svg index 4b1ebc3214..ad6fe57386 100644 --- a/test/output/autoBarStackColor.svg +++ b/test/output/autoBarStackColor.svg @@ -50,12 +50,12 @@ Frequency → - - - - - - + + + + + + diff --git a/test/output/autoBarTimeSeriesReduce.svg b/test/output/autoBarTimeSeriesReduce.svg index 0b675afc61..b68317fb31 100644 --- a/test/output/autoBarTimeSeriesReduce.svg +++ b/test/output/autoBarTimeSeriesReduce.svg @@ -57,12 +57,12 @@ 30 - - - - + + + + diff --git a/test/output/autoDotOrdinal.svg b/test/output/autoDotOrdinal.svg index 7150a02fa5..eedecc88a8 100644 --- a/test/output/autoDotOrdinal.svg +++ b/test/output/autoDotOrdinal.svg @@ -465,12 +465,12 @@ - + - + @@ -482,8 +482,8 @@ - + @@ -502,12 +502,12 @@ - - + - + + @@ -516,8 +516,8 @@ - + @@ -526,334 +526,334 @@ - - - + + + + - - + - - - + + + - - + + + - - + - - + - + + + - - - + + + - - - + - - + + + - - - - + + + + + - - - + + - + - + - - + + - + - + - - + + + + - - - - - - - - + - - - + + + + - - - - + + + + - + - + + + + + + + + - - - - - + + + + + + + - - + + + + + - - + - - - - - - - - - + + + + - - - - - - + + + + + + + + + + + + + + + - - - - - + + + + + - + - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - + + + + - - - - - + + + - + + + + + + + + + - + + + + + + + + + + + + + - - - - - - - + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + - + + + + + + + + - - - + + - - - - - - - - - - - + + + + + - - - - - - - - - - - + + - - - - - - + + + + + + + + - - - - - - - + - - + - - - - - - - - + + + + + + + + + + - + + + + + - + + + - - + - - - + + \ No newline at end of file diff --git a/test/output/autoHeatmapOrdinal.svg b/test/output/autoHeatmapOrdinal.svg index 22a1b50a38..2948cbf9d2 100644 --- a/test/output/autoHeatmapOrdinal.svg +++ b/test/output/autoHeatmapOrdinal.svg @@ -40,9 +40,9 @@ island + - diff --git a/test/output/autoHistogramGroup.svg b/test/output/autoHistogramGroup.svg index 20b7d7c5be..2cc6884fe6 100644 --- a/test/output/autoHistogramGroup.svg +++ b/test/output/autoHistogramGroup.svg @@ -52,9 +52,9 @@ island + - diff --git a/test/output/autoLineMeanColor.svg b/test/output/autoLineMeanColor.svg index 6c86e4aa9e..3bb3e748f1 100644 --- a/test/output/autoLineMeanColor.svg +++ b/test/output/autoLineMeanColor.svg @@ -62,8 +62,8 @@ date_of_birth → - + \ No newline at end of file diff --git a/test/output/autoRectStackColor.svg b/test/output/autoRectStackColor.svg index f2796ddb3b..8e25172779 100644 --- a/test/output/autoRectStackColor.svg +++ b/test/output/autoRectStackColor.svg @@ -58,39 +58,39 @@ culmen_length_mm → - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - diff --git a/test/output/carsMpg.svg b/test/output/carsMpg.svg index 3905f61dd8..9680efa026 100644 --- a/test/output/carsMpg.svg +++ b/test/output/carsMpg.svg @@ -86,187 +86,187 @@ year - + + + - - - - - - + + + + + + + - + - - - - - - - - - - - - + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/test/output/channelDomainAscending.svg b/test/output/channelDomainAscending.svg index 63d2579509..3bd169ae03 100644 --- a/test/output/channelDomainAscending.svg +++ b/test/output/channelDomainAscending.svg @@ -81,24 +81,24 @@ - - - + - + + + + + - - + + - + + - - - - + \ No newline at end of file diff --git a/test/output/channelDomainAscendingReverse.svg b/test/output/channelDomainAscendingReverse.svg index 58d4c588cd..89d8deb18d 100644 --- a/test/output/channelDomainAscendingReverse.svg +++ b/test/output/channelDomainAscendingReverse.svg @@ -80,25 +80,25 @@ Frequency → - - - - - - - - - - - - + - - + + + + + + + + + + + + + + - \ No newline at end of file diff --git a/test/output/channelDomainComparator.svg b/test/output/channelDomainComparator.svg index 13755bdb50..89d8deb18d 100644 --- a/test/output/channelDomainComparator.svg +++ b/test/output/channelDomainComparator.svg @@ -55,7 +55,7 @@ NZL UKR SWE - COL + HUN nationality @@ -80,25 +80,25 @@ Frequency → - - - - - - - - - - - - + - - + + + + + + + + + + + + + + - \ No newline at end of file diff --git a/test/output/channelDomainComparatorReverse.svg b/test/output/channelDomainComparatorReverse.svg index 58d4c588cd..c3dd86fbc7 100644 --- a/test/output/channelDomainComparatorReverse.svg +++ b/test/output/channelDomainComparatorReverse.svg @@ -55,7 +55,7 @@ NZL UKR SWE - HUN + COL nationality @@ -80,25 +80,25 @@ Frequency → - + + + + + + + + + + + - - - + - + + - - - - - - - - - \ No newline at end of file diff --git a/test/output/channelDomainDefault.svg b/test/output/channelDomainDefault.svg index 63d2579509..3bd169ae03 100644 --- a/test/output/channelDomainDefault.svg +++ b/test/output/channelDomainDefault.svg @@ -81,24 +81,24 @@ - - - + - + + + + + - - + + - + + - - - - + \ No newline at end of file diff --git a/test/output/channelDomainDefaultReverse.svg b/test/output/channelDomainDefaultReverse.svg index 58d4c588cd..89d8deb18d 100644 --- a/test/output/channelDomainDefaultReverse.svg +++ b/test/output/channelDomainDefaultReverse.svg @@ -80,25 +80,25 @@ Frequency → - - - - - - - - - - - - + - - + + + + + + + + + + + + + + - \ No newline at end of file diff --git a/test/output/channelDomainDescending.svg b/test/output/channelDomainDescending.svg index 13755bdb50..c3dd86fbc7 100644 --- a/test/output/channelDomainDescending.svg +++ b/test/output/channelDomainDescending.svg @@ -80,25 +80,25 @@ Frequency → - - - - - - - - - - - - + - - + + + + + + + + + + + + + + - \ No newline at end of file diff --git a/test/output/channelDomainDescendingReverse.svg b/test/output/channelDomainDescendingReverse.svg index bfd1a094f2..826c68a853 100644 --- a/test/output/channelDomainDescendingReverse.svg +++ b/test/output/channelDomainDescendingReverse.svg @@ -80,25 +80,25 @@ Frequency → - - - + - + + + + + - - + + - + + - - - - - + + \ No newline at end of file diff --git a/test/output/channelDomainMinus.svg b/test/output/channelDomainMinus.svg index 13755bdb50..c3dd86fbc7 100644 --- a/test/output/channelDomainMinus.svg +++ b/test/output/channelDomainMinus.svg @@ -80,25 +80,25 @@ Frequency → - - - - - - - - - - - - + - - + + + + + + + + + + + + + + - \ No newline at end of file diff --git a/test/output/channelDomainMinusReverse.svg b/test/output/channelDomainMinusReverse.svg index bfd1a094f2..826c68a853 100644 --- a/test/output/channelDomainMinusReverse.svg +++ b/test/output/channelDomainMinusReverse.svg @@ -80,25 +80,25 @@ Frequency → - - - + - + + + + + - - + + - + + - - - - - + + \ No newline at end of file diff --git a/test/output/diamondsBoxplot.svg b/test/output/diamondsBoxplot.svg index e1b1150865..5e832bc392 100644 --- a/test/output/diamondsBoxplot.svg +++ b/test/output/diamondsBoxplot.svg @@ -62,34 +62,34 @@ price → - - - + - + + + - - - + - + + + - - - + - + + + diff --git a/test/output/fruitSales.svg b/test/output/fruitSales.svg index 61edc265cd..df6ba7250e 100644 --- a/test/output/fruitSales.svg +++ b/test/output/fruitSales.svg @@ -56,9 +56,9 @@ - - + + diff --git a/test/output/gridReduceIdentity.svg b/test/output/gridReduceIdentity.svg index 2403cd624a..03cd47c78c 100644 --- a/test/output/gridReduceIdentity.svg +++ b/test/output/gridReduceIdentity.svg @@ -68,12 +68,12 @@ AK,ME - VT,NH,MA + CA,NV,UT,CO,KS,MO,KY,WV,DC,MD,DE + HI,FL WA,MT,ND,SD,MN,WI,MI,NY,CT,RI OR,ID,WY,NE,IA,IL,IN,OH,PA,NJ - CA,NV,UT,CO,KS,MO,KY,WV,DC,MD,DE AZ,NM,OK,AR,TN,VA,NC TX,LA,MS,AL,GA,SC - HI,FL + VT,NH,MA \ No newline at end of file diff --git a/test/output/hexbinSymbol.html b/test/output/hexbinSymbol.html index 025b6d1a24..c3eb03e81a 100644 --- a/test/output/hexbinSymbol.html +++ b/test/output/hexbinSymbol.html @@ -132,21 +132,12 @@ + + - - - - - - - - - - - @@ -158,28 +149,15 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + @@ -204,6 +182,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -272,73 +339,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/output/internFacetNaN.svg b/test/output/internFacetNaN.svg index 2cca9cb3cd..0dfb4d2791 100644 --- a/test/output/internFacetNaN.svg +++ b/test/output/internFacetNaN.svg @@ -199,20 +199,20 @@ - + - + - + - + @@ -221,8 +221,8 @@ - + @@ -245,20 +245,20 @@ - + - + - + - + @@ -267,8 +267,8 @@ - + @@ -291,20 +291,20 @@ - + - + - + - + @@ -313,8 +313,8 @@ - + diff --git a/test/output/intervalAwareBin.svg b/test/output/intervalAwareBin.svg index 57e5e58180..155621f022 100644 --- a/test/output/intervalAwareBin.svg +++ b/test/output/intervalAwareBin.svg @@ -66,65 +66,6 @@ weight → - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -151,6 +92,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -258,30 +225,28 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -324,6 +289,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -334,6 +323,19 @@ + + + + + + + + + + + + + @@ -346,7 +348,5 @@ - - \ No newline at end of file diff --git a/test/output/intervalAwareGroup.svg b/test/output/intervalAwareGroup.svg index 8a11a77442..87430c8f87 100644 --- a/test/output/intervalAwareGroup.svg +++ b/test/output/intervalAwareGroup.svg @@ -60,16 +60,16 @@ date_of_birth → - - - - - - + + + + + + \ No newline at end of file diff --git a/test/output/likertSurvey.html b/test/output/likertSurvey.html index 45da862a02..e014dc66ad 100644 --- a/test/output/likertSurvey.html +++ b/test/output/likertSurvey.html @@ -87,26 +87,26 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/test/output/mobyDickFaceted.svg b/test/output/mobyDickFaceted.svg index 3286115326..c9e112a03e 100644 --- a/test/output/mobyDickFaceted.svg +++ b/test/output/mobyDickFaceted.svg @@ -228,60 +228,60 @@ - - - - - - - - - - - - - + + + + + - + + + + + + + + + - - - + + + + + + + - - - - - - - + + + + - - - + + - - + + + - diff --git a/test/output/mobyDickLetterFrequency.svg b/test/output/mobyDickLetterFrequency.svg index e51880fe2d..e586d5acba 100644 --- a/test/output/mobyDickLetterFrequency.svg +++ b/test/output/mobyDickLetterFrequency.svg @@ -118,32 +118,32 @@ Z - - - - - - - - - - + - + + + + - - + - - - + + + - - + + + + + + + + + diff --git a/test/output/mobyDickLetterFrequencyFillX.svg b/test/output/mobyDickLetterFrequencyFillX.svg index 998a42a7c9..1a0cb918e0 100644 --- a/test/output/mobyDickLetterFrequencyFillX.svg +++ b/test/output/mobyDickLetterFrequencyFillX.svg @@ -118,32 +118,32 @@ Z - - - - - - - - - - + - + + + + - - + - - - + + + - - + + + + + + + + + diff --git a/test/output/mobyDickLetterPairs.svg b/test/output/mobyDickLetterPairs.svg index 27b58c0540..5f86e2645e 100644 --- a/test/output/mobyDickLetterPairs.svg +++ b/test/output/mobyDickLetterPairs.svg @@ -72,411 +72,411 @@ Z - - - - - - - - - - - + + - + + + + - - + - - - + + + - - + + + + + + + + + + * + * * - * - * - * + * + * + * * - * - * + * * - * + * + * + * * - * - * + * + * * - * - * + * * - * - * - * * - * + * + * * - * - A - A + * A - A + A A - A - A + A A - A - A - A - A - A - A A - A + A A + A + A A - A + A + A + A + A + A + A A - A - A + A + A A - B + A + A B - B - B B - B - B - B + B + B B + B + B B - C - C - C + B + B C C - C + C + C + C C C - C + C + C C C - C + C + D + D D + D + D + D + D D D - D D - D - D - D - D D - D - E + E E - E - E - E + E + E + E + E + E + E + E E - E - E E + E + E + E + E + E E E - E - E - E + E + E E - E - E - E - E - E - E + E E E - E - E + E + F + F F - F - F + F F - F F - F - F - F - F F - F - F + F F - G + F + F + F + F + F G - G + G + G G - G - G + G G - G + G + G G + G G - G + H H - H - H - H + H H - H + H + H + H H + H H - H - H - H + H I - I - I + I I - I - I + I + I + I + I + I + I I + I + I I - I + I + I + I I - I - I + I I I - I - I - I - I - I - I - I - I + I I + I J - J J + J K - K K - K - K - K - K + K K + K K + K K - L + K + K L - L - L - L + L L - L - L - L + L + L + L L - L - L - L - L L + L + L + L + L L - L - L + L + L + L + L + L L - L + L M - M - M - M M + M M + M + M M M - M - M - M + M M + M + M M - M + M N + N + N N N - N - N + N N - N - N + N N + N + N N - N - N - O - O - O - O - O - O + O O O - O - O O - O + O O - O - O - O - O + O O - O O + O + O + O + O + O + O + O + O + O O + O + O P - P - P - P - P + P P - P - P + P + P P + P + P + P P - P - P P - P - Q + P + P + P Q + Q Q - R R - R - R - R R - R + R + R + R + R + R + R R + R + R + R R - R - R - R R - R - R + R R + S S + S + S + S + S + S + S S S - S + S + S + S S - S + S S - S - S - S - S S - S - S - S + S S - S S - S - S - S - S - T - T - T - T - T - T - T + S + S T - T - T + T T - T T + T + T T - T + T T + T + T + T + T T + T + T T - U - U - U + T + U U - U - U + U U - U - U U + U + U + U + U + U + U + U U + U U - U - U - U U - U - U + U + U U - V - V V + V V - V - V V + V + V V + V + W W - W + W W + W W W - W - W - W + W W - X X X + X Y + Y + Y + Y + Y Y + Y + Y Y - Y Y - Y - Y - Y - Y - Y Y Y Y - Y - Y - Y - Y Y - Z - Z + Y + Y + Y + Y Z Z + Z + Z \ No newline at end of file diff --git a/test/output/mobyDickLetterPosition.svg b/test/output/mobyDickLetterPosition.svg index 07b4a424e1..0388e29bec 100644 --- a/test/output/mobyDickLetterPosition.svg +++ b/test/output/mobyDickLetterPosition.svg @@ -105,252 +105,252 @@ Position within word - + + + + + + + + + + + - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + - + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + + + + + - - - + + - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + \ No newline at end of file diff --git a/test/output/mobyDickLetterRelativeFrequency.svg b/test/output/mobyDickLetterRelativeFrequency.svg index 10761a9d02..133ed30dbc 100644 --- a/test/output/mobyDickLetterRelativeFrequency.svg +++ b/test/output/mobyDickLetterRelativeFrequency.svg @@ -118,32 +118,32 @@ Z - - - - - - - - - - + - + + + + - - + - - - + + + - - + + + + + + + + + diff --git a/test/output/moviesProfitByGenre.svg b/test/output/moviesProfitByGenre.svg index 40ce0c496c..e21cbd8e3c 100644 --- a/test/output/moviesProfitByGenre.svg +++ b/test/output/moviesProfitByGenre.svg @@ -74,19 +74,19 @@ - - - - - - + - + - - + + + + + + + @@ -3292,18 +3292,18 @@ - - - - - - + - + - - + + + + + + + \ No newline at end of file diff --git a/test/output/penguinAnnotated.svg b/test/output/penguinAnnotated.svg index b71bb8c8ad..a6c71c4b37 100644 --- a/test/output/penguinAnnotated.svg +++ b/test/output/penguinAnnotated.svg @@ -49,17 +49,17 @@ Frequency → - - FEMALE (73) - FEMALE (34) - FEMALE (58) - MALE (73) - MALE (34) - MALE (61) + MALE (73) + MALE (34) + MALE (61) + FEMALE (73) + FEMALE (34) + FEMALE (58) null (6) null (5) + Count of penguinsgrouped by species and colored by sex diff --git a/test/output/penguinFacetAnnotated.svg b/test/output/penguinFacetAnnotated.svg index df2dbaf0ec..e5870074fc 100644 --- a/test/output/penguinFacetAnnotated.svg +++ b/test/output/penguinFacetAnnotated.svg @@ -89,11 +89,6 @@ Frequency → - - - - - @@ -110,11 +105,16 @@ - - + + + + + + + Torgersen Island only has Adelie penguins! diff --git a/test/output/penguinFacetAnnotatedX.svg b/test/output/penguinFacetAnnotatedX.svg index 329793cdf1..ba0f635467 100644 --- a/test/output/penguinFacetAnnotatedX.svg +++ b/test/output/penguinFacetAnnotatedX.svg @@ -81,11 +81,6 @@ Frequency → - - - - - @@ -102,11 +97,16 @@ - - + + + + + + + Torgersen Islandonly has Adeliepenguins! diff --git a/test/output/penguinIslandUnknown.svg b/test/output/penguinIslandUnknown.svg index 0d5fd0b532..89b40ff5f2 100644 --- a/test/output/penguinIslandUnknown.svg +++ b/test/output/penguinIslandUnknown.svg @@ -57,8 +57,8 @@ - + diff --git a/test/output/penguinSex.svg b/test/output/penguinSex.svg index b163855c28..1a18b2c87b 100644 --- a/test/output/penguinSex.svg +++ b/test/output/penguinSex.svg @@ -51,8 +51,8 @@ sex - + diff --git a/test/output/penguinSpeciesIslandSex.svg b/test/output/penguinSpeciesIslandSex.svg index ff272ab9e9..7cd5d4921c 100644 --- a/test/output/penguinSpeciesIslandSex.svg +++ b/test/output/penguinSpeciesIslandSex.svg @@ -160,14 +160,14 @@ - - - - - - - - + + + + + + + + diff --git a/test/output/shorthandGroupBarY.svg b/test/output/shorthandGroupBarY.svg index b06c1a9e50..70828e3b69 100644 --- a/test/output/shorthandGroupBarY.svg +++ b/test/output/shorthandGroupBarY.svg @@ -50,8 +50,8 @@ - + \ No newline at end of file diff --git a/test/output/tipBar.svg b/test/output/tipBar.svg index fa3f011951..c483d5b970 100644 --- a/test/output/tipBar.svg +++ b/test/output/tipBar.svg @@ -94,34 +94,34 @@ Frequency → - - - - - - - - + + + + + + + - - + + + + + + - - - - - - - - - + + + + - + + + \ No newline at end of file diff --git a/test/output/tipCell.svg b/test/output/tipCell.svg index 1e2f7c6e45..09526b1c48 100644 --- a/test/output/tipCell.svg +++ b/test/output/tipCell.svg @@ -88,62 +88,62 @@ sex - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + - + + + - - - + - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - + + \ No newline at end of file diff --git a/test/output/tipCellFacet.svg b/test/output/tipCellFacet.svg index 24ee381742..c24f88eae2 100644 --- a/test/output/tipCellFacet.svg +++ b/test/output/tipCellFacet.svg @@ -93,64 +93,64 @@ + + + + + + + + + + + + + - - - + + + + - - - - - - - - - - - - - - - + - + - - - - - - + + + + + + + + + + - - - + - - - - - - - - - + + + + - + + + + diff --git a/test/output/tipGroupPrimitives.svg b/test/output/tipGroupPrimitives.svg index 3441cf3017..70fae9e7c8 100644 --- a/test/output/tipGroupPrimitives.svg +++ b/test/output/tipGroupPrimitives.svg @@ -49,16 +49,16 @@ f + + - - - - - + + + \ No newline at end of file diff --git a/test/output/usPopulationStateAgeDots.svg b/test/output/usPopulationStateAgeDots.svg index f8b8164ac4..c609d74952 100644 --- a/test/output/usPopulationStateAgeDots.svg +++ b/test/output/usPopulationStateAgeDots.svg @@ -59,58 +59,58 @@ - - + + - + - + - - + + - + - - + - + + - - + - + + diff --git a/test/output/wordCloud.svg b/test/output/wordCloud.svg index d23901c58c..05a3fa5322 100644 --- a/test/output/wordCloud.svg +++ b/test/output/wordCloud.svg @@ -14,253 +14,253 @@ } - a (69) - about (7) - account (2) - ago (2) - air (2) - all (23) - almost (3) - aloft (2) - always (2) - am (4) - among (2) - an (4) - and (73) - any (2) - are (5) - as (26) - at (5) - be (9) - because (4) - been (2) - before (3) - begin (2) - being (4) - besides (2) - better (2) - between (2) - broiled (3) - but (15) - by (8) - can (6) - cannot (2) - captain (2) - care (2) - chief (2) - city (2) - come (3) - commodore (2) - content (2) - cook (3) - could (2) - country (2) - crowds (2) - deck (2) - deep (2) - did (5) - distant (2) - do (8) - does (2) - down (6) - each (2) - else (2) - ever (5) - every (4) - exactly (2) - fates (2) - find (2) - first (4) - fixed (2) - for (16) - forecastle (2) - from (11) - get (6) - glory (2) - go (12) - going (4) - grand (3) - great (3) - grow (2) - hand (3) - have (8) - having (2) - he (10) - head (4) - healthy (2) - here (5) - high (4) - hill (2) - him (3) - himself (2) - his (10) - how (3) - however (2) - hunks (2) - i (43) - if (9) - image (3) - in (48) - into (9) - is (34) - ishmael (2) - it (33) - its (2) - just (2) - land (6) - lead (2) - leaders (2) - leaves (2) - let (2) - like (6) - little (4) - long (2) - look (2) - magic (2) - make (2) - man (3) - mast (2) - may (3) - me (25) - meadow (2) - mean (2) - meaning (2) - men (4) - metaphysical (2) - miles (3) - money (4) - more (6) - most (5) - motives (2) - much (4) - must (4) - my (14) - myself (3) - never (5) - no (6) - not (11) - nothing (3) - now (5) - ocean (2) - of (81) - off (3) - officer (2) - old (6) - on (12) - once (2) - one (10) - or (10) - order (2) - other (5) - others (2) - ourselves (2) - out (3) - over (2) - own (2) - paid (2) - part (7) - particular (2) - parts (3) - passenger (4) - passengers (3) - pay (2) - paying (3) - perhaps (2) - phantom (2) - plunged (2) - point (2) - previous (2) - purse (3) - requires (2) - respectfully (2) - reveries (2) - right (3) - robust (2) - round (2) - sail (2) - sailor (5) - same (5) - say (3) - schoolmaster (2) - scores (2) - sea (13) - seas (2) - see (6) - set (3) - shepherds (2) - ship (3) - ships (3) - should (3) - sight (2) - sleep (2) - so (4) - some (11) - something (3) - sort (3) - soul (3) - spar (2) - stand (5) - still (3) - stream (2) - streets (2) - strong (2) - such (5) - take (6) - tell (4) - than (4) - that (31) - the (124) - their (4) - them (5) - themselves (2) - then (5) - there (16) - these (4) - they (12) - thing (2) - things (4) - think (2) - thinks (2) - this (17) - those (4) - though (7) - thousand (2) - thousands (2) - thump (2) - time (6) - to (53) - two (4) - under (2) - unless (2) - up (4) - upon (9) - voyage (6) - warehouses (2) - was (8) - water (8) - way (6) - we (3) - well (2) - were (7) - whale (3) - whaling (5) - what (9) - when (5) - whenever (5) - where (2) - which (4) - who (5) - why (7) - wild (2) - will (6) - winds (3) - with (13) - without (3) - world (4) - would (4) - yet (4) - yonder (2) - you (23) - your (6) + me (25) + ishmael (2) + some (11) + ago (2) + never (5) + how (3) + long (2) + having (2) + little (4) + or (10) + no (6) + money (4) + in (48) + my (14) + purse (3) + and (73) + nothing (3) + particular (2) + to (53) + on (12) + i (43) + would (4) + sail (2) + about (7) + a (69) + see (6) + the (124) + part (7) + of (81) + world (4) + it (33) + is (34) + way (6) + have (8) + off (3) + whenever (5) + find (2) + myself (3) + soul (3) + before (3) + warehouses (2) + up (4) + every (4) + get (6) + such (5) + an (4) + hand (3) + that (31) + requires (2) + strong (2) + from (11) + into (9) + then (5) + account (2) + high (4) + time (6) + sea (13) + as (26) + can (6) + this (17) + for (16) + with (13) + himself (2) + upon (9) + his (10) + take (6) + ship (3) + there (16) + if (9) + they (12) + but (15) + almost (3) + all (23) + men (4) + their (4) + other (5) + same (5) + ocean (2) + now (5) + your (6) + city (2) + round (2) + by (8) + right (3) + streets (2) + you (23) + its (2) + where (2) + which (4) + previous (2) + were (7) + out (3) + sight (2) + land (6) + look (2) + at (5) + crowds (2) + water (8) + go (12) + what (9) + do (8) + like (6) + stand (5) + thousands (2) + fixed (2) + reveries (2) + over (2) + ships (3) + aloft (2) + still (3) + better (2) + these (4) + are (5) + here (5) + come (3) + more (6) + will (6) + content (2) + them (5) + under (2) + yonder (2) + not (11) + must (4) + just (2) + without (3) + miles (3) + yet (4) + tell (4) + does (2) + those (4) + once (2) + say (3) + country (2) + any (2) + one (10) + down (6) + leaves (2) + stream (2) + magic (2) + let (2) + most (5) + be (9) + plunged (2) + man (3) + set (3) + going (4) + he (10) + lead (2) + should (3) + ever (5) + great (3) + metaphysical (2) + chief (2) + each (2) + meadow (2) + sleep (2) + deep (2) + distant (2) + winds (3) + hill (2) + though (7) + shepherds (2) + head (4) + unless (2) + him (3) + when (5) + scores (2) + among (2) + thousand (2) + why (7) + did (5) + two (4) + robust (2) + healthy (2) + first (4) + voyage (6) + passenger (4) + old (6) + own (2) + meaning (2) + who (5) + because (4) + could (2) + image (3) + was (8) + we (3) + ourselves (2) + phantom (2) + am (4) + begin (2) + grow (2) + mean (2) + something (3) + besides (2) + passengers (3) + themselves (2) + much (4) + thing (2) + commodore (2) + captain (2) + cook (3) + glory (2) + care (2) + being (4) + sort (3) + officer (2) + broiled (3) + respectfully (2) + than (4) + sailor (5) + mast (2) + forecastle (2) + order (2) + make (2) + spar (2) + may (3) + been (2) + schoolmaster (2) + hunks (2) + think (2) + thinks (2) + well (2) + however (2) + thump (2) + else (2) + point (2) + so (4) + others (2) + always (2) + paying (3) + pay (2) + between (2) + paid (2) + perhaps (2) + air (2) + deck (2) + leaders (2) + things (4) + whaling (5) + fates (2) + grand (3) + cannot (2) + exactly (2) + parts (3) + motives (2) + whale (3) + wild (2) + seas (2) \ No newline at end of file diff --git a/test/output/wordLengthMobyDick.svg b/test/output/wordLengthMobyDick.svg index 9bfde568f9..87d1ef00e9 100644 --- a/test/output/wordLengthMobyDick.svg +++ b/test/output/wordLengthMobyDick.svg @@ -91,19 +91,19 @@ Word length → - a - of - the that - there - though + of because - whenever + there + the passenger + though passengers + whenever + a circulation - metaphysical involuntarily + metaphysical Circumambulate \ No newline at end of file diff --git a/test/plots/cars-mpg.ts b/test/plots/cars-mpg.ts index 527585fa11..f5c583e8f1 100644 --- a/test/plots/cars-mpg.ts +++ b/test/plots/cars-mpg.ts @@ -18,7 +18,7 @@ export async function carsMpg() { Plot.line( data, Plot.groupX( - {y: "mean"}, + {y: "mean", sort: "x"}, { x: "year", y: "economy (mpg)", diff --git a/test/plots/moby-dick-letter-pairs.ts b/test/plots/moby-dick-letter-pairs.ts index 00a9d5a0d9..79442baf26 100644 --- a/test/plots/moby-dick-letter-pairs.ts +++ b/test/plots/moby-dick-letter-pairs.ts @@ -17,7 +17,8 @@ export async function mobyDickLetterPairs() { { text: "first", y: "first", - x: "distinct" + x: "distinct", + sort: "x" }, { y: "letter", diff --git a/test/plots/penguin-annotated.ts b/test/plots/penguin-annotated.ts index 2b06a872e6..7a70b7e801 100644 --- a/test/plots/penguin-annotated.ts +++ b/test/plots/penguin-annotated.ts @@ -7,8 +7,8 @@ export async function penguinAnnotated() { marginLeft: 75, x: {insetRight: 10}, marks: [ - Plot.frame(), Plot.barX(penguins, Plot.groupY({x: "count"}, {y: "species", fill: "sex", title: "sex", sort: {y: "-x"}})), + Plot.frame(), Plot.text(["Count of penguins\ngrouped by species\n and colored by sex"], { frameAnchor: "bottom-right", dx: -3, diff --git a/test/plots/penguin-facet-annotated-x.ts b/test/plots/penguin-facet-annotated-x.ts index 9a5de69c6a..19fabb1e34 100644 --- a/test/plots/penguin-facet-annotated-x.ts +++ b/test/plots/penguin-facet-annotated-x.ts @@ -7,8 +7,8 @@ export async function penguinFacetAnnotatedX() { marginLeft: 75, x: {insetRight: 10}, marks: [ - Plot.frame(), Plot.barX(penguins, Plot.groupY({x: "count"}, {fx: "island", y: "species", fill: "sex"})), + Plot.frame(), Plot.text(["Torgersen Island only has Adelie penguins!"], { fx: ["Torgersen"], frameAnchor: "top-right", diff --git a/test/plots/penguin-facet-annotated.ts b/test/plots/penguin-facet-annotated.ts index 2524d26701..c823d75218 100644 --- a/test/plots/penguin-facet-annotated.ts +++ b/test/plots/penguin-facet-annotated.ts @@ -7,8 +7,8 @@ export async function penguinFacetAnnotated() { marginLeft: 75, facet: {marginRight: 70}, marks: [ - Plot.frame(), Plot.barX(penguins, Plot.groupY({x: "count"}, {fy: "island", y: "species", fill: "sex"})), + Plot.frame(), Plot.text(["Torgersen Island only has Adelie penguins!"], { fy: ["Torgersen"], frameAnchor: "top-right", diff --git a/test/plots/penguin-island-unknown.ts b/test/plots/penguin-island-unknown.ts index 31ceb0afb5..e074ca8468 100644 --- a/test/plots/penguin-island-unknown.ts +++ b/test/plots/penguin-island-unknown.ts @@ -8,6 +8,6 @@ export async function penguinIslandUnknown() { domain: ["Dream"], unknown: "#ccc" }, - marks: [Plot.barY(penguins, Plot.groupX({y: "count"}, {x: "sex", fill: "island"})), Plot.ruleY([0])] + marks: [Plot.barY(penguins, Plot.groupX({y: "count", sort: "z"}, {x: "sex", fill: "island"})), Plot.ruleY([0])] }); } diff --git a/test/plots/penguin-species-island-relative.ts b/test/plots/penguin-species-island-relative.ts index 1279e15de6..eb0975a33d 100644 --- a/test/plots/penguin-species-island-relative.ts +++ b/test/plots/penguin-species-island-relative.ts @@ -14,6 +14,6 @@ export async function penguinSpeciesIslandRelative() { data: penguins, x: "species" }, - marks: [Plot.barY(penguins, Plot.groupZ({y: "proportion-facet"}, {fill: "island"})), Plot.ruleY([0])] + marks: [Plot.barY(penguins, Plot.groupZ({y: "proportion-facet", sort: "z"}, {fill: "island"})), Plot.ruleY([0])] }); } diff --git a/test/plots/penguin-species-island.ts b/test/plots/penguin-species-island.ts index e164fb42a7..00be400d06 100644 --- a/test/plots/penguin-species-island.ts +++ b/test/plots/penguin-species-island.ts @@ -7,6 +7,6 @@ export async function penguinSpeciesIsland() { y: { grid: true }, - marks: [Plot.barY(data, Plot.groupX({y: "count"}, {x: "species", fill: "island"})), Plot.ruleY([0])] + marks: [Plot.barY(data, Plot.groupX({y: "count", sort: "z"}, {x: "species", fill: "island"})), Plot.ruleY([0])] }); } diff --git a/test/plots/sf-covid-deaths.ts b/test/plots/sf-covid-deaths.ts index f7ef2c2a14..282f8d0382 100644 --- a/test/plots/sf-covid-deaths.ts +++ b/test/plots/sf-covid-deaths.ts @@ -10,7 +10,8 @@ export async function sfCovidDeaths() { Plot.binX( { y: "sum", - filter: null + filter: null, + sort: "z" }, { x: "specimen_collection_date", diff --git a/test/plots/stargazers-hourly-group.ts b/test/plots/stargazers-hourly-group.ts index f96ea6e59c..96a4bcae4e 100644 --- a/test/plots/stargazers-hourly-group.ts +++ b/test/plots/stargazers-hourly-group.ts @@ -17,7 +17,7 @@ export async function stargazersHourlyGroup() { Plot.binX( {y: "count", interval: 1}, Plot.binX( - {x: (d) => Math.min(10, d.length), title: "first", thresholds: "hour"}, + {x: (d) => Math.min(10, d.length), title: "first", thresholds: "hour", sort: "z"}, {x: "date", fill: (d) => d.date.getUTCDay(), title: (d) => "SMTWTFS"[d.date.getUTCDay()]} ) ) diff --git a/test/plots/tip.ts b/test/plots/tip.ts index 7f48802072..4cecf671d3 100644 --- a/test/plots/tip.ts +++ b/test/plots/tip.ts @@ -27,7 +27,7 @@ export async function tipBin() { export async function tipBinStack() { const olympians = await d3.csv("data/athletes.csv", d3.autoType); - return Plot.rectY(olympians, Plot.binX({y: "count"}, {x: "weight", fill: "sex", tip: true})).plot(); + return Plot.rectY(olympians, Plot.binX({y: "count", sort: "z"}, {x: "weight", fill: "sex", tip: true})).plot(); } export async function tipCell() {