Skip to content

Commit

Permalink
refactor(core): make header mark use underscore (#1075)
Browse files Browse the repository at this point in the history
* feat: update schema with _header

* fix: update uses of header mark

* refactor: update comment
  • Loading branch information
etowahadams authored Jun 12, 2024
1 parent 17fd085 commit eedb53b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/compiler/bounding-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/gosling-to-higlass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
2 changes: 1 addition & 1 deletion src/gosling-schema/gosling.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3758,7 +3758,7 @@
"triangleRight",
"triangleBottom",
"brush",
"header"
"_header"
],
"type": "string"
},
Expand Down
5 changes: 2 additions & 3 deletions src/gosling-schema/gosling.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/gosling-schema/template.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@
"triangleRight",
"triangleBottom",
"brush",
"header"
"_header"
],
"type": "string"
},
Expand Down

0 comments on commit eedb53b

Please sign in to comment.