From 5b3d76befdab85973ad4edb24989d3be7f53ecfd Mon Sep 17 00:00:00 2001 From: "Weng, Chia-Ling" <75072960+ChiaLingWeng@users.noreply.github.com> Date: Tue, 30 Jan 2024 06:07:34 +0000 Subject: [PATCH 1/3] fix: interactive false for faceted selection --- src/compile/mark/mark.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/compile/mark/mark.ts b/src/compile/mark/mark.ts index 009d974753..3df16c7cd7 100644 --- a/src/compile/mark/mark.ts +++ b/src/compile/mark/mark.ts @@ -335,8 +335,8 @@ function getMarkGroup(model: UnitModel, opt: {fromPrefix: string} = {fromPrefix: }, ...(postEncodingTransform ? { - transform: postEncodingTransform - } + transform: postEncodingTransform + } : {}) } ]; @@ -366,7 +366,7 @@ function projectionClip(model: UnitModel) { * Only output interactive flags if we have selections defined somewhere in our model hierarchy. */ function interactiveFlag(model: UnitModel) { - if (!model.component.selection) return null; + if (!model.component.selection || keys(model.component.selection).length === 0) return null; const unitCount = keys(model.component.selection).length; let parentCount = unitCount; let parent = model.parent; @@ -374,9 +374,14 @@ function interactiveFlag(model: UnitModel) { parentCount = keys(parent.component.selection).length; parent = parent.parent; } + console.log(parentCount + ? { + interactive: unitCount > 0 || model.mark === 'geoshape' || !!model.encoding.tooltip + } + : null) return parentCount ? { - interactive: unitCount > 0 || model.mark === 'geoshape' || !!model.encoding.tooltip - } + interactive: unitCount > 0 || model.mark === 'geoshape' || !!model.encoding.tooltip + } : null; } From 95f49f5971cc4ca21d56c4c2023a6e133f9308a2 Mon Sep 17 00:00:00 2001 From: "Weng, Chia-Ling" <75072960+ChiaLingWeng@users.noreply.github.com> Date: Tue, 30 Jan 2024 06:56:46 +0000 Subject: [PATCH 2/3] add markDef.tooltip for interactive check --- src/compile/mark/mark.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/compile/mark/mark.ts b/src/compile/mark/mark.ts index 3df16c7cd7..cacce90c61 100644 --- a/src/compile/mark/mark.ts +++ b/src/compile/mark/mark.ts @@ -366,7 +366,7 @@ function projectionClip(model: UnitModel) { * Only output interactive flags if we have selections defined somewhere in our model hierarchy. */ function interactiveFlag(model: UnitModel) { - if (!model.component.selection || keys(model.component.selection).length === 0) return null; + if (!model.component.selection) return null; const unitCount = keys(model.component.selection).length; let parentCount = unitCount; let parent = model.parent; @@ -374,14 +374,9 @@ function interactiveFlag(model: UnitModel) { parentCount = keys(parent.component.selection).length; parent = parent.parent; } - console.log(parentCount - ? { - interactive: unitCount > 0 || model.mark === 'geoshape' || !!model.encoding.tooltip - } - : null) return parentCount ? { - interactive: unitCount > 0 || model.mark === 'geoshape' || !!model.encoding.tooltip + interactive: unitCount > 0 || model.mark === 'geoshape' || !!model.encoding.tooltip || !!model.markDef.tooltip } : null; } From b5eefac660c1bbeaa5a433edbb342b61bded3fb7 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Tue, 30 Jan 2024 07:00:49 +0000 Subject: [PATCH 3/3] style: auto-formatting [CI] --- src/compile/mark/mark.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compile/mark/mark.ts b/src/compile/mark/mark.ts index cacce90c61..cf821cb509 100644 --- a/src/compile/mark/mark.ts +++ b/src/compile/mark/mark.ts @@ -335,8 +335,8 @@ function getMarkGroup(model: UnitModel, opt: {fromPrefix: string} = {fromPrefix: }, ...(postEncodingTransform ? { - transform: postEncodingTransform - } + transform: postEncodingTransform + } : {}) } ]; @@ -376,7 +376,7 @@ function interactiveFlag(model: UnitModel) { } return parentCount ? { - interactive: unitCount > 0 || model.mark === 'geoshape' || !!model.encoding.tooltip || !!model.markDef.tooltip - } + interactive: unitCount > 0 || model.mark === 'geoshape' || !!model.encoding.tooltip || !!model.markDef.tooltip + } : null; }