From 8c303b1f39d74e551079a0f7131feee0b6a40c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Thu, 8 Jul 2021 21:46:18 +0200 Subject: [PATCH 01/12] explicit facet option in a mark --- README.md | 25 ++++++++++++++++++++++++- src/facet.js | 25 +++++++++++++++---------- src/mark.js | 3 ++- 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e2825bc258..587b26c5e2 100644 --- a/README.md +++ b/README.md @@ -372,7 +372,7 @@ The following *facet* constant options are also supported: * facet.**marginLeft** - the left margin * facet.**grid** - if true, draw grid lines for each facet -Marks whose data is strictly equal to (`===`) the facet data will be filtered within each facet to show the current facet’s subset, whereas other marks will be repeated across facets. You can disable faceting for an individual mark by giving it a shallow copy of the data, say using [*array*.slice](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice). +Marks whose data is strictly equal to (`===`) the facet data will be filtered within each facet to show the current facet’s subset, whereas other marks will be repeated across facets. You can disable faceting for an individual mark by giving it a shallow copy of the data, say using [*array*.slice](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice). ```js Plot.plot({ @@ -388,6 +388,29 @@ Plot.plot({ }) ``` +Additionally, you can enable or disable faceting explicitly on a mark with the facet option, which accepts the following values: + +* *false* - disable faceting for this mark +* *true* - enable faceting for this mark +* *"exclude"* - enable exclusion faceting for this mark (each facet receives all the data except those of the facet’s subset) + +If faceting is enabled, the *data* must have the same cardinality as the faceted data (and should match its order). + +```js +Plot.plot({ + facet: { + x: Plot.values(penguins, "sex"), + y: Plot.values(penguins, "island") + }, + marks: { + Plot.frame(), // draws an outline around each facet + Plot.dot(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm", fill: "#eee", facet: "exclude"}), // draws excluded penguins on each facet + Plot.dot(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm", facet: true}) // draws only the current facet’s subset + } +}) +``` + + ## Marks [Marks](https://observablehq.com/@data-workflows/plot-marks) visualize data as geometric shapes such as bars, dots, and lines. An single mark can generate multiple shapes: for example, passing a [Plot.barY](#plotbarydata-options) to [Plot.plot](#plotplotoptions) will produce a bar for each element in the associated data. Multiple marks can be layered into [plots](#plotplotoptions). diff --git a/src/facet.js b/src/facet.js index 26d311de79..c8ec208181 100644 --- a/src/facet.js +++ b/src/facet.js @@ -1,6 +1,6 @@ -import {cross, groups, InternMap} from "d3"; +import {cross, difference, groups, InternMap} from "d3"; import {create} from "d3"; -import {Mark, values, first, second} from "./mark.js"; +import {Mark, range, values, first, second} from "./mark.js"; export function facets(data, {x, y, ...options}, marks) { return x === undefined && y === undefined @@ -38,24 +38,29 @@ class Facet extends Mark { } for (let i = 0; i < this.marks.length; ++i) { const mark = this.marks[i]; - const markFacets = mark.data === this.data ? facetsIndex : undefined; - const {index, channels} = mark.initialize(markFacets); + const markFacets = mark.facet === undefined ? mark.data === this.data ? facetsIndex : undefined + : mark.facet === "exclude" ? facetsIndex.map(facet => Uint32Array.from(difference(index, facet))) + : mark.facet === true ? facetsIndex + : undefined; + if (mark.facet && range(mark.data).length !== index.length) { + throw new Error("faceted mark data must match facet data length"); + } + const {index: I, channels} = mark.initialize(markFacets); // If an index is returned by mark.initialize, its structure depends on // whether or not faceting has been applied: it is a flat index ([0, 1, 2, // …]) when not faceted, and a nested index ([[0, 1, …], [2, 3, …], …]) - // when faceted. Faceting is only applied if the mark data is the same as - // the facet’s data. - if (index !== undefined) { + // when faceted. + if (I !== undefined) { if (markFacets) { for (let j = 0; j < facetsKeys.length; ++j) { - marksIndexByFacet.get(facetsKeys[j])[i] = index[j]; + marksIndexByFacet.get(facetsKeys[j])[i] = I[j]; } marksIndex[i] = []; // implicit empty index for sparse facets } else { for (let j = 0; j < facetsKeys.length; ++j) { - marksIndexByFacet.get(facetsKeys[j])[i] = index; + marksIndexByFacet.get(facetsKeys[j])[i] = I; } - marksIndex[i] = index; + marksIndex[i] = I; } } for (const [, channel] of channels) { diff --git a/src/mark.js b/src/mark.js index e6010a93dd..c94c75fd19 100644 --- a/src/mark.js +++ b/src/mark.js @@ -7,9 +7,10 @@ const TypedArray = Object.getPrototypeOf(Uint8Array); const objectToString = Object.prototype.toString; export class Mark { - constructor(data, channels = [], options = {}) { + constructor(data, channels = [], {facet, ...options} = {}) { const names = new Set(); this.data = data; + this.facet = facet; const {transform} = maybeTransform(options); this.transform = transform; this.channels = channels.filter(channel => { From 355d585d91df160466db6b7985b4276c3408176a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 9 Jul 2021 13:14:12 +0200 Subject: [PATCH 02/12] make the data.slice() technique secondary in README --- README.md | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 587b26c5e2..9da8bdc20b 100644 --- a/README.md +++ b/README.md @@ -372,44 +372,32 @@ The following *facet* constant options are also supported: * facet.**marginLeft** - the left margin * facet.**grid** - if true, draw grid lines for each facet -Marks whose data is strictly equal to (`===`) the facet data will be filtered within each facet to show the current facet’s subset, whereas other marks will be repeated across facets. You can disable faceting for an individual mark by giving it a shallow copy of the data, say using [*array*.slice](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice). +By default, marks whose data is strictly equal to (`===`) the facet data will be filtered within each facet to show the current facet’s subset, whereas other marks will be repeated across facets. -```js -Plot.plot({ - facet: { - data: penguins, - x: "sex" - }, - marks: { - Plot.frame(), // draws an outline around each facet - Plot.dot(penguins.slice(), {x: "culmen_length_mm", y: "culmen_depth_mm", fill: "#eee"}), // draws all penguins on each facet - Plot.dot(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm"}) // draws only the current facet’s subset - } -}) -``` - -Additionally, you can enable or disable faceting explicitly on a mark with the facet option, which accepts the following values: +Faceting can be explicitly enabled or disabled on a mark with the *facet* option, which accepts the following values: +* *null* (default) - facet this mark if its data is strictly equal to the facet data * *false* - disable faceting for this mark * *true* - enable faceting for this mark -* *"exclude"* - enable exclusion faceting for this mark (each facet receives all the data except those of the facet’s subset) +* *exclude* - enable exclusion faceting for this mark (each facet receives all the data except the facet’s subset) -If faceting is enabled, the *data* must have the same cardinality as the faceted data (and should match its order). +If faceting is enabled, the mark’s data must have the same cardinality as the facet data (and should match its order). ```js Plot.plot({ facet: { - x: Plot.values(penguins, "sex"), - y: Plot.values(penguins, "island") + data: penguins, + x: "sex" }, marks: { Plot.frame(), // draws an outline around each facet Plot.dot(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm", fill: "#eee", facet: "exclude"}), // draws excluded penguins on each facet - Plot.dot(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm", facet: true}) // draws only the current facet’s subset + Plot.dot(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm"}) // draws only the current facet’s subset } }) ``` +The strict equality check means that an individual mark that receives a shallow copy of the data, say using [*array*.slice](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) or [*array*.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) has faceting disabled by default. ## Marks From 9fd5aff5584876d3e80778b6367b8b4da2f780cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 9 Jul 2021 13:14:35 +0200 Subject: [PATCH 03/12] facet: null is the default --- src/facet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/facet.js b/src/facet.js index c8ec208181..cbc9cd32b8 100644 --- a/src/facet.js +++ b/src/facet.js @@ -38,7 +38,7 @@ class Facet extends Mark { } for (let i = 0; i < this.marks.length; ++i) { const mark = this.marks[i]; - const markFacets = mark.facet === undefined ? mark.data === this.data ? facetsIndex : undefined + const markFacets = mark.facet == null ? mark.data === this.data ? facetsIndex : undefined : mark.facet === "exclude" ? facetsIndex.map(facet => Uint32Array.from(difference(index, facet))) : mark.facet === true ? facetsIndex : undefined; From 9d753222a211c1d6650a1e31b5b1424ad1ea1b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 9 Jul 2021 19:31:57 +0200 Subject: [PATCH 04/12] Update src/facet.js Co-authored-by: Mike Bostock --- src/facet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/facet.js b/src/facet.js index cbc9cd32b8..c9470ba61a 100644 --- a/src/facet.js +++ b/src/facet.js @@ -42,7 +42,7 @@ class Facet extends Mark { : mark.facet === "exclude" ? facetsIndex.map(facet => Uint32Array.from(difference(index, facet))) : mark.facet === true ? facetsIndex : undefined; - if (mark.facet && range(mark.data).length !== index.length) { + if (markFacets && range(mark.data).length !== index.length) { throw new Error("faceted mark data must match facet data length"); } const {index: I, channels} = mark.initialize(markFacets); From 674e246f622550d6c3b18ad3f2751bf82dd4b6c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 9 Jul 2021 21:40:22 +0200 Subject: [PATCH 05/12] clarify options - "include" (shorthand: true) - "exclude" - null (or falsy) undefined is the default test on data === facet.data. --- README.md | 11 +- src/facet.js | 9 +- test/output/penguinCulmen.svg | 687 +---------------------------- test/plots/penguin-culmen-array.js | 3 +- test/plots/penguin-culmen.js | 3 +- 5 files changed, 15 insertions(+), 698 deletions(-) diff --git a/README.md b/README.md index 9da8bdc20b..6beae174a9 100644 --- a/README.md +++ b/README.md @@ -372,16 +372,15 @@ The following *facet* constant options are also supported: * facet.**marginLeft** - the left margin * facet.**grid** - if true, draw grid lines for each facet -By default, marks whose data is strictly equal to (`===`) the facet data will be filtered within each facet to show the current facet’s subset, whereas other marks will be repeated across facets. - Faceting can be explicitly enabled or disabled on a mark with the *facet* option, which accepts the following values: -* *null* (default) - facet this mark if its data is strictly equal to the facet data -* *false* - disable faceting for this mark -* *true* - enable faceting for this mark +* *null* - (or false) disable faceting for this mark +* *include* - enable faceting for this mark (shorthand: *true*) * *exclude* - enable exclusion faceting for this mark (each facet receives all the data except the facet’s subset) -If faceting is enabled, the mark’s data must have the same cardinality as the facet data (and should match its order). +By default, marks whose data is strictly equal to (`===`) the facet data will be filtered within each facet to show the current facet’s subset (*include*), whereas other marks will be repeated across facets (*null*). + +The data in faceted marks must have the same cardinality as the facet data (and should match its order). ```js Plot.plot({ diff --git a/src/facet.js b/src/facet.js index c9470ba61a..eec386ff35 100644 --- a/src/facet.js +++ b/src/facet.js @@ -1,6 +1,6 @@ import {cross, difference, groups, InternMap} from "d3"; import {create} from "d3"; -import {Mark, range, values, first, second} from "./mark.js"; +import {Mark, keyword, range, values, first, second} from "./mark.js"; export function facets(data, {x, y, ...options}, marks) { return x === undefined && y === undefined @@ -38,9 +38,10 @@ class Facet extends Mark { } for (let i = 0; i < this.marks.length; ++i) { const mark = this.marks[i]; - const markFacets = mark.facet == null ? mark.data === this.data ? facetsIndex : undefined - : mark.facet === "exclude" ? facetsIndex.map(facet => Uint32Array.from(difference(index, facet))) - : mark.facet === true ? facetsIndex + const facet = mark.facet && keyword(mark.facet, "facet", ["include", "exclude"]); + const markFacets = facet === undefined ? mark.data === this.data ? facetsIndex : undefined + : facet === "include" ? facetsIndex + : facet === "exclude" ? facetsIndex.map(f => Uint32Array.from(difference(index, f))) : undefined; if (markFacets && range(mark.data).length !== index.length) { throw new Error("faceted mark data must match facet data length"); diff --git a/test/output/penguinCulmen.svg b/test/output/penguinCulmen.svg index 2a48514961..d98f6a61e4 100644 --- a/test/output/penguinCulmen.svg +++ b/test/output/penguinCulmen.svg @@ -134,155 +134,82 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -706,74 +633,40 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1157,128 +1050,70 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1345,157 +1180,84 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1919,72 +1681,38 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2370,128 +2098,67 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2567,10 +2234,6 @@ - - - - @@ -2606,7 +2269,6 @@ - @@ -2913,350 +2575,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -3507,7 +2826,6 @@ - @@ -3547,7 +2865,6 @@ - @@ -3585,7 +2902,6 @@ - @@ -3597,7 +2913,6 @@ - diff --git a/test/plots/penguin-culmen-array.js b/test/plots/penguin-culmen-array.js index 06b405b375..ffdfaa59be 100644 --- a/test/plots/penguin-culmen-array.js +++ b/test/plots/penguin-culmen-array.js @@ -15,7 +15,8 @@ export default async function() { marginRight: 80 }, marks: [ - Plot.dot(data.slice(), { + Plot.dot(data, { + facet: null, x: culmen_depth_mm, y: culmen_length_mm, r: 2, diff --git a/test/plots/penguin-culmen.js b/test/plots/penguin-culmen.js index 0c6de62a67..0feec1d297 100644 --- a/test/plots/penguin-culmen.js +++ b/test/plots/penguin-culmen.js @@ -14,7 +14,8 @@ export default async function() { }, marks: [ Plot.frame(), - Plot.dot(data.slice(), { + Plot.dot(data, { + facet: "exclude", x: "culmen_depth_mm", y: "culmen_length_mm", r: 2, From 576f3380b96df8ae9425a36d64919a072c152996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 9 Jul 2021 21:57:36 +0200 Subject: [PATCH 06/12] parse the keyword in the mark constructor adds an "auto" symbol as default value computes the facet exclusion index only once. --- src/facet.js | 9 +++++---- src/mark.js | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/facet.js b/src/facet.js index eec386ff35..38dd3cb504 100644 --- a/src/facet.js +++ b/src/facet.js @@ -1,6 +1,6 @@ import {cross, difference, groups, InternMap} from "d3"; import {create} from "d3"; -import {Mark, keyword, range, values, first, second} from "./mark.js"; +import {Mark, range, values, first, second} from "./mark.js"; export function facets(data, {x, y, ...options}, marks) { return x === undefined && y === undefined @@ -36,12 +36,13 @@ class Facet extends Mark { for (const facetKey of facetsKeys) { marksIndexByFacet.set(facetKey, new Array(this.marks.length)); } + let facetsExclude; for (let i = 0; i < this.marks.length; ++i) { const mark = this.marks[i]; - const facet = mark.facet && keyword(mark.facet, "facet", ["include", "exclude"]); - const markFacets = facet === undefined ? mark.data === this.data ? facetsIndex : undefined + const {facet} = mark; + const markFacets = facet === "auto" ? mark.data === this.data ? facetsIndex : undefined : facet === "include" ? facetsIndex - : facet === "exclude" ? facetsIndex.map(f => Uint32Array.from(difference(index, f))) + : facet === "exclude" ? facetsExclude || (facetsExclude = facetsIndex.map(f => Uint32Array.from(difference(index, f)))) : undefined; if (markFacets && range(mark.data).length !== index.length) { throw new Error("faceted mark data must match facet data length"); diff --git a/src/mark.js b/src/mark.js index c94c75fd19..aae84d617f 100644 --- a/src/mark.js +++ b/src/mark.js @@ -7,10 +7,11 @@ const TypedArray = Object.getPrototypeOf(Uint8Array); const objectToString = Object.prototype.toString; export class Mark { - constructor(data, channels = [], {facet, ...options} = {}) { + constructor(data, channels = [], {facet = "auto", ...options} = {}) { const names = new Set(); this.data = data; - this.facet = facet; + this.facet = facet && keyword(facet, "facet", ["auto", "include", "exclude"]); + const {transform} = maybeTransform(options); this.transform = transform; this.channels = channels.filter(channel => { From 166af6dc56ba6eb6f9d0b7923397953f31706083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 9 Jul 2021 22:01:58 +0200 Subject: [PATCH 07/12] coerce falsy to false, and true to "include" --- src/mark.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mark.js b/src/mark.js index aae84d617f..870f7a175b 100644 --- a/src/mark.js +++ b/src/mark.js @@ -10,7 +10,7 @@ export class Mark { constructor(data, channels = [], {facet = "auto", ...options} = {}) { const names = new Set(); this.data = data; - this.facet = facet && keyword(facet, "facet", ["auto", "include", "exclude"]); + this.facet = !!facet && keyword(facet === true ? "include" : facet, "facet", ["auto", "include", "exclude"]); const {transform} = maybeTransform(options); this.transform = transform; From a192d35aa6eb66427331dd60fc4f2f27374c33a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 9 Jul 2021 22:03:45 +0200 Subject: [PATCH 08/12] coerce falsy to null --- src/mark.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mark.js b/src/mark.js index 870f7a175b..7877556e0d 100644 --- a/src/mark.js +++ b/src/mark.js @@ -10,7 +10,7 @@ export class Mark { constructor(data, channels = [], {facet = "auto", ...options} = {}) { const names = new Set(); this.data = data; - this.facet = !!facet && keyword(facet === true ? "include" : facet, "facet", ["auto", "include", "exclude"]); + this.facet = facet ? keyword(facet === true ? "include" : facet, "facet", ["auto", "include", "exclude"]) : null; const {transform} = maybeTransform(options); this.transform = transform; From 9b0b13bfb940c08f37f9b8f11771b40ed44a2118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 9 Jul 2021 22:12:01 +0200 Subject: [PATCH 09/12] remove length test Co-authored-by: Mike Bostock --- src/facet.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/facet.js b/src/facet.js index 38dd3cb504..e7fdecede6 100644 --- a/src/facet.js +++ b/src/facet.js @@ -44,9 +44,6 @@ class Facet extends Mark { : facet === "include" ? facetsIndex : facet === "exclude" ? facetsExclude || (facetsExclude = facetsIndex.map(f => Uint32Array.from(difference(index, f)))) : undefined; - if (markFacets && range(mark.data).length !== index.length) { - throw new Error("faceted mark data must match facet data length"); - } const {index: I, channels} = mark.initialize(markFacets); // If an index is returned by mark.initialize, its structure depends on // whether or not faceting has been applied: it is a flat index ([0, 1, 2, From 84ec12430b6a77978e512ce7a386b576b93201b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 9 Jul 2021 22:16:23 +0200 Subject: [PATCH 10/12] clarify documentation --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6beae174a9..c8aa83755a 100644 --- a/README.md +++ b/README.md @@ -374,13 +374,10 @@ The following *facet* constant options are also supported: Faceting can be explicitly enabled or disabled on a mark with the *facet* option, which accepts the following values: -* *null* - (or false) disable faceting for this mark +* *auto* (default) - marks whose data is strictly equal to (`===`) the facet data will be filtered within each facet to show the current facet’s subset (see *include*), whereas other marks will be repeated across facets. * *include* - enable faceting for this mark (shorthand: *true*) * *exclude* - enable exclusion faceting for this mark (each facet receives all the data except the facet’s subset) - -By default, marks whose data is strictly equal to (`===`) the facet data will be filtered within each facet to show the current facet’s subset (*include*), whereas other marks will be repeated across facets (*null*). - -The data in faceted marks must have the same cardinality as the facet data (and should match its order). +* null - (or false) disable faceting for this mark ```js Plot.plot({ From f14dabcea12bb8568b1bdc3742f3ff258b469ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 9 Jul 2021 22:19:40 +0200 Subject: [PATCH 11/12] unused range --- src/facet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/facet.js b/src/facet.js index e7fdecede6..43a0cac9c0 100644 --- a/src/facet.js +++ b/src/facet.js @@ -1,6 +1,6 @@ import {cross, difference, groups, InternMap} from "d3"; import {create} from "d3"; -import {Mark, range, values, first, second} from "./mark.js"; +import {Mark, values, first, second} from "./mark.js"; export function facets(data, {x, y, ...options}, marks) { return x === undefined && y === undefined From ecc7abbe50aace856db6b1d71c1c948914c58687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 9 Jul 2021 22:22:30 +0200 Subject: [PATCH 12/12] remove newline --- src/mark.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mark.js b/src/mark.js index 7877556e0d..df56f88d7a 100644 --- a/src/mark.js +++ b/src/mark.js @@ -11,7 +11,6 @@ export class Mark { const names = new Set(); this.data = data; this.facet = facet ? keyword(facet === true ? "include" : facet, "facet", ["auto", "include", "exclude"]) : null; - const {transform} = maybeTransform(options); this.transform = transform; this.channels = channels.filter(channel => {