From 7be362c2ee2cadf8824a02ab0dab1046a639a84e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Tue, 31 May 2022 09:05:29 +0200 Subject: [PATCH] maintain faceting after optional sort (follows #891) --- src/channel.js | 2 +- test/output/hexbinText.svg | 136 ++++++++++++++--------------- test/output/penguinDodgeHexbin.svg | 8 +- 3 files changed, 73 insertions(+), 73 deletions(-) diff --git a/src/channel.js b/src/channel.js index d2a63219ad..2614fab9b6 100644 --- a/src/channel.js +++ b/src/channel.js @@ -76,7 +76,7 @@ export function channelDomain(channels, facetChannels, data, options) { function sortInitializer(name, optional, compare = ascendingDefined) { return (data, facets, {[name]: V}) => { if (!V) { - if (optional) return {}; // do nothing if given channel does not exist + if (optional) return {facets}; // do nothing if given channel does not exist throw new Error(`missing channel: ${name}`); } V = V.value; diff --git a/test/output/hexbinText.svg b/test/output/hexbinText.svg index eee645ce84..b251c8c6f7 100644 --- a/test/output/hexbinText.svg +++ b/test/output/hexbinText.svg @@ -86,64 +86,58 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + 7447546101148212213115315122311311111115712313414662111 @@ -152,75 +146,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5141131318111414541111112111225522111138131466654241110113111211 - - - - - - + + + + + + + + 11211111 diff --git a/test/output/penguinDodgeHexbin.svg b/test/output/penguinDodgeHexbin.svg index 863a0fb098..2a4b7b57fd 100644 --- a/test/output/penguinDodgeHexbin.svg +++ b/test/output/penguinDodgeHexbin.svg @@ -360,8 +360,6 @@ - - @@ -437,6 +435,8 @@ + + @@ -503,8 +503,6 @@ - - @@ -635,6 +633,8 @@ + +