From 2f67c81214ba6424601840048b26d241e5214d9f Mon Sep 17 00:00:00 2001 From: Michael Puehringer Date: Thu, 15 Feb 2024 10:58:55 +0100 Subject: [PATCH] Add enabled flag to select style --- src/gosling-schema/gosling.schema.ts | 4 +++- src/tracks/gosling-track/gosling-track.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gosling-schema/gosling.schema.ts b/src/gosling-schema/gosling.schema.ts index 6998b5c7..0f331b62 100644 --- a/src/gosling-schema/gosling.schema.ts +++ b/src/gosling-schema/gosling.schema.ts @@ -648,7 +648,9 @@ export interface Style { /** * Customize visual effects of `rangeSelect` events on marks . */ - select?: EventStyle; + select?: EventStyle & { + enabled?: boolean; + }; /** * Customize the style of the brush mark in the `rangeSelect` mouse event. diff --git a/src/tracks/gosling-track/gosling-track.ts b/src/tracks/gosling-track/gosling-track.ts index afa18497..13759b78 100644 --- a/src/tracks/gosling-track/gosling-track.ts +++ b/src/tracks/gosling-track/gosling-track.ts @@ -1222,7 +1222,7 @@ const factory: PluginTrackFactory = (HGC, context, op }); } - if (capturedElements.length !== 0) { + if (capturedElements.length !== 0 && this.options.spec.style?.select?.enabled !== false) { // selection effect graphics const g = this.pMouseSelection;