From e11af455edfd11d992838a51cf842a20a6cd0069 Mon Sep 17 00:00:00 2001 From: "Weng, Chia-Ling" <75072960+ChiaLingWeng@users.noreply.github.com> Date: Tue, 30 Jan 2024 10:16:17 +0800 Subject: [PATCH] fix: use child signal for radius if faceted (#9232) close #8754 I found that the range for radius using width and height without checking if the model is faceted https://github.com/vega/vega-lite/blob/c33f46bad7f80f779e463a8a36481f888f18e222/src/compile/scale/range.ts#L311-L314 --------- Co-authored-by: GitHub Actions Bot Co-authored-by: Dominik Moritz --- src/compile/scale/range.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compile/scale/range.ts b/src/compile/scale/range.ts index e114d5625e..87058fea01 100644 --- a/src/compile/scale/range.ts +++ b/src/compile/scale/range.ts @@ -63,6 +63,7 @@ import {Explicit, makeExplicit, makeImplicit} from '../split'; import {UnitModel} from '../unit'; import {ScaleComponentIndex} from './component'; import {durationExpr} from '../../timeunit'; +import {isFacetModel} from '../model'; export const RANGE_PROPERTIES: (keyof Scale)[] = ['range', 'scheme']; @@ -306,11 +307,12 @@ function defaultRange(channel: ScaleChannel, model: UnitModel): VgRange { case RADIUS: { // max radius = half od min(width,height) + return [ 0, new SignalRefWrapper(() => { - const w = model.getSignalName('width'); - const h = model.getSignalName('height'); + const w = model.getSignalName(isFacetModel(model.parent) ? 'child_width' : 'width'); + const h = model.getSignalName(isFacetModel(model.parent) ? 'child_height' : 'height'); return `min(${w},${h})/2`; }) ];