Skip to content

Commit eef07d7

Browse files
committed
remove console.log, allow explicit sorting of scale domain
1 parent 22804c0 commit eef07d7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib/helpers/scales.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ export function createScale<T extends ScaleOptions>(
184184
// we're deliberately checking for !== undefined and not for != null
185185
// since the explicit sort transforms like shuffle will set the
186186
// sort channel to null to we know that there's an explicit order
187-
if (name === 'y') console.log(mark.type, mark.options[IS_SORTED]);
188-
if (mark.options[IS_SORTED] != null) {
187+
if ((name === 'x' || name === 'y') && mark.options[IS_SORTED] != undefined) {
189188
sortOrdinalDomain = false;
190189
}
190+
191191
for (const channel of mark.channels) {
192192
// channelOptions can be passed as prop, but most often users will just
193193
// pass the channel accessor or constant value, so we may need to wrap
@@ -282,6 +282,10 @@ export function createScale<T extends ScaleOptions>(
282282
}
283283
}
284284

285+
if ((name === 'x' || name === 'y') && scaleOptions.sort) {
286+
sortOrdinalDomain = true;
287+
}
288+
285289
// construct domain from data values
286290
const valueArr = [...dataValues.values(), ...(scaleOptions.domain || [])].filter(
287291
(d) => d != null

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy