From eedb53b4c2dd70a434e4bad7744eea9c5592d2e9 Mon Sep 17 00:00:00 2001 From: etowahadams Date: Wed, 12 Jun 2024 14:27:33 -0400 Subject: [PATCH] refactor(core): make header mark use underscore (#1075) * feat: update schema with _header * fix: update uses of header mark * refactor: update comment --- src/compiler/bounding-box.ts | 2 +- src/compiler/gosling-to-higlass.ts | 2 +- src/gosling-schema/gosling.schema.json | 2 +- src/gosling-schema/gosling.schema.ts | 5 ++--- src/gosling-schema/template.schema.json | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/compiler/bounding-box.ts b/src/compiler/bounding-box.ts index 8ae3ca3d..2974af36 100644 --- a/src/compiler/bounding-box.ts +++ b/src/compiler/bounding-box.ts @@ -385,7 +385,7 @@ export function getNumOfYAxes(tracks: Track[]): number { const getTextTrack = (size: Size, title?: string, subtitle?: string) => { return JSON.parse( JSON.stringify({ - mark: 'header', + mark: '_header', width: size.width, height: size.height, title, diff --git a/src/compiler/gosling-to-higlass.ts b/src/compiler/gosling-to-higlass.ts index 6d5296f4..77577b34 100644 --- a/src/compiler/gosling-to-higlass.ts +++ b/src/compiler/gosling-to-higlass.ts @@ -282,7 +282,7 @@ export function goslingToHiGlass( }); hgModel.validateSpec(true); - } else if (firstResolvedSpec.mark === 'header') { + } else if (firstResolvedSpec.mark === '_header') { // `text` tracks are used to show title and subtitle of the views hgModel.addDefaultView(`${trackId}-title`).setLayout(layout); if (typeof firstResolvedSpec.title === 'string') { diff --git a/src/gosling-schema/gosling.schema.json b/src/gosling-schema/gosling.schema.json index 4a1c1eba..29b99b8e 100644 --- a/src/gosling-schema/gosling.schema.json +++ b/src/gosling-schema/gosling.schema.json @@ -3758,7 +3758,7 @@ "triangleRight", "triangleBottom", "brush", - "header" + "_header" ], "type": "string" }, diff --git a/src/gosling-schema/gosling.schema.ts b/src/gosling-schema/gosling.schema.ts index 27d5e531..9ac64b3e 100644 --- a/src/gosling-schema/gosling.schema.ts +++ b/src/gosling-schema/gosling.schema.ts @@ -272,9 +272,8 @@ export type Mark = | 'triangleRight' | 'triangleBottom' | 'brush' - // TODO: perhaps need to make this invisible to users - // being used to show title/subtitle internally - | 'header'; + // The _header mark is used internally for text tracks + | '_header'; /* ----------------------------- API & MOUSE EVENTS ----------------------------- */ interface CommonEventData { diff --git a/src/gosling-schema/template.schema.json b/src/gosling-schema/template.schema.json index c136c22a..b03abce5 100644 --- a/src/gosling-schema/template.schema.json +++ b/src/gosling-schema/template.schema.json @@ -924,7 +924,7 @@ "triangleRight", "triangleBottom", "brush", - "header" + "_header" ], "type": "string" },