From 87cd7ef20989bd6a99217157d8d634ba0bf8a772 Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Thu, 12 Aug 2021 15:58:29 -0400 Subject: [PATCH 01/34] feat: add yDomain --- schema/gosling.schema.json | 305 +++++++++++-- schema/template.schema.json | 22 +- src/core/gosling.schema.ts | 7 +- src/core/utils/bounding-box.test.ts | 2 +- src/core/utils/spec-preprocess.ts | 21 +- src/editor/example/cancer-variant.ts | 2 +- src/editor/example/corces.ts | 2 +- src/editor/example/debug.ts | 631 +++++++++++++-------------- src/editor/example/gremlin.ts | 2 +- src/editor/example/index.ts | 9 +- src/editor/example/matrix-hffc6.ts | 2 +- src/editor/example/matrix.ts | 2 +- src/editor/example/sars-cov-2.ts | 2 +- src/editor/example/theme.ts | 2 +- src/editor/example/vertical-band.ts | 128 ++++++ src/editor/example/visual-linking.ts | 2 +- 16 files changed, 768 insertions(+), 373 deletions(-) diff --git a/schema/gosling.schema.json b/schema/gosling.schema.json index d5121bac2..16b1b867f 100644 --- a/schema/gosling.schema.json +++ b/schema/gosling.schema.json @@ -514,9 +514,6 @@ "layout": { "$ref": "#/definitions/Layout" }, - "linkingId": { - "type": "string" - }, "orientation": { "$ref": "#/definitions/Orientation" }, @@ -572,9 +569,28 @@ } ] }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, "yOffset": { "type": "number" } @@ -911,9 +927,6 @@ "layout": { "$ref": "#/definitions/Layout" }, - "linkingId": { - "type": "string" - }, "orientation": { "$ref": "#/definitions/Orientation" }, @@ -948,9 +961,28 @@ } ] }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, "yOffset": { "type": "number" } @@ -1602,9 +1634,6 @@ "layout": { "$ref": "#/definitions/Layout" }, - "linkingId": { - "type": "string" - }, "orientation": { "$ref": "#/definitions/Orientation" }, @@ -1646,9 +1675,28 @@ } ] }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, "yOffset": { "type": "number" } @@ -1799,9 +1847,6 @@ "layout": { "$ref": "#/definitions/Layout" }, - "linkingId": { - "type": "string" - }, "mark": { "$ref": "#/definitions/Mark" }, @@ -1861,9 +1906,6 @@ "innerRadius": { "type": "number" }, - "linkingId": { - "type": "string" - }, "mark": { "$ref": "#/definitions/Mark" }, @@ -1958,6 +2000,9 @@ } ] }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, @@ -1973,6 +2018,22 @@ "y1e": { "$ref": "#/definitions/Channel" }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, "yOffset": { "type": "number" }, @@ -2075,6 +2136,9 @@ } ] }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, @@ -2090,6 +2154,22 @@ "y1e": { "$ref": "#/definitions/Channel" }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, "yOffset": { "type": "number" }, @@ -2160,9 +2240,6 @@ "layout": { "$ref": "#/definitions/Layout" }, - "linkingId": { - "type": "string" - }, "mark": { "$ref": "#/definitions/Mark" }, @@ -2531,6 +2608,9 @@ } ] }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, @@ -2546,6 +2626,22 @@ "y1e": { "$ref": "#/definitions/Channel" }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, "yOffset": { "type": "number" }, @@ -2651,6 +2747,9 @@ } ] }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, @@ -2666,6 +2765,22 @@ "y1e": { "$ref": "#/definitions/Channel" }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, "yOffset": { "type": "number" }, @@ -2746,9 +2861,6 @@ "layout": { "$ref": "#/definitions/Layout" }, - "linkingId": { - "type": "string" - }, "orientation": { "$ref": "#/definitions/Orientation" }, @@ -2796,9 +2908,28 @@ } ] }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, "yOffset": { "type": "number" } @@ -2869,9 +3000,6 @@ "layout": { "$ref": "#/definitions/Layout" }, - "linkingId": { - "type": "string" - }, "mark": { "$ref": "#/definitions/Mark" }, @@ -2981,6 +3109,9 @@ } ] }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, @@ -2996,6 +3127,22 @@ "y1e": { "$ref": "#/definitions/Channel" }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, "yOffset": { "type": "number" }, @@ -3070,9 +3217,6 @@ "layout": { "$ref": "#/definitions/Layout" }, - "linkingId": { - "type": "string" - }, "mark": { "$ref": "#/definitions/Mark" }, @@ -3189,6 +3333,9 @@ } ] }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, @@ -3204,6 +3351,22 @@ "y1e": { "$ref": "#/definitions/Channel" }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, "yOffset": { "type": "number" }, @@ -3232,9 +3395,6 @@ "layout": { "$ref": "#/definitions/Layout" }, - "linkingId": { - "type": "string" - }, "orientation": { "$ref": "#/definitions/Orientation" }, @@ -3275,9 +3435,28 @@ } ] }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, "yOffset": { "type": "number" } @@ -3341,9 +3520,6 @@ "layout": { "$ref": "#/definitions/Layout" }, - "linkingId": { - "type": "string" - }, "mark": { "$ref": "#/definitions/Mark" }, @@ -3447,6 +3623,9 @@ } ] }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, @@ -3462,6 +3641,22 @@ "y1e": { "$ref": "#/definitions/Channel" }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, "yOffset": { "type": "number" }, @@ -3592,9 +3787,6 @@ "layout": { "$ref": "#/definitions/Layout" }, - "linkingId": { - "type": "string" - }, "mark": { "$ref": "#/definitions/Mark" }, @@ -3711,6 +3903,9 @@ } ] }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, @@ -3726,6 +3921,22 @@ "y1e": { "$ref": "#/definitions/Channel" }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, "yOffset": { "type": "number" }, @@ -3968,9 +4179,6 @@ "layout": { "$ref": "#/definitions/Layout" }, - "linkingId": { - "type": "string" - }, "orientation": { "$ref": "#/definitions/Orientation" }, @@ -4029,9 +4237,28 @@ } ] }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, "yOffset": { "type": "number" } diff --git a/schema/template.schema.json b/schema/template.schema.json index 20d8c2cf0..90307d9ea 100644 --- a/schema/template.schema.json +++ b/schema/template.schema.json @@ -1290,9 +1290,6 @@ "innerRadius": { "type": "number" }, - "linkingId": { - "type": "string" - }, "mark": { "$ref": "#/definitions/Mark" }, @@ -1387,6 +1384,9 @@ } ] }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, @@ -1402,6 +1402,22 @@ "y1e": { "$ref": "#/definitions/ChannelWithBase" }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, "yOffset": { "type": "number" }, diff --git a/src/core/gosling.schema.ts b/src/core/gosling.schema.ts index 19f988773..249cb1430 100644 --- a/src/core/gosling.schema.ts +++ b/src/core/gosling.schema.ts @@ -60,9 +60,12 @@ export interface CommonViewDef { assembly?: Assembly; - // TODO: Change to domain? xDomain?: DomainInterval | DomainChrInterval | DomainChr; - linkingId?: string; + yDomain?: DomainInterval | DomainChrInterval | DomainChr; + + xLinkingId?: string; + yLinkingId?: string; + xAxis?: AxisPosition; // not supported currently /** diff --git a/src/core/utils/bounding-box.test.ts b/src/core/utils/bounding-box.test.ts index 3691b9085..89e4b15f7 100644 --- a/src/core/utils/bounding-box.test.ts +++ b/src/core/utils/bounding-box.test.ts @@ -277,7 +277,7 @@ describe('Arrangement', () => { tracks: [t] }, { - linkingId: '_', + xLinkingId: '_', tracks: [t] } ] diff --git a/src/core/utils/spec-preprocess.ts b/src/core/utils/spec-preprocess.ts index 544cc406d..333cc4838 100644 --- a/src/core/utils/spec-preprocess.ts +++ b/src/core/utils/spec-preprocess.ts @@ -137,7 +137,8 @@ export function traverseToFixSpecDownstream(spec: GoslingSpec | SingleView, pare if (spec.orientation === undefined) spec.orientation = parentDef.orientation; if (spec.static === undefined) spec.static = parentDef.static !== undefined ? parentDef.static : false; if (spec.xDomain === undefined) spec.xDomain = parentDef.xDomain; - if (spec.linkingId === undefined) spec.linkingId = parentDef.linkingId; + if (spec.yDomain === undefined) spec.yDomain = parentDef.yDomain; + if (spec.xLinkingId === undefined) spec.xLinkingId = parentDef.xLinkingId; if (spec.centerRadius === undefined) spec.centerRadius = parentDef.centerRadius; if (spec.spacing === undefined && !('tracks' in spec)) spec.spacing = parentDef.spacing; if (spec.xOffset === undefined) spec.xOffset = parentDef.xOffset; @@ -157,6 +158,7 @@ export function traverseToFixSpecDownstream(spec: GoslingSpec | SingleView, pare if (spec.xOffset === undefined) spec.xOffset = 0; if (spec.yOffset === undefined) spec.yOffset = 0; // Nothing to do when `xDomain` not suggested + // Nothing to do when `yDomain` not suggested // Nothing to do when `xLinkID` not suggested } @@ -260,11 +262,24 @@ export function traverseToFixSpecDownstream(spec: GoslingSpec | SingleView, pare }); } + /** + * Add y-axis domain + */ + if ((IsSingleTrack(track) || IsOverlaidTrack(track)) && IsChannelDeep(track.y) && !track.y.domain) { + track.y.domain = spec.yDomain; + } else if (IsOverlaidTrack(track)) { + track.overlay.forEach(o => { + if (IsChannelDeep(o.y) && !o.y.domain) { + o.y.domain = spec.yDomain; + } + }); + } + /** * Link tracks in a single view */ if ((IsSingleTrack(track) || IsOverlaidTrack(track)) && IsChannelDeep(track.x) && !track.x.linkingId) { - track.x.linkingId = spec.linkingId ?? linkID; + track.x.linkingId = spec.xLinkingId ?? linkID; } else if (IsOverlaidTrack(track)) { let isAdded = false; track.overlay.forEach(o => { @@ -272,7 +287,7 @@ export function traverseToFixSpecDownstream(spec: GoslingSpec | SingleView, pare if (IsChannelDeep(o.x) && !o.x.linkingId) { // TODO: Is this safe? - o.x.linkingId = spec.linkingId ?? linkID; + o.x.linkingId = spec.xLinkingId ?? linkID; isAdded = true; } }); diff --git a/src/editor/example/cancer-variant.ts b/src/editor/example/cancer-variant.ts index 3a96635c9..6a8c5383c 100644 --- a/src/editor/example/cancer-variant.ts +++ b/src/editor/example/cancer-variant.ts @@ -200,7 +200,7 @@ export const EX_SPEC_CANCER_VARIANT_PROTOTYPE: GoslingSpec = { ] }, { - linkingId: 'mid-scale', + xLinkingId: 'mid-scale', xDomain: { chromosome: '1' }, layout: 'linear', tracks: [ diff --git a/src/editor/example/corces.ts b/src/editor/example/corces.ts index 8d110cafb..ff81b1c0d 100644 --- a/src/editor/example/corces.ts +++ b/src/editor/example/corces.ts @@ -78,7 +78,7 @@ export const EX_SPEC_CORCES_ET_AL: GoslingSpec = { }, { xDomain: { chromosome: '3', interval: [52168000, 52890000] }, - linkingId: 'detail', + xLinkingId: 'detail', mark: 'bar', x: { field: 'position', diff --git a/src/editor/example/debug.ts b/src/editor/example/debug.ts index 9d4d8e64e..e622037bb 100644 --- a/src/editor/example/debug.ts +++ b/src/editor/example/debug.ts @@ -1,323 +1,322 @@ import { GoslingSpec } from '../../core/gosling.schema'; -export const EX_SPEC_DEBUG: GoslingSpec = - // { - // title: 'Between-Connectivity In 2D Tracks', - // subtitle: 'Between-link examples with three types, i.e., straight, corner, and curve', - // // "xDomain": {"interval": [0, 1000000000]}, - // style: { outlineWidth: 0.5 }, - // spacing: 10, - // linkingId: '-', - // arrangement: 'horizontal', - // views: [ - // { - // orientation: 'vertical', - // tracks: [ - // { - // data: { - // url: 'https://server.gosling-lang.org/api/v1/tileset_info/?d=cistrome-multivec', - // type: 'multivec', - // row: 'sample', - // column: 'position', - // value: 'peak', - // categories: ['sample 1', 'sample 2', 'sample 3', 'sample 4'], - // binSize: 4 - // }, - // mark: 'rect', - // x: { field: 'start', type: 'genomic', axis: 'left' }, - // xe: { field: 'end', type: 'genomic' }, - // row: { field: 'sample', type: 'nominal', legend: false }, - // color: { - // field: 'peak', - // type: 'quantitative', - // legend: false, - // range: 'grey' - // }, - // width: 300, - // height: 300 - // } - // ] - // }, - // { - // xOffset: 30, - // tracks: [ - // { - // data: { - // url: - // 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', - // type: 'csv', - // chromosomeField: 'c2', - // genomicFields: ['s1', 'e1', 's2', 'e2'] - // }, - // style: { linkConnectionType: 'corner' }, - // mark: 'withinLink', - // x: { field: 's1', type: 'genomic', axis: 'bottom' }, - // xe: { field: 's2', type: 'genomic' }, - // flipY: false, - // color: { value: '#3275B4' }, - // size: { value: 2 }, - // stroke: { value: '#3275B4' }, - // opacity: { value: 0.2 }, - // width: 300, - // height: 300 - // } - // ] - // } - // ] - // }; - - { - title: 'Between-Connectivity In 2D Tracks', - subtitle: 'Between-link examples with three types, i.e., straight, corner, and curve', - xDomain: { interval: [0, 1000000000] }, - style: { outlineWidth: 0.5 }, - spacing: 10, - // linkingId: '-', - views: [ - { - arrangement: 'horizontal', - views: [ - { - yOffset: 250, - spacing: 10, - orientation: 'vertical', - tracks: [ - { - data: { - url: 'https://server.gosling-lang.org/api/v1/tileset_info/?d=cistrome-multivec', - type: 'multivec', - row: 'sample', - column: 'position', - value: 'peak', - categories: ['sample 1', 'sample 2', 'sample 3', 'sample 4'], - binSize: 4 - }, - mark: 'rect', - x: { field: 'start', type: 'genomic', axis: 'left' }, - xe: { field: 'end', type: 'genomic' }, - row: { field: 'sample', type: 'nominal', legend: false }, - color: { field: 'peak', type: 'quantitative', legend: false, range: 'grey' }, - width: 100, - height: 500 - }, - { - data: { - url: - 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', - type: 'csv', - chromosomeField: 'c2', - genomicFields: ['s1', 'e1', 's2', 'e2'] - }, - style: { linkConnectionType: 'corner' }, - mark: 'withinLink', - x: { field: 's1', type: 'genomic', axis: 'none' }, - xe: { field: 's2', type: 'genomic' }, - flipY: false, - color: { value: '#3275B4' }, - size: { value: 2 }, - stroke: { value: '#3275B4' }, - opacity: { value: 0.2 }, - width: 100, - height: 500 - } - ] +export const EX_SPEC_DEBUG: GoslingSpec = { + title: 'Between-Connectivity In 2D Tracks', + subtitle: 'Between-link examples with three types, i.e., straight, corner, and curve', + xDomain: { interval: [0, 1000000000] }, + style: { outlineWidth: 0.5 }, + spacing: 10, + xLinkingId: '-', + arrangement: 'horizontal', + views: [ + { + orientation: 'vertical', + tracks: [ + { + data: { + url: 'https://server.gosling-lang.org/api/v1/tileset_info/?d=cistrome-multivec', + type: 'multivec', + row: 'sample', + column: 'position', + value: 'peak', + categories: ['sample 1', 'sample 2', 'sample 3', 'sample 4'], + binSize: 4 + }, + mark: 'rect', + x: { field: 'start', type: 'genomic', axis: 'left' }, + xe: { field: 'end', type: 'genomic' }, + row: { field: 'sample', type: 'nominal', legend: false }, + color: { + field: 'peak', + type: 'quantitative', + legend: false, + range: 'grey' }, - { - arrangement: 'vertical', - views: [ - { - spacing: 10, - tracks: [ - { - data: { - url: - 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', - type: 'csv', - chromosomeField: 'c2', - genomicFields: ['s1', 'e1', 's2', 'e2'] - }, - style: { linkConnectionType: 'corner' }, - mark: 'withinLink', - x: { field: 's1', type: 'genomic' }, - xe: { field: 's2', type: 'genomic' }, - flipY: false, - color: { value: '#3275B4' }, - size: { value: 2 }, - stroke: { value: '#3275B4' }, - opacity: { value: 0.2 }, - width: 500, - height: 100 - }, - { - data: { - url: - 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', - type: 'csv', - chromosomeField: 'c2', - genomicFields: ['s1', 'e1', 's2', 'e2'] - }, - style: { linkConnectionType: 'corner' }, - mark: 'withinLink', - x: { field: 's1', type: 'genomic' }, - xe: { field: 's2', type: 'genomic' }, - flipY: false, - color: { value: '#3275B4' }, - size: { value: 2 }, - stroke: { value: '#3275B4' }, - opacity: { value: 0.2 }, - width: 500, - height: 100 - } - ] - }, - { - tracks: [ - { - title: 'Curved Connection', - alignment: 'overlay', - data: { - url: - 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', - type: 'csv', - chromosomeField: 'c2', - genomicFields: ['s1', 'e1', 's2', 'e2'] - }, - style: { linkConnectionType: 'corner' }, - tracks: [ - { - mark: 'betweenLink', - x: { field: 's1', type: 'genomic', axis: 'none' }, - y: { field: 's2', type: 'genomic', axis: 'none' } - }, - { - mark: 'betweenLink', - y: { field: 's1', type: 'genomic', axis: 'none' }, - x: { field: 's2', type: 'genomic', axis: 'none' } - }, - { - mark: 'point', - x: { field: 's1', type: 'genomic', axis: 'none' }, - y: { field: 's2', type: 'genomic', axis: 'none' }, - opacity: { value: 1 } - }, - { - mark: 'point', - y: { field: 's1', type: 'genomic', axis: 'none' }, - x: { field: 's2', type: 'genomic', axis: 'none' }, - opacity: { value: 1 } - } - ], - color: { value: '#3275B4' }, - size: { value: 1 }, - stroke: { value: '#3275B4' }, - opacity: { value: 0.2 }, - width: 500, - height: 500 - } - ] - } - ] + width: 300, + height: 300 + } + ] + }, + { + xOffset: 30, + tracks: [ + { + data: { + url: + 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', + type: 'csv', + chromosomeField: 'c2', + genomicFields: ['s1', 'e1', 's2', 'e2'] }, - { - xDomain: { interval: [0, 1000000000] }, - yOffset: 250, - spacing: 10, - orientation: 'vertical', - tracks: [ - { - data: { - url: - 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', - type: 'csv', - chromosomeField: 'c2', - genomicFields: ['s1', 'e1', 's2', 'e2'] - }, - style: { linkConnectionType: 'corner' }, - mark: 'withinLink', - x: { field: 's1', type: 'genomic', axis: 'none' }, - xe: { field: 's2', type: 'genomic' }, - flipY: true, - color: { value: '#3275B4' }, - size: { value: 2 }, - stroke: { value: '#3275B4' }, - opacity: { value: 0.2 }, - width: 100, - height: 500 - }, - { - data: { - url: 'https://server.gosling-lang.org/api/v1/tileset_info/?d=cistrome-multivec', - type: 'multivec', - row: 'sample', - column: 'position', - value: 'peak', - categories: ['sample 1', 'sample 2', 'sample 3', 'sample 4'], - binSize: 4 - }, - mark: 'rect', - x: { field: 'start', type: 'genomic', axis: 'right' }, - xe: { field: 'end', type: 'genomic' }, - row: { field: 'sample', type: 'nominal', legend: false }, - color: { field: 'peak', type: 'quantitative', legend: false, range: 'rdbu' }, - width: 100, - height: 500 - } - ] - } - ] - }, - { - views: [ - { - xOffset: 250, - spacing: 10, - tracks: [ - { - data: { - url: - 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', - type: 'csv', - chromosomeField: 'c2', - genomicFields: ['s1', 'e1', 's2', 'e2'] - }, - style: { linkConnectionType: 'corner' }, - mark: 'withinLink', - x: { field: 's1', type: 'genomic', axis: 'none' }, - xe: { field: 's2', type: 'genomic' }, - flipY: true, - color: { value: '#3275B4' }, - size: { value: 2 }, - stroke: { value: '#3275B4' }, - opacity: { value: 0.2 }, - width: 500, - height: 100 - }, - { - data: { - url: - 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', - type: 'csv', - chromosomeField: 'c2', - genomicFields: ['s1', 'e1', 's2', 'e2'] - }, - style: { linkConnectionType: 'corner' }, - mark: 'withinLink', - x: { field: 's1', type: 'genomic', axis: 'bottom' }, - xe: { field: 's2', type: 'genomic' }, - flipY: true, - color: { value: '#3275B4' }, - size: { value: 2 }, - stroke: { value: '#3275B4' }, - opacity: { value: 0.2 }, - width: 500, - height: 100 - } - ] - } - ] - } - ] - }; + style: { linkConnectionType: 'corner' }, + mark: 'withinLink', + x: { field: 's1', type: 'genomic', axis: 'bottom' }, + xe: { field: 's2', type: 'genomic' }, + flipY: false, + color: { value: '#3275B4' }, + size: { value: 2 }, + stroke: { value: '#3275B4' }, + opacity: { value: 0.2 }, + width: 300, + height: 300 + } + ] + } + ] +}; + +// { +// title: 'Between-Connectivity In 2D Tracks', +// subtitle: 'Between-link examples with three types, i.e., straight, corner, and curve', +// xDomain: { interval: [0, 1000000000] }, +// style: { outlineWidth: 0.5 }, +// spacing: 10, +// // linkingId: '-', +// views: [ +// { +// arrangement: 'horizontal', +// views: [ +// { +// yOffset: 250, +// spacing: 10, +// orientation: 'vertical', +// tracks: [ +// { +// data: { +// url: 'https://server.gosling-lang.org/api/v1/tileset_info/?d=cistrome-multivec', +// type: 'multivec', +// row: 'sample', +// column: 'position', +// value: 'peak', +// categories: ['sample 1', 'sample 2', 'sample 3', 'sample 4'], +// binSize: 4 +// }, +// mark: 'rect', +// x: { field: 'start', type: 'genomic', axis: 'left' }, +// xe: { field: 'end', type: 'genomic' }, +// row: { field: 'sample', type: 'nominal', legend: false }, +// color: { field: 'peak', type: 'quantitative', legend: false, range: 'grey' }, +// width: 100, +// height: 500 +// }, +// { +// data: { +// url: +// 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', +// type: 'csv', +// chromosomeField: 'c2', +// genomicFields: ['s1', 'e1', 's2', 'e2'] +// }, +// style: { linkConnectionType: 'corner' }, +// mark: 'withinLink', +// x: { field: 's1', type: 'genomic', axis: 'none' }, +// xe: { field: 's2', type: 'genomic' }, +// flipY: false, +// color: { value: '#3275B4' }, +// size: { value: 2 }, +// stroke: { value: '#3275B4' }, +// opacity: { value: 0.2 }, +// width: 100, +// height: 500 +// } +// ] +// }, +// { +// arrangement: 'vertical', +// views: [ +// { +// spacing: 10, +// tracks: [ +// { +// data: { +// url: +// 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', +// type: 'csv', +// chromosomeField: 'c2', +// genomicFields: ['s1', 'e1', 's2', 'e2'] +// }, +// style: { linkConnectionType: 'corner' }, +// mark: 'withinLink', +// x: { field: 's1', type: 'genomic' }, +// xe: { field: 's2', type: 'genomic' }, +// flipY: false, +// color: { value: '#3275B4' }, +// size: { value: 2 }, +// stroke: { value: '#3275B4' }, +// opacity: { value: 0.2 }, +// width: 500, +// height: 100 +// }, +// { +// data: { +// url: +// 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', +// type: 'csv', +// chromosomeField: 'c2', +// genomicFields: ['s1', 'e1', 's2', 'e2'] +// }, +// style: { linkConnectionType: 'corner' }, +// mark: 'withinLink', +// x: { field: 's1', type: 'genomic' }, +// xe: { field: 's2', type: 'genomic' }, +// flipY: false, +// color: { value: '#3275B4' }, +// size: { value: 2 }, +// stroke: { value: '#3275B4' }, +// opacity: { value: 0.2 }, +// width: 500, +// height: 100 +// } +// ] +// }, +// { +// tracks: [ +// { +// title: 'Curved Connection', +// alignment: 'overlay', +// data: { +// url: +// 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', +// type: 'csv', +// chromosomeField: 'c2', +// genomicFields: ['s1', 'e1', 's2', 'e2'] +// }, +// style: { linkConnectionType: 'corner' }, +// tracks: [ +// { +// mark: 'betweenLink', +// x: { field: 's1', type: 'genomic', axis: 'none' }, +// y: { field: 's2', type: 'genomic', axis: 'none' } +// }, +// { +// mark: 'betweenLink', +// y: { field: 's1', type: 'genomic', axis: 'none' }, +// x: { field: 's2', type: 'genomic', axis: 'none' } +// }, +// { +// mark: 'point', +// x: { field: 's1', type: 'genomic', axis: 'none' }, +// y: { field: 's2', type: 'genomic', axis: 'none' }, +// opacity: { value: 1 } +// }, +// { +// mark: 'point', +// y: { field: 's1', type: 'genomic', axis: 'none' }, +// x: { field: 's2', type: 'genomic', axis: 'none' }, +// opacity: { value: 1 } +// } +// ], +// color: { value: '#3275B4' }, +// size: { value: 1 }, +// stroke: { value: '#3275B4' }, +// opacity: { value: 0.2 }, +// width: 500, +// height: 500 +// } +// ] +// } +// ] +// }, +// { +// xDomain: { interval: [0, 1000000000] }, +// yOffset: 250, +// spacing: 10, +// orientation: 'vertical', +// tracks: [ +// { +// data: { +// url: +// 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', +// type: 'csv', +// chromosomeField: 'c2', +// genomicFields: ['s1', 'e1', 's2', 'e2'] +// }, +// style: { linkConnectionType: 'corner' }, +// mark: 'withinLink', +// x: { field: 's1', type: 'genomic', axis: 'none' }, +// xe: { field: 's2', type: 'genomic' }, +// flipY: true, +// color: { value: '#3275B4' }, +// size: { value: 2 }, +// stroke: { value: '#3275B4' }, +// opacity: { value: 0.2 }, +// width: 100, +// height: 500 +// }, +// { +// data: { +// url: 'https://server.gosling-lang.org/api/v1/tileset_info/?d=cistrome-multivec', +// type: 'multivec', +// row: 'sample', +// column: 'position', +// value: 'peak', +// categories: ['sample 1', 'sample 2', 'sample 3', 'sample 4'], +// binSize: 4 +// }, +// mark: 'rect', +// x: { field: 'start', type: 'genomic', axis: 'right' }, +// xe: { field: 'end', type: 'genomic' }, +// row: { field: 'sample', type: 'nominal', legend: false }, +// color: { field: 'peak', type: 'quantitative', legend: false, range: 'rdbu' }, +// width: 100, +// height: 500 +// } +// ] +// } +// ] +// }, +// { +// views: [ +// { +// xOffset: 250, +// spacing: 10, +// tracks: [ +// { +// data: { +// url: +// 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', +// type: 'csv', +// chromosomeField: 'c2', +// genomicFields: ['s1', 'e1', 's2', 'e2'] +// }, +// style: { linkConnectionType: 'corner' }, +// mark: 'withinLink', +// x: { field: 's1', type: 'genomic', axis: 'none' }, +// xe: { field: 's2', type: 'genomic' }, +// flipY: true, +// color: { value: '#3275B4' }, +// size: { value: 2 }, +// stroke: { value: '#3275B4' }, +// opacity: { value: 0.2 }, +// width: 500, +// height: 100 +// }, +// { +// data: { +// url: +// 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', +// type: 'csv', +// chromosomeField: 'c2', +// genomicFields: ['s1', 'e1', 's2', 'e2'] +// }, +// style: { linkConnectionType: 'corner' }, +// mark: 'withinLink', +// x: { field: 's1', type: 'genomic', axis: 'bottom' }, +// xe: { field: 's2', type: 'genomic' }, +// flipY: true, +// color: { value: '#3275B4' }, +// size: { value: 2 }, +// stroke: { value: '#3275B4' }, +// opacity: { value: 0.2 }, +// width: 500, +// height: 100 +// } +// ] +// } +// ] +// } +// ] +// }; // { // "arrangement": "horizontal", diff --git a/src/editor/example/gremlin.ts b/src/editor/example/gremlin.ts index d1564dc7c..c6db387b0 100644 --- a/src/editor/example/gremlin.ts +++ b/src/editor/example/gremlin.ts @@ -4,7 +4,7 @@ export const EX_SPEC_GREMLIN: GoslingSpec = { title: "Gremlin (O'Brien et al. 2010)", views: [ { - linkingId: 'view1', + xLinkingId: 'view1', xDomain: { chromosome: '5', interval: [0, 80000000] }, tracks: [ { diff --git a/src/editor/example/index.ts b/src/editor/example/index.ts index ce496e37c..9ab14f054 100644 --- a/src/editor/example/index.ts +++ b/src/editor/example/index.ts @@ -16,7 +16,7 @@ import { EX_SPEC_GIVE } from './give'; import { EX_SPEC_CORCES_ET_AL } from './corces'; import { EX_SPEC_CYTOBANDS } from './ideograms'; import { EX_SPEC_PILEUP } from './pileup'; -import { EX_SPEC_BAND } from './vertical-band'; +import { EX_SPEC_BAND, EX_SPEC_VERTICAL_BAND } from './vertical-band'; import { EX_SPEC_TEMPLATE } from './track-template'; import { EX_SPEC_DEBUG } from './debug'; @@ -83,6 +83,13 @@ export const examples: ReadonlyArray<{ id: 'CIRCULAR_OVERVIEW_LINEAR_DETAIL', spec: EX_SPEC_CIRCULAR_OVERVIEW_LINEAR_DETAIL }, + { + name: 'Basic Example: Vertical Band Connection w/ Independent Axes', + id: 'VERTICAL_BAND', + spec: EX_SPEC_VERTICAL_BAND, + forceShow: true, + underDevelopment: true + }, { name: 'Multi-Scale Sequence Track', id: 'SEQUENCE', diff --git a/src/editor/example/matrix-hffc6.ts b/src/editor/example/matrix-hffc6.ts index 7931ce334..ebbf13ee3 100644 --- a/src/editor/example/matrix-hffc6.ts +++ b/src/editor/example/matrix-hffc6.ts @@ -7,7 +7,7 @@ export const EX_SPEC_MATRIX_HFFC6: GoslingSpec = { arrangement: 'horizontal', xDomain: { chromosome: '7', interval: [77700000, 81000000] }, spacing: 1, - linkingId: '-', + xLinkingId: '-', views: [ { orientation: 'vertical', diff --git a/src/editor/example/matrix.ts b/src/editor/example/matrix.ts index 3e3208608..db3abe628 100644 --- a/src/editor/example/matrix.ts +++ b/src/editor/example/matrix.ts @@ -180,7 +180,7 @@ export const EX_SPEC_MATRIX: GoslingSpec = { }, { xDomain: { chromosome: '5', interval: [0, 43000000] }, - linkingId: 'all', + xLinkingId: 'all', spacing: 0, views: [ { diff --git a/src/editor/example/sars-cov-2.ts b/src/editor/example/sars-cov-2.ts index 108206ab4..4daa93bb4 100644 --- a/src/editor/example/sars-cov-2.ts +++ b/src/editor/example/sars-cov-2.ts @@ -69,7 +69,7 @@ export const EX_SPEC_SARS_COV_2: GoslingSpec = { { centerRadius: 0, xDomain: { interval: [1, 29903] }, - linkingId: 'detail', + xLinkingId: 'detail', alignment: 'stack', tracks: [ // { diff --git a/src/editor/example/theme.ts b/src/editor/example/theme.ts index 645b722f6..85c9beb21 100644 --- a/src/editor/example/theme.ts +++ b/src/editor/example/theme.ts @@ -112,7 +112,7 @@ export const EX_SPEC_CUSTOM_THEME: GoslingSpec = { }, { xDomain: { chromosome: '3', interval: [52168000, 52890000] }, - linkingId: 'detail', + xLinkingId: 'detail', mark: 'bar', x: { field: 'position', diff --git a/src/editor/example/vertical-band.ts b/src/editor/example/vertical-band.ts index 7d8aa5757..7652e9e9f 100644 --- a/src/editor/example/vertical-band.ts +++ b/src/editor/example/vertical-band.ts @@ -1,5 +1,133 @@ import { GoslingSpec } from '../../core/gosling.schema'; +export const EX_SPEC_VERTICAL_BAND: GoslingSpec = { + title: 'Between-Connectivity In 2D Tracks', + subtitle: 'Between-link examples with three types, i.e., straight, corner, and curve', + xDomain: { chromosome: '1' }, + yDomain: { chromosome: '1' }, + views: [ + { + arrangement: 'horizontal', + views: [ + { + tracks: [ + { + title: 'Straight Connection', + alignment: 'overlay', + data: { + url: + 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', + type: 'csv', + chromosomeField: 'c2', + genomicFields: ['s1', 'e1', 's2', 'e2'] + }, + style: { linkConnectionType: 'straight' }, + tracks: [ + { + mark: 'betweenLink', + x: { field: 's1', type: 'genomic', axis: 'top' }, + y: { field: 's2', type: 'genomic', axis: 'left' } + }, + { + mark: 'betweenLink', + y: { field: 's1', type: 'genomic', axis: 'top' }, + x: { field: 's2', type: 'genomic', axis: 'left' } + } + ], + color: { value: '#3275B4' }, + size: { value: 2 }, + stroke: { value: '#3275B4' }, + opacity: { value: 0.2 }, + width: 500, + height: 500 + } + ] + }, + { + tracks: [ + { + title: 'Cornered Connection', + alignment: 'overlay', + data: { + url: + 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', + type: 'csv', + chromosomeField: 'c2', + genomicFields: ['s1', 'e1', 's2', 'e2'] + }, + style: { linkConnectionType: 'corner' }, + tracks: [ + { + mark: 'betweenLink', + x: { field: 's1', type: 'genomic', axis: 'top' }, + y: { field: 's2', type: 'genomic', axis: 'left' } + }, + { + mark: 'betweenLink', + y: { field: 's1', type: 'genomic', axis: 'top' }, + x: { field: 's2', type: 'genomic', axis: 'left' } + }, + { + mark: 'point', + x: { field: 's1', type: 'genomic', axis: 'top' }, + y: { field: 's2', type: 'genomic', axis: 'left' }, + opacity: { value: 1 } + }, + { + mark: 'point', + y: { field: 's1', type: 'genomic', axis: 'top' }, + x: { field: 's2', type: 'genomic', axis: 'left' }, + opacity: { value: 1 } + } + ], + color: { value: 'black' }, + size: { value: 1 }, + stroke: { value: '#3275B4' }, + opacity: { value: 0.2 }, + width: 500, + height: 500 + } + ] + } + ] + }, + { + tracks: [ + { + title: 'Curved Connection', + alignment: 'overlay', + data: { + url: + 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/circos-segdup-edited.txt', + type: 'csv', + chromosomeField: 'c2', + genomicFields: ['s1', 'e1', 's2', 'e2'] + }, + style: { linkConnectionType: 'curve' }, + tracks: [ + { + mark: 'betweenLink', + x: { field: 's1', type: 'genomic', axis: 'top' }, + y: { field: 's2', type: 'genomic', axis: 'left' } + }, + { + mark: 'betweenLink', + y: { field: 's1', type: 'genomic', axis: 'top' }, + x: { field: 's2', type: 'genomic', axis: 'left' } + } + ], + color: { value: 'black' }, + size: { value: 1 }, + stroke: { value: '#3275B4' }, + opacity: { value: 0.2 }, + width: 500, + height: 500 + } + ] + } + ] +}; + export const EX_SPEC_BAND: GoslingSpec = { layout: 'linear', xDomain: { chromosome: '1', interval: [103900000, 104100000] }, diff --git a/src/editor/example/visual-linking.ts b/src/editor/example/visual-linking.ts index f8a8cc239..c302040ed 100644 --- a/src/editor/example/visual-linking.ts +++ b/src/editor/example/visual-linking.ts @@ -72,7 +72,7 @@ export const EX_SPEC_LINKING: GoslingSpec = { { layout: 'linear', xDomain: { chromosome: '1', interval: [160000000, 200000000] }, - linkingId: 'detail', + xLinkingId: 'detail', tracks: [ { data: { From 7a866dd7e9593da6e2e65b8814b386418be54a97 Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Thu, 12 Aug 2021 17:36:11 -0400 Subject: [PATCH 02/34] chore: working on cross-axis linking --- src/core/gosling.schema.guards.ts | 16 +++-- src/core/gosling.schema.ts | 3 +- src/editor/example/give.ts | 103 +++++++++++++++++++++++++----- src/editor/example/index.ts | 22 ++++--- 4 files changed, 114 insertions(+), 30 deletions(-) diff --git a/src/core/gosling.schema.guards.ts b/src/core/gosling.schema.guards.ts index 2028fcbe7..b6f00a6c3 100644 --- a/src/core/gosling.schema.guards.ts +++ b/src/core/gosling.schema.guards.ts @@ -128,12 +128,20 @@ export function IsTemplateTrack(track: Partial): track is TemplateTrack { * Is this 2D track, i.e., two genomic axes? */ export function Is2DTrack(track: Track) { + // TODO: For the readability, use if-else statements. return ( IsSingleTrack(track) && - IsChannelDeep(track['x']) && - track['x'].type === 'genomic' && - IsChannelDeep(track['y']) && - track['y'].type === 'genomic' + ((IsChannelDeep(track['x']) && + track['x'].type === 'genomic' && + IsChannelDeep(track['y']) && + track['y'].type === 'genomic') || + (IsChannelDeep(track['x']) && + track['x'].type === 'genomic' && + IsChannelDeep(track['x1']) && + track['x1'].type === 'genomic' && + track['x'].linkingId && + track['x1'].linkingId && + track['x'].linkingId !== track['x1'].linkingId)) ); } diff --git a/src/core/gosling.schema.ts b/src/core/gosling.schema.ts index 249cb1430..6a54a4df1 100644 --- a/src/core/gosling.schema.ts +++ b/src/core/gosling.schema.ts @@ -64,7 +64,8 @@ export interface CommonViewDef { yDomain?: DomainInterval | DomainChrInterval | DomainChr; xLinkingId?: string; - yLinkingId?: string; + x1LinkingId?: string; // TODO: + yLinkingId?: string; // TODO: xAxis?: AxisPosition; // not supported currently diff --git a/src/editor/example/give.ts b/src/editor/example/give.ts index daf27b118..21bfa2ae5 100644 --- a/src/editor/example/give.ts +++ b/src/editor/example/give.ts @@ -3,10 +3,11 @@ import { GoslingSpec } from '../../core/gosling.schema'; export const EX_SPEC_GIVE: GoslingSpec = { title: 'GIVE', subtitle: 'Reimplementation of GenoCAT examples', - spacing: 60, + // "spacing": 60, arrangement: 'vertical', views: [ { + xLinkingId: 'top', layout: 'linear', tracks: [ { @@ -138,7 +139,14 @@ export const EX_SPEC_GIVE: GoslingSpec = { tracks: [ { mark: 'rect', - dataTransform: [{ type: 'filter', field: 'Stain', oneOf: ['acen'], not: true }] + dataTransform: [ + { + type: 'filter', + field: 'Stain', + oneOf: ['acen'], + not: true + } + ] }, { mark: 'triangleRight', @@ -166,7 +174,7 @@ export const EX_SPEC_GIVE: GoslingSpec = { stroke: { value: 'black' }, strokeWidth: { value: 0.5 }, width: 700, - height: 40 + height: 14 }, { data: { @@ -178,7 +186,6 @@ export const EX_SPEC_GIVE: GoslingSpec = { genomicFields: ['p1', 'p2'], separator: ' ', longToWideId: 'id' - //sampleLength: 5000 }, dataTransform: [{ type: 'filter', field: 'chr', oneOf: ['hs17'] }], mark: 'rect', @@ -218,11 +225,72 @@ export const EX_SPEC_GIVE: GoslingSpec = { size: { value: 14 }, overlayOnPreviousTrack: true, width: 700, - height: 40 + height: 14 + } + ] + }, + { + layout: 'linear', + tracks: [ + { + data: { + url: 'https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt', + type: 'csv', + headerNames: ['id', 'chr', 'p1', 'p2'], + chromosomePrefix: 'hs', + chromosomeField: 'chr', + genomicFields: ['p1', 'p2'], + separator: ' ', + longToWideId: 'id' + }, + mark: 'betweenLink', + x: { + field: 'p1', + type: 'genomic', + axis: 'none', + linkingId: 'top' + }, + xe: { field: 'p2', type: 'genomic' }, + x1: { field: 'p1_2', type: 'genomic', linkingId: 'bottom' }, + x1e: { field: 'p2_2', type: 'genomic' }, + stroke: { + field: 'chr', + type: 'nominal', + domain: [ + 'chr1', + 'chr2', + 'chr3', + 'chr4', + 'chr5', + 'chr6', + 'chr7', + 'chr8', + 'chr9', + 'chr10', + 'chr11', + 'chr12', + 'chr13', + 'chr14', + 'chr15', + 'chr16', + 'chr17', + 'chr18', + 'chr19', + 'chr20', + 'chr21', + 'chr22', + 'chrX', + 'chrY' + ] + }, + opacity: { value: 0.5 }, + width: 700, + height: 100 } ] }, { + xLinkingId: 'bottom', layout: 'linear', tracks: [ { @@ -237,7 +305,14 @@ export const EX_SPEC_GIVE: GoslingSpec = { tracks: [ { mark: 'rect', - dataTransform: [{ type: 'filter', field: 'Stain', oneOf: ['acen'], not: true }] + dataTransform: [ + { + type: 'filter', + field: 'Stain', + oneOf: ['acen'], + not: true + } + ] }, { mark: 'triangleRight', @@ -254,18 +329,14 @@ export const EX_SPEC_GIVE: GoslingSpec = { ] } ], - x: { - field: 'chromStart', - type: 'genomic', - axis: 'none' - }, + x: { field: 'chromStart', type: 'genomic' }, xe: { field: 'chromEnd', type: 'genomic' }, color: { value: 'white' }, size: { value: 14 }, stroke: { value: 'black' }, strokeWidth: { value: 0.5 }, width: 700, - height: 40 + height: 14 }, { data: { @@ -277,7 +348,6 @@ export const EX_SPEC_GIVE: GoslingSpec = { genomicFields: ['p1', 'p2'], separator: ' ', longToWideId: 'id' - //sampleLength: 5000 }, dataTransform: [{ type: 'filter', field: 'chr_2', oneOf: ['hs1'] }], mark: 'rect', @@ -317,7 +387,7 @@ export const EX_SPEC_GIVE: GoslingSpec = { size: { value: 14 }, overlayOnPreviousTrack: true, width: 700, - height: 40 + height: 14 }, { data: { @@ -402,7 +472,10 @@ export const EX_SPEC_GIVE: GoslingSpec = { x: { field: 'end', type: 'genomic', - domain: { chromosome: '1', interval: [109000000, 112000000] }, + domain: { + chromosome: '1', + interval: [109000000, 112000000] + }, axis: 'bottom' }, size: { value: 7 } diff --git a/src/editor/example/index.ts b/src/editor/example/index.ts index 9ab14f054..434a16632 100644 --- a/src/editor/example/index.ts +++ b/src/editor/example/index.ts @@ -16,7 +16,7 @@ import { EX_SPEC_GIVE } from './give'; import { EX_SPEC_CORCES_ET_AL } from './corces'; import { EX_SPEC_CYTOBANDS } from './ideograms'; import { EX_SPEC_PILEUP } from './pileup'; -import { EX_SPEC_BAND, EX_SPEC_VERTICAL_BAND } from './vertical-band'; +import { EX_SPEC_BAND } from './vertical-band'; import { EX_SPEC_TEMPLATE } from './track-template'; import { EX_SPEC_DEBUG } from './debug'; @@ -38,7 +38,8 @@ export const examples: ReadonlyArray<{ { name: 'Basic Example: Visual Encoding', id: 'VISUAL_ENCODING', - spec: EX_SPEC_VISUAL_ENCODING + spec: EX_SPEC_VISUAL_ENCODING, + forceShow: true }, { name: 'Basic Example: Circular Visual Encoding', @@ -83,13 +84,13 @@ export const examples: ReadonlyArray<{ id: 'CIRCULAR_OVERVIEW_LINEAR_DETAIL', spec: EX_SPEC_CIRCULAR_OVERVIEW_LINEAR_DETAIL }, - { - name: 'Basic Example: Vertical Band Connection w/ Independent Axes', - id: 'VERTICAL_BAND', - spec: EX_SPEC_VERTICAL_BAND, - forceShow: true, - underDevelopment: true - }, + // { + // name: 'Basic Example: Vertical Band Connection w/ Independent Axes', + // id: 'VERTICAL_BAND', + // spec: EX_SPEC_VERTICAL_BAND, + // forceShow: true, + // underDevelopment: true + // }, { name: 'Multi-Scale Sequence Track', id: 'SEQUENCE', @@ -146,7 +147,8 @@ export const examples: ReadonlyArray<{ name: 'GIVE (Cao et al. 2018)', id: 'GIVE', spec: EX_SPEC_GIVE, - underDevelopment: true + underDevelopment: true, + forceShow: true }, { name: 'Breast Cancer Variant (Staaf et al. 2019)', From a5be414a0ce17d792bc42e47e739535b96a03ade Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Fri, 13 Aug 2021 12:02:32 -0400 Subject: [PATCH 03/34] chore: first working independent top and bottom axes with bands --- src/core/example/hg-view-config-1.ts | 2683 ++++++++++++++++---------- src/core/gosling-to-higlass.ts | 3 - src/core/layout/higlass.ts | 3 + src/core/mark/index.ts | 8 +- src/editor/example/give.ts | 685 +++---- src/editor/example/index.ts | 3 +- 6 files changed, 2060 insertions(+), 1325 deletions(-) diff --git a/src/core/example/hg-view-config-1.ts b/src/core/example/hg-view-config-1.ts index c8f4a1aa9..ece0cd97f 100644 --- a/src/core/example/hg-view-config-1.ts +++ b/src/core/example/hg-view-config-1.ts @@ -1,990 +1,1719 @@ const example = { - compactLayout: false, - trackSourceServers: ['https://server.gosling-lang.org/api/v1/'], - views: [ - { - genomePositionSearchBoxVisible: false, - genomePositionSearchBox: { - autocompleteServer: 'https://higlass.io/api/v1', - autocompleteId: 'P0PLbQMwTYGy-5uPIQid7A', - chromInfoServer: 'https://higlass.io/api/v1', - chromInfoId: 'hg38' - }, - layout: { x: 0, y: 0, w: 6.4, h: 600 }, - tracks: { - top: [], - left: [ - { - type: 'combined', - width: 130, - height: 600, - contents: [ + "compactLayout": false, + "trackSourceServers": [], + "views": [ + { + "genomePositionSearchBoxVisible": false, + "genomePositionSearchBox": { + "autocompleteServer": "https://higlass.io/api/v1", + "autocompleteId": "P0PLbQMwTYGy-5uPIQid7A", + "chromInfoServer": "https://higlass.io/api/v1", + "chromInfoId": "hg38" + }, + "layout": {"x": 0, "y": 50, "w": 12, "h": 44}, + "tracks": { + "top": [ + { + "uid": "dbed29d0-fc48-11eb-b136-51c77f658267", + "type": "axis-track", + "chromInfoPath": "https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes", + "options": { + "layout": "linear", + "innerRadius": null, + "width": 700, + "height": 44, + "theme": { + "base": "light", + "root": { + "background": "white", + "titleColor": "black", + "titleBackgroundColor": "transparent", + "titleFontSize": 18, + "titleFontFamily": "Arial", + "titleAlign": "left", + "titleFontWeight": "bold", + "subtitleColor": "gray", + "subtitleBackgroundColor": "transparent", + "subtitleFontSize": 16, + "subtitleFontFamily": "Arial", + "subtitleFontWeight": "normal", + "subtitleAlign": "left", + "mousePositionColor": "#000000" + }, + "track": { + "background": "transparent", + "alternatingBackground": "transparent", + "titleColor": "black", + "titleBackground": "white", + "titleFontSize": 24, + "titleAlign": "left", + "outline": "black", + "outlineWidth": 1 + }, + "legend": { + "position": "top", + "background": "white", + "backgroundOpacity": 0.7, + "labelColor": "black", + "labelFontSize": 12, + "labelFontWeight": "normal", + "labelFontFamily": "Arial", + "backgroundStroke": "#DBDBDB", + "tickColor": "black" + }, + "axis": { + "tickColor": "black", + "labelColor": "black", + "labelFontSize": 12, + "labelFontWeight": "normal", + "labelFontFamily": "Arial", + "baselineColor": "black", + "gridColor": "#E3E3E3", + "gridStrokeWidth": 1, + "gridStrokeType": "solid", + "gridStrokeDash": [4, 4] + }, + "markCommon": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "point": { + "color": "#E79F00", + "size": 3, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "rect": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "triangle": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "area": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "line": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "bar": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "rule": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 1, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "link": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 1, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "text": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6], + "textAnchor": "middle", + "textFontWeight": "normal" + }, + "brush": { + "color": "gray", + "size": 1, + "stroke": "black", + "strokeWidth": 1, + "opacity": 0.3, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + } + }, + "assembly": "hg38", + "stroke": "transparent", + "color": "black", + "fontSize": 12, + "fontFamily": "Arial", + "fontWeight": "normal", + "tickColor": "black", + "tickFormat": "plain", + "tickPositions": "even", + "reverseOrientation": false + }, + "height": 30 + } + ], + "left": [], + "center": [ + { + "type": "combined", + "width": 699, + "height": 14, + "contents": [ + { + "type": "gosling-track", + "width": 700, + "height": 14, + "options": { + "showMousePosition": true, + "mousePositionColor": "#000000", + "fontSize": 24, + "labelPosition": "none", + "labelShowResolution": false, + "labelColor": "black", + "labelBackgroundColor": "white", + "labelTextOpacity": 1, + "labelLeftMargin": 1, + "labelTopMargin": 1, + "labelRightMargin": 0, + "labelBottomMargin": 0, + "backgroundColor": "transparent", + "spec": { + "data": { + "url": "https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/UCSC.HG38.Human.CytoBandIdeogram.csv", + "type": "csv", + "chromosomeField": "Chromosome", + "genomicFields": ["chromStart", "chromEnd"] + }, + "x": { + "field": "chromStart", + "type": "genomic", + "domain": { + "chromosome": "17", + "interval": [20000000, 50000000] + }, + "linkingId": "top", + "axis": "top" + }, + "xe": {"field": "chromEnd", "type": "genomic"}, + "color": {"value": "white"}, + "size": {"value": 14}, + "stroke": {"value": "black"}, + "strokeWidth": {"value": 0.5}, + "width": 700, + "height": 44, + "overlay": [ + { + "mark": "rect", + "dataTransform": [ { - type: 'gosling-track', - server: 'https://server.gosling-lang.org/api/v1/', - tilesetUid: 'cistrome-multivec', - width: 130, - height: 600, - options: { - showMousePosition: true, - mousePositionColor: '#000000', - fontSize: 24, - labelPosition: 'none', - labelShowResolution: false, - labelColor: 'black', - labelBackgroundColor: 'white', - labelTextOpacity: 1, - labelLeftMargin: 1, - labelTopMargin: 1, - labelRightMargin: 0, - labelBottomMargin: 0, - backgroundColor: 'transparent', - spec: { - spacing: 10, - orientation: 'vertical', - assembly: 'hg38', - layout: 'linear', - static: false, - xDomain: { interval: [0, 1000000000] }, - centerRadius: 0.3, - xOffset: 0, - yOffset: 0, - style: { outlineWidth: 0.5 }, - data: { - url: - 'https://server.gosling-lang.org/api/v1/tileset_info/?d=cistrome-multivec', - type: 'multivec', - row: 'sample', - column: 'position', - value: 'peak', - categories: ['sample 1', 'sample 2', 'sample 3', 'sample 4'], - binSize: 4 - }, - mark: 'rect', - x: { - field: 'start', - type: 'genomic', - axis: 'left', - domain: { interval: [0, 1000000000] }, - linkingId: '7f94b74e-25ec-4e67-8c75-3dc0f1b0d6bd' - }, - xe: { field: 'end', type: 'genomic' }, - row: { - field: 'sample', - type: 'nominal', - legend: true - }, - color: { - field: 'peak', - type: 'quantitative', - legend: true - }, - tooltip: [ - { - field: 'start', - type: 'genomic', - alt: 'Start Position' - }, - { - field: 'end', - type: 'genomic', - alt: 'End Position' - }, - { - field: 'peak', - type: 'quantitative', - alt: 'Value', - format: '.2' - }, - { field: 'sample', type: 'nominal', alt: 'Sample' } - ], - width: 160, - height: 600, - overlayOnPreviousTrack: false - }, - theme: { - base: 'light', - root: { - background: 'white', - titleColor: 'black', - titleBackgroundColor: 'transparent', - titleFontSize: 18, - titleFontFamily: 'Arial', - titleAlign: 'left', - titleFontWeight: 'bold', - subtitleColor: 'gray', - subtitleBackgroundColor: 'transparent', - subtitleFontSize: 16, - subtitleFontFamily: 'Arial', - subtitleFontWeight: 'normal', - subtitleAlign: 'left', - mousePositionColor: '#000000' - }, - track: { - background: 'transparent', - alternatingBackground: 'transparent', - titleColor: 'black', - titleBackground: 'white', - titleFontSize: 24, - titleAlign: 'left', - outline: 'black', - outlineWidth: 1 - }, - legend: { - position: 'top', - background: 'white', - backgroundOpacity: 0.7, - labelColor: 'black', - labelFontSize: 12, - labelFontWeight: 'normal', - labelFontFamily: 'Arial', - backgroundStroke: '#DBDBDB', - tickColor: 'black' - }, - axis: { - tickColor: 'black', - labelColor: 'black', - labelFontSize: 12, - labelFontWeight: 'normal', - labelFontFamily: 'Arial', - baselineColor: 'black', - gridColor: '#E3E3E3', - gridStrokeWidth: 1, - gridStrokeType: 'solid', - gridStrokeDash: [4, 4] - }, - markCommon: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - point: { - color: '#E79F00', - size: 3, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - rect: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - triangle: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - area: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - line: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - bar: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - rule: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 1, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - link: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 1, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - text: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6], - textAnchor: 'middle', - textFontWeight: 'normal' - }, - brush: { - color: 'gray', - size: 1, - stroke: 'black', - strokeWidth: 1, - opacity: 0.3, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - } - } - } + "type": "filter", + "field": "Stain", + "oneOf": ["acen"], + "not": true } - ] - }, - { - uid: '15483511-f6fb-11eb-914b-976b6ecda162', - type: 'axis-track', - chromInfoPath: 'https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes', - options: { - layout: 'linear', - outerRadius: null, - width: 160, - height: 600, - theme: { - base: 'light', - root: { - background: 'white', - titleColor: 'black', - titleBackgroundColor: 'transparent', - titleFontSize: 18, - titleFontFamily: 'Arial', - titleAlign: 'left', - titleFontWeight: 'bold', - subtitleColor: 'gray', - subtitleBackgroundColor: 'transparent', - subtitleFontSize: 16, - subtitleFontFamily: 'Arial', - subtitleFontWeight: 'normal', - subtitleAlign: 'left', - mousePositionColor: '#000000' - }, - track: { - background: 'transparent', - alternatingBackground: 'transparent', - titleColor: 'black', - titleBackground: 'white', - titleFontSize: 24, - titleAlign: 'left', - outline: 'black', - outlineWidth: 1 - }, - legend: { - position: 'top', - background: 'white', - backgroundOpacity: 0.7, - labelColor: 'black', - labelFontSize: 12, - labelFontWeight: 'normal', - labelFontFamily: 'Arial', - backgroundStroke: '#DBDBDB', - tickColor: 'black' - }, - axis: { - tickColor: 'black', - labelColor: 'black', - labelFontSize: 12, - labelFontWeight: 'normal', - labelFontFamily: 'Arial', - baselineColor: 'black', - gridColor: '#E3E3E3', - gridStrokeWidth: 1, - gridStrokeType: 'solid', - gridStrokeDash: [4, 4] - }, - markCommon: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - point: { - color: '#E79F00', - size: 3, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - rect: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - triangle: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - area: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - line: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - bar: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - rule: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 1, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - link: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 1, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - text: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6], - textAnchor: 'middle', - textFontWeight: 'normal' - }, - brush: { - color: 'gray', - size: 1, - stroke: 'black', - strokeWidth: 1, - opacity: 0.3, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - } + ], + "style": {"outlineWidth": 0} + }, + { + "mark": "triangleRight", + "dataTransform": [ + { + "type": "filter", + "field": "Stain", + "oneOf": ["acen"] }, - assembly: 'hg38', - stroke: 'transparent', - color: 'black', - fontSize: 12, - fontFamily: 'Arial', - fontWeight: 'normal', - tickColor: 'black', - tickFormat: 'plain', - tickPositions: 'even', - reverseOrientation: false + {"type": "filter", "field": "Name", "include": "q"} + ], + "style": {"outlineWidth": 0} }, - width: 30 + { + "mark": "triangleLeft", + "dataTransform": [ + { + "type": "filter", + "field": "Stain", + "oneOf": ["acen"] + }, + {"type": "filter", "field": "Name", "include": "p"} + ], + "style": {"outlineWidth": 0} + } + ], + "assembly": "hg38", + "layout": "linear", + "orientation": "horizontal", + "static": false, + "style": {"outlineWidth": 0}, + "overlayOnPreviousTrack": false + }, + "theme": { + "base": "light", + "root": { + "background": "white", + "titleColor": "black", + "titleBackgroundColor": "transparent", + "titleFontSize": 18, + "titleFontFamily": "Arial", + "titleAlign": "left", + "titleFontWeight": "bold", + "subtitleColor": "gray", + "subtitleBackgroundColor": "transparent", + "subtitleFontSize": 16, + "subtitleFontFamily": "Arial", + "subtitleFontWeight": "normal", + "subtitleAlign": "left", + "mousePositionColor": "#000000" + }, + "track": { + "background": "transparent", + "alternatingBackground": "transparent", + "titleColor": "black", + "titleBackground": "white", + "titleFontSize": 24, + "titleAlign": "left", + "outline": "black", + "outlineWidth": 1 + }, + "legend": { + "position": "top", + "background": "white", + "backgroundOpacity": 0.7, + "labelColor": "black", + "labelFontSize": 12, + "labelFontWeight": "normal", + "labelFontFamily": "Arial", + "backgroundStroke": "#DBDBDB", + "tickColor": "black" + }, + "axis": { + "tickColor": "black", + "labelColor": "black", + "labelFontSize": 12, + "labelFontWeight": "normal", + "labelFontFamily": "Arial", + "baselineColor": "black", + "gridColor": "#E3E3E3", + "gridStrokeWidth": 1, + "gridStrokeType": "solid", + "gridStrokeDash": [4, 4] + }, + "markCommon": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "point": { + "color": "#E79F00", + "size": 3, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "rect": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "triangle": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "area": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "line": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "bar": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "rule": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 1, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "link": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 1, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "text": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6], + "textAnchor": "middle", + "textFontWeight": "normal" + }, + "brush": { + "color": "gray", + "size": 1, + "stroke": "black", + "strokeWidth": 1, + "opacity": 0.3, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + } } - ], - center: [], - right: [], - bottom: [], - gallery: [], - whole: [] - }, - initialXDomain: [0, 1000000000], - initialYDomain: [0, 1000000000], - zoomFixed: false, - zoomLimits: [1, null], - uid: '15483510-f6fb-11eb-914b-976b6ecda162', - chromInfoPath: 'https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes' + }, + "data": { + "url": "https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/UCSC.HG38.Human.CytoBandIdeogram.csv", + "type": "csv", + "chromosomeField": "Chromosome", + "genomicFields": ["chromStart", "chromEnd"], + "assembly": "hg38" + } + } + ] + } + ], + "right": [], + "bottom": [], + "gallery": [], + "whole": [] + }, + "initialXDomain": [2510780562, 2540780562], + "initialYDomain": [2510780562, 2540780562], + "zoomFixed": false, + "zoomLimits": [1, null], + "uid": "view-1", + "chromInfoPath": "https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes" + }, + { + "genomePositionSearchBoxVisible": false, + "genomePositionSearchBox": { + "autocompleteServer": "https://higlass.io/api/v1", + "autocompleteId": "P0PLbQMwTYGy-5uPIQid7A", + "chromInfoServer": "https://higlass.io/api/v1", + "chromInfoId": "hg38" + }, + "layout": {"x": 0, "y": 104, "w": 12, "h": 400}, + "tracks": { + "top": [], + "left": [], + "center": [ + { + "type": "combined", + "width": 699, + "height": 400, + "contents": [ + { + "type": "gosling-2d-track", + "width": 700, + "height": 400, + "options": { + "showMousePosition": true, + "mousePositionColor": "#000000", + "fontSize": 24, + "labelPosition": "none", + "labelShowResolution": false, + "labelColor": "black", + "labelBackgroundColor": "white", + "labelTextOpacity": 1, + "labelLeftMargin": 1, + "labelTopMargin": 1, + "labelRightMargin": 0, + "labelBottomMargin": 0, + "backgroundColor": "transparent", + "spec": { + "layout": "linear", + "xDomain": {"chromosome": "1"}, + "assembly": "hg38", + "orientation": "horizontal", + "static": false, + "centerRadius": 0.3, + "xOffset": 0, + "yOffset": 0, + "style": {"outlineWidth": 0}, + "data": { + "url": "https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt", + "type": "csv", + "headerNames": ["id", "chr", "p1", "p2"], + "chromosomePrefix": "hs", + "chromosomeField": "chr", + "genomicFields": ["p1", "p2"], + "separator": " ", + "longToWideId": "id" + }, + "mark": "betweenLink", + "x": { + "field": "p1", + "type": "genomic", + "axis": "none", + "linkingId": "top", + "domain": {"chromosome": "1"} + }, + "xe": {"field": "p2", "type": "genomic"}, + "x1": { + "field": "p1_2", + "type": "genomic", + "linkingId": "bottom" + }, + "x1e": {"field": "p2_2", "type": "genomic"}, + "stroke": { + "field": "chr", + "type": "nominal", + "domain": [ + "chr1", + "chr2", + "chr3", + "chr4", + "chr5", + "chr6", + "chr7", + "chr8", + "chr9", + "chr10", + "chr11", + "chr12", + "chr13", + "chr14", + "chr15", + "chr16", + "chr17", + "chr18", + "chr19", + "chr20", + "chr21", + "chr22", + "chrX", + "chrY" + ] + }, + "opacity": {"value": 0.5}, + "width": 700, + "height": 400, + "overlayOnPreviousTrack": false + }, + "theme": { + "base": "light", + "root": { + "background": "white", + "titleColor": "black", + "titleBackgroundColor": "transparent", + "titleFontSize": 18, + "titleFontFamily": "Arial", + "titleAlign": "left", + "titleFontWeight": "bold", + "subtitleColor": "gray", + "subtitleBackgroundColor": "transparent", + "subtitleFontSize": 16, + "subtitleFontFamily": "Arial", + "subtitleFontWeight": "normal", + "subtitleAlign": "left", + "mousePositionColor": "#000000" + }, + "track": { + "background": "transparent", + "alternatingBackground": "transparent", + "titleColor": "black", + "titleBackground": "white", + "titleFontSize": 24, + "titleAlign": "left", + "outline": "black", + "outlineWidth": 1 + }, + "legend": { + "position": "top", + "background": "white", + "backgroundOpacity": 0.7, + "labelColor": "black", + "labelFontSize": 12, + "labelFontWeight": "normal", + "labelFontFamily": "Arial", + "backgroundStroke": "#DBDBDB", + "tickColor": "black" + }, + "axis": { + "tickColor": "black", + "labelColor": "black", + "labelFontSize": 12, + "labelFontWeight": "normal", + "labelFontFamily": "Arial", + "baselineColor": "black", + "gridColor": "#E3E3E3", + "gridStrokeWidth": 1, + "gridStrokeType": "solid", + "gridStrokeDash": [4, 4] + }, + "markCommon": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "point": { + "color": "#E79F00", + "size": 3, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "rect": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "triangle": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "area": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "line": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "bar": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "rule": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 1, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "link": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 1, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "text": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6], + "textAnchor": "middle", + "textFontWeight": "normal" + }, + "brush": { + "color": "gray", + "size": 1, + "stroke": "black", + "strokeWidth": 1, + "opacity": 0.3, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + } + } + }, + "data": { + "url": "https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt", + "type": "csv", + "headerNames": ["id", "chr", "p1", "p2"], + "chromosomePrefix": "hs", + "chromosomeField": "chr", + "genomicFields": ["p1", "p2"], + "separator": " ", + "longToWideId": "id", + "assembly": "hg38" + } + } + ] + } + ], + "right": [], + "bottom": [], + "gallery": [], + "whole": [] + }, + "initialXDomain": [1, 248956422], + "initialYDomain": [0, 3088269832], + "zoomFixed": false, + "zoomLimits": [1, null], + "uid": "view-2", + "chromInfoPath": "https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes" + }, + { + "genomePositionSearchBoxVisible": false, + "genomePositionSearchBox": { + "autocompleteServer": "https://higlass.io/api/v1", + "autocompleteId": "P0PLbQMwTYGy-5uPIQid7A", + "chromInfoServer": "https://higlass.io/api/v1", + "chromInfoId": "hg38" }, - { - genomePositionSearchBoxVisible: false, - genomePositionSearchBox: { - autocompleteServer: 'https://higlass.io/api/v1', - autocompleteId: 'P0PLbQMwTYGy-5uPIQid7A', - chromInfoServer: 'https://higlass.io/api/v1', - chromInfoId: 'hg38' - }, - layout: { x: 6.8, y: 0, w: 5.2, h: 600 }, - tracks: { - top: [], - left: [ - { - type: 'combined', - width: 130, - height: 600, - contents: [ + "layout": {"x": 0, "y": 514, "w": 12, "h": 44}, + "tracks": { + "top": [], + "left": [], + "center": [ + { + "type": "combined", + "width": 699, + "height": 14, + "contents": [ + { + "type": "gosling-track", + "width": 700, + "height": 14, + "options": { + "showMousePosition": true, + "mousePositionColor": "#000000", + "fontSize": 24, + "labelPosition": "none", + "labelShowResolution": false, + "labelColor": "black", + "labelBackgroundColor": "white", + "labelTextOpacity": 1, + "labelLeftMargin": 1, + "labelTopMargin": 1, + "labelRightMargin": 0, + "labelBottomMargin": 0, + "backgroundColor": "transparent", + "spec": { + "data": { + "url": "https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/UCSC.HG38.Human.CytoBandIdeogram.csv", + "type": "csv", + "chromosomeField": "Chromosome", + "genomicFields": ["chromStart", "chromEnd"] + }, + "x": { + "field": "chromStart", + "type": "genomic", + "axis": "bottom", + "domain": {"chromosome": "3"}, + "linkingId": "bottom" + }, + "xe": {"field": "chromEnd", "type": "genomic"}, + "color": {"value": "white"}, + "size": {"value": 14}, + "stroke": {"value": "black"}, + "strokeWidth": {"value": 0.5}, + "width": 700, + "height": 44, + "overlay": [ + { + "mark": "rect", + "dataTransform": [ { - type: 'gosling-track', - server: 'https://server.gosling-lang.org/api/v1/', - tilesetUid: 'cistrome-multivec', - width: 130, - height: 600, - options: { - showMousePosition: true, - mousePositionColor: '#000000', - fontSize: 24, - labelPosition: 'none', - labelShowResolution: false, - labelColor: 'black', - labelBackgroundColor: 'white', - labelTextOpacity: 1, - labelLeftMargin: 1, - labelTopMargin: 1, - labelRightMargin: 0, - labelBottomMargin: 0, - backgroundColor: 'transparent', - spec: { - spacing: 10, - orientation: 'vertical', - assembly: 'hg38', - layout: 'linear', - static: false, - xDomain: { interval: [0, 1000000000] }, - centerRadius: 0.3, - xOffset: 0, - yOffset: 0, - style: { outlineWidth: 0.5 }, - data: { - url: - 'https://server.gosling-lang.org/api/v1/tileset_info/?d=cistrome-multivec', - type: 'multivec', - row: 'sample', - column: 'position', - value: 'peak', - categories: ['sample 1', 'sample 2', 'sample 3', 'sample 4'], - binSize: 4 - }, - mark: 'rect', - x: { - field: 'start', - type: 'genomic', - domain: { interval: [0, 1000000000] }, - linkingId: '7f94b74e-25ec-4e67-8c75-3dc0f1b0d6bd' - }, - xe: { field: 'end', type: 'genomic' }, - row: { - field: 'sample', - type: 'nominal', - legend: true - }, - color: { - field: 'peak', - type: 'quantitative', - legend: true - }, - tooltip: [ - { - field: 'start', - type: 'genomic', - alt: 'Start Position' - }, - { - field: 'end', - type: 'genomic', - alt: 'End Position' - }, - { - field: 'peak', - type: 'quantitative', - alt: 'Value', - format: '.2' - }, - { field: 'sample', type: 'nominal', alt: 'Sample' } - ], - width: 130, - height: 600 - }, - theme: { - base: 'light', - root: { - background: 'white', - titleColor: 'black', - titleBackgroundColor: 'transparent', - titleFontSize: 18, - titleFontFamily: 'Arial', - titleAlign: 'left', - titleFontWeight: 'bold', - subtitleColor: 'gray', - subtitleBackgroundColor: 'transparent', - subtitleFontSize: 16, - subtitleFontFamily: 'Arial', - subtitleFontWeight: 'normal', - subtitleAlign: 'left', - mousePositionColor: '#000000' - }, - track: { - background: 'transparent', - alternatingBackground: 'transparent', - titleColor: 'black', - titleBackground: 'white', - titleFontSize: 24, - titleAlign: 'left', - outline: 'black', - outlineWidth: 1 - }, - legend: { - position: 'top', - background: 'white', - backgroundOpacity: 0.7, - labelColor: 'black', - labelFontSize: 12, - labelFontWeight: 'normal', - labelFontFamily: 'Arial', - backgroundStroke: '#DBDBDB', - tickColor: 'black' - }, - axis: { - tickColor: 'black', - labelColor: 'black', - labelFontSize: 12, - labelFontWeight: 'normal', - labelFontFamily: 'Arial', - baselineColor: 'black', - gridColor: '#E3E3E3', - gridStrokeWidth: 1, - gridStrokeType: 'solid', - gridStrokeDash: [4, 4] - }, - markCommon: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - point: { - color: '#E79F00', - size: 3, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - rect: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - triangle: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - area: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - line: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - bar: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - rule: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 1, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - link: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 1, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - }, - text: { - color: '#E79F00', - size: 1, - stroke: 'black', - strokeWidth: 0, - opacity: 1, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6], - textAnchor: 'middle', - textFontWeight: 'normal' - }, - brush: { - color: 'gray', - size: 1, - stroke: 'black', - strokeWidth: 1, - opacity: 0.3, - nominalColorRange: [ - '#E79F00', - '#029F73', - '#0072B2', - '#CB7AA7', - '#D45E00', - '#57B4E9', - '#EFE441' - ], - quantitativeSizeRange: [2, 6] - } - } - } + "type": "filter", + "field": "Stain", + "oneOf": ["acen"], + "not": true } - ] + ], + "style": {"outlineWidth": 0} + }, + { + "mark": "triangleRight", + "dataTransform": [ + { + "type": "filter", + "field": "Stain", + "oneOf": ["acen"] + }, + {"type": "filter", "field": "Name", "include": "q"} + ], + "style": {"outlineWidth": 0} + }, + { + "mark": "triangleLeft", + "dataTransform": [ + { + "type": "filter", + "field": "Stain", + "oneOf": ["acen"] + }, + {"type": "filter", "field": "Name", "include": "p"} + ], + "style": {"outlineWidth": 0} + } + ], + "assembly": "hg38", + "layout": "linear", + "orientation": "horizontal", + "static": false, + "style": {"outlineWidth": 0}, + "overlayOnPreviousTrack": false + }, + "theme": { + "base": "light", + "root": { + "background": "white", + "titleColor": "black", + "titleBackgroundColor": "transparent", + "titleFontSize": 18, + "titleFontFamily": "Arial", + "titleAlign": "left", + "titleFontWeight": "bold", + "subtitleColor": "gray", + "subtitleBackgroundColor": "transparent", + "subtitleFontSize": 16, + "subtitleFontFamily": "Arial", + "subtitleFontWeight": "normal", + "subtitleAlign": "left", + "mousePositionColor": "#000000" + }, + "track": { + "background": "transparent", + "alternatingBackground": "transparent", + "titleColor": "black", + "titleBackground": "white", + "titleFontSize": 24, + "titleAlign": "left", + "outline": "black", + "outlineWidth": 1 + }, + "legend": { + "position": "top", + "background": "white", + "backgroundOpacity": 0.7, + "labelColor": "black", + "labelFontSize": 12, + "labelFontWeight": "normal", + "labelFontFamily": "Arial", + "backgroundStroke": "#DBDBDB", + "tickColor": "black" + }, + "axis": { + "tickColor": "black", + "labelColor": "black", + "labelFontSize": 12, + "labelFontWeight": "normal", + "labelFontFamily": "Arial", + "baselineColor": "black", + "gridColor": "#E3E3E3", + "gridStrokeWidth": 1, + "gridStrokeType": "solid", + "gridStrokeDash": [4, 4] + }, + "markCommon": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "point": { + "color": "#E79F00", + "size": 3, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "rect": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "triangle": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "area": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "line": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "bar": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "rule": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 1, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "link": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 1, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "text": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6], + "textAnchor": "middle", + "textFontWeight": "normal" + }, + "brush": { + "color": "gray", + "size": 1, + "stroke": "black", + "strokeWidth": 1, + "opacity": 0.3, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + } } - ], - center: [], - right: [], - bottom: [], - gallery: [], - whole: [] - }, - initialXDomain: [0, 1000000000], - initialYDomain: [0, 1000000000], - zoomFixed: false, - zoomLimits: [1, null], - uid: '154b1b40-f6fb-11eb-914b-976b6ecda162' - } + }, + "data": { + "url": "https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/UCSC.HG38.Human.CytoBandIdeogram.csv", + "type": "csv", + "chromosomeField": "Chromosome", + "genomicFields": ["chromStart", "chromEnd"], + "assembly": "hg38" + } + } + ] + } + ], + "right": [], + "bottom": [ + { + "uid": "dbf196a0-fc48-11eb-b136-51c77f658267", + "type": "axis-track", + "chromInfoPath": "https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes", + "options": { + "layout": "linear", + "outerRadius": null, + "width": 700, + "height": 44, + "theme": { + "base": "light", + "root": { + "background": "white", + "titleColor": "black", + "titleBackgroundColor": "transparent", + "titleFontSize": 18, + "titleFontFamily": "Arial", + "titleAlign": "left", + "titleFontWeight": "bold", + "subtitleColor": "gray", + "subtitleBackgroundColor": "transparent", + "subtitleFontSize": 16, + "subtitleFontFamily": "Arial", + "subtitleFontWeight": "normal", + "subtitleAlign": "left", + "mousePositionColor": "#000000" + }, + "track": { + "background": "transparent", + "alternatingBackground": "transparent", + "titleColor": "black", + "titleBackground": "white", + "titleFontSize": 24, + "titleAlign": "left", + "outline": "black", + "outlineWidth": 1 + }, + "legend": { + "position": "top", + "background": "white", + "backgroundOpacity": 0.7, + "labelColor": "black", + "labelFontSize": 12, + "labelFontWeight": "normal", + "labelFontFamily": "Arial", + "backgroundStroke": "#DBDBDB", + "tickColor": "black" + }, + "axis": { + "tickColor": "black", + "labelColor": "black", + "labelFontSize": 12, + "labelFontWeight": "normal", + "labelFontFamily": "Arial", + "baselineColor": "black", + "gridColor": "#E3E3E3", + "gridStrokeWidth": 1, + "gridStrokeType": "solid", + "gridStrokeDash": [4, 4] + }, + "markCommon": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "point": { + "color": "#E79F00", + "size": 3, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "rect": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "triangle": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "area": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "line": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "bar": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "rule": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 1, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "link": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 1, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + }, + "text": { + "color": "#E79F00", + "size": 1, + "stroke": "black", + "strokeWidth": 0, + "opacity": 1, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6], + "textAnchor": "middle", + "textFontWeight": "normal" + }, + "brush": { + "color": "gray", + "size": 1, + "stroke": "black", + "strokeWidth": 1, + "opacity": 0.3, + "nominalColorRange": [ + "#E79F00", + "#029F73", + "#0072B2", + "#CB7AA7", + "#D45E00", + "#57B4E9", + "#EFE441" + ], + "quantitativeSizeRange": [2, 6] + } + }, + "assembly": "hg38", + "stroke": "transparent", + "color": "black", + "fontSize": 12, + "fontFamily": "Arial", + "fontWeight": "normal", + "tickColor": "black", + "tickFormat": "plain", + "tickPositions": "even", + "reverseOrientation": true + }, + "height": 30 + } + ], + "gallery": [], + "whole": [] + }, + "initialXDomain": [491149952, 689445510], + "initialYDomain": [491149952, 689445510], + "zoomFixed": false, + "zoomLimits": [1, null], + "uid": "view-3" + } ], - zoomLocks: { locksByViewUid: {}, locksDict: {} }, - locationLocks: { locksByViewUid: {}, locksDict: {} }, - editable: false, - chromInfoPath: 'https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes' -}; + "zoomLocks": { + "locksByViewUid": { + "view-1": "top", + // "view-2": "bottom", + "view-3": "bottom" + }, + "locksDict": { + "top": { + "uid": "top", + "view-1": [ + 124625310.5, + 124625310.5, + 249250.621 + ], + "view-3": [ + 124625310.5, + 124625310.5, + 249250.621 + ] + }, + "bottom": { + "uid": "bottom", + "view-1": [ + 124625310.5, + 124625310.5, + 249250.621 + ], + "view-3": [ + 124625310.5, + 124625310.5, + 249250.621 + ] + } + } + }, + "locationLocks": { + "locksByViewUid": { + "view-1": { "x": { "lock": "top", "axis": "x" } }, + "view-2": { "x": { "lock": "bottom", "axis": "x" }, "x": { "lock": "top", "axis": "y" } }, + "view-3": { "y": { "lock": "bottom", "axis": "x" } }, + }, + "locksDict": { + "top": { + "uid": "top", + "view-1": [ + 124625310.5, + 124625310.5, + 249250.621 + ], + "view-2": [ + 124625310.5, + 124625310.5, + 249250.621 + ] + }, + "bottom": { + "uid": "bottom", + "view-2": [ + 124625310.5, + 124625310.5, + 249250.621 + ], + "view-3": [ + 124625310.5, + 124625310.5, + 249250.621 + ] + } + } + }, + "editable": false, + "chromInfoPath": "https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes" + }; export default example; diff --git a/src/core/gosling-to-higlass.ts b/src/core/gosling-to-higlass.ts index 94e2b33b4..f0ea7ebe2 100644 --- a/src/core/gosling-to-higlass.ts +++ b/src/core/gosling-to-higlass.ts @@ -239,8 +239,5 @@ export function goslingToHiGlass( } } - // Uncomment the following code to test with specific HiGlass viewConfig - // hgModel.setExampleHiglassViewConfig(); - return hgModel; } diff --git a/src/core/layout/higlass.ts b/src/core/layout/higlass.ts index 98c021ee2..33af5370e 100644 --- a/src/core/layout/higlass.ts +++ b/src/core/layout/higlass.ts @@ -68,5 +68,8 @@ export function renderHiGlass( }); }); + // !! Uncomment the following code to test with specific HiGlass viewConfig + hgModel.setExampleHiglassViewConfig(); + setHg(hgModel.spec(), getBoundingBox(trackInfos)); } diff --git a/src/core/mark/index.ts b/src/core/mark/index.ts index 86528b43a..89de0a5b5 100644 --- a/src/core/mark/index.ts +++ b/src/core/mark/index.ts @@ -62,10 +62,14 @@ export function drawMark(HGC: any, trackInfo: any, tile: any, model: GoslingTrac // console.log(trackInfo._xScale.domain(), trackInfo._yScale.domain(), (model.getChannelScale('x') as any)?.domain(), (model.getChannelScale('y') as any)?.domain()); // Replace the scale of a genomic axis with the one that is generated by the HiGlass data fetcher. - ['x', 'x1', 'x1e', 'xe'].forEach((d: any) => { + ['x', 'xe', 'x1', 'x1e'].forEach((d: any) => { // const c = tm.spec()[d as keyof typeof ChannelTypes]; // if(IsChannelDeep(c) && c.type === 'genomic') { - model.setChannelScale(d, trackInfo._xScale); + if(Is2DTrack(model.spec()) && model.spec().mark === 'betweenLink' && (d === 'x1' || d === 'x1e')) { + model.setChannelScale(d, trackInfo._yScale); + } else { + model.setChannelScale(d, trackInfo._xScale); + } // } }); diff --git a/src/editor/example/give.ts b/src/editor/example/give.ts index 21bfa2ae5..e46f37a98 100644 --- a/src/editor/example/give.ts +++ b/src/editor/example/give.ts @@ -9,124 +9,125 @@ export const EX_SPEC_GIVE: GoslingSpec = { { xLinkingId: 'top', layout: 'linear', + xDomain: { chromosome: '1'}, tracks: [ - { - alignment: 'overlay', - title: 'Genes', - data: { - url: 'https://resgen.io/api/v1/tileset_info/?d=M9A9klpwTci5Vf4bHZ864g', - type: 'beddb', - genomicFields: [ - { index: 1, name: 'start' }, - { index: 2, name: 'end' } - ], - valueFields: [ - { index: 5, name: 'strand', type: 'nominal' }, - { index: 3, name: 'name', type: 'nominal' } - ], - exonIntervalFields: [ - { index: 12, name: 'start' }, - { index: 13, name: 'end' } - ] - }, - tracks: [ - { - dataTransform: [ - { type: 'filter', field: 'type', oneOf: ['gene'] }, - { type: 'filter', field: 'strand', oneOf: ['+'] } - ], - mark: 'rect', - x: { - field: 'end', - type: 'genomic', - domain: { chromosome: '17', interval: [200000, 800000] }, - axis: 'top' - }, - size: { value: 7 } - }, - { - dataTransform: [ - { type: 'filter', field: 'type', oneOf: ['gene'] }, - { type: 'filter', field: 'strand', oneOf: ['-'] } - ], - mark: 'rect', - x: { field: 'start', type: 'genomic' }, - size: { value: 7 } - }, - { - dataTransform: [{ type: 'filter', field: 'type', oneOf: ['exon'] }], - mark: 'rect', - x: { field: 'start', type: 'genomic' }, - xe: { field: 'end', type: 'genomic' }, - size: { value: 14 } - }, - { - dataTransform: [{ type: 'filter', field: 'type', oneOf: ['gene'] }], - mark: 'rule', - x: { field: 'start', type: 'genomic' }, - xe: { field: 'end', type: 'genomic' }, - strokeWidth: { value: 3 } - } - ], - row: { field: 'strand', type: 'nominal', domain: ['+', '-'] }, - color: { value: '#4050B4' }, - width: 700, - height: 50 - }, - { - data: { - url: 'https://resgen.io/api/v1/tileset_info/?d=Zz3CBDSqQ3ySrOSe2yj1eg', - type: 'vector', - column: 'position', - value: 'peak', - binSize: 4 - }, - mark: 'bar', - x: { field: 'start', type: 'genomic' }, - xe: { field: 'end', type: 'genomic' }, - y: { field: 'peak', type: 'quantitative' }, - color: { value: '#8A96D5' }, - stroke: { value: '#3C4DB4' }, - strokeWidth: { value: 0.5 }, - width: 700, - height: 40 - }, - { - data: { - url: 'https://resgen.io/api/v1/tileset_info/?d=dc_SOjdCRgq_8PYf6W--7w', - type: 'vector', - column: 'position', - value: 'peak', - binSize: 4 - }, - mark: 'bar', - x: { field: 'start', type: 'genomic' }, - xe: { field: 'end', type: 'genomic' }, - y: { field: 'peak', type: 'quantitative' }, - color: { value: '#8A96D5' }, - stroke: { value: '#3C4DB4' }, - strokeWidth: { value: 0.5 }, - width: 700, - height: 40 - }, - { - data: { - url: 'https://resgen.io/api/v1/tileset_info/?d=Nolbrk9kS3CE0jJL_7OW1g', - type: 'vector', - column: 'position', - value: 'peak', - binSize: 4 - }, - mark: 'bar', - x: { field: 'start', type: 'genomic' }, - xe: { field: 'end', type: 'genomic' }, - y: { field: 'peak', type: 'quantitative' }, - color: { value: '#8A96D5' }, - stroke: { value: '#3C4DB4' }, - strokeWidth: { value: 0.5 }, - width: 700, - height: 40 - }, + // { + // alignment: 'overlay', + // title: 'Genes', + // data: { + // url: 'https://resgen.io/api/v1/tileset_info/?d=M9A9klpwTci5Vf4bHZ864g', + // type: 'beddb', + // genomicFields: [ + // { index: 1, name: 'start' }, + // { index: 2, name: 'end' } + // ], + // valueFields: [ + // { index: 5, name: 'strand', type: 'nominal' }, + // { index: 3, name: 'name', type: 'nominal' } + // ], + // exonIntervalFields: [ + // { index: 12, name: 'start' }, + // { index: 13, name: 'end' } + // ] + // }, + // tracks: [ + // { + // dataTransform: [ + // { type: 'filter', field: 'type', oneOf: ['gene'] }, + // { type: 'filter', field: 'strand', oneOf: ['+'] } + // ], + // mark: 'rect', + // x: { + // field: 'end', + // type: 'genomic', + // domain: { chromosome: '17', interval: [200000, 800000] }, + // axis: 'top' + // }, + // size: { value: 7 } + // }, + // { + // dataTransform: [ + // { type: 'filter', field: 'type', oneOf: ['gene'] }, + // { type: 'filter', field: 'strand', oneOf: ['-'] } + // ], + // mark: 'rect', + // x: { field: 'start', type: 'genomic' }, + // size: { value: 7 } + // }, + // { + // dataTransform: [{ type: 'filter', field: 'type', oneOf: ['exon'] }], + // mark: 'rect', + // x: { field: 'start', type: 'genomic' }, + // xe: { field: 'end', type: 'genomic' }, + // size: { value: 14 } + // }, + // { + // dataTransform: [{ type: 'filter', field: 'type', oneOf: ['gene'] }], + // mark: 'rule', + // x: { field: 'start', type: 'genomic' }, + // xe: { field: 'end', type: 'genomic' }, + // strokeWidth: { value: 3 } + // } + // ], + // row: { field: 'strand', type: 'nominal', domain: ['+', '-'] }, + // color: { value: '#4050B4' }, + // width: 700, + // height: 50 + // }, + // { + // data: { + // url: 'https://resgen.io/api/v1/tileset_info/?d=Zz3CBDSqQ3ySrOSe2yj1eg', + // type: 'vector', + // column: 'position', + // value: 'peak', + // binSize: 4 + // }, + // mark: 'bar', + // x: { field: 'start', type: 'genomic' }, + // xe: { field: 'end', type: 'genomic' }, + // y: { field: 'peak', type: 'quantitative' }, + // color: { value: '#8A96D5' }, + // stroke: { value: '#3C4DB4' }, + // strokeWidth: { value: 0.5 }, + // width: 700, + // height: 40 + // }, + // { + // data: { + // url: 'https://resgen.io/api/v1/tileset_info/?d=dc_SOjdCRgq_8PYf6W--7w', + // type: 'vector', + // column: 'position', + // value: 'peak', + // binSize: 4 + // }, + // mark: 'bar', + // x: { field: 'start', type: 'genomic' }, + // xe: { field: 'end', type: 'genomic' }, + // y: { field: 'peak', type: 'quantitative' }, + // color: { value: '#8A96D5' }, + // stroke: { value: '#3C4DB4' }, + // strokeWidth: { value: 0.5 }, + // width: 700, + // height: 40 + // }, + // { + // data: { + // url: 'https://resgen.io/api/v1/tileset_info/?d=Nolbrk9kS3CE0jJL_7OW1g', + // type: 'vector', + // column: 'position', + // value: 'peak', + // binSize: 4 + // }, + // mark: 'bar', + // x: { field: 'start', type: 'genomic' }, + // xe: { field: 'end', type: 'genomic' }, + // y: { field: 'peak', type: 'quantitative' }, + // color: { value: '#8A96D5' }, + // stroke: { value: '#3C4DB4' }, + // strokeWidth: { value: 0.5 }, + // width: 700, + // height: 40 + // }, { alignment: 'overlay', data: { @@ -176,61 +177,62 @@ export const EX_SPEC_GIVE: GoslingSpec = { width: 700, height: 14 }, - { - data: { - url: 'https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt', - type: 'csv', - headerNames: ['id', 'chr', 'p1', 'p2'], - chromosomePrefix: 'hs', - chromosomeField: 'chr', - genomicFields: ['p1', 'p2'], - separator: ' ', - longToWideId: 'id' - }, - dataTransform: [{ type: 'filter', field: 'chr', oneOf: ['hs17'] }], - mark: 'rect', - x: { field: 'p1', type: 'genomic' }, - xe: { field: 'p2', type: 'genomic' }, - color: { - field: 'chr_2', - type: 'nominal', - domain: [ - 'chr1', - 'chr2', - 'chr3', - 'chr4', - 'chr5', - 'chr6', - 'chr7', - 'chr8', - 'chr9', - 'chr10', - 'chr11', - 'chr12', - 'chr13', - 'chr14', - 'chr15', - 'chr16', - 'chr17', - 'chr18', - 'chr19', - 'chr20', - 'chr21', - 'chr22', - 'chrX', - 'chrY' - ] - }, - opacity: { value: 0.5 }, - size: { value: 14 }, - overlayOnPreviousTrack: true, - width: 700, - height: 14 - } + // { + // data: { + // url: 'https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt', + // type: 'csv', + // headerNames: ['id', 'chr', 'p1', 'p2'], + // chromosomePrefix: 'hs', + // chromosomeField: 'chr', + // genomicFields: ['p1', 'p2'], + // separator: ' ', + // longToWideId: 'id' + // }, + // dataTransform: [{ type: 'filter', field: 'chr', oneOf: ['hs17'] }], + // mark: 'rect', + // x: { field: 'p1', type: 'genomic' }, + // xe: { field: 'p2', type: 'genomic' }, + // color: { + // field: 'chr_2', + // type: 'nominal', + // domain: [ + // 'chr1', + // 'chr2', + // 'chr3', + // 'chr4', + // 'chr5', + // 'chr6', + // 'chr7', + // 'chr8', + // 'chr9', + // 'chr10', + // 'chr11', + // 'chr12', + // 'chr13', + // 'chr14', + // 'chr15', + // 'chr16', + // 'chr17', + // 'chr18', + // 'chr19', + // 'chr20', + // 'chr21', + // 'chr22', + // 'chrX', + // 'chrY' + // ] + // }, + // opacity: { value: 0.5 }, + // size: { value: 14 }, + // overlayOnPreviousTrack: true, + // width: 700, + // height: 14 + // } ] }, { layout: 'linear', + xDomain: { chromosome: '1'}, tracks: [ { data: { @@ -285,13 +287,14 @@ export const EX_SPEC_GIVE: GoslingSpec = { }, opacity: { value: 0.5 }, width: 700, - height: 100 + height: 600 } ] }, { xLinkingId: 'bottom', layout: 'linear', + xDomain: { chromosome: '3'}, tracks: [ { alignment: 'overlay', @@ -329,7 +332,7 @@ export const EX_SPEC_GIVE: GoslingSpec = { ] } ], - x: { field: 'chromStart', type: 'genomic' }, + x: { field: 'chromStart', type: 'genomic', axis: 'bottom' }, xe: { field: 'chromEnd', type: 'genomic' }, color: { value: 'white' }, size: { value: 14 }, @@ -338,177 +341,177 @@ export const EX_SPEC_GIVE: GoslingSpec = { width: 700, height: 14 }, - { - data: { - url: 'https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt', - type: 'csv', - headerNames: ['id', 'chr', 'p1', 'p2'], - chromosomePrefix: 'hs', - chromosomeField: 'chr', - genomicFields: ['p1', 'p2'], - separator: ' ', - longToWideId: 'id' - }, - dataTransform: [{ type: 'filter', field: 'chr_2', oneOf: ['hs1'] }], - mark: 'rect', - x: { field: 'p1_2', type: 'genomic' }, - xe: { field: 'p2_2', type: 'genomic' }, - color: { - field: 'chr', - type: 'nominal', - domain: [ - 'chr1', - 'chr2', - 'chr3', - 'chr4', - 'chr5', - 'chr6', - 'chr7', - 'chr8', - 'chr9', - 'chr10', - 'chr11', - 'chr12', - 'chr13', - 'chr14', - 'chr15', - 'chr16', - 'chr17', - 'chr18', - 'chr19', - 'chr20', - 'chr21', - 'chr22', - 'chrX', - 'chrY' - ] - }, - opacity: { value: 0.5 }, - size: { value: 14 }, - overlayOnPreviousTrack: true, - width: 700, - height: 14 - }, - { - data: { - url: 'https://resgen.io/api/v1/tileset_info/?d=Zz3CBDSqQ3ySrOSe2yj1eg', - type: 'vector', - column: 'position', - value: 'peak', - binSize: 4 - }, - mark: 'bar', - x: { field: 'start', type: 'genomic' }, - xe: { field: 'end', type: 'genomic' }, - y: { field: 'peak', type: 'quantitative' }, - color: { value: '#8A96D5' }, - stroke: { value: '#3C4DB4' }, - strokeWidth: { value: 0.5 }, - width: 700, - height: 40 - }, - { - data: { - url: 'https://resgen.io/api/v1/tileset_info/?d=dc_SOjdCRgq_8PYf6W--7w', - type: 'vector', - column: 'position', - value: 'peak', - binSize: 4 - }, - mark: 'bar', - x: { field: 'start', type: 'genomic' }, - xe: { field: 'end', type: 'genomic' }, - y: { field: 'peak', type: 'quantitative' }, - color: { value: '#8A96D5' }, - stroke: { value: '#3C4DB4' }, - strokeWidth: { value: 0.5 }, - width: 700, - height: 40 - }, - { - data: { - url: 'https://resgen.io/api/v1/tileset_info/?d=Nolbrk9kS3CE0jJL_7OW1g', - type: 'vector', - column: 'position', - value: 'peak', - binSize: 4 - }, - mark: 'bar', - x: { field: 'start', type: 'genomic' }, - xe: { field: 'end', type: 'genomic' }, - y: { field: 'peak', type: 'quantitative' }, - color: { value: '#8A96D5' }, - stroke: { value: '#3C4DB4' }, - strokeWidth: { value: 0.5 }, - width: 700, - height: 40 - }, - { - alignment: 'overlay', - title: 'Genes', - data: { - url: 'https://resgen.io/api/v1/tileset_info/?d=M9A9klpwTci5Vf4bHZ864g', - type: 'beddb', - genomicFields: [ - { index: 1, name: 'start' }, - { index: 2, name: 'end' } - ], - valueFields: [ - { index: 5, name: 'strand', type: 'nominal' }, - { index: 3, name: 'name', type: 'nominal' } - ], - exonIntervalFields: [ - { index: 12, name: 'start' }, - { index: 13, name: 'end' } - ] - }, - tracks: [ - { - dataTransform: [ - { type: 'filter', field: 'type', oneOf: ['gene'] }, - { type: 'filter', field: 'strand', oneOf: ['+'] } - ], - mark: 'rect', - x: { - field: 'end', - type: 'genomic', - domain: { - chromosome: '1', - interval: [109000000, 112000000] - }, - axis: 'bottom' - }, - size: { value: 7 } - }, - { - dataTransform: [ - { type: 'filter', field: 'type', oneOf: ['gene'] }, - { type: 'filter', field: 'strand', oneOf: ['-'] } - ], - mark: 'rect', - x: { field: 'start', type: 'genomic' }, - size: { value: 7 } - }, - { - dataTransform: [{ type: 'filter', field: 'type', oneOf: ['exon'] }], - mark: 'rect', - x: { field: 'start', type: 'genomic' }, - xe: { field: 'end', type: 'genomic' }, - size: { value: 14 } - }, - { - dataTransform: [{ type: 'filter', field: 'type', oneOf: ['gene'] }], - mark: 'rule', - x: { field: 'start', type: 'genomic' }, - xe: { field: 'end', type: 'genomic' }, - strokeWidth: { value: 3 } - } - ], - row: { field: 'strand', type: 'nominal', domain: ['+', '-'] }, - color: { value: '#4050B4' }, - width: 700, - height: 50 - } + // { + // data: { + // url: 'https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt', + // type: 'csv', + // headerNames: ['id', 'chr', 'p1', 'p2'], + // chromosomePrefix: 'hs', + // chromosomeField: 'chr', + // genomicFields: ['p1', 'p2'], + // separator: ' ', + // longToWideId: 'id' + // }, + // dataTransform: [{ type: 'filter', field: 'chr_2', oneOf: ['hs1'] }], + // mark: 'rect', + // x: { field: 'p1_2', type: 'genomic' }, + // xe: { field: 'p2_2', type: 'genomic' }, + // color: { + // field: 'chr', + // type: 'nominal', + // domain: [ + // 'chr1', + // 'chr2', + // 'chr3', + // 'chr4', + // 'chr5', + // 'chr6', + // 'chr7', + // 'chr8', + // 'chr9', + // 'chr10', + // 'chr11', + // 'chr12', + // 'chr13', + // 'chr14', + // 'chr15', + // 'chr16', + // 'chr17', + // 'chr18', + // 'chr19', + // 'chr20', + // 'chr21', + // 'chr22', + // 'chrX', + // 'chrY' + // ] + // }, + // opacity: { value: 0.5 }, + // size: { value: 14 }, + // overlayOnPreviousTrack: true, + // width: 700, + // height: 14 + // }, + // { + // data: { + // url: 'https://resgen.io/api/v1/tileset_info/?d=Zz3CBDSqQ3ySrOSe2yj1eg', + // type: 'vector', + // column: 'position', + // value: 'peak', + // binSize: 4 + // }, + // mark: 'bar', + // x: { field: 'start', type: 'genomic' }, + // xe: { field: 'end', type: 'genomic' }, + // y: { field: 'peak', type: 'quantitative' }, + // color: { value: '#8A96D5' }, + // stroke: { value: '#3C4DB4' }, + // strokeWidth: { value: 0.5 }, + // width: 700, + // height: 40 + // }, + // { + // data: { + // url: 'https://resgen.io/api/v1/tileset_info/?d=dc_SOjdCRgq_8PYf6W--7w', + // type: 'vector', + // column: 'position', + // value: 'peak', + // binSize: 4 + // }, + // mark: 'bar', + // x: { field: 'start', type: 'genomic' }, + // xe: { field: 'end', type: 'genomic' }, + // y: { field: 'peak', type: 'quantitative' }, + // color: { value: '#8A96D5' }, + // stroke: { value: '#3C4DB4' }, + // strokeWidth: { value: 0.5 }, + // width: 700, + // height: 40 + // }, + // { + // data: { + // url: 'https://resgen.io/api/v1/tileset_info/?d=Nolbrk9kS3CE0jJL_7OW1g', + // type: 'vector', + // column: 'position', + // value: 'peak', + // binSize: 4 + // }, + // mark: 'bar', + // x: { field: 'start', type: 'genomic' }, + // xe: { field: 'end', type: 'genomic' }, + // y: { field: 'peak', type: 'quantitative' }, + // color: { value: '#8A96D5' }, + // stroke: { value: '#3C4DB4' }, + // strokeWidth: { value: 0.5 }, + // width: 700, + // height: 40 + // }, + // { + // alignment: 'overlay', + // title: 'Genes', + // data: { + // url: 'https://resgen.io/api/v1/tileset_info/?d=M9A9klpwTci5Vf4bHZ864g', + // type: 'beddb', + // genomicFields: [ + // { index: 1, name: 'start' }, + // { index: 2, name: 'end' } + // ], + // valueFields: [ + // { index: 5, name: 'strand', type: 'nominal' }, + // { index: 3, name: 'name', type: 'nominal' } + // ], + // exonIntervalFields: [ + // { index: 12, name: 'start' }, + // { index: 13, name: 'end' } + // ] + // }, + // tracks: [ + // { + // dataTransform: [ + // { type: 'filter', field: 'type', oneOf: ['gene'] }, + // { type: 'filter', field: 'strand', oneOf: ['+'] } + // ], + // mark: 'rect', + // x: { + // field: 'end', + // type: 'genomic', + // domain: { + // chromosome: '1', + // interval: [109000000, 112000000] + // }, + // axis: 'bottom' + // }, + // size: { value: 7 } + // }, + // { + // dataTransform: [ + // { type: 'filter', field: 'type', oneOf: ['gene'] }, + // { type: 'filter', field: 'strand', oneOf: ['-'] } + // ], + // mark: 'rect', + // x: { field: 'start', type: 'genomic' }, + // size: { value: 7 } + // }, + // { + // dataTransform: [{ type: 'filter', field: 'type', oneOf: ['exon'] }], + // mark: 'rect', + // x: { field: 'start', type: 'genomic' }, + // xe: { field: 'end', type: 'genomic' }, + // size: { value: 14 } + // }, + // { + // dataTransform: [{ type: 'filter', field: 'type', oneOf: ['gene'] }], + // mark: 'rule', + // x: { field: 'start', type: 'genomic' }, + // xe: { field: 'end', type: 'genomic' }, + // strokeWidth: { value: 3 } + // } + // ], + // row: { field: 'strand', type: 'nominal', domain: ['+', '-'] }, + // color: { value: '#4050B4' }, + // width: 700, + // height: 50 + // } ] } ], diff --git a/src/editor/example/index.ts b/src/editor/example/index.ts index 434a16632..ec3675482 100644 --- a/src/editor/example/index.ts +++ b/src/editor/example/index.ts @@ -38,8 +38,7 @@ export const examples: ReadonlyArray<{ { name: 'Basic Example: Visual Encoding', id: 'VISUAL_ENCODING', - spec: EX_SPEC_VISUAL_ENCODING, - forceShow: true + spec: EX_SPEC_VISUAL_ENCODING }, { name: 'Basic Example: Circular Visual Encoding', From cda34e93e06ac56af35343ebe077f876a4515530 Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Fri, 13 Aug 2021 17:54:45 -0400 Subject: [PATCH 04/34] chore: adjust scales --- schema/gosling.schema.json | 42 + schema/template.schema.json | 3 + src/core/example/hg-view-config-1.ts | 3361 +++++++++++++------------- src/core/gosling-to-higlass.ts | 6 +- src/core/gosling-track-model.ts | 9 +- src/core/higlass-model.ts | 1 + src/core/mark/index.ts | 26 +- src/editor/example/give.ts | 10 +- 8 files changed, 1750 insertions(+), 1708 deletions(-) diff --git a/schema/gosling.schema.json b/schema/gosling.schema.json index 16b1b867f..7b8065f0d 100644 --- a/schema/gosling.schema.json +++ b/schema/gosling.schema.json @@ -553,6 +553,9 @@ "width": { "type": "number" }, + "x1LinkingId": { + "type": "string" + }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, @@ -945,6 +948,9 @@ }, "type": "array" }, + "x1LinkingId": { + "type": "string" + }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, @@ -1659,6 +1665,9 @@ }, "type": "array" }, + "x1LinkingId": { + "type": "string" + }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, @@ -1981,6 +1990,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -2117,6 +2129,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -2589,6 +2604,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -2728,6 +2746,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -2892,6 +2913,9 @@ }, "type": "array" }, + "x1LinkingId": { + "type": "string" + }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, @@ -3090,6 +3114,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -3314,6 +3341,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -3419,6 +3449,9 @@ }, "type": "array" }, + "x1LinkingId": { + "type": "string" + }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, @@ -3604,6 +3637,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -3884,6 +3920,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -4221,6 +4260,9 @@ "width": { "type": "number" }, + "x1LinkingId": { + "type": "string" + }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, diff --git a/schema/template.schema.json b/schema/template.schema.json index 90307d9ea..6fdf5bbd3 100644 --- a/schema/template.schema.json +++ b/schema/template.schema.json @@ -1365,6 +1365,9 @@ "x1": { "$ref": "#/definitions/ChannelWithBase" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/ChannelWithBase" }, diff --git a/src/core/example/hg-view-config-1.ts b/src/core/example/hg-view-config-1.ts index ece0cd97f..47c652e46 100644 --- a/src/core/example/hg-view-config-1.ts +++ b/src/core/example/hg-view-config-1.ts @@ -1,1719 +1,1688 @@ const example = { - "compactLayout": false, - "trackSourceServers": [], - "views": [ - { - "genomePositionSearchBoxVisible": false, - "genomePositionSearchBox": { - "autocompleteServer": "https://higlass.io/api/v1", - "autocompleteId": "P0PLbQMwTYGy-5uPIQid7A", - "chromInfoServer": "https://higlass.io/api/v1", - "chromInfoId": "hg38" - }, - "layout": {"x": 0, "y": 50, "w": 12, "h": 44}, - "tracks": { - "top": [ - { - "uid": "dbed29d0-fc48-11eb-b136-51c77f658267", - "type": "axis-track", - "chromInfoPath": "https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes", - "options": { - "layout": "linear", - "innerRadius": null, - "width": 700, - "height": 44, - "theme": { - "base": "light", - "root": { - "background": "white", - "titleColor": "black", - "titleBackgroundColor": "transparent", - "titleFontSize": 18, - "titleFontFamily": "Arial", - "titleAlign": "left", - "titleFontWeight": "bold", - "subtitleColor": "gray", - "subtitleBackgroundColor": "transparent", - "subtitleFontSize": 16, - "subtitleFontFamily": "Arial", - "subtitleFontWeight": "normal", - "subtitleAlign": "left", - "mousePositionColor": "#000000" - }, - "track": { - "background": "transparent", - "alternatingBackground": "transparent", - "titleColor": "black", - "titleBackground": "white", - "titleFontSize": 24, - "titleAlign": "left", - "outline": "black", - "outlineWidth": 1 - }, - "legend": { - "position": "top", - "background": "white", - "backgroundOpacity": 0.7, - "labelColor": "black", - "labelFontSize": 12, - "labelFontWeight": "normal", - "labelFontFamily": "Arial", - "backgroundStroke": "#DBDBDB", - "tickColor": "black" - }, - "axis": { - "tickColor": "black", - "labelColor": "black", - "labelFontSize": 12, - "labelFontWeight": "normal", - "labelFontFamily": "Arial", - "baselineColor": "black", - "gridColor": "#E3E3E3", - "gridStrokeWidth": 1, - "gridStrokeType": "solid", - "gridStrokeDash": [4, 4] - }, - "markCommon": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "point": { - "color": "#E79F00", - "size": 3, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "rect": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "triangle": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "area": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "line": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "bar": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "rule": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 1, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "link": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 1, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "text": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6], - "textAnchor": "middle", - "textFontWeight": "normal" - }, - "brush": { - "color": "gray", - "size": 1, - "stroke": "black", - "strokeWidth": 1, - "opacity": 0.3, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - } - }, - "assembly": "hg38", - "stroke": "transparent", - "color": "black", - "fontSize": 12, - "fontFamily": "Arial", - "fontWeight": "normal", - "tickColor": "black", - "tickFormat": "plain", - "tickPositions": "even", - "reverseOrientation": false - }, - "height": 30 - } - ], - "left": [], - "center": [ - { - "type": "combined", - "width": 699, - "height": 14, - "contents": [ - { - "type": "gosling-track", - "width": 700, - "height": 14, - "options": { - "showMousePosition": true, - "mousePositionColor": "#000000", - "fontSize": 24, - "labelPosition": "none", - "labelShowResolution": false, - "labelColor": "black", - "labelBackgroundColor": "white", - "labelTextOpacity": 1, - "labelLeftMargin": 1, - "labelTopMargin": 1, - "labelRightMargin": 0, - "labelBottomMargin": 0, - "backgroundColor": "transparent", - "spec": { - "data": { - "url": "https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/UCSC.HG38.Human.CytoBandIdeogram.csv", - "type": "csv", - "chromosomeField": "Chromosome", - "genomicFields": ["chromStart", "chromEnd"] - }, - "x": { - "field": "chromStart", - "type": "genomic", - "domain": { - "chromosome": "17", - "interval": [20000000, 50000000] - }, - "linkingId": "top", - "axis": "top" - }, - "xe": {"field": "chromEnd", "type": "genomic"}, - "color": {"value": "white"}, - "size": {"value": 14}, - "stroke": {"value": "black"}, - "strokeWidth": {"value": 0.5}, - "width": 700, - "height": 44, - "overlay": [ - { - "mark": "rect", - "dataTransform": [ - { - "type": "filter", - "field": "Stain", - "oneOf": ["acen"], - "not": true - } - ], - "style": {"outlineWidth": 0} - }, - { - "mark": "triangleRight", - "dataTransform": [ - { - "type": "filter", - "field": "Stain", - "oneOf": ["acen"] + compactLayout: false, + trackSourceServers: [], + views: [ + { + genomePositionSearchBoxVisible: false, + genomePositionSearchBox: { + autocompleteServer: 'https://higlass.io/api/v1', + autocompleteId: 'P0PLbQMwTYGy-5uPIQid7A', + chromInfoServer: 'https://higlass.io/api/v1', + chromInfoId: 'hg38' + }, + layout: { x: 0, y: 50, w: 12, h: 44 }, + tracks: { + top: [ + { + uid: 'dbed29d0-fc48-11eb-b136-51c77f658267', + type: 'axis-track', + chromInfoPath: 'https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes', + options: { + layout: 'linear', + innerRadius: null, + width: 400, + height: 44, + theme: { + base: 'light', + root: { + background: 'white', + titleColor: 'black', + titleBackgroundColor: 'transparent', + titleFontSize: 18, + titleFontFamily: 'Arial', + titleAlign: 'left', + titleFontWeight: 'bold', + subtitleColor: 'gray', + subtitleBackgroundColor: 'transparent', + subtitleFontSize: 16, + subtitleFontFamily: 'Arial', + subtitleFontWeight: 'normal', + subtitleAlign: 'left', + mousePositionColor: '#000000' + }, + track: { + background: 'transparent', + alternatingBackground: 'transparent', + titleColor: 'black', + titleBackground: 'white', + titleFontSize: 24, + titleAlign: 'left', + outline: 'black', + outlineWidth: 1 + }, + legend: { + position: 'top', + background: 'white', + backgroundOpacity: 0.7, + labelColor: 'black', + labelFontSize: 12, + labelFontWeight: 'normal', + labelFontFamily: 'Arial', + backgroundStroke: '#DBDBDB', + tickColor: 'black' + }, + axis: { + tickColor: 'black', + labelColor: 'black', + labelFontSize: 12, + labelFontWeight: 'normal', + labelFontFamily: 'Arial', + baselineColor: 'black', + gridColor: '#E3E3E3', + gridStrokeWidth: 1, + gridStrokeType: 'solid', + gridStrokeDash: [4, 4] + }, + markCommon: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + point: { + color: '#E79F00', + size: 3, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + rect: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + triangle: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + area: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + line: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + bar: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + rule: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 1, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + link: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 1, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + text: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6], + textAnchor: 'middle', + textFontWeight: 'normal' + }, + brush: { + color: 'gray', + size: 1, + stroke: 'black', + strokeWidth: 1, + opacity: 0.3, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + } }, - {"type": "filter", "field": "Name", "include": "q"} - ], - "style": {"outlineWidth": 0} + assembly: 'hg38', + stroke: 'transparent', + color: 'black', + fontSize: 12, + fontFamily: 'Arial', + fontWeight: 'normal', + tickColor: 'black', + tickFormat: 'plain', + tickPositions: 'even', + reverseOrientation: false }, - { - "mark": "triangleLeft", - "dataTransform": [ + height: 30 + } + ], + left: [], + center: [ + { + type: 'combined', + width: 399, + height: 14, + contents: [ { - "type": "filter", - "field": "Stain", - "oneOf": ["acen"] - }, - {"type": "filter", "field": "Name", "include": "p"} - ], - "style": {"outlineWidth": 0} - } - ], - "assembly": "hg38", - "layout": "linear", - "orientation": "horizontal", - "static": false, - "style": {"outlineWidth": 0}, - "overlayOnPreviousTrack": false - }, - "theme": { - "base": "light", - "root": { - "background": "white", - "titleColor": "black", - "titleBackgroundColor": "transparent", - "titleFontSize": 18, - "titleFontFamily": "Arial", - "titleAlign": "left", - "titleFontWeight": "bold", - "subtitleColor": "gray", - "subtitleBackgroundColor": "transparent", - "subtitleFontSize": 16, - "subtitleFontFamily": "Arial", - "subtitleFontWeight": "normal", - "subtitleAlign": "left", - "mousePositionColor": "#000000" - }, - "track": { - "background": "transparent", - "alternatingBackground": "transparent", - "titleColor": "black", - "titleBackground": "white", - "titleFontSize": 24, - "titleAlign": "left", - "outline": "black", - "outlineWidth": 1 - }, - "legend": { - "position": "top", - "background": "white", - "backgroundOpacity": 0.7, - "labelColor": "black", - "labelFontSize": 12, - "labelFontWeight": "normal", - "labelFontFamily": "Arial", - "backgroundStroke": "#DBDBDB", - "tickColor": "black" - }, - "axis": { - "tickColor": "black", - "labelColor": "black", - "labelFontSize": 12, - "labelFontWeight": "normal", - "labelFontFamily": "Arial", - "baselineColor": "black", - "gridColor": "#E3E3E3", - "gridStrokeWidth": 1, - "gridStrokeType": "solid", - "gridStrokeDash": [4, 4] - }, - "markCommon": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "point": { - "color": "#E79F00", - "size": 3, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "rect": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "triangle": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "area": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "line": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "bar": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "rule": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 1, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "link": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 1, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "text": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6], - "textAnchor": "middle", - "textFontWeight": "normal" - }, - "brush": { - "color": "gray", - "size": 1, - "stroke": "black", - "strokeWidth": 1, - "opacity": 0.3, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - } + type: 'gosling-track', + width: 400, + height: 14, + options: { + showMousePosition: true, + mousePositionColor: '#000000', + fontSize: 24, + labelPosition: 'none', + labelShowResolution: false, + labelColor: 'black', + labelBackgroundColor: 'white', + labelTextOpacity: 1, + labelLeftMargin: 1, + labelTopMargin: 1, + labelRightMargin: 0, + labelBottomMargin: 0, + backgroundColor: 'transparent', + spec: { + data: { + url: + 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/UCSC.HG38.Human.CytoBandIdeogram.csv', + type: 'csv', + chromosomeField: 'Chromosome', + genomicFields: ['chromStart', 'chromEnd'] + }, + x: { + field: 'chromStart', + type: 'genomic', + domain: { + chromosome: '17', + interval: [20000000, 50000000] + }, + linkingId: 'top', + axis: 'top' + }, + xe: { field: 'chromEnd', type: 'genomic' }, + color: { value: 'white' }, + size: { value: 14 }, + stroke: { value: 'black' }, + strokeWidth: { value: 0.5 }, + width: 400, + height: 44, + overlay: [ + { + mark: 'rect', + dataTransform: [ + { + type: 'filter', + field: 'Stain', + oneOf: ['acen'], + not: true + } + ], + style: { outlineWidth: 0 } + }, + { + mark: 'triangleRight', + dataTransform: [ + { + type: 'filter', + field: 'Stain', + oneOf: ['acen'] + }, + { type: 'filter', field: 'Name', include: 'q' } + ], + style: { outlineWidth: 0 } + }, + { + mark: 'triangleLeft', + dataTransform: [ + { + type: 'filter', + field: 'Stain', + oneOf: ['acen'] + }, + { type: 'filter', field: 'Name', include: 'p' } + ], + style: { outlineWidth: 0 } + } + ], + assembly: 'hg38', + layout: 'linear', + orientation: 'horizontal', + static: false, + style: { outlineWidth: 0 }, + overlayOnPreviousTrack: false + }, + theme: { + base: 'light', + root: { + background: 'white', + titleColor: 'black', + titleBackgroundColor: 'transparent', + titleFontSize: 18, + titleFontFamily: 'Arial', + titleAlign: 'left', + titleFontWeight: 'bold', + subtitleColor: 'gray', + subtitleBackgroundColor: 'transparent', + subtitleFontSize: 16, + subtitleFontFamily: 'Arial', + subtitleFontWeight: 'normal', + subtitleAlign: 'left', + mousePositionColor: '#000000' + }, + track: { + background: 'transparent', + alternatingBackground: 'transparent', + titleColor: 'black', + titleBackground: 'white', + titleFontSize: 24, + titleAlign: 'left', + outline: 'black', + outlineWidth: 1 + }, + legend: { + position: 'top', + background: 'white', + backgroundOpacity: 0.7, + labelColor: 'black', + labelFontSize: 12, + labelFontWeight: 'normal', + labelFontFamily: 'Arial', + backgroundStroke: '#DBDBDB', + tickColor: 'black' + }, + axis: { + tickColor: 'black', + labelColor: 'black', + labelFontSize: 12, + labelFontWeight: 'normal', + labelFontFamily: 'Arial', + baselineColor: 'black', + gridColor: '#E3E3E3', + gridStrokeWidth: 1, + gridStrokeType: 'solid', + gridStrokeDash: [4, 4] + }, + markCommon: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + point: { + color: '#E79F00', + size: 3, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + rect: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + triangle: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + area: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + line: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + bar: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + rule: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 1, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + link: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 1, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + text: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6], + textAnchor: 'middle', + textFontWeight: 'normal' + }, + brush: { + color: 'gray', + size: 1, + stroke: 'black', + strokeWidth: 1, + opacity: 0.3, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + } + } + }, + data: { + url: + 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/UCSC.HG38.Human.CytoBandIdeogram.csv', + type: 'csv', + chromosomeField: 'Chromosome', + genomicFields: ['chromStart', 'chromEnd'], + assembly: 'hg38' + } + } + ] } - }, - "data": { - "url": "https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/UCSC.HG38.Human.CytoBandIdeogram.csv", - "type": "csv", - "chromosomeField": "Chromosome", - "genomicFields": ["chromStart", "chromEnd"], - "assembly": "hg38" - } - } - ] - } - ], - "right": [], - "bottom": [], - "gallery": [], - "whole": [] + ], + right: [], + bottom: [], + gallery: [], + whole: [] + }, + initialXDomain: [2510780562, 2540780562], + initialYDomain: [2510780562, 2540780562], + zoomFixed: false, + zoomLimits: [1, null], + uid: 'view-1', + chromInfoPath: 'https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes' }, - "initialXDomain": [2510780562, 2540780562], - "initialYDomain": [2510780562, 2540780562], - "zoomFixed": false, - "zoomLimits": [1, null], - "uid": "view-1", - "chromInfoPath": "https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes" - }, - { - "genomePositionSearchBoxVisible": false, - "genomePositionSearchBox": { - "autocompleteServer": "https://higlass.io/api/v1", - "autocompleteId": "P0PLbQMwTYGy-5uPIQid7A", - "chromInfoServer": "https://higlass.io/api/v1", - "chromInfoId": "hg38" - }, - "layout": {"x": 0, "y": 104, "w": 12, "h": 400}, - "tracks": { - "top": [], - "left": [], - "center": [ - { - "type": "combined", - "width": 699, - "height": 400, - "contents": [ - { - "type": "gosling-2d-track", - "width": 700, - "height": 400, - "options": { - "showMousePosition": true, - "mousePositionColor": "#000000", - "fontSize": 24, - "labelPosition": "none", - "labelShowResolution": false, - "labelColor": "black", - "labelBackgroundColor": "white", - "labelTextOpacity": 1, - "labelLeftMargin": 1, - "labelTopMargin": 1, - "labelRightMargin": 0, - "labelBottomMargin": 0, - "backgroundColor": "transparent", - "spec": { - "layout": "linear", - "xDomain": {"chromosome": "1"}, - "assembly": "hg38", - "orientation": "horizontal", - "static": false, - "centerRadius": 0.3, - "xOffset": 0, - "yOffset": 0, - "style": {"outlineWidth": 0}, - "data": { - "url": "https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt", - "type": "csv", - "headerNames": ["id", "chr", "p1", "p2"], - "chromosomePrefix": "hs", - "chromosomeField": "chr", - "genomicFields": ["p1", "p2"], - "separator": " ", - "longToWideId": "id" - }, - "mark": "betweenLink", - "x": { - "field": "p1", - "type": "genomic", - "axis": "none", - "linkingId": "top", - "domain": {"chromosome": "1"} - }, - "xe": {"field": "p2", "type": "genomic"}, - "x1": { - "field": "p1_2", - "type": "genomic", - "linkingId": "bottom" - }, - "x1e": {"field": "p2_2", "type": "genomic"}, - "stroke": { - "field": "chr", - "type": "nominal", - "domain": [ - "chr1", - "chr2", - "chr3", - "chr4", - "chr5", - "chr6", - "chr7", - "chr8", - "chr9", - "chr10", - "chr11", - "chr12", - "chr13", - "chr14", - "chr15", - "chr16", - "chr17", - "chr18", - "chr19", - "chr20", - "chr21", - "chr22", - "chrX", - "chrY" + { + genomePositionSearchBoxVisible: false, + genomePositionSearchBox: { + autocompleteServer: 'https://higlass.io/api/v1', + autocompleteId: 'P0PLbQMwTYGy-5uPIQid7A', + chromInfoServer: 'https://higlass.io/api/v1', + chromInfoId: 'hg38' + }, + layout: { x: 0, y: 104, w: 12, h: 400 }, + tracks: { + top: [], + left: [], + center: [ + { + type: 'combined', + width: 399, + height: 400, + contents: [ + { + type: 'gosling-2d-track', + width: 400, + height: 400, + options: { + showMousePosition: true, + mousePositionColor: '#000000', + fontSize: 24, + labelPosition: 'none', + labelShowResolution: false, + labelColor: 'black', + labelBackgroundColor: 'white', + labelTextOpacity: 1, + labelLeftMargin: 1, + labelTopMargin: 1, + labelRightMargin: 0, + labelBottomMargin: 0, + backgroundColor: 'transparent', + spec: { + layout: 'linear', + xDomain: { chromosome: '1' }, + assembly: 'hg38', + orientation: 'horizontal', + static: false, + centerRadius: 0.3, + xOffset: 0, + yOffset: 0, + style: { outlineWidth: 0 }, + data: { + url: + 'https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt', + type: 'csv', + headerNames: ['id', 'chr', 'p1', 'p2'], + chromosomePrefix: 'hs', + chromosomeField: 'chr', + genomicFields: ['p1', 'p2'], + separator: ' ', + longToWideId: 'id' + }, + mark: 'betweenLink', + x: { + field: 'p1', + type: 'genomic', + axis: 'none', + linkingId: 'top', + domain: { chromosome: '1' } + }, + xe: { field: 'p2', type: 'genomic' }, + x1: { + field: 'p1_2', + type: 'genomic', + linkingId: 'bottom' + }, + x1e: { field: 'p2_2', type: 'genomic' }, + stroke: { + field: 'chr', + type: 'nominal', + domain: [ + 'chr1', + 'chr2', + 'chr3', + 'chr4', + 'chr5', + 'chr6', + 'chr7', + 'chr8', + 'chr9', + 'chr10', + 'chr11', + 'chr12', + 'chr13', + 'chr14', + 'chr15', + 'chr16', + 'chr17', + 'chr18', + 'chr19', + 'chr20', + 'chr21', + 'chr22', + 'chrX', + 'chrY' + ] + }, + opacity: { value: 0.5 }, + width: 400, + height: 400, + overlayOnPreviousTrack: false + }, + theme: { + base: 'light', + root: { + background: 'white', + titleColor: 'black', + titleBackgroundColor: 'transparent', + titleFontSize: 18, + titleFontFamily: 'Arial', + titleAlign: 'left', + titleFontWeight: 'bold', + subtitleColor: 'gray', + subtitleBackgroundColor: 'transparent', + subtitleFontSize: 16, + subtitleFontFamily: 'Arial', + subtitleFontWeight: 'normal', + subtitleAlign: 'left', + mousePositionColor: '#000000' + }, + track: { + background: 'transparent', + alternatingBackground: 'transparent', + titleColor: 'black', + titleBackground: 'white', + titleFontSize: 24, + titleAlign: 'left', + outline: 'black', + outlineWidth: 1 + }, + legend: { + position: 'top', + background: 'white', + backgroundOpacity: 0.7, + labelColor: 'black', + labelFontSize: 12, + labelFontWeight: 'normal', + labelFontFamily: 'Arial', + backgroundStroke: '#DBDBDB', + tickColor: 'black' + }, + axis: { + tickColor: 'black', + labelColor: 'black', + labelFontSize: 12, + labelFontWeight: 'normal', + labelFontFamily: 'Arial', + baselineColor: 'black', + gridColor: '#E3E3E3', + gridStrokeWidth: 1, + gridStrokeType: 'solid', + gridStrokeDash: [4, 4] + }, + markCommon: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + point: { + color: '#E79F00', + size: 3, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + rect: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + triangle: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + area: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + line: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + bar: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + rule: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 1, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + link: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 1, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + text: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6], + textAnchor: 'middle', + textFontWeight: 'normal' + }, + brush: { + color: 'gray', + size: 1, + stroke: 'black', + strokeWidth: 1, + opacity: 0.3, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + } + } + }, + data: { + url: 'https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt', + type: 'csv', + headerNames: ['id', 'chr', 'p1', 'p2'], + chromosomePrefix: 'hs', + chromosomeField: 'chr', + genomicFields: ['p1', 'p2'], + separator: ' ', + longToWideId: 'id', + assembly: 'hg38' + } + } ] - }, - "opacity": {"value": 0.5}, - "width": 700, - "height": 400, - "overlayOnPreviousTrack": false - }, - "theme": { - "base": "light", - "root": { - "background": "white", - "titleColor": "black", - "titleBackgroundColor": "transparent", - "titleFontSize": 18, - "titleFontFamily": "Arial", - "titleAlign": "left", - "titleFontWeight": "bold", - "subtitleColor": "gray", - "subtitleBackgroundColor": "transparent", - "subtitleFontSize": 16, - "subtitleFontFamily": "Arial", - "subtitleFontWeight": "normal", - "subtitleAlign": "left", - "mousePositionColor": "#000000" - }, - "track": { - "background": "transparent", - "alternatingBackground": "transparent", - "titleColor": "black", - "titleBackground": "white", - "titleFontSize": 24, - "titleAlign": "left", - "outline": "black", - "outlineWidth": 1 - }, - "legend": { - "position": "top", - "background": "white", - "backgroundOpacity": 0.7, - "labelColor": "black", - "labelFontSize": 12, - "labelFontWeight": "normal", - "labelFontFamily": "Arial", - "backgroundStroke": "#DBDBDB", - "tickColor": "black" - }, - "axis": { - "tickColor": "black", - "labelColor": "black", - "labelFontSize": 12, - "labelFontWeight": "normal", - "labelFontFamily": "Arial", - "baselineColor": "black", - "gridColor": "#E3E3E3", - "gridStrokeWidth": 1, - "gridStrokeType": "solid", - "gridStrokeDash": [4, 4] - }, - "markCommon": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "point": { - "color": "#E79F00", - "size": 3, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "rect": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "triangle": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "area": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "line": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "bar": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "rule": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 1, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "link": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 1, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "text": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6], - "textAnchor": "middle", - "textFontWeight": "normal" - }, - "brush": { - "color": "gray", - "size": 1, - "stroke": "black", - "strokeWidth": 1, - "opacity": 0.3, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - } } - }, - "data": { - "url": "https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt", - "type": "csv", - "headerNames": ["id", "chr", "p1", "p2"], - "chromosomePrefix": "hs", - "chromosomeField": "chr", - "genomicFields": ["p1", "p2"], - "separator": " ", - "longToWideId": "id", - "assembly": "hg38" - } - } - ] - } - ], - "right": [], - "bottom": [], - "gallery": [], - "whole": [] - }, - "initialXDomain": [1, 248956422], - "initialYDomain": [0, 3088269832], - "zoomFixed": false, - "zoomLimits": [1, null], - "uid": "view-2", - "chromInfoPath": "https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes" - }, - { - "genomePositionSearchBoxVisible": false, - "genomePositionSearchBox": { - "autocompleteServer": "https://higlass.io/api/v1", - "autocompleteId": "P0PLbQMwTYGy-5uPIQid7A", - "chromInfoServer": "https://higlass.io/api/v1", - "chromInfoId": "hg38" + ], + right: [], + bottom: [], + gallery: [], + whole: [] + }, + initialXDomain: [1, 248956422], + initialYDomain: [0, 3088269832], + zoomFixed: false, + zoomLimits: [1, null], + uid: 'view-2', + chromInfoPath: 'https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes' }, - "layout": {"x": 0, "y": 514, "w": 12, "h": 44}, - "tracks": { - "top": [], - "left": [], - "center": [ - { - "type": "combined", - "width": 699, - "height": 14, - "contents": [ - { - "type": "gosling-track", - "width": 700, - "height": 14, - "options": { - "showMousePosition": true, - "mousePositionColor": "#000000", - "fontSize": 24, - "labelPosition": "none", - "labelShowResolution": false, - "labelColor": "black", - "labelBackgroundColor": "white", - "labelTextOpacity": 1, - "labelLeftMargin": 1, - "labelTopMargin": 1, - "labelRightMargin": 0, - "labelBottomMargin": 0, - "backgroundColor": "transparent", - "spec": { - "data": { - "url": "https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/UCSC.HG38.Human.CytoBandIdeogram.csv", - "type": "csv", - "chromosomeField": "Chromosome", - "genomicFields": ["chromStart", "chromEnd"] - }, - "x": { - "field": "chromStart", - "type": "genomic", - "axis": "bottom", - "domain": {"chromosome": "3"}, - "linkingId": "bottom" - }, - "xe": {"field": "chromEnd", "type": "genomic"}, - "color": {"value": "white"}, - "size": {"value": 14}, - "stroke": {"value": "black"}, - "strokeWidth": {"value": 0.5}, - "width": 700, - "height": 44, - "overlay": [ - { - "mark": "rect", - "dataTransform": [ + { + genomePositionSearchBoxVisible: false, + genomePositionSearchBox: { + autocompleteServer: 'https://higlass.io/api/v1', + autocompleteId: 'P0PLbQMwTYGy-5uPIQid7A', + chromInfoServer: 'https://higlass.io/api/v1', + chromInfoId: 'hg38' + }, + layout: { x: 0, y: 514, w: 12, h: 44 }, + tracks: { + top: [], + left: [], + center: [ + { + type: 'combined', + width: 399, + height: 14, + contents: [ { - "type": "filter", - "field": "Stain", - "oneOf": ["acen"], - "not": true + type: 'gosling-track', + width: 400, + height: 14, + options: { + showMousePosition: true, + mousePositionColor: '#000000', + fontSize: 24, + labelPosition: 'none', + labelShowResolution: false, + labelColor: 'black', + labelBackgroundColor: 'white', + labelTextOpacity: 1, + labelLeftMargin: 1, + labelTopMargin: 1, + labelRightMargin: 0, + labelBottomMargin: 0, + backgroundColor: 'transparent', + spec: { + data: { + url: + 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/UCSC.HG38.Human.CytoBandIdeogram.csv', + type: 'csv', + chromosomeField: 'Chromosome', + genomicFields: ['chromStart', 'chromEnd'] + }, + x: { + field: 'chromStart', + type: 'genomic', + axis: 'bottom', + domain: { chromosome: '3' }, + linkingId: 'bottom' + }, + xe: { field: 'chromEnd', type: 'genomic' }, + color: { value: 'white' }, + size: { value: 14 }, + stroke: { value: 'black' }, + strokeWidth: { value: 0.5 }, + width: 400, + height: 44, + overlay: [ + { + mark: 'rect', + dataTransform: [ + { + type: 'filter', + field: 'Stain', + oneOf: ['acen'], + not: true + } + ], + style: { outlineWidth: 0 } + }, + { + mark: 'triangleRight', + dataTransform: [ + { + type: 'filter', + field: 'Stain', + oneOf: ['acen'] + }, + { type: 'filter', field: 'Name', include: 'q' } + ], + style: { outlineWidth: 0 } + }, + { + mark: 'triangleLeft', + dataTransform: [ + { + type: 'filter', + field: 'Stain', + oneOf: ['acen'] + }, + { type: 'filter', field: 'Name', include: 'p' } + ], + style: { outlineWidth: 0 } + } + ], + assembly: 'hg38', + layout: 'linear', + orientation: 'horizontal', + static: false, + style: { outlineWidth: 0 }, + overlayOnPreviousTrack: false + }, + theme: { + base: 'light', + root: { + background: 'white', + titleColor: 'black', + titleBackgroundColor: 'transparent', + titleFontSize: 18, + titleFontFamily: 'Arial', + titleAlign: 'left', + titleFontWeight: 'bold', + subtitleColor: 'gray', + subtitleBackgroundColor: 'transparent', + subtitleFontSize: 16, + subtitleFontFamily: 'Arial', + subtitleFontWeight: 'normal', + subtitleAlign: 'left', + mousePositionColor: '#000000' + }, + track: { + background: 'transparent', + alternatingBackground: 'transparent', + titleColor: 'black', + titleBackground: 'white', + titleFontSize: 24, + titleAlign: 'left', + outline: 'black', + outlineWidth: 1 + }, + legend: { + position: 'top', + background: 'white', + backgroundOpacity: 0.7, + labelColor: 'black', + labelFontSize: 12, + labelFontWeight: 'normal', + labelFontFamily: 'Arial', + backgroundStroke: '#DBDBDB', + tickColor: 'black' + }, + axis: { + tickColor: 'black', + labelColor: 'black', + labelFontSize: 12, + labelFontWeight: 'normal', + labelFontFamily: 'Arial', + baselineColor: 'black', + gridColor: '#E3E3E3', + gridStrokeWidth: 1, + gridStrokeType: 'solid', + gridStrokeDash: [4, 4] + }, + markCommon: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + point: { + color: '#E79F00', + size: 3, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + rect: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + triangle: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + area: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + line: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + bar: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + rule: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 1, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + link: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 1, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + text: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6], + textAnchor: 'middle', + textFontWeight: 'normal' + }, + brush: { + color: 'gray', + size: 1, + stroke: 'black', + strokeWidth: 1, + opacity: 0.3, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + } + } + }, + data: { + url: + 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/UCSC.HG38.Human.CytoBandIdeogram.csv', + type: 'csv', + chromosomeField: 'Chromosome', + genomicFields: ['chromStart', 'chromEnd'], + assembly: 'hg38' + } } - ], - "style": {"outlineWidth": 0} - }, - { - "mark": "triangleRight", - "dataTransform": [ - { - "type": "filter", - "field": "Stain", - "oneOf": ["acen"] + ] + } + ], + right: [], + bottom: [ + { + uid: 'dbf196a0-fc48-11eb-b136-51c77f658267', + type: 'axis-track', + chromInfoPath: 'https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes', + options: { + layout: 'linear', + outerRadius: null, + width: 400, + height: 44, + theme: { + base: 'light', + root: { + background: 'white', + titleColor: 'black', + titleBackgroundColor: 'transparent', + titleFontSize: 18, + titleFontFamily: 'Arial', + titleAlign: 'left', + titleFontWeight: 'bold', + subtitleColor: 'gray', + subtitleBackgroundColor: 'transparent', + subtitleFontSize: 16, + subtitleFontFamily: 'Arial', + subtitleFontWeight: 'normal', + subtitleAlign: 'left', + mousePositionColor: '#000000' + }, + track: { + background: 'transparent', + alternatingBackground: 'transparent', + titleColor: 'black', + titleBackground: 'white', + titleFontSize: 24, + titleAlign: 'left', + outline: 'black', + outlineWidth: 1 + }, + legend: { + position: 'top', + background: 'white', + backgroundOpacity: 0.7, + labelColor: 'black', + labelFontSize: 12, + labelFontWeight: 'normal', + labelFontFamily: 'Arial', + backgroundStroke: '#DBDBDB', + tickColor: 'black' + }, + axis: { + tickColor: 'black', + labelColor: 'black', + labelFontSize: 12, + labelFontWeight: 'normal', + labelFontFamily: 'Arial', + baselineColor: 'black', + gridColor: '#E3E3E3', + gridStrokeWidth: 1, + gridStrokeType: 'solid', + gridStrokeDash: [4, 4] + }, + markCommon: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + point: { + color: '#E79F00', + size: 3, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + rect: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + triangle: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + area: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + line: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + bar: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + rule: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 1, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + link: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 1, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + }, + text: { + color: '#E79F00', + size: 1, + stroke: 'black', + strokeWidth: 0, + opacity: 1, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6], + textAnchor: 'middle', + textFontWeight: 'normal' + }, + brush: { + color: 'gray', + size: 1, + stroke: 'black', + strokeWidth: 1, + opacity: 0.3, + nominalColorRange: [ + '#E79F00', + '#029F73', + '#0072B2', + '#CB7AA7', + '#D45E00', + '#57B4E9', + '#EFE441' + ], + quantitativeSizeRange: [2, 6] + } }, - {"type": "filter", "field": "Name", "include": "q"} - ], - "style": {"outlineWidth": 0} + assembly: 'hg38', + stroke: 'transparent', + color: 'black', + fontSize: 12, + fontFamily: 'Arial', + fontWeight: 'normal', + tickColor: 'black', + tickFormat: 'plain', + tickPositions: 'even', + reverseOrientation: true }, - { - "mark": "triangleLeft", - "dataTransform": [ - { - "type": "filter", - "field": "Stain", - "oneOf": ["acen"] - }, - {"type": "filter", "field": "Name", "include": "p"} - ], - "style": {"outlineWidth": 0} - } - ], - "assembly": "hg38", - "layout": "linear", - "orientation": "horizontal", - "static": false, - "style": {"outlineWidth": 0}, - "overlayOnPreviousTrack": false - }, - "theme": { - "base": "light", - "root": { - "background": "white", - "titleColor": "black", - "titleBackgroundColor": "transparent", - "titleFontSize": 18, - "titleFontFamily": "Arial", - "titleAlign": "left", - "titleFontWeight": "bold", - "subtitleColor": "gray", - "subtitleBackgroundColor": "transparent", - "subtitleFontSize": 16, - "subtitleFontFamily": "Arial", - "subtitleFontWeight": "normal", - "subtitleAlign": "left", - "mousePositionColor": "#000000" - }, - "track": { - "background": "transparent", - "alternatingBackground": "transparent", - "titleColor": "black", - "titleBackground": "white", - "titleFontSize": 24, - "titleAlign": "left", - "outline": "black", - "outlineWidth": 1 - }, - "legend": { - "position": "top", - "background": "white", - "backgroundOpacity": 0.7, - "labelColor": "black", - "labelFontSize": 12, - "labelFontWeight": "normal", - "labelFontFamily": "Arial", - "backgroundStroke": "#DBDBDB", - "tickColor": "black" - }, - "axis": { - "tickColor": "black", - "labelColor": "black", - "labelFontSize": 12, - "labelFontWeight": "normal", - "labelFontFamily": "Arial", - "baselineColor": "black", - "gridColor": "#E3E3E3", - "gridStrokeWidth": 1, - "gridStrokeType": "solid", - "gridStrokeDash": [4, 4] - }, - "markCommon": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "point": { - "color": "#E79F00", - "size": 3, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "rect": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "triangle": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "area": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "line": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "bar": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "rule": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 1, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "link": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 1, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "text": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6], - "textAnchor": "middle", - "textFontWeight": "normal" - }, - "brush": { - "color": "gray", - "size": 1, - "stroke": "black", - "strokeWidth": 1, - "opacity": 0.3, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - } + height: 30 } - }, - "data": { - "url": "https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/UCSC.HG38.Human.CytoBandIdeogram.csv", - "type": "csv", - "chromosomeField": "Chromosome", - "genomicFields": ["chromStart", "chromEnd"], - "assembly": "hg38" - } - } - ] - } - ], - "right": [], - "bottom": [ - { - "uid": "dbf196a0-fc48-11eb-b136-51c77f658267", - "type": "axis-track", - "chromInfoPath": "https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes", - "options": { - "layout": "linear", - "outerRadius": null, - "width": 700, - "height": 44, - "theme": { - "base": "light", - "root": { - "background": "white", - "titleColor": "black", - "titleBackgroundColor": "transparent", - "titleFontSize": 18, - "titleFontFamily": "Arial", - "titleAlign": "left", - "titleFontWeight": "bold", - "subtitleColor": "gray", - "subtitleBackgroundColor": "transparent", - "subtitleFontSize": 16, - "subtitleFontFamily": "Arial", - "subtitleFontWeight": "normal", - "subtitleAlign": "left", - "mousePositionColor": "#000000" - }, - "track": { - "background": "transparent", - "alternatingBackground": "transparent", - "titleColor": "black", - "titleBackground": "white", - "titleFontSize": 24, - "titleAlign": "left", - "outline": "black", - "outlineWidth": 1 - }, - "legend": { - "position": "top", - "background": "white", - "backgroundOpacity": 0.7, - "labelColor": "black", - "labelFontSize": 12, - "labelFontWeight": "normal", - "labelFontFamily": "Arial", - "backgroundStroke": "#DBDBDB", - "tickColor": "black" - }, - "axis": { - "tickColor": "black", - "labelColor": "black", - "labelFontSize": 12, - "labelFontWeight": "normal", - "labelFontFamily": "Arial", - "baselineColor": "black", - "gridColor": "#E3E3E3", - "gridStrokeWidth": 1, - "gridStrokeType": "solid", - "gridStrokeDash": [4, 4] - }, - "markCommon": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "point": { - "color": "#E79F00", - "size": 3, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "rect": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "triangle": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "area": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "line": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "bar": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "rule": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 1, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "link": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 1, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - }, - "text": { - "color": "#E79F00", - "size": 1, - "stroke": "black", - "strokeWidth": 0, - "opacity": 1, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6], - "textAnchor": "middle", - "textFontWeight": "normal" - }, - "brush": { - "color": "gray", - "size": 1, - "stroke": "black", - "strokeWidth": 1, - "opacity": 0.3, - "nominalColorRange": [ - "#E79F00", - "#029F73", - "#0072B2", - "#CB7AA7", - "#D45E00", - "#57B4E9", - "#EFE441" - ], - "quantitativeSizeRange": [2, 6] - } - }, - "assembly": "hg38", - "stroke": "transparent", - "color": "black", - "fontSize": 12, - "fontFamily": "Arial", - "fontWeight": "normal", - "tickColor": "black", - "tickFormat": "plain", - "tickPositions": "even", - "reverseOrientation": true - }, - "height": 30 - } - ], - "gallery": [], - "whole": [] - }, - "initialXDomain": [491149952, 689445510], - "initialYDomain": [491149952, 689445510], - "zoomFixed": false, - "zoomLimits": [1, null], - "uid": "view-3" - } + ], + gallery: [], + whole: [] + }, + initialXDomain: [491149952, 689445510], + initialYDomain: [491149952, 689445510], + zoomFixed: false, + zoomLimits: [1, null], + uid: 'view-3' + } ], - "zoomLocks": { - "locksByViewUid": { - "view-1": "top", - // "view-2": "bottom", - "view-3": "bottom" - }, - "locksDict": { - "top": { - "uid": "top", - "view-1": [ - 124625310.5, - 124625310.5, - 249250.621 - ], - "view-3": [ - 124625310.5, - 124625310.5, - 249250.621 - ] + zoomLocks: { + locksByViewUid: { + 'view-1': 'all', + 'view-2': 'all', + 'view-3': 'all' }, - "bottom": { - "uid": "bottom", - "view-1": [ - 124625310.5, - 124625310.5, - 249250.621 - ], - "view-3": [ - 124625310.5, - 124625310.5, - 249250.621 - ] + locksDict: { + all: { + uid: 'all', + 'view-1': [124625310.5, 124625310.5, 249250.621], + 'view-2': [124625310.5, 124625310.5, 249250.621], + 'view-3': [124625310.5, 124625310.5, 249250.621] + } } - } }, - "locationLocks": { - "locksByViewUid": { - "view-1": { "x": { "lock": "top", "axis": "x" } }, - "view-2": { "x": { "lock": "bottom", "axis": "x" }, "x": { "lock": "top", "axis": "y" } }, - "view-3": { "y": { "lock": "bottom", "axis": "x" } }, - }, - "locksDict": { - "top": { - "uid": "top", - "view-1": [ - 124625310.5, - 124625310.5, - 249250.621 - ], - "view-2": [ - 124625310.5, - 124625310.5, - 249250.621 - ] + locationLocks: { + locksByViewUid: { + 'view-1': { x: { lock: 'top', axis: 'x' } }, + 'view-2': { x: { lock: 'top', axis: 'x' }, y: { lock: 'bottom', axis: 'x' } }, + 'view-3': { x: { lock: 'bottom', axis: 'y' } } }, - "bottom": { - "uid": "bottom", - "view-2": [ - 124625310.5, - 124625310.5, - 249250.621 - ], - "view-3": [ - 124625310.5, - 124625310.5, - 249250.621 - ] + locksDict: { + top: { + uid: 'top', + 'view-1': [124625310.5, 124625310.5, 249250.621], + 'view-2': [124625310.5, 124625310.5, 249250.621] + }, + bottom: { + uid: 'bottom', + 'view-2': [124625310.5, 124625310.5, 249250.621], + 'view-3': [124625310.5, 124625310.5, 249250.621] + } } - } }, - "editable": false, - "chromInfoPath": "https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes" - }; + editable: false, + chromInfoPath: 'https://s3.amazonaws.com/gosling-lang.org/data/hg38.chrom.sizes' +}; export default example; diff --git a/src/core/gosling-to-higlass.ts b/src/core/gosling-to-higlass.ts index f0ea7ebe2..a5b2f2fd4 100644 --- a/src/core/gosling-to-higlass.ts +++ b/src/core/gosling-to-higlass.ts @@ -70,7 +70,11 @@ export function goslingToHiGlass( height, options: { /* Mouse hover position */ - showMousePosition: firstResolvedSpec.layout === 'circular' ? false : theme.root.showMousePosition, // show mouse position only for linear tracks // TODO: or vertical + showMousePosition: + firstResolvedSpec.layout === 'circular' || + (Is2DTrack(firstResolvedSpec) && firstResolvedSpec.mark === 'betweenLink') + ? false + : theme.root.showMousePosition, // show mouse position only for linear tracks // TODO: or vertical mousePositionColor: theme.root.mousePositionColor, /* Track title */ name: firstResolvedSpec.layout === 'linear' ? firstResolvedSpec.title : ' ', diff --git a/src/core/gosling-track-model.ts b/src/core/gosling-track-model.ts index 444329f16..5f7f57974 100644 --- a/src/core/gosling-track-model.ts +++ b/src/core/gosling-track-model.ts @@ -819,7 +819,14 @@ export class GoslingTrackModel { /** * Set a new scale for a certain channel. */ - public setChannelScale(channelKey: keyof typeof ChannelTypes, scale: ScaleType) { + public setChannelScale( + channelKey: keyof typeof ChannelTypes, + scale: ScaleType, + config?: { range: [number, number] } + ) { + if (config?.range) { + (scale as any).range(config.range); + } this.channelScales[channelKey] = scale; } diff --git a/src/core/higlass-model.ts b/src/core/higlass-model.ts index 289bdae96..809ca03fb 100644 --- a/src/core/higlass-model.ts +++ b/src/core/higlass-model.ts @@ -347,6 +347,7 @@ export class HiGlassModel { } public setExampleHiglassViewConfig() { + console.warn('Be aware that you are replacing the compiled HiGlass view config with an example one.'); this.hg = exampleHg as any; } } diff --git a/src/core/mark/index.ts b/src/core/mark/index.ts index 89de0a5b5..b38fe3ebc 100644 --- a/src/core/mark/index.ts +++ b/src/core/mark/index.ts @@ -61,12 +61,31 @@ export function drawMark(HGC: any, trackInfo: any, tile: any, model: GoslingTrac // console.log(trackInfo._xScale.domain(), trackInfo._yScale.domain(), (model.getChannelScale('x') as any)?.domain(), (model.getChannelScale('y') as any)?.domain()); + // Size of a track + const [trackWidth, trackHeight] = trackInfo.dimensions; + // Replace the scale of a genomic axis with the one that is generated by the HiGlass data fetcher. ['x', 'xe', 'x1', 'x1e'].forEach((d: any) => { // const c = tm.spec()[d as keyof typeof ChannelTypes]; // if(IsChannelDeep(c) && c.type === 'genomic') { - if(Is2DTrack(model.spec()) && model.spec().mark === 'betweenLink' && (d === 'x1' || d === 'x1e')) { - model.setChannelScale(d, trackInfo._yScale); + if (Is2DTrack(model.spec()) && model.spec().mark === 'betweenLink' && (d === 'x1' || d === 'x1e')) { + const xRange = trackInfo._xScale.range(); + const xRangeSize = Math.abs(xRange[1] - xRange[0]); + const yRange = trackInfo._yScale.range(); + const yRangeSize = Math.abs(yRange[1] - yRange[0]); + + const factor = xRangeSize / yRangeSize; + + const [yDomainMin, yDomainMax] = trackInfo._yScale.domain(); + const yDomainSize = Math.abs(yDomainMax - yDomainMin); + const yDomainCenter = yDomainMin + yDomainSize / 2.0; + const newYDOmainSize = yDomainSize * factor; + + const adjustedYScale = trackInfo._yScale + .copy() + .domain([yDomainCenter - newYDOmainSize / 2.0, yDomainCenter + newYDOmainSize / 2.0]) + .range(xRange); + model.setChannelScale(d, adjustedYScale); } else { model.setChannelScale(d, trackInfo._xScale); } @@ -83,9 +102,6 @@ export function drawMark(HGC: any, trackInfo: any, tile: any, model: GoslingTrac }); } - // Size of a track - const [trackWidth, trackHeight] = trackInfo.dimensions; - // DEBUG // drawChartOutlines(HGC, trackInfo, model); // diff --git a/src/editor/example/give.ts b/src/editor/example/give.ts index e46f37a98..465d59d7b 100644 --- a/src/editor/example/give.ts +++ b/src/editor/example/give.ts @@ -9,7 +9,7 @@ export const EX_SPEC_GIVE: GoslingSpec = { { xLinkingId: 'top', layout: 'linear', - xDomain: { chromosome: '1'}, + xDomain: { chromosome: '1' }, tracks: [ // { // alignment: 'overlay', @@ -176,7 +176,7 @@ export const EX_SPEC_GIVE: GoslingSpec = { strokeWidth: { value: 0.5 }, width: 700, height: 14 - }, + } // { // data: { // url: 'https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt', @@ -232,7 +232,7 @@ export const EX_SPEC_GIVE: GoslingSpec = { }, { layout: 'linear', - xDomain: { chromosome: '1'}, + xDomain: { chromosome: '1' }, tracks: [ { data: { @@ -294,7 +294,7 @@ export const EX_SPEC_GIVE: GoslingSpec = { { xLinkingId: 'bottom', layout: 'linear', - xDomain: { chromosome: '3'}, + xDomain: { chromosome: '3' }, tracks: [ { alignment: 'overlay', @@ -340,7 +340,7 @@ export const EX_SPEC_GIVE: GoslingSpec = { strokeWidth: { value: 0.5 }, width: 700, height: 14 - }, + } // { // data: { // url: 'https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt', From 864c726fde19c650a4856ce4c2e91694d21d052e Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Fri, 20 Aug 2021 16:06:25 -0400 Subject: [PATCH 05/34] chore: rebase --- CHANGELOG.md | 26 ++++++-------------------- schema/gosling.schema.json | 28 ++++++++++++++++++++++------ 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a04211cf7..c782053a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,30 +50,16 @@ ## [0.9.3](https://github.com/gosling-lang/gosling.js/compare/v0.9.2...v0.9.3) (2021-08-18) +## [0.9.3](https://github.com/gosling-lang/gosling.js/compare/v0.9.0...v0.9.3) (2021-08-20) ### Features -* inline bam worker to the bundle ([#467](https://github.com/gosling-lang/gosling.js/issues/467)) ([95d4f1f](https://github.com/gosling-lang/gosling.js/commit/95d4f1fb97249835952c42807d2904594d1fa88b)) - - - -## [0.9.2](https://github.com/gosling-lang/gosling.js/compare/v0.9.1...v0.9.2) (2021-08-17) - - -### Features - -* add explicit PartialTrack def to schema ([#466](https://github.com/gosling-lang/gosling.js/issues/466)) ([c5c9be5](https://github.com/gosling-lang/gosling.js/commit/c5c9be599a5fdd9d375495f6e5d71ffdc364bbab)) - - - -## [0.9.1](https://github.com/gosling-lang/gosling.js/compare/v0.9.0...v0.9.1) (2021-08-14) - - -### Features - -* enable showing track titles in circular layouts ([#464](https://github.com/gosling-lang/gosling.js/issues/464)) ([e223377](https://github.com/gosling-lang/gosling.js/commit/e2233778a22bf37ac1ca85fdc7d77e538a1651a7)) -* responsive quantitative color legend for compact tracks ([#462](https://github.com/gosling-lang/gosling.js/issues/462)) ([9d56cbe](https://github.com/gosling-lang/gosling.js/commit/9d56cbe242b3c1ef0e0ec726436b935fc7bd0fe7)) +* add explicit PartialTrack def to schema ([#466](https://github.com/gosling-lang/gosling.js/issues/466)) ([7f02cd3](https://github.com/gosling-lang/gosling.js/commit/7f02cd3efb8bf3f6840a44f603c9e05d13a77c5a)) +* add yDomain ([a6be28e](https://github.com/gosling-lang/gosling.js/commit/a6be28eb4b3ca8e63ab240e1c4de7695dd9e87ea)) +* enable showing track titles in circular layouts ([#464](https://github.com/gosling-lang/gosling.js/issues/464)) ([4bbc4f9](https://github.com/gosling-lang/gosling.js/commit/4bbc4f983f81c93a30b0efba673e436a88b6228d)) +* inline bam worker to the bundle ([#467](https://github.com/gosling-lang/gosling.js/issues/467)) ([1a21ff1](https://github.com/gosling-lang/gosling.js/commit/1a21ff1357f24524f4423f17c44f218d9d422341)) +* responsive quantitative color legend for compact tracks ([#462](https://github.com/gosling-lang/gosling.js/issues/462)) ([40c3edf](https://github.com/gosling-lang/gosling.js/commit/40c3edf8e572f0e18b4fca7dc7b1dfc8afb1daaf)) diff --git a/schema/gosling.schema.json b/schema/gosling.schema.json index 7b8065f0d..2ecd91a1e 100644 --- a/schema/gosling.schema.json +++ b/schema/gosling.schema.json @@ -2345,6 +2345,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -2364,6 +2367,9 @@ } ] }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, @@ -2379,6 +2385,22 @@ "y1e": { "$ref": "#/definitions/Channel" }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, "yOffset": { "type": "number" }, @@ -2464,9 +2486,6 @@ "layout": { "$ref": "#/definitions/Layout" }, - "linkingId": { - "type": "string" - }, "mark": { "$ref": "#/definitions/Mark" }, @@ -2526,9 +2545,6 @@ "innerRadius": { "type": "number" }, - "linkingId": { - "type": "string" - }, "mark": { "$ref": "#/definitions/Mark" }, From 9cdc8881bc42971f5e78d041d8bbe4bec70fab13 Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Thu, 12 Aug 2021 17:36:11 -0400 Subject: [PATCH 06/34] chore: working on cross-axis linking --- src/editor/example/give.ts | 282 +++++++++++++++++++++++++++++------- src/editor/example/index.ts | 3 +- 2 files changed, 230 insertions(+), 55 deletions(-) diff --git a/src/editor/example/give.ts b/src/editor/example/give.ts index 465d59d7b..7394f0b87 100644 --- a/src/editor/example/give.ts +++ b/src/editor/example/give.ts @@ -176,63 +176,66 @@ export const EX_SPEC_GIVE: GoslingSpec = { strokeWidth: { value: 0.5 }, width: 700, height: 14 + }, + { + data: { + url: 'https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt', + type: 'csv', + headerNames: ['id', 'chr', 'p1', 'p2'], + chromosomePrefix: 'hs', + chromosomeField: 'chr', + genomicFields: ['p1', 'p2'], + separator: ' ', + longToWideId: 'id' + }, + mark: 'betweenLink', + x: { + field: 'p1', + type: 'genomic', + axis: 'none', + linkingId: 'top' + }, + xe: { field: 'p2', type: 'genomic' }, + x1: { field: 'p1_2', type: 'genomic', linkingId: 'bottom' }, + x1e: { field: 'p2_2', type: 'genomic' }, + stroke: { + field: 'chr', + type: 'nominal', + domain: [ + 'chr1', + 'chr2', + 'chr3', + 'chr4', + 'chr5', + 'chr6', + 'chr7', + 'chr8', + 'chr9', + 'chr10', + 'chr11', + 'chr12', + 'chr13', + 'chr14', + 'chr15', + 'chr16', + 'chr17', + 'chr18', + 'chr19', + 'chr20', + 'chr21', + 'chr22', + 'chrX', + 'chrY' + ] + }, + opacity: { value: 0.5 }, + width: 700, + height: 14 } - // { - // data: { - // url: 'https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt', - // type: 'csv', - // headerNames: ['id', 'chr', 'p1', 'p2'], - // chromosomePrefix: 'hs', - // chromosomeField: 'chr', - // genomicFields: ['p1', 'p2'], - // separator: ' ', - // longToWideId: 'id' - // }, - // dataTransform: [{ type: 'filter', field: 'chr', oneOf: ['hs17'] }], - // mark: 'rect', - // x: { field: 'p1', type: 'genomic' }, - // xe: { field: 'p2', type: 'genomic' }, - // color: { - // field: 'chr_2', - // type: 'nominal', - // domain: [ - // 'chr1', - // 'chr2', - // 'chr3', - // 'chr4', - // 'chr5', - // 'chr6', - // 'chr7', - // 'chr8', - // 'chr9', - // 'chr10', - // 'chr11', - // 'chr12', - // 'chr13', - // 'chr14', - // 'chr15', - // 'chr16', - // 'chr17', - // 'chr18', - // 'chr19', - // 'chr20', - // 'chr21', - // 'chr22', - // 'chrX', - // 'chrY' - // ] - // }, - // opacity: { value: 0.5 }, - // size: { value: 14 }, - // overlayOnPreviousTrack: true, - // width: 700, - // height: 14 - // } ] }, { layout: 'linear', - xDomain: { chromosome: '1' }, tracks: [ { data: { @@ -287,7 +290,7 @@ export const EX_SPEC_GIVE: GoslingSpec = { }, opacity: { value: 0.5 }, width: 700, - height: 600 + height: 100 } ] }, @@ -332,7 +335,7 @@ export const EX_SPEC_GIVE: GoslingSpec = { ] } ], - x: { field: 'chromStart', type: 'genomic', axis: 'bottom' }, + x: { field: 'chromStart', type: 'genomic' }, xe: { field: 'chromEnd', type: 'genomic' }, color: { value: 'white' }, size: { value: 14 }, @@ -340,6 +343,177 @@ export const EX_SPEC_GIVE: GoslingSpec = { strokeWidth: { value: 0.5 }, width: 700, height: 14 + }, + { + data: { + url: 'https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt', + type: 'csv', + headerNames: ['id', 'chr', 'p1', 'p2'], + chromosomePrefix: 'hs', + chromosomeField: 'chr', + genomicFields: ['p1', 'p2'], + separator: ' ', + longToWideId: 'id' + }, + dataTransform: [{ type: 'filter', field: 'chr_2', oneOf: ['hs1'] }], + mark: 'rect', + x: { field: 'p1_2', type: 'genomic' }, + xe: { field: 'p2_2', type: 'genomic' }, + color: { + field: 'chr', + type: 'nominal', + domain: [ + 'chr1', + 'chr2', + 'chr3', + 'chr4', + 'chr5', + 'chr6', + 'chr7', + 'chr8', + 'chr9', + 'chr10', + 'chr11', + 'chr12', + 'chr13', + 'chr14', + 'chr15', + 'chr16', + 'chr17', + 'chr18', + 'chr19', + 'chr20', + 'chr21', + 'chr22', + 'chrX', + 'chrY' + ] + }, + opacity: { value: 0.5 }, + size: { value: 14 }, + overlayOnPreviousTrack: true, + width: 700, + height: 14 + }, + { + data: { + url: 'https://resgen.io/api/v1/tileset_info/?d=Zz3CBDSqQ3ySrOSe2yj1eg', + type: 'vector', + column: 'position', + value: 'peak', + binSize: 4 + }, + mark: 'bar', + x: { field: 'start', type: 'genomic' }, + xe: { field: 'end', type: 'genomic' }, + y: { field: 'peak', type: 'quantitative' }, + color: { value: '#8A96D5' }, + stroke: { value: '#3C4DB4' }, + strokeWidth: { value: 0.5 }, + width: 700, + height: 40 + }, + { + data: { + url: 'https://resgen.io/api/v1/tileset_info/?d=dc_SOjdCRgq_8PYf6W--7w', + type: 'vector', + column: 'position', + value: 'peak', + binSize: 4 + }, + mark: 'bar', + x: { field: 'start', type: 'genomic' }, + xe: { field: 'end', type: 'genomic' }, + y: { field: 'peak', type: 'quantitative' }, + color: { value: '#8A96D5' }, + stroke: { value: '#3C4DB4' }, + strokeWidth: { value: 0.5 }, + width: 700, + height: 40 + }, + { + data: { + url: 'https://resgen.io/api/v1/tileset_info/?d=Nolbrk9kS3CE0jJL_7OW1g', + type: 'vector', + column: 'position', + value: 'peak', + binSize: 4 + }, + mark: 'bar', + x: { field: 'start', type: 'genomic' }, + xe: { field: 'end', type: 'genomic' }, + y: { field: 'peak', type: 'quantitative' }, + color: { value: '#8A96D5' }, + stroke: { value: '#3C4DB4' }, + strokeWidth: { value: 0.5 }, + width: 700, + height: 40 + }, + { + alignment: 'overlay', + title: 'Genes', + data: { + url: 'https://resgen.io/api/v1/tileset_info/?d=M9A9klpwTci5Vf4bHZ864g', + type: 'beddb', + genomicFields: [ + { index: 1, name: 'start' }, + { index: 2, name: 'end' } + ], + valueFields: [ + { index: 5, name: 'strand', type: 'nominal' }, + { index: 3, name: 'name', type: 'nominal' } + ], + exonIntervalFields: [ + { index: 12, name: 'start' }, + { index: 13, name: 'end' } + ] + }, + tracks: [ + { + dataTransform: [ + { type: 'filter', field: 'type', oneOf: ['gene'] }, + { type: 'filter', field: 'strand', oneOf: ['+'] } + ], + mark: 'rect', + x: { + field: 'end', + type: 'genomic', + domain: { + chromosome: '1', + interval: [109000000, 112000000] + }, + axis: 'bottom' + }, + size: { value: 7 } + }, + { + dataTransform: [ + { type: 'filter', field: 'type', oneOf: ['gene'] }, + { type: 'filter', field: 'strand', oneOf: ['-'] } + ], + mark: 'rect', + x: { field: 'start', type: 'genomic' }, + size: { value: 7 } + }, + { + dataTransform: [{ type: 'filter', field: 'type', oneOf: ['exon'] }], + mark: 'rect', + x: { field: 'start', type: 'genomic' }, + xe: { field: 'end', type: 'genomic' }, + size: { value: 14 } + }, + { + dataTransform: [{ type: 'filter', field: 'type', oneOf: ['gene'] }], + mark: 'rule', + x: { field: 'start', type: 'genomic' }, + xe: { field: 'end', type: 'genomic' }, + strokeWidth: { value: 3 } + } + ], + row: { field: 'strand', type: 'nominal', domain: ['+', '-'] }, + color: { value: '#4050B4' }, + width: 700, + height: 50 } // { // data: { diff --git a/src/editor/example/index.ts b/src/editor/example/index.ts index ec3675482..434a16632 100644 --- a/src/editor/example/index.ts +++ b/src/editor/example/index.ts @@ -38,7 +38,8 @@ export const examples: ReadonlyArray<{ { name: 'Basic Example: Visual Encoding', id: 'VISUAL_ENCODING', - spec: EX_SPEC_VISUAL_ENCODING + spec: EX_SPEC_VISUAL_ENCODING, + forceShow: true }, { name: 'Basic Example: Circular Visual Encoding', From 753cf7f840b1367175f310f74320b275757c49ee Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Sat, 14 Aug 2021 15:46:11 -0400 Subject: [PATCH 07/34] feat: enable showing track titles in circular layouts (#464) --- src/core/gosling-to-higlass.ts | 4 ++++ src/core/mark/title.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/core/gosling-to-higlass.ts b/src/core/gosling-to-higlass.ts index a5b2f2fd4..088bdfe55 100644 --- a/src/core/gosling-to-higlass.ts +++ b/src/core/gosling-to-higlass.ts @@ -78,6 +78,10 @@ export function goslingToHiGlass( mousePositionColor: theme.root.mousePositionColor, /* Track title */ name: firstResolvedSpec.layout === 'linear' ? firstResolvedSpec.title : ' ', +<<<<<<< HEAD +======= + fontSize: theme.track.titleFontSize, +>>>>>>> 4bbc4f9 (feat: enable showing track titles in circular layouts (#464)) labelPosition: firstResolvedSpec.title ? theme.track.titleAlign === 'left' ? 'topLeft' diff --git a/src/core/mark/title.ts b/src/core/mark/title.ts index 7be29a548..882345fb9 100644 --- a/src/core/mark/title.ts +++ b/src/core/mark/title.ts @@ -47,7 +47,11 @@ export function drawCircularTitle( /* Title label */ const styleConfig = getTextStyle({ color: theme.track.titleColor, +<<<<<<< HEAD size: 12, // `theme.track.titleFontSize` seems to use much larger fonts +======= + size: theme.axis.labelFontSize, // `theme.track.titleFontSize` seems to use much larger fonts +>>>>>>> 4bbc4f9 (feat: enable showing track titles in circular layouts (#464)) fontFamily: theme.axis.labelFontFamily, // TODO: support fontWeight: theme.axis.labelFontWeight // TODO: support }); From 78db7e887cc13bd1feb2c35e92c0461ec7edac6a Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Tue, 17 Aug 2021 11:30:12 -0400 Subject: [PATCH 08/34] feat: add explicit PartialTrack def to schema (#466) --- schema/gosling.schema.json | 143 +++++++++++++++++++++++++++++++++ src/core/gosling-to-higlass.ts | 4 - src/core/mark/title.ts | 4 - 3 files changed, 143 insertions(+), 8 deletions(-) diff --git a/schema/gosling.schema.json b/schema/gosling.schema.json index 2ecd91a1e..dd954d786 100644 --- a/schema/gosling.schema.json +++ b/schema/gosling.schema.json @@ -2504,6 +2504,149 @@ "properties": { "_invalidTrack": { "type": "boolean" +<<<<<<< HEAD +======= + }, + "_renderingId": { + "type": "string" + }, + "assembly": { + "$ref": "#/definitions/Assembly" + }, + "centerRadius": { + "description": "Proportion of the radius of the center white space.", + "type": "number" + }, + "color": { + "$ref": "#/definitions/Channel" + }, + "column": { + "$ref": "#/definitions/Channel" + }, + "data": { + "$ref": "#/definitions/DataDeep" + }, + "dataTransform": { + "items": { + "$ref": "#/definitions/DataTransform" + }, + "type": "array" + }, + "displacement": { + "$ref": "#/definitions/Displacement" + }, + "endAngle": { + "type": "number" + }, + "flipY": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "innerRadius": { + "type": "number" + }, + "linkingId": { + "type": "string" + }, + "mark": { + "$ref": "#/definitions/Mark" + }, + "opacity": { + "$ref": "#/definitions/Channel" + }, + "orientation": { + "$ref": "#/definitions/Orientation" + }, + "outerRadius": { + "type": "number" + }, + "overlayOnPreviousTrack": { + "type": "boolean" + }, + "overrideTemplate": { + "type": "boolean" + }, + "prerelease": { + "additionalProperties": false, + "properties": { + "testUsingNewRectRenderingForBAM": { + "type": "boolean" + } + }, + "type": "object" + }, + "row": { + "$ref": "#/definitions/Channel" + }, + "size": { + "$ref": "#/definitions/Channel" + }, + "spacing": { + "type": "number" + }, + "startAngle": { + "type": "number" + }, + "static": { + "type": "boolean" + }, + "stretch": { + "type": "boolean" + }, + "stroke": { + "$ref": "#/definitions/Channel" + }, + "strokeWidth": { + "$ref": "#/definitions/Channel" + }, + "style": { + "$ref": "#/definitions/Style" + }, + "text": { + "$ref": "#/definitions/Channel" + }, + "tooltip": { + "items": { + "$ref": "#/definitions/Tooltip" + }, + "type": "array" + }, + "visibility": { + "items": { + "$ref": "#/definitions/VisibilityCondition" + }, + "type": "array" + }, + "x": { + "$ref": "#/definitions/Channel" + }, + "x1": { + "$ref": "#/definitions/Channel" + }, + "x1LinkingId": { + "type": "string" + }, + "x1e": { + "$ref": "#/definitions/Channel" + }, + "xAxis": { + "$ref": "#/definitions/AxisPosition" + }, + "xDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] +>>>>>>> 7f02cd3 (feat: add explicit PartialTrack def to schema (#466)) }, "_renderingId": { "type": "string" diff --git a/src/core/gosling-to-higlass.ts b/src/core/gosling-to-higlass.ts index 088bdfe55..a5b2f2fd4 100644 --- a/src/core/gosling-to-higlass.ts +++ b/src/core/gosling-to-higlass.ts @@ -78,10 +78,6 @@ export function goslingToHiGlass( mousePositionColor: theme.root.mousePositionColor, /* Track title */ name: firstResolvedSpec.layout === 'linear' ? firstResolvedSpec.title : ' ', -<<<<<<< HEAD -======= - fontSize: theme.track.titleFontSize, ->>>>>>> 4bbc4f9 (feat: enable showing track titles in circular layouts (#464)) labelPosition: firstResolvedSpec.title ? theme.track.titleAlign === 'left' ? 'topLeft' diff --git a/src/core/mark/title.ts b/src/core/mark/title.ts index 882345fb9..7be29a548 100644 --- a/src/core/mark/title.ts +++ b/src/core/mark/title.ts @@ -47,11 +47,7 @@ export function drawCircularTitle( /* Title label */ const styleConfig = getTextStyle({ color: theme.track.titleColor, -<<<<<<< HEAD size: 12, // `theme.track.titleFontSize` seems to use much larger fonts -======= - size: theme.axis.labelFontSize, // `theme.track.titleFontSize` seems to use much larger fonts ->>>>>>> 4bbc4f9 (feat: enable showing track titles in circular layouts (#464)) fontFamily: theme.axis.labelFontFamily, // TODO: support fontWeight: theme.axis.labelFontWeight // TODO: support }); From 98638981d4bf518c0cdfcc66c4cc09ac73aab321 Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Sat, 14 Aug 2021 15:46:11 -0400 Subject: [PATCH 09/34] feat: enable showing track titles in circular layouts (#464) --- src/core/mark/title.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/mark/title.ts b/src/core/mark/title.ts index 7be29a548..0c14d8f0e 100644 --- a/src/core/mark/title.ts +++ b/src/core/mark/title.ts @@ -47,7 +47,11 @@ export function drawCircularTitle( /* Title label */ const styleConfig = getTextStyle({ color: theme.track.titleColor, +<<<<<<< HEAD size: 12, // `theme.track.titleFontSize` seems to use much larger fonts +======= + size: theme.axis.labelFontSize, // `theme.track.titleFontSize` seems to use much larger fonts +>>>>>>> e223377 (feat: enable showing track titles in circular layouts (#464)) fontFamily: theme.axis.labelFontFamily, // TODO: support fontWeight: theme.axis.labelFontWeight // TODO: support }); From a816a5d83487b24a552f72736f04d7e4f8441429 Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Tue, 17 Aug 2021 11:30:12 -0400 Subject: [PATCH 10/34] feat: add explicit PartialTrack def to schema (#466) --- schema/gosling.schema.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/schema/gosling.schema.json b/schema/gosling.schema.json index dd954d786..b3371f308 100644 --- a/schema/gosling.schema.json +++ b/schema/gosling.schema.json @@ -2345,9 +2345,12 @@ "x1": { "$ref": "#/definitions/Channel" }, +<<<<<<< HEAD "x1LinkingId": { "type": "string" }, +======= +>>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) "x1e": { "$ref": "#/definitions/Channel" }, @@ -2367,9 +2370,12 @@ } ] }, +<<<<<<< HEAD "xLinkingId": { "type": "string" }, +======= +>>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) "xOffset": { "type": "number" }, @@ -2385,6 +2391,7 @@ "y1e": { "$ref": "#/definitions/Channel" }, +<<<<<<< HEAD "yDomain": { "anyOf": [ { @@ -2401,6 +2408,8 @@ "yLinkingId": { "type": "string" }, +======= +>>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) "yOffset": { "type": "number" }, @@ -2486,6 +2495,12 @@ "layout": { "$ref": "#/definitions/Layout" }, +<<<<<<< HEAD +======= + "linkingId": { + "type": "string" + }, +>>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) "mark": { "$ref": "#/definitions/Mark" }, @@ -2505,7 +2520,10 @@ "_invalidTrack": { "type": "boolean" <<<<<<< HEAD +<<<<<<< HEAD ======= +======= +>>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) }, "_renderingId": { "type": "string" @@ -2625,6 +2643,7 @@ "x1": { "$ref": "#/definitions/Channel" }, +<<<<<<< HEAD "x1LinkingId": { "type": "string" }, @@ -2766,6 +2785,8 @@ "x1LinkingId": { "type": "string" }, +======= +>>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) "x1e": { "$ref": "#/definitions/Channel" }, From e7ecdebd3e7a88ce848855589f41135a3185a714 Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Thu, 12 Aug 2021 15:58:29 -0400 Subject: [PATCH 11/34] feat: add yDomain --- schema/gosling.schema.json | 1376 +++++++++++++++++++++++++++++++++++ src/editor/example/index.ts | 9 +- 2 files changed, 1384 insertions(+), 1 deletion(-) diff --git a/schema/gosling.schema.json b/schema/gosling.schema.json index b3371f308..d16aa1d2e 100644 --- a/schema/gosling.schema.json +++ b/schema/gosling.schema.json @@ -2565,8 +2565,13 @@ "innerRadius": { "type": "number" }, +<<<<<<< HEAD "linkingId": { "type": "string" +======= + "layout": { + "$ref": "#/definitions/Layout" +>>>>>>> a6be28e (feat: add yDomain) }, "mark": { "$ref": "#/definitions/Mark" @@ -2580,6 +2585,195 @@ "outerRadius": { "type": "number" }, +<<<<<<< HEAD +======= + "overlay": { + "items": { + "additionalProperties": false, + "properties": { + "_invalidTrack": { + "type": "boolean" + }, + "_renderingId": { + "type": "string" + }, + "assembly": { + "$ref": "#/definitions/Assembly" + }, + "centerRadius": { + "description": "Proportion of the radius of the center white space.", + "type": "number" + }, + "color": { + "$ref": "#/definitions/Channel" + }, + "column": { + "$ref": "#/definitions/Channel" + }, + "data": { + "$ref": "#/definitions/DataDeep" + }, + "dataTransform": { + "items": { + "$ref": "#/definitions/DataTransform" + }, + "type": "array" + }, + "displacement": { + "$ref": "#/definitions/Displacement" + }, + "endAngle": { + "type": "number" + }, + "flipY": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "innerRadius": { + "type": "number" + }, + "mark": { + "$ref": "#/definitions/Mark" + }, + "opacity": { + "$ref": "#/definitions/Channel" + }, + "orientation": { + "$ref": "#/definitions/Orientation" + }, + "outerRadius": { + "type": "number" + }, + "overlayOnPreviousTrack": { + "type": "boolean" + }, + "overrideTemplate": { + "type": "boolean" + }, + "prerelease": { + "additionalProperties": false, + "properties": { + "testUsingNewRectRenderingForBAM": { + "type": "boolean" + } + }, + "type": "object" + }, + "row": { + "$ref": "#/definitions/Channel" + }, + "size": { + "$ref": "#/definitions/Channel" + }, + "spacing": { + "type": "number" + }, + "startAngle": { + "type": "number" + }, + "static": { + "type": "boolean" + }, + "stretch": { + "type": "boolean" + }, + "stroke": { + "$ref": "#/definitions/Channel" + }, + "strokeWidth": { + "$ref": "#/definitions/Channel" + }, + "style": { + "$ref": "#/definitions/Style" + }, + "text": { + "$ref": "#/definitions/Channel" + }, + "tooltip": { + "items": { + "$ref": "#/definitions/Tooltip" + }, + "type": "array" + }, + "visibility": { + "items": { + "$ref": "#/definitions/VisibilityCondition" + }, + "type": "array" + }, + "x": { + "$ref": "#/definitions/Channel" + }, + "x1": { + "$ref": "#/definitions/Channel" + }, + "x1e": { + "$ref": "#/definitions/Channel" + }, + "xAxis": { + "$ref": "#/definitions/AxisPosition" + }, + "xDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "xLinkingId": { + "type": "string" + }, + "xOffset": { + "type": "number" + }, + "xe": { + "$ref": "#/definitions/Channel" + }, + "y": { + "$ref": "#/definitions/Channel" + }, + "y1": { + "$ref": "#/definitions/Channel" + }, + "y1e": { + "$ref": "#/definitions/Channel" + }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, + "yOffset": { + "type": "number" + }, + "ye": { + "$ref": "#/definitions/Channel" + } + }, + "type": "object" + }, + "type": "array" + }, +>>>>>>> a6be28e (feat: add yDomain) "overlayOnPreviousTrack": { "type": "boolean" }, @@ -3275,7 +3469,401 @@ }, "tracks": { "items": { +<<<<<<< HEAD "$ref": "#/definitions/PartialTrack" +======= + "additionalProperties": false, + "properties": { + "_invalidTrack": { + "type": "boolean" + }, + "_renderingId": { + "type": "string" + }, + "assembly": { + "$ref": "#/definitions/Assembly" + }, + "centerRadius": { + "description": "Proportion of the radius of the center white space.", + "type": "number" + }, + "color": { + "$ref": "#/definitions/Channel" + }, + "column": { + "$ref": "#/definitions/Channel" + }, + "data": { + "$ref": "#/definitions/DataDeep" + }, + "dataTransform": { + "items": { + "$ref": "#/definitions/DataTransform" + }, + "type": "array" + }, + "displacement": { + "$ref": "#/definitions/Displacement" + }, + "encoding": { + "additionalProperties": { + "$ref": "#/definitions/Channel" + }, + "type": "object" + }, + "endAngle": { + "type": "number" + }, + "flipY": { + "type": "boolean" + }, + "height": { + "type": "number" + }, + "id": { + "type": "string" + }, + "innerRadius": { + "type": "number" + }, + "layout": { + "$ref": "#/definitions/Layout" + }, + "mark": { + "$ref": "#/definitions/Mark" + }, + "opacity": { + "$ref": "#/definitions/Channel" + }, + "orientation": { + "$ref": "#/definitions/Orientation" + }, + "outerRadius": { + "type": "number" + }, + "overlay": { + "items": { + "additionalProperties": false, + "properties": { + "_invalidTrack": { + "type": "boolean" + }, + "_renderingId": { + "type": "string" + }, + "assembly": { + "$ref": "#/definitions/Assembly" + }, + "centerRadius": { + "description": "Proportion of the radius of the center white space.", + "type": "number" + }, + "color": { + "$ref": "#/definitions/Channel" + }, + "column": { + "$ref": "#/definitions/Channel" + }, + "data": { + "$ref": "#/definitions/DataDeep" + }, + "dataTransform": { + "items": { + "$ref": "#/definitions/DataTransform" + }, + "type": "array" + }, + "displacement": { + "$ref": "#/definitions/Displacement" + }, + "endAngle": { + "type": "number" + }, + "flipY": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "innerRadius": { + "type": "number" + }, + "mark": { + "$ref": "#/definitions/Mark" + }, + "opacity": { + "$ref": "#/definitions/Channel" + }, + "orientation": { + "$ref": "#/definitions/Orientation" + }, + "outerRadius": { + "type": "number" + }, + "overlayOnPreviousTrack": { + "type": "boolean" + }, + "overrideTemplate": { + "type": "boolean" + }, + "prerelease": { + "additionalProperties": false, + "properties": { + "testUsingNewRectRenderingForBAM": { + "type": "boolean" + } + }, + "type": "object" + }, + "row": { + "$ref": "#/definitions/Channel" + }, + "size": { + "$ref": "#/definitions/Channel" + }, + "spacing": { + "type": "number" + }, + "startAngle": { + "type": "number" + }, + "static": { + "type": "boolean" + }, + "stretch": { + "type": "boolean" + }, + "stroke": { + "$ref": "#/definitions/Channel" + }, + "strokeWidth": { + "$ref": "#/definitions/Channel" + }, + "style": { + "$ref": "#/definitions/Style" + }, + "text": { + "$ref": "#/definitions/Channel" + }, + "tooltip": { + "items": { + "$ref": "#/definitions/Tooltip" + }, + "type": "array" + }, + "visibility": { + "items": { + "$ref": "#/definitions/VisibilityCondition" + }, + "type": "array" + }, + "x": { + "$ref": "#/definitions/Channel" + }, + "x1": { + "$ref": "#/definitions/Channel" + }, + "x1e": { + "$ref": "#/definitions/Channel" + }, + "xAxis": { + "$ref": "#/definitions/AxisPosition" + }, + "xDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "xLinkingId": { + "type": "string" + }, + "xOffset": { + "type": "number" + }, + "xe": { + "$ref": "#/definitions/Channel" + }, + "y": { + "$ref": "#/definitions/Channel" + }, + "y1": { + "$ref": "#/definitions/Channel" + }, + "y1e": { + "$ref": "#/definitions/Channel" + }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, + "yOffset": { + "type": "number" + }, + "ye": { + "$ref": "#/definitions/Channel" + } + }, + "type": "object" + }, + "type": "array" + }, + "overlayOnPreviousTrack": { + "type": "boolean" + }, + "overrideTemplate": { + "type": "boolean" + }, + "prerelease": { + "additionalProperties": false, + "properties": { + "testUsingNewRectRenderingForBAM": { + "type": "boolean" + } + }, + "type": "object" + }, + "row": { + "$ref": "#/definitions/Channel" + }, + "size": { + "$ref": "#/definitions/Channel" + }, + "spacing": { + "type": "number" + }, + "startAngle": { + "type": "number" + }, + "static": { + "type": "boolean" + }, + "stretch": { + "type": "boolean" + }, + "stroke": { + "$ref": "#/definitions/Channel" + }, + "strokeWidth": { + "$ref": "#/definitions/Channel" + }, + "style": { + "$ref": "#/definitions/Style" + }, + "subtitle": { + "type": "string" + }, + "template": { + "type": "string" + }, + "text": { + "$ref": "#/definitions/Channel" + }, + "title": { + "type": "string" + }, + "tooltip": { + "items": { + "$ref": "#/definitions/Tooltip" + }, + "type": "array" + }, + "visibility": { + "items": { + "$ref": "#/definitions/VisibilityCondition" + }, + "type": "array" + }, + "width": { + "type": "number" + }, + "x": { + "$ref": "#/definitions/Channel" + }, + "x1": { + "$ref": "#/definitions/Channel" + }, + "x1e": { + "$ref": "#/definitions/Channel" + }, + "xAxis": { + "$ref": "#/definitions/AxisPosition" + }, + "xDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "xLinkingId": { + "type": "string" + }, + "xOffset": { + "type": "number" + }, + "xe": { + "$ref": "#/definitions/Channel" + }, + "y": { + "$ref": "#/definitions/Channel" + }, + "y1": { + "$ref": "#/definitions/Channel" + }, + "y1e": { + "$ref": "#/definitions/Channel" + }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, + "yOffset": { + "type": "number" + }, + "ye": { + "$ref": "#/definitions/Channel" + } + }, + "type": "object" +>>>>>>> a6be28e (feat: add yDomain) }, "type": "array" }, @@ -3497,7 +4085,401 @@ "items": { "anyOf": [ { +<<<<<<< HEAD "$ref": "#/definitions/PartialTrack" +======= + "additionalProperties": false, + "properties": { + "_invalidTrack": { + "type": "boolean" + }, + "_renderingId": { + "type": "string" + }, + "assembly": { + "$ref": "#/definitions/Assembly" + }, + "centerRadius": { + "description": "Proportion of the radius of the center white space.", + "type": "number" + }, + "color": { + "$ref": "#/definitions/Channel" + }, + "column": { + "$ref": "#/definitions/Channel" + }, + "data": { + "$ref": "#/definitions/DataDeep" + }, + "dataTransform": { + "items": { + "$ref": "#/definitions/DataTransform" + }, + "type": "array" + }, + "displacement": { + "$ref": "#/definitions/Displacement" + }, + "encoding": { + "additionalProperties": { + "$ref": "#/definitions/Channel" + }, + "type": "object" + }, + "endAngle": { + "type": "number" + }, + "flipY": { + "type": "boolean" + }, + "height": { + "type": "number" + }, + "id": { + "type": "string" + }, + "innerRadius": { + "type": "number" + }, + "layout": { + "$ref": "#/definitions/Layout" + }, + "mark": { + "$ref": "#/definitions/Mark" + }, + "opacity": { + "$ref": "#/definitions/Channel" + }, + "orientation": { + "$ref": "#/definitions/Orientation" + }, + "outerRadius": { + "type": "number" + }, + "overlay": { + "items": { + "additionalProperties": false, + "properties": { + "_invalidTrack": { + "type": "boolean" + }, + "_renderingId": { + "type": "string" + }, + "assembly": { + "$ref": "#/definitions/Assembly" + }, + "centerRadius": { + "description": "Proportion of the radius of the center white space.", + "type": "number" + }, + "color": { + "$ref": "#/definitions/Channel" + }, + "column": { + "$ref": "#/definitions/Channel" + }, + "data": { + "$ref": "#/definitions/DataDeep" + }, + "dataTransform": { + "items": { + "$ref": "#/definitions/DataTransform" + }, + "type": "array" + }, + "displacement": { + "$ref": "#/definitions/Displacement" + }, + "endAngle": { + "type": "number" + }, + "flipY": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "innerRadius": { + "type": "number" + }, + "mark": { + "$ref": "#/definitions/Mark" + }, + "opacity": { + "$ref": "#/definitions/Channel" + }, + "orientation": { + "$ref": "#/definitions/Orientation" + }, + "outerRadius": { + "type": "number" + }, + "overlayOnPreviousTrack": { + "type": "boolean" + }, + "overrideTemplate": { + "type": "boolean" + }, + "prerelease": { + "additionalProperties": false, + "properties": { + "testUsingNewRectRenderingForBAM": { + "type": "boolean" + } + }, + "type": "object" + }, + "row": { + "$ref": "#/definitions/Channel" + }, + "size": { + "$ref": "#/definitions/Channel" + }, + "spacing": { + "type": "number" + }, + "startAngle": { + "type": "number" + }, + "static": { + "type": "boolean" + }, + "stretch": { + "type": "boolean" + }, + "stroke": { + "$ref": "#/definitions/Channel" + }, + "strokeWidth": { + "$ref": "#/definitions/Channel" + }, + "style": { + "$ref": "#/definitions/Style" + }, + "text": { + "$ref": "#/definitions/Channel" + }, + "tooltip": { + "items": { + "$ref": "#/definitions/Tooltip" + }, + "type": "array" + }, + "visibility": { + "items": { + "$ref": "#/definitions/VisibilityCondition" + }, + "type": "array" + }, + "x": { + "$ref": "#/definitions/Channel" + }, + "x1": { + "$ref": "#/definitions/Channel" + }, + "x1e": { + "$ref": "#/definitions/Channel" + }, + "xAxis": { + "$ref": "#/definitions/AxisPosition" + }, + "xDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "xLinkingId": { + "type": "string" + }, + "xOffset": { + "type": "number" + }, + "xe": { + "$ref": "#/definitions/Channel" + }, + "y": { + "$ref": "#/definitions/Channel" + }, + "y1": { + "$ref": "#/definitions/Channel" + }, + "y1e": { + "$ref": "#/definitions/Channel" + }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, + "yOffset": { + "type": "number" + }, + "ye": { + "$ref": "#/definitions/Channel" + } + }, + "type": "object" + }, + "type": "array" + }, + "overlayOnPreviousTrack": { + "type": "boolean" + }, + "overrideTemplate": { + "type": "boolean" + }, + "prerelease": { + "additionalProperties": false, + "properties": { + "testUsingNewRectRenderingForBAM": { + "type": "boolean" + } + }, + "type": "object" + }, + "row": { + "$ref": "#/definitions/Channel" + }, + "size": { + "$ref": "#/definitions/Channel" + }, + "spacing": { + "type": "number" + }, + "startAngle": { + "type": "number" + }, + "static": { + "type": "boolean" + }, + "stretch": { + "type": "boolean" + }, + "stroke": { + "$ref": "#/definitions/Channel" + }, + "strokeWidth": { + "$ref": "#/definitions/Channel" + }, + "style": { + "$ref": "#/definitions/Style" + }, + "subtitle": { + "type": "string" + }, + "template": { + "type": "string" + }, + "text": { + "$ref": "#/definitions/Channel" + }, + "title": { + "type": "string" + }, + "tooltip": { + "items": { + "$ref": "#/definitions/Tooltip" + }, + "type": "array" + }, + "visibility": { + "items": { + "$ref": "#/definitions/VisibilityCondition" + }, + "type": "array" + }, + "width": { + "type": "number" + }, + "x": { + "$ref": "#/definitions/Channel" + }, + "x1": { + "$ref": "#/definitions/Channel" + }, + "x1e": { + "$ref": "#/definitions/Channel" + }, + "xAxis": { + "$ref": "#/definitions/AxisPosition" + }, + "xDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "xLinkingId": { + "type": "string" + }, + "xOffset": { + "type": "number" + }, + "xe": { + "$ref": "#/definitions/Channel" + }, + "y": { + "$ref": "#/definitions/Channel" + }, + "y1": { + "$ref": "#/definitions/Channel" + }, + "y1e": { + "$ref": "#/definitions/Channel" + }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, + "yOffset": { + "type": "number" + }, + "ye": { + "$ref": "#/definitions/Channel" + } + }, + "type": "object" +>>>>>>> a6be28e (feat: add yDomain) }, { "$ref": "#/definitions/OverlaidTracks" @@ -4076,7 +5058,401 @@ "items": { "anyOf": [ { +<<<<<<< HEAD "$ref": "#/definitions/PartialTrack" +======= + "additionalProperties": false, + "properties": { + "_invalidTrack": { + "type": "boolean" + }, + "_renderingId": { + "type": "string" + }, + "assembly": { + "$ref": "#/definitions/Assembly" + }, + "centerRadius": { + "description": "Proportion of the radius of the center white space.", + "type": "number" + }, + "color": { + "$ref": "#/definitions/Channel" + }, + "column": { + "$ref": "#/definitions/Channel" + }, + "data": { + "$ref": "#/definitions/DataDeep" + }, + "dataTransform": { + "items": { + "$ref": "#/definitions/DataTransform" + }, + "type": "array" + }, + "displacement": { + "$ref": "#/definitions/Displacement" + }, + "encoding": { + "additionalProperties": { + "$ref": "#/definitions/Channel" + }, + "type": "object" + }, + "endAngle": { + "type": "number" + }, + "flipY": { + "type": "boolean" + }, + "height": { + "type": "number" + }, + "id": { + "type": "string" + }, + "innerRadius": { + "type": "number" + }, + "layout": { + "$ref": "#/definitions/Layout" + }, + "mark": { + "$ref": "#/definitions/Mark" + }, + "opacity": { + "$ref": "#/definitions/Channel" + }, + "orientation": { + "$ref": "#/definitions/Orientation" + }, + "outerRadius": { + "type": "number" + }, + "overlay": { + "items": { + "additionalProperties": false, + "properties": { + "_invalidTrack": { + "type": "boolean" + }, + "_renderingId": { + "type": "string" + }, + "assembly": { + "$ref": "#/definitions/Assembly" + }, + "centerRadius": { + "description": "Proportion of the radius of the center white space.", + "type": "number" + }, + "color": { + "$ref": "#/definitions/Channel" + }, + "column": { + "$ref": "#/definitions/Channel" + }, + "data": { + "$ref": "#/definitions/DataDeep" + }, + "dataTransform": { + "items": { + "$ref": "#/definitions/DataTransform" + }, + "type": "array" + }, + "displacement": { + "$ref": "#/definitions/Displacement" + }, + "endAngle": { + "type": "number" + }, + "flipY": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "innerRadius": { + "type": "number" + }, + "mark": { + "$ref": "#/definitions/Mark" + }, + "opacity": { + "$ref": "#/definitions/Channel" + }, + "orientation": { + "$ref": "#/definitions/Orientation" + }, + "outerRadius": { + "type": "number" + }, + "overlayOnPreviousTrack": { + "type": "boolean" + }, + "overrideTemplate": { + "type": "boolean" + }, + "prerelease": { + "additionalProperties": false, + "properties": { + "testUsingNewRectRenderingForBAM": { + "type": "boolean" + } + }, + "type": "object" + }, + "row": { + "$ref": "#/definitions/Channel" + }, + "size": { + "$ref": "#/definitions/Channel" + }, + "spacing": { + "type": "number" + }, + "startAngle": { + "type": "number" + }, + "static": { + "type": "boolean" + }, + "stretch": { + "type": "boolean" + }, + "stroke": { + "$ref": "#/definitions/Channel" + }, + "strokeWidth": { + "$ref": "#/definitions/Channel" + }, + "style": { + "$ref": "#/definitions/Style" + }, + "text": { + "$ref": "#/definitions/Channel" + }, + "tooltip": { + "items": { + "$ref": "#/definitions/Tooltip" + }, + "type": "array" + }, + "visibility": { + "items": { + "$ref": "#/definitions/VisibilityCondition" + }, + "type": "array" + }, + "x": { + "$ref": "#/definitions/Channel" + }, + "x1": { + "$ref": "#/definitions/Channel" + }, + "x1e": { + "$ref": "#/definitions/Channel" + }, + "xAxis": { + "$ref": "#/definitions/AxisPosition" + }, + "xDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "xLinkingId": { + "type": "string" + }, + "xOffset": { + "type": "number" + }, + "xe": { + "$ref": "#/definitions/Channel" + }, + "y": { + "$ref": "#/definitions/Channel" + }, + "y1": { + "$ref": "#/definitions/Channel" + }, + "y1e": { + "$ref": "#/definitions/Channel" + }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, + "yOffset": { + "type": "number" + }, + "ye": { + "$ref": "#/definitions/Channel" + } + }, + "type": "object" + }, + "type": "array" + }, + "overlayOnPreviousTrack": { + "type": "boolean" + }, + "overrideTemplate": { + "type": "boolean" + }, + "prerelease": { + "additionalProperties": false, + "properties": { + "testUsingNewRectRenderingForBAM": { + "type": "boolean" + } + }, + "type": "object" + }, + "row": { + "$ref": "#/definitions/Channel" + }, + "size": { + "$ref": "#/definitions/Channel" + }, + "spacing": { + "type": "number" + }, + "startAngle": { + "type": "number" + }, + "static": { + "type": "boolean" + }, + "stretch": { + "type": "boolean" + }, + "stroke": { + "$ref": "#/definitions/Channel" + }, + "strokeWidth": { + "$ref": "#/definitions/Channel" + }, + "style": { + "$ref": "#/definitions/Style" + }, + "subtitle": { + "type": "string" + }, + "template": { + "type": "string" + }, + "text": { + "$ref": "#/definitions/Channel" + }, + "title": { + "type": "string" + }, + "tooltip": { + "items": { + "$ref": "#/definitions/Tooltip" + }, + "type": "array" + }, + "visibility": { + "items": { + "$ref": "#/definitions/VisibilityCondition" + }, + "type": "array" + }, + "width": { + "type": "number" + }, + "x": { + "$ref": "#/definitions/Channel" + }, + "x1": { + "$ref": "#/definitions/Channel" + }, + "x1e": { + "$ref": "#/definitions/Channel" + }, + "xAxis": { + "$ref": "#/definitions/AxisPosition" + }, + "xDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "xLinkingId": { + "type": "string" + }, + "xOffset": { + "type": "number" + }, + "xe": { + "$ref": "#/definitions/Channel" + }, + "y": { + "$ref": "#/definitions/Channel" + }, + "y1": { + "$ref": "#/definitions/Channel" + }, + "y1e": { + "$ref": "#/definitions/Channel" + }, + "yDomain": { + "anyOf": [ + { + "$ref": "#/definitions/DomainInterval" + }, + { + "$ref": "#/definitions/DomainChrInterval" + }, + { + "$ref": "#/definitions/DomainChr" + } + ] + }, + "yLinkingId": { + "type": "string" + }, + "yOffset": { + "type": "number" + }, + "ye": { + "$ref": "#/definitions/Channel" + } + }, + "type": "object" +>>>>>>> a6be28e (feat: add yDomain) }, { "$ref": "#/definitions/OverlaidTracks" diff --git a/src/editor/example/index.ts b/src/editor/example/index.ts index 434a16632..7801200e0 100644 --- a/src/editor/example/index.ts +++ b/src/editor/example/index.ts @@ -16,7 +16,7 @@ import { EX_SPEC_GIVE } from './give'; import { EX_SPEC_CORCES_ET_AL } from './corces'; import { EX_SPEC_CYTOBANDS } from './ideograms'; import { EX_SPEC_PILEUP } from './pileup'; -import { EX_SPEC_BAND } from './vertical-band'; +import { EX_SPEC_BAND, EX_SPEC_VERTICAL_BAND } from './vertical-band'; import { EX_SPEC_TEMPLATE } from './track-template'; import { EX_SPEC_DEBUG } from './debug'; @@ -91,6 +91,13 @@ export const examples: ReadonlyArray<{ // forceShow: true, // underDevelopment: true // }, + { + name: 'Basic Example: Vertical Band Connection w/ Independent Axes', + id: 'VERTICAL_BAND', + spec: EX_SPEC_VERTICAL_BAND, + forceShow: true, + underDevelopment: true + }, { name: 'Multi-Scale Sequence Track', id: 'SEQUENCE', From 71fc3c72a05a5fa5f683c1dd5550fb3276f8bb55 Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Fri, 13 Aug 2021 17:54:45 -0400 Subject: [PATCH 12/34] chore: adjust scales --- schema/gosling.schema.json | 42 ++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/schema/gosling.schema.json b/schema/gosling.schema.json index d16aa1d2e..8459f7f3a 100644 --- a/schema/gosling.schema.json +++ b/schema/gosling.schema.json @@ -2345,12 +2345,9 @@ "x1": { "$ref": "#/definitions/Channel" }, -<<<<<<< HEAD "x1LinkingId": { "type": "string" }, -======= ->>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) "x1e": { "$ref": "#/definitions/Channel" }, @@ -2370,12 +2367,9 @@ } ] }, -<<<<<<< HEAD "xLinkingId": { "type": "string" }, -======= ->>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) "xOffset": { "type": "number" }, @@ -2391,7 +2385,6 @@ "y1e": { "$ref": "#/definitions/Channel" }, -<<<<<<< HEAD "yDomain": { "anyOf": [ { @@ -2408,8 +2401,6 @@ "yLinkingId": { "type": "string" }, -======= ->>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) "yOffset": { "type": "number" }, @@ -2495,12 +2486,6 @@ "layout": { "$ref": "#/definitions/Layout" }, -<<<<<<< HEAD -======= - "linkingId": { - "type": "string" - }, ->>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) "mark": { "$ref": "#/definitions/Mark" }, @@ -2709,6 +2694,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -2837,6 +2825,7 @@ "x1": { "$ref": "#/definitions/Channel" }, +<<<<<<< HEAD <<<<<<< HEAD "x1LinkingId": { "type": "string" @@ -2981,6 +2970,11 @@ }, ======= >>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) +======= + "x1LinkingId": { + "type": "string" + }, +>>>>>>> a901e8d (chore: adjust scales) "x1e": { "$ref": "#/definitions/Channel" }, @@ -3663,6 +3657,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -3802,6 +3799,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -4279,6 +4279,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -4418,6 +4421,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -5252,6 +5258,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -5391,6 +5400,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, From a0d2f208550aee36a289a2c63875d1c0c63b8ec9 Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Sat, 14 Aug 2021 15:46:11 -0400 Subject: [PATCH 13/34] feat: enable showing track titles in circular layouts (#464) --- src/core/mark/title.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/core/mark/title.ts b/src/core/mark/title.ts index 0c14d8f0e..7be29a548 100644 --- a/src/core/mark/title.ts +++ b/src/core/mark/title.ts @@ -47,11 +47,7 @@ export function drawCircularTitle( /* Title label */ const styleConfig = getTextStyle({ color: theme.track.titleColor, -<<<<<<< HEAD size: 12, // `theme.track.titleFontSize` seems to use much larger fonts -======= - size: theme.axis.labelFontSize, // `theme.track.titleFontSize` seems to use much larger fonts ->>>>>>> e223377 (feat: enable showing track titles in circular layouts (#464)) fontFamily: theme.axis.labelFontFamily, // TODO: support fontWeight: theme.axis.labelFontWeight // TODO: support }); From 4b3b2994863fce97501c0f2489c9f1e596c5f870 Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Tue, 17 Aug 2021 11:30:12 -0400 Subject: [PATCH 14/34] feat: add explicit PartialTrack def to schema (#466) --- schema/gosling.schema.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/schema/gosling.schema.json b/schema/gosling.schema.json index 8459f7f3a..270b94fe5 100644 --- a/schema/gosling.schema.json +++ b/schema/gosling.schema.json @@ -2550,6 +2550,7 @@ "innerRadius": { "type": "number" }, +<<<<<<< HEAD <<<<<<< HEAD "linkingId": { "type": "string" @@ -2557,6 +2558,10 @@ "layout": { "$ref": "#/definitions/Layout" >>>>>>> a6be28e (feat: add yDomain) +======= + "linkingId": { + "type": "string" +>>>>>>> 7f02cd3 (feat: add explicit PartialTrack def to schema (#466)) }, "mark": { "$ref": "#/definitions/Mark" @@ -2571,6 +2576,7 @@ "type": "number" }, <<<<<<< HEAD +<<<<<<< HEAD ======= "overlay": { "items": { @@ -2762,6 +2768,8 @@ "type": "array" }, >>>>>>> a6be28e (feat: add yDomain) +======= +>>>>>>> 7f02cd3 (feat: add explicit PartialTrack def to schema (#466)) "overlayOnPreviousTrack": { "type": "boolean" }, @@ -3463,6 +3471,7 @@ }, "tracks": { "items": { +<<<<<<< HEAD <<<<<<< HEAD "$ref": "#/definitions/PartialTrack" ======= @@ -3864,6 +3873,9 @@ }, "type": "object" >>>>>>> a6be28e (feat: add yDomain) +======= + "$ref": "#/definitions/PartialTrack" +>>>>>>> 7f02cd3 (feat: add explicit PartialTrack def to schema (#466)) }, "type": "array" }, @@ -4085,6 +4097,7 @@ "items": { "anyOf": [ { +<<<<<<< HEAD <<<<<<< HEAD "$ref": "#/definitions/PartialTrack" ======= @@ -4486,6 +4499,9 @@ }, "type": "object" >>>>>>> a6be28e (feat: add yDomain) +======= + "$ref": "#/definitions/PartialTrack" +>>>>>>> 7f02cd3 (feat: add explicit PartialTrack def to schema (#466)) }, { "$ref": "#/definitions/OverlaidTracks" @@ -5064,6 +5080,7 @@ "items": { "anyOf": [ { +<<<<<<< HEAD <<<<<<< HEAD "$ref": "#/definitions/PartialTrack" ======= @@ -5465,6 +5482,9 @@ }, "type": "object" >>>>>>> a6be28e (feat: add yDomain) +======= + "$ref": "#/definitions/PartialTrack" +>>>>>>> 7f02cd3 (feat: add explicit PartialTrack def to schema (#466)) }, { "$ref": "#/definitions/OverlaidTracks" From 4987b8e5d6f496a597632d243a492b90c2edda08 Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Fri, 20 Aug 2021 16:06:25 -0400 Subject: [PATCH 15/34] chore: rebase --- schema/gosling.schema.json | 1459 +----------------------------------- 1 file changed, 3 insertions(+), 1456 deletions(-) diff --git a/schema/gosling.schema.json b/schema/gosling.schema.json index 270b94fe5..d592bdf7c 100644 --- a/schema/gosling.schema.json +++ b/schema/gosling.schema.json @@ -553,9 +553,6 @@ "width": { "type": "number" }, - "x1LinkingId": { - "type": "string" - }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, @@ -948,9 +945,6 @@ }, "type": "array" }, - "x1LinkingId": { - "type": "string" - }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, @@ -1665,9 +1659,6 @@ }, "type": "array" }, - "x1LinkingId": { - "type": "string" - }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, @@ -1990,9 +1981,6 @@ "x1": { "$ref": "#/definitions/Channel" }, - "x1LinkingId": { - "type": "string" - }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -2129,9 +2117,6 @@ "x1": { "$ref": "#/definitions/Channel" }, - "x1LinkingId": { - "type": "string" - }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -2550,18 +2535,8 @@ "innerRadius": { "type": "number" }, -<<<<<<< HEAD -<<<<<<< HEAD "linkingId": { "type": "string" -======= - "layout": { - "$ref": "#/definitions/Layout" ->>>>>>> a6be28e (feat: add yDomain) -======= - "linkingId": { - "type": "string" ->>>>>>> 7f02cd3 (feat: add explicit PartialTrack def to schema (#466)) }, "mark": { "$ref": "#/definitions/Mark" @@ -2575,201 +2550,6 @@ "outerRadius": { "type": "number" }, -<<<<<<< HEAD -<<<<<<< HEAD -======= - "overlay": { - "items": { - "additionalProperties": false, - "properties": { - "_invalidTrack": { - "type": "boolean" - }, - "_renderingId": { - "type": "string" - }, - "assembly": { - "$ref": "#/definitions/Assembly" - }, - "centerRadius": { - "description": "Proportion of the radius of the center white space.", - "type": "number" - }, - "color": { - "$ref": "#/definitions/Channel" - }, - "column": { - "$ref": "#/definitions/Channel" - }, - "data": { - "$ref": "#/definitions/DataDeep" - }, - "dataTransform": { - "items": { - "$ref": "#/definitions/DataTransform" - }, - "type": "array" - }, - "displacement": { - "$ref": "#/definitions/Displacement" - }, - "endAngle": { - "type": "number" - }, - "flipY": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "innerRadius": { - "type": "number" - }, - "mark": { - "$ref": "#/definitions/Mark" - }, - "opacity": { - "$ref": "#/definitions/Channel" - }, - "orientation": { - "$ref": "#/definitions/Orientation" - }, - "outerRadius": { - "type": "number" - }, - "overlayOnPreviousTrack": { - "type": "boolean" - }, - "overrideTemplate": { - "type": "boolean" - }, - "prerelease": { - "additionalProperties": false, - "properties": { - "testUsingNewRectRenderingForBAM": { - "type": "boolean" - } - }, - "type": "object" - }, - "row": { - "$ref": "#/definitions/Channel" - }, - "size": { - "$ref": "#/definitions/Channel" - }, - "spacing": { - "type": "number" - }, - "startAngle": { - "type": "number" - }, - "static": { - "type": "boolean" - }, - "stretch": { - "type": "boolean" - }, - "stroke": { - "$ref": "#/definitions/Channel" - }, - "strokeWidth": { - "$ref": "#/definitions/Channel" - }, - "style": { - "$ref": "#/definitions/Style" - }, - "text": { - "$ref": "#/definitions/Channel" - }, - "tooltip": { - "items": { - "$ref": "#/definitions/Tooltip" - }, - "type": "array" - }, - "visibility": { - "items": { - "$ref": "#/definitions/VisibilityCondition" - }, - "type": "array" - }, - "x": { - "$ref": "#/definitions/Channel" - }, - "x1": { - "$ref": "#/definitions/Channel" - }, - "x1LinkingId": { - "type": "string" - }, - "x1e": { - "$ref": "#/definitions/Channel" - }, - "xAxis": { - "$ref": "#/definitions/AxisPosition" - }, - "xDomain": { - "anyOf": [ - { - "$ref": "#/definitions/DomainInterval" - }, - { - "$ref": "#/definitions/DomainChrInterval" - }, - { - "$ref": "#/definitions/DomainChr" - } - ] - }, - "xLinkingId": { - "type": "string" - }, - "xOffset": { - "type": "number" - }, - "xe": { - "$ref": "#/definitions/Channel" - }, - "y": { - "$ref": "#/definitions/Channel" - }, - "y1": { - "$ref": "#/definitions/Channel" - }, - "y1e": { - "$ref": "#/definitions/Channel" - }, - "yDomain": { - "anyOf": [ - { - "$ref": "#/definitions/DomainInterval" - }, - { - "$ref": "#/definitions/DomainChrInterval" - }, - { - "$ref": "#/definitions/DomainChr" - } - ] - }, - "yLinkingId": { - "type": "string" - }, - "yOffset": { - "type": "number" - }, - "ye": { - "$ref": "#/definitions/Channel" - } - }, - "type": "object" - }, - "type": "array" - }, ->>>>>>> a6be28e (feat: add yDomain) -======= ->>>>>>> 7f02cd3 (feat: add explicit PartialTrack def to schema (#466)) "overlayOnPreviousTrack": { "type": "boolean" }, @@ -2834,6 +2614,7 @@ "$ref": "#/definitions/Channel" }, <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD "x1LinkingId": { "type": "string" @@ -2983,6 +2764,8 @@ "type": "string" }, >>>>>>> a901e8d (chore: adjust scales) +======= +>>>>>>> 9a3cd64 (chore: rebase) "x1e": { "$ref": "#/definitions/Channel" }, @@ -3122,9 +2905,6 @@ "x1": { "$ref": "#/definitions/Channel" }, - "x1LinkingId": { - "type": "string" - }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -3289,9 +3069,6 @@ }, "type": "array" }, - "x1LinkingId": { - "type": "string" - }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, @@ -3471,411 +3248,7 @@ }, "tracks": { "items": { -<<<<<<< HEAD -<<<<<<< HEAD "$ref": "#/definitions/PartialTrack" -======= - "additionalProperties": false, - "properties": { - "_invalidTrack": { - "type": "boolean" - }, - "_renderingId": { - "type": "string" - }, - "assembly": { - "$ref": "#/definitions/Assembly" - }, - "centerRadius": { - "description": "Proportion of the radius of the center white space.", - "type": "number" - }, - "color": { - "$ref": "#/definitions/Channel" - }, - "column": { - "$ref": "#/definitions/Channel" - }, - "data": { - "$ref": "#/definitions/DataDeep" - }, - "dataTransform": { - "items": { - "$ref": "#/definitions/DataTransform" - }, - "type": "array" - }, - "displacement": { - "$ref": "#/definitions/Displacement" - }, - "encoding": { - "additionalProperties": { - "$ref": "#/definitions/Channel" - }, - "type": "object" - }, - "endAngle": { - "type": "number" - }, - "flipY": { - "type": "boolean" - }, - "height": { - "type": "number" - }, - "id": { - "type": "string" - }, - "innerRadius": { - "type": "number" - }, - "layout": { - "$ref": "#/definitions/Layout" - }, - "mark": { - "$ref": "#/definitions/Mark" - }, - "opacity": { - "$ref": "#/definitions/Channel" - }, - "orientation": { - "$ref": "#/definitions/Orientation" - }, - "outerRadius": { - "type": "number" - }, - "overlay": { - "items": { - "additionalProperties": false, - "properties": { - "_invalidTrack": { - "type": "boolean" - }, - "_renderingId": { - "type": "string" - }, - "assembly": { - "$ref": "#/definitions/Assembly" - }, - "centerRadius": { - "description": "Proportion of the radius of the center white space.", - "type": "number" - }, - "color": { - "$ref": "#/definitions/Channel" - }, - "column": { - "$ref": "#/definitions/Channel" - }, - "data": { - "$ref": "#/definitions/DataDeep" - }, - "dataTransform": { - "items": { - "$ref": "#/definitions/DataTransform" - }, - "type": "array" - }, - "displacement": { - "$ref": "#/definitions/Displacement" - }, - "endAngle": { - "type": "number" - }, - "flipY": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "innerRadius": { - "type": "number" - }, - "mark": { - "$ref": "#/definitions/Mark" - }, - "opacity": { - "$ref": "#/definitions/Channel" - }, - "orientation": { - "$ref": "#/definitions/Orientation" - }, - "outerRadius": { - "type": "number" - }, - "overlayOnPreviousTrack": { - "type": "boolean" - }, - "overrideTemplate": { - "type": "boolean" - }, - "prerelease": { - "additionalProperties": false, - "properties": { - "testUsingNewRectRenderingForBAM": { - "type": "boolean" - } - }, - "type": "object" - }, - "row": { - "$ref": "#/definitions/Channel" - }, - "size": { - "$ref": "#/definitions/Channel" - }, - "spacing": { - "type": "number" - }, - "startAngle": { - "type": "number" - }, - "static": { - "type": "boolean" - }, - "stretch": { - "type": "boolean" - }, - "stroke": { - "$ref": "#/definitions/Channel" - }, - "strokeWidth": { - "$ref": "#/definitions/Channel" - }, - "style": { - "$ref": "#/definitions/Style" - }, - "text": { - "$ref": "#/definitions/Channel" - }, - "tooltip": { - "items": { - "$ref": "#/definitions/Tooltip" - }, - "type": "array" - }, - "visibility": { - "items": { - "$ref": "#/definitions/VisibilityCondition" - }, - "type": "array" - }, - "x": { - "$ref": "#/definitions/Channel" - }, - "x1": { - "$ref": "#/definitions/Channel" - }, - "x1LinkingId": { - "type": "string" - }, - "x1e": { - "$ref": "#/definitions/Channel" - }, - "xAxis": { - "$ref": "#/definitions/AxisPosition" - }, - "xDomain": { - "anyOf": [ - { - "$ref": "#/definitions/DomainInterval" - }, - { - "$ref": "#/definitions/DomainChrInterval" - }, - { - "$ref": "#/definitions/DomainChr" - } - ] - }, - "xLinkingId": { - "type": "string" - }, - "xOffset": { - "type": "number" - }, - "xe": { - "$ref": "#/definitions/Channel" - }, - "y": { - "$ref": "#/definitions/Channel" - }, - "y1": { - "$ref": "#/definitions/Channel" - }, - "y1e": { - "$ref": "#/definitions/Channel" - }, - "yDomain": { - "anyOf": [ - { - "$ref": "#/definitions/DomainInterval" - }, - { - "$ref": "#/definitions/DomainChrInterval" - }, - { - "$ref": "#/definitions/DomainChr" - } - ] - }, - "yLinkingId": { - "type": "string" - }, - "yOffset": { - "type": "number" - }, - "ye": { - "$ref": "#/definitions/Channel" - } - }, - "type": "object" - }, - "type": "array" - }, - "overlayOnPreviousTrack": { - "type": "boolean" - }, - "overrideTemplate": { - "type": "boolean" - }, - "prerelease": { - "additionalProperties": false, - "properties": { - "testUsingNewRectRenderingForBAM": { - "type": "boolean" - } - }, - "type": "object" - }, - "row": { - "$ref": "#/definitions/Channel" - }, - "size": { - "$ref": "#/definitions/Channel" - }, - "spacing": { - "type": "number" - }, - "startAngle": { - "type": "number" - }, - "static": { - "type": "boolean" - }, - "stretch": { - "type": "boolean" - }, - "stroke": { - "$ref": "#/definitions/Channel" - }, - "strokeWidth": { - "$ref": "#/definitions/Channel" - }, - "style": { - "$ref": "#/definitions/Style" - }, - "subtitle": { - "type": "string" - }, - "template": { - "type": "string" - }, - "text": { - "$ref": "#/definitions/Channel" - }, - "title": { - "type": "string" - }, - "tooltip": { - "items": { - "$ref": "#/definitions/Tooltip" - }, - "type": "array" - }, - "visibility": { - "items": { - "$ref": "#/definitions/VisibilityCondition" - }, - "type": "array" - }, - "width": { - "type": "number" - }, - "x": { - "$ref": "#/definitions/Channel" - }, - "x1": { - "$ref": "#/definitions/Channel" - }, - "x1LinkingId": { - "type": "string" - }, - "x1e": { - "$ref": "#/definitions/Channel" - }, - "xAxis": { - "$ref": "#/definitions/AxisPosition" - }, - "xDomain": { - "anyOf": [ - { - "$ref": "#/definitions/DomainInterval" - }, - { - "$ref": "#/definitions/DomainChrInterval" - }, - { - "$ref": "#/definitions/DomainChr" - } - ] - }, - "xLinkingId": { - "type": "string" - }, - "xOffset": { - "type": "number" - }, - "xe": { - "$ref": "#/definitions/Channel" - }, - "y": { - "$ref": "#/definitions/Channel" - }, - "y1": { - "$ref": "#/definitions/Channel" - }, - "y1e": { - "$ref": "#/definitions/Channel" - }, - "yDomain": { - "anyOf": [ - { - "$ref": "#/definitions/DomainInterval" - }, - { - "$ref": "#/definitions/DomainChrInterval" - }, - { - "$ref": "#/definitions/DomainChr" - } - ] - }, - "yLinkingId": { - "type": "string" - }, - "yOffset": { - "type": "number" - }, - "ye": { - "$ref": "#/definitions/Channel" - } - }, - "type": "object" ->>>>>>> a6be28e (feat: add yDomain) -======= - "$ref": "#/definitions/PartialTrack" ->>>>>>> 7f02cd3 (feat: add explicit PartialTrack def to schema (#466)) }, "type": "array" }, @@ -3894,9 +3267,6 @@ "x1": { "$ref": "#/definitions/Channel" }, - "x1LinkingId": { - "type": "string" - }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -4097,411 +3467,7 @@ "items": { "anyOf": [ { -<<<<<<< HEAD -<<<<<<< HEAD "$ref": "#/definitions/PartialTrack" -======= - "additionalProperties": false, - "properties": { - "_invalidTrack": { - "type": "boolean" - }, - "_renderingId": { - "type": "string" - }, - "assembly": { - "$ref": "#/definitions/Assembly" - }, - "centerRadius": { - "description": "Proportion of the radius of the center white space.", - "type": "number" - }, - "color": { - "$ref": "#/definitions/Channel" - }, - "column": { - "$ref": "#/definitions/Channel" - }, - "data": { - "$ref": "#/definitions/DataDeep" - }, - "dataTransform": { - "items": { - "$ref": "#/definitions/DataTransform" - }, - "type": "array" - }, - "displacement": { - "$ref": "#/definitions/Displacement" - }, - "encoding": { - "additionalProperties": { - "$ref": "#/definitions/Channel" - }, - "type": "object" - }, - "endAngle": { - "type": "number" - }, - "flipY": { - "type": "boolean" - }, - "height": { - "type": "number" - }, - "id": { - "type": "string" - }, - "innerRadius": { - "type": "number" - }, - "layout": { - "$ref": "#/definitions/Layout" - }, - "mark": { - "$ref": "#/definitions/Mark" - }, - "opacity": { - "$ref": "#/definitions/Channel" - }, - "orientation": { - "$ref": "#/definitions/Orientation" - }, - "outerRadius": { - "type": "number" - }, - "overlay": { - "items": { - "additionalProperties": false, - "properties": { - "_invalidTrack": { - "type": "boolean" - }, - "_renderingId": { - "type": "string" - }, - "assembly": { - "$ref": "#/definitions/Assembly" - }, - "centerRadius": { - "description": "Proportion of the radius of the center white space.", - "type": "number" - }, - "color": { - "$ref": "#/definitions/Channel" - }, - "column": { - "$ref": "#/definitions/Channel" - }, - "data": { - "$ref": "#/definitions/DataDeep" - }, - "dataTransform": { - "items": { - "$ref": "#/definitions/DataTransform" - }, - "type": "array" - }, - "displacement": { - "$ref": "#/definitions/Displacement" - }, - "endAngle": { - "type": "number" - }, - "flipY": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "innerRadius": { - "type": "number" - }, - "mark": { - "$ref": "#/definitions/Mark" - }, - "opacity": { - "$ref": "#/definitions/Channel" - }, - "orientation": { - "$ref": "#/definitions/Orientation" - }, - "outerRadius": { - "type": "number" - }, - "overlayOnPreviousTrack": { - "type": "boolean" - }, - "overrideTemplate": { - "type": "boolean" - }, - "prerelease": { - "additionalProperties": false, - "properties": { - "testUsingNewRectRenderingForBAM": { - "type": "boolean" - } - }, - "type": "object" - }, - "row": { - "$ref": "#/definitions/Channel" - }, - "size": { - "$ref": "#/definitions/Channel" - }, - "spacing": { - "type": "number" - }, - "startAngle": { - "type": "number" - }, - "static": { - "type": "boolean" - }, - "stretch": { - "type": "boolean" - }, - "stroke": { - "$ref": "#/definitions/Channel" - }, - "strokeWidth": { - "$ref": "#/definitions/Channel" - }, - "style": { - "$ref": "#/definitions/Style" - }, - "text": { - "$ref": "#/definitions/Channel" - }, - "tooltip": { - "items": { - "$ref": "#/definitions/Tooltip" - }, - "type": "array" - }, - "visibility": { - "items": { - "$ref": "#/definitions/VisibilityCondition" - }, - "type": "array" - }, - "x": { - "$ref": "#/definitions/Channel" - }, - "x1": { - "$ref": "#/definitions/Channel" - }, - "x1LinkingId": { - "type": "string" - }, - "x1e": { - "$ref": "#/definitions/Channel" - }, - "xAxis": { - "$ref": "#/definitions/AxisPosition" - }, - "xDomain": { - "anyOf": [ - { - "$ref": "#/definitions/DomainInterval" - }, - { - "$ref": "#/definitions/DomainChrInterval" - }, - { - "$ref": "#/definitions/DomainChr" - } - ] - }, - "xLinkingId": { - "type": "string" - }, - "xOffset": { - "type": "number" - }, - "xe": { - "$ref": "#/definitions/Channel" - }, - "y": { - "$ref": "#/definitions/Channel" - }, - "y1": { - "$ref": "#/definitions/Channel" - }, - "y1e": { - "$ref": "#/definitions/Channel" - }, - "yDomain": { - "anyOf": [ - { - "$ref": "#/definitions/DomainInterval" - }, - { - "$ref": "#/definitions/DomainChrInterval" - }, - { - "$ref": "#/definitions/DomainChr" - } - ] - }, - "yLinkingId": { - "type": "string" - }, - "yOffset": { - "type": "number" - }, - "ye": { - "$ref": "#/definitions/Channel" - } - }, - "type": "object" - }, - "type": "array" - }, - "overlayOnPreviousTrack": { - "type": "boolean" - }, - "overrideTemplate": { - "type": "boolean" - }, - "prerelease": { - "additionalProperties": false, - "properties": { - "testUsingNewRectRenderingForBAM": { - "type": "boolean" - } - }, - "type": "object" - }, - "row": { - "$ref": "#/definitions/Channel" - }, - "size": { - "$ref": "#/definitions/Channel" - }, - "spacing": { - "type": "number" - }, - "startAngle": { - "type": "number" - }, - "static": { - "type": "boolean" - }, - "stretch": { - "type": "boolean" - }, - "stroke": { - "$ref": "#/definitions/Channel" - }, - "strokeWidth": { - "$ref": "#/definitions/Channel" - }, - "style": { - "$ref": "#/definitions/Style" - }, - "subtitle": { - "type": "string" - }, - "template": { - "type": "string" - }, - "text": { - "$ref": "#/definitions/Channel" - }, - "title": { - "type": "string" - }, - "tooltip": { - "items": { - "$ref": "#/definitions/Tooltip" - }, - "type": "array" - }, - "visibility": { - "items": { - "$ref": "#/definitions/VisibilityCondition" - }, - "type": "array" - }, - "width": { - "type": "number" - }, - "x": { - "$ref": "#/definitions/Channel" - }, - "x1": { - "$ref": "#/definitions/Channel" - }, - "x1LinkingId": { - "type": "string" - }, - "x1e": { - "$ref": "#/definitions/Channel" - }, - "xAxis": { - "$ref": "#/definitions/AxisPosition" - }, - "xDomain": { - "anyOf": [ - { - "$ref": "#/definitions/DomainInterval" - }, - { - "$ref": "#/definitions/DomainChrInterval" - }, - { - "$ref": "#/definitions/DomainChr" - } - ] - }, - "xLinkingId": { - "type": "string" - }, - "xOffset": { - "type": "number" - }, - "xe": { - "$ref": "#/definitions/Channel" - }, - "y": { - "$ref": "#/definitions/Channel" - }, - "y1": { - "$ref": "#/definitions/Channel" - }, - "y1e": { - "$ref": "#/definitions/Channel" - }, - "yDomain": { - "anyOf": [ - { - "$ref": "#/definitions/DomainInterval" - }, - { - "$ref": "#/definitions/DomainChrInterval" - }, - { - "$ref": "#/definitions/DomainChr" - } - ] - }, - "yLinkingId": { - "type": "string" - }, - "yOffset": { - "type": "number" - }, - "ye": { - "$ref": "#/definitions/Channel" - } - }, - "type": "object" ->>>>>>> a6be28e (feat: add yDomain) -======= - "$ref": "#/definitions/PartialTrack" ->>>>>>> 7f02cd3 (feat: add explicit PartialTrack def to schema (#466)) }, { "$ref": "#/definitions/OverlaidTracks" @@ -4525,9 +3491,6 @@ "x1": { "$ref": "#/definitions/Channel" }, - "x1LinkingId": { - "type": "string" - }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -4633,9 +3596,6 @@ }, "type": "array" }, - "x1LinkingId": { - "type": "string" - }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, @@ -4821,9 +3781,6 @@ "x1": { "$ref": "#/definitions/Channel" }, - "x1LinkingId": { - "type": "string" - }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -5080,411 +4037,7 @@ "items": { "anyOf": [ { -<<<<<<< HEAD -<<<<<<< HEAD - "$ref": "#/definitions/PartialTrack" -======= - "additionalProperties": false, - "properties": { - "_invalidTrack": { - "type": "boolean" - }, - "_renderingId": { - "type": "string" - }, - "assembly": { - "$ref": "#/definitions/Assembly" - }, - "centerRadius": { - "description": "Proportion of the radius of the center white space.", - "type": "number" - }, - "color": { - "$ref": "#/definitions/Channel" - }, - "column": { - "$ref": "#/definitions/Channel" - }, - "data": { - "$ref": "#/definitions/DataDeep" - }, - "dataTransform": { - "items": { - "$ref": "#/definitions/DataTransform" - }, - "type": "array" - }, - "displacement": { - "$ref": "#/definitions/Displacement" - }, - "encoding": { - "additionalProperties": { - "$ref": "#/definitions/Channel" - }, - "type": "object" - }, - "endAngle": { - "type": "number" - }, - "flipY": { - "type": "boolean" - }, - "height": { - "type": "number" - }, - "id": { - "type": "string" - }, - "innerRadius": { - "type": "number" - }, - "layout": { - "$ref": "#/definitions/Layout" - }, - "mark": { - "$ref": "#/definitions/Mark" - }, - "opacity": { - "$ref": "#/definitions/Channel" - }, - "orientation": { - "$ref": "#/definitions/Orientation" - }, - "outerRadius": { - "type": "number" - }, - "overlay": { - "items": { - "additionalProperties": false, - "properties": { - "_invalidTrack": { - "type": "boolean" - }, - "_renderingId": { - "type": "string" - }, - "assembly": { - "$ref": "#/definitions/Assembly" - }, - "centerRadius": { - "description": "Proportion of the radius of the center white space.", - "type": "number" - }, - "color": { - "$ref": "#/definitions/Channel" - }, - "column": { - "$ref": "#/definitions/Channel" - }, - "data": { - "$ref": "#/definitions/DataDeep" - }, - "dataTransform": { - "items": { - "$ref": "#/definitions/DataTransform" - }, - "type": "array" - }, - "displacement": { - "$ref": "#/definitions/Displacement" - }, - "endAngle": { - "type": "number" - }, - "flipY": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "innerRadius": { - "type": "number" - }, - "mark": { - "$ref": "#/definitions/Mark" - }, - "opacity": { - "$ref": "#/definitions/Channel" - }, - "orientation": { - "$ref": "#/definitions/Orientation" - }, - "outerRadius": { - "type": "number" - }, - "overlayOnPreviousTrack": { - "type": "boolean" - }, - "overrideTemplate": { - "type": "boolean" - }, - "prerelease": { - "additionalProperties": false, - "properties": { - "testUsingNewRectRenderingForBAM": { - "type": "boolean" - } - }, - "type": "object" - }, - "row": { - "$ref": "#/definitions/Channel" - }, - "size": { - "$ref": "#/definitions/Channel" - }, - "spacing": { - "type": "number" - }, - "startAngle": { - "type": "number" - }, - "static": { - "type": "boolean" - }, - "stretch": { - "type": "boolean" - }, - "stroke": { - "$ref": "#/definitions/Channel" - }, - "strokeWidth": { - "$ref": "#/definitions/Channel" - }, - "style": { - "$ref": "#/definitions/Style" - }, - "text": { - "$ref": "#/definitions/Channel" - }, - "tooltip": { - "items": { - "$ref": "#/definitions/Tooltip" - }, - "type": "array" - }, - "visibility": { - "items": { - "$ref": "#/definitions/VisibilityCondition" - }, - "type": "array" - }, - "x": { - "$ref": "#/definitions/Channel" - }, - "x1": { - "$ref": "#/definitions/Channel" - }, - "x1LinkingId": { - "type": "string" - }, - "x1e": { - "$ref": "#/definitions/Channel" - }, - "xAxis": { - "$ref": "#/definitions/AxisPosition" - }, - "xDomain": { - "anyOf": [ - { - "$ref": "#/definitions/DomainInterval" - }, - { - "$ref": "#/definitions/DomainChrInterval" - }, - { - "$ref": "#/definitions/DomainChr" - } - ] - }, - "xLinkingId": { - "type": "string" - }, - "xOffset": { - "type": "number" - }, - "xe": { - "$ref": "#/definitions/Channel" - }, - "y": { - "$ref": "#/definitions/Channel" - }, - "y1": { - "$ref": "#/definitions/Channel" - }, - "y1e": { - "$ref": "#/definitions/Channel" - }, - "yDomain": { - "anyOf": [ - { - "$ref": "#/definitions/DomainInterval" - }, - { - "$ref": "#/definitions/DomainChrInterval" - }, - { - "$ref": "#/definitions/DomainChr" - } - ] - }, - "yLinkingId": { - "type": "string" - }, - "yOffset": { - "type": "number" - }, - "ye": { - "$ref": "#/definitions/Channel" - } - }, - "type": "object" - }, - "type": "array" - }, - "overlayOnPreviousTrack": { - "type": "boolean" - }, - "overrideTemplate": { - "type": "boolean" - }, - "prerelease": { - "additionalProperties": false, - "properties": { - "testUsingNewRectRenderingForBAM": { - "type": "boolean" - } - }, - "type": "object" - }, - "row": { - "$ref": "#/definitions/Channel" - }, - "size": { - "$ref": "#/definitions/Channel" - }, - "spacing": { - "type": "number" - }, - "startAngle": { - "type": "number" - }, - "static": { - "type": "boolean" - }, - "stretch": { - "type": "boolean" - }, - "stroke": { - "$ref": "#/definitions/Channel" - }, - "strokeWidth": { - "$ref": "#/definitions/Channel" - }, - "style": { - "$ref": "#/definitions/Style" - }, - "subtitle": { - "type": "string" - }, - "template": { - "type": "string" - }, - "text": { - "$ref": "#/definitions/Channel" - }, - "title": { - "type": "string" - }, - "tooltip": { - "items": { - "$ref": "#/definitions/Tooltip" - }, - "type": "array" - }, - "visibility": { - "items": { - "$ref": "#/definitions/VisibilityCondition" - }, - "type": "array" - }, - "width": { - "type": "number" - }, - "x": { - "$ref": "#/definitions/Channel" - }, - "x1": { - "$ref": "#/definitions/Channel" - }, - "x1LinkingId": { - "type": "string" - }, - "x1e": { - "$ref": "#/definitions/Channel" - }, - "xAxis": { - "$ref": "#/definitions/AxisPosition" - }, - "xDomain": { - "anyOf": [ - { - "$ref": "#/definitions/DomainInterval" - }, - { - "$ref": "#/definitions/DomainChrInterval" - }, - { - "$ref": "#/definitions/DomainChr" - } - ] - }, - "xLinkingId": { - "type": "string" - }, - "xOffset": { - "type": "number" - }, - "xe": { - "$ref": "#/definitions/Channel" - }, - "y": { - "$ref": "#/definitions/Channel" - }, - "y1": { - "$ref": "#/definitions/Channel" - }, - "y1e": { - "$ref": "#/definitions/Channel" - }, - "yDomain": { - "anyOf": [ - { - "$ref": "#/definitions/DomainInterval" - }, - { - "$ref": "#/definitions/DomainChrInterval" - }, - { - "$ref": "#/definitions/DomainChr" - } - ] - }, - "yLinkingId": { - "type": "string" - }, - "yOffset": { - "type": "number" - }, - "ye": { - "$ref": "#/definitions/Channel" - } - }, - "type": "object" ->>>>>>> a6be28e (feat: add yDomain) -======= "$ref": "#/definitions/PartialTrack" ->>>>>>> 7f02cd3 (feat: add explicit PartialTrack def to schema (#466)) }, { "$ref": "#/definitions/OverlaidTracks" @@ -5508,9 +4061,6 @@ "x1": { "$ref": "#/definitions/Channel" }, - "x1LinkingId": { - "type": "string" - }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -5848,9 +4398,6 @@ "width": { "type": "number" }, - "x1LinkingId": { - "type": "string" - }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, From 0376a05ea2712d6d20eb80c65c12ff0663248e03 Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Tue, 17 Aug 2021 11:30:12 -0400 Subject: [PATCH 16/34] feat: add explicit PartialTrack def to schema (#466) --- schema/gosling.schema.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/schema/gosling.schema.json b/schema/gosling.schema.json index d592bdf7c..5379d6018 100644 --- a/schema/gosling.schema.json +++ b/schema/gosling.schema.json @@ -2491,7 +2491,10 @@ "type": "boolean" <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= ======= +>>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) ======= >>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) }, @@ -2615,6 +2618,7 @@ }, <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD "x1LinkingId": { "type": "string" @@ -2766,6 +2770,8 @@ >>>>>>> a901e8d (chore: adjust scales) ======= >>>>>>> 9a3cd64 (chore: rebase) +======= +>>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) "x1e": { "$ref": "#/definitions/Channel" }, From 04805f93c5bd195698b30025de15a927498960a7 Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Thu, 12 Aug 2021 15:58:29 -0400 Subject: [PATCH 17/34] feat: add yDomain --- schema/gosling.schema.json | 3 +++ src/editor/example/index.ts | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/schema/gosling.schema.json b/schema/gosling.schema.json index 5379d6018..ad6b5fb47 100644 --- a/schema/gosling.schema.json +++ b/schema/gosling.schema.json @@ -2794,6 +2794,9 @@ "xLinkingId": { "type": "string" }, + "xLinkingId": { + "type": "string" + }, "xOffset": { "type": "number" }, diff --git a/src/editor/example/index.ts b/src/editor/example/index.ts index 7801200e0..cedf64851 100644 --- a/src/editor/example/index.ts +++ b/src/editor/example/index.ts @@ -98,6 +98,13 @@ export const examples: ReadonlyArray<{ forceShow: true, underDevelopment: true }, + { + name: 'Basic Example: Vertical Band Connection w/ Independent Axes', + id: 'VERTICAL_BAND', + spec: EX_SPEC_VERTICAL_BAND, + forceShow: true, + underDevelopment: true + }, { name: 'Multi-Scale Sequence Track', id: 'SEQUENCE', From 4661f218624ad0de6049a10b38156d99de3f38cf Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Fri, 13 Aug 2021 17:54:45 -0400 Subject: [PATCH 18/34] chore: adjust scales --- schema/gosling.schema.json | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/schema/gosling.schema.json b/schema/gosling.schema.json index ad6b5fb47..eb6a0b520 100644 --- a/schema/gosling.schema.json +++ b/schema/gosling.schema.json @@ -553,6 +553,9 @@ "width": { "type": "number" }, + "x1LinkingId": { + "type": "string" + }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, @@ -945,6 +948,9 @@ }, "type": "array" }, + "x1LinkingId": { + "type": "string" + }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, @@ -1659,6 +1665,9 @@ }, "type": "array" }, + "x1LinkingId": { + "type": "string" + }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, @@ -1981,6 +1990,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -2117,6 +2129,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -2620,6 +2635,9 @@ <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> 944b106 (chore: adjust scales) "x1LinkingId": { "type": "string" }, @@ -2914,6 +2932,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -3078,6 +3099,9 @@ }, "type": "array" }, + "x1LinkingId": { + "type": "string" + }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, @@ -3276,6 +3300,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -3500,6 +3527,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -3605,6 +3635,9 @@ }, "type": "array" }, + "x1LinkingId": { + "type": "string" + }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, @@ -3790,6 +3823,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -4070,6 +4106,9 @@ "x1": { "$ref": "#/definitions/Channel" }, + "x1LinkingId": { + "type": "string" + }, "x1e": { "$ref": "#/definitions/Channel" }, @@ -4407,6 +4446,9 @@ "width": { "type": "number" }, + "x1LinkingId": { + "type": "string" + }, "xAxis": { "$ref": "#/definitions/AxisPosition" }, From 59fbfd4d3a1786bc9ecde8de03da5176cbed1b23 Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Sat, 14 Aug 2021 15:46:11 -0400 Subject: [PATCH 19/34] feat: enable showing track titles in circular layouts (#464) --- src/core/mark/title.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/mark/title.ts b/src/core/mark/title.ts index 7be29a548..d006a6ab1 100644 --- a/src/core/mark/title.ts +++ b/src/core/mark/title.ts @@ -78,7 +78,11 @@ export function drawCircularTitle( const endRad = valueToRadian(scaledEndX + padding, tw, startAngle, endAngle); g.lineStyle(1, colorToHex('red'), 0, 0.5); +<<<<<<< HEAD g.beginFill(colorToHex(theme.track.titleBackground), 0.5); // TODO: support `theme.track.titleBackgroundOpacity` +======= + g.beginFill(colorToHex(theme.track.titleBackground), 0.8); // override the opacity +>>>>>>> 4bbc4f9 (feat: enable showing track titles in circular layouts (#464)) g.moveTo(pos.x, pos.y); g.arc(cx, cy, titleR - metric.height, startRad, endRad, true); g.arc(cx, cy, titleR, endRad, startRad, false); From a38fca85271bd73365fb91b41695b79272ac678a Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Fri, 20 Aug 2021 16:26:03 -0400 Subject: [PATCH 20/34] chore: rebase --- CHANGELOG.md | 26 +++++++++++++++++++++----- schema/gosling.schema.json | 6 ++++++ src/core/mark/title.ts | 4 ---- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c782053a9..578a339e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,15 +51,31 @@ ## [0.9.3](https://github.com/gosling-lang/gosling.js/compare/v0.9.2...v0.9.3) (2021-08-18) ## [0.9.3](https://github.com/gosling-lang/gosling.js/compare/v0.9.0...v0.9.3) (2021-08-20) +## [0.9.3](https://github.com/gosling-lang/gosling.js/compare/v0.9.2...v0.9.3) (2021-08-18) + + +### Features + +* inline bam worker to the bundle ([#467](https://github.com/gosling-lang/gosling.js/issues/467)) ([95d4f1f](https://github.com/gosling-lang/gosling.js/commit/95d4f1fb97249835952c42807d2904594d1fa88b)) + + + +## [0.9.2](https://github.com/gosling-lang/gosling.js/compare/v0.9.1...v0.9.2) (2021-08-17) + + +### Features + +* add explicit PartialTrack def to schema ([#466](https://github.com/gosling-lang/gosling.js/issues/466)) ([c5c9be5](https://github.com/gosling-lang/gosling.js/commit/c5c9be599a5fdd9d375495f6e5d71ffdc364bbab)) + + + +## [0.9.1](https://github.com/gosling-lang/gosling.js/compare/v0.9.0...v0.9.1) (2021-08-14) ### Features -* add explicit PartialTrack def to schema ([#466](https://github.com/gosling-lang/gosling.js/issues/466)) ([7f02cd3](https://github.com/gosling-lang/gosling.js/commit/7f02cd3efb8bf3f6840a44f603c9e05d13a77c5a)) -* add yDomain ([a6be28e](https://github.com/gosling-lang/gosling.js/commit/a6be28eb4b3ca8e63ab240e1c4de7695dd9e87ea)) -* enable showing track titles in circular layouts ([#464](https://github.com/gosling-lang/gosling.js/issues/464)) ([4bbc4f9](https://github.com/gosling-lang/gosling.js/commit/4bbc4f983f81c93a30b0efba673e436a88b6228d)) -* inline bam worker to the bundle ([#467](https://github.com/gosling-lang/gosling.js/issues/467)) ([1a21ff1](https://github.com/gosling-lang/gosling.js/commit/1a21ff1357f24524f4423f17c44f218d9d422341)) -* responsive quantitative color legend for compact tracks ([#462](https://github.com/gosling-lang/gosling.js/issues/462)) ([40c3edf](https://github.com/gosling-lang/gosling.js/commit/40c3edf8e572f0e18b4fca7dc7b1dfc8afb1daaf)) +* enable showing track titles in circular layouts ([#464](https://github.com/gosling-lang/gosling.js/issues/464)) ([e223377](https://github.com/gosling-lang/gosling.js/commit/e2233778a22bf37ac1ca85fdc7d77e538a1651a7)) +* responsive quantitative color legend for compact tracks ([#462](https://github.com/gosling-lang/gosling.js/issues/462)) ([9d56cbe](https://github.com/gosling-lang/gosling.js/commit/9d56cbe242b3c1ef0e0ec726436b935fc7bd0fe7)) diff --git a/schema/gosling.schema.json b/schema/gosling.schema.json index eb6a0b520..d2d4a8804 100644 --- a/schema/gosling.schema.json +++ b/schema/gosling.schema.json @@ -2507,6 +2507,7 @@ <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) @@ -2660,6 +2661,8 @@ } ] >>>>>>> 7f02cd3 (feat: add explicit PartialTrack def to schema (#466)) +======= +>>>>>>> a5dd569 (chore: rebase) }, "_renderingId": { "type": "string" @@ -2779,6 +2782,7 @@ "x1LinkingId": { "type": "string" }, +<<<<<<< HEAD ======= >>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) ======= @@ -2790,6 +2794,8 @@ >>>>>>> 9a3cd64 (chore: rebase) ======= >>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) +======= +>>>>>>> a5dd569 (chore: rebase) "x1e": { "$ref": "#/definitions/Channel" }, diff --git a/src/core/mark/title.ts b/src/core/mark/title.ts index d006a6ab1..7be29a548 100644 --- a/src/core/mark/title.ts +++ b/src/core/mark/title.ts @@ -78,11 +78,7 @@ export function drawCircularTitle( const endRad = valueToRadian(scaledEndX + padding, tw, startAngle, endAngle); g.lineStyle(1, colorToHex('red'), 0, 0.5); -<<<<<<< HEAD g.beginFill(colorToHex(theme.track.titleBackground), 0.5); // TODO: support `theme.track.titleBackgroundOpacity` -======= - g.beginFill(colorToHex(theme.track.titleBackground), 0.8); // override the opacity ->>>>>>> 4bbc4f9 (feat: enable showing track titles in circular layouts (#464)) g.moveTo(pos.x, pos.y); g.arc(cx, cy, titleR - metric.height, startRad, endRad, true); g.arc(cx, cy, titleR, endRad, startRad, false); From 79370ca786d6f2ce9da56b0cc5efcd00f295b9c9 Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Fri, 20 Aug 2021 16:30:08 -0400 Subject: [PATCH 21/34] chore: update schema --- CHANGELOG.md | 50 ++++++----- schema/gosling.schema.json | 176 ------------------------------------- 2 files changed, 26 insertions(+), 200 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 578a339e5..6068a273c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +<<<<<<< HEAD ## [0.9.7](https://github.com/gosling-lang/gosling.js/compare/v0.9.6...v0.9.7) (2021-08-28) @@ -21,6 +22,9 @@ +======= +<<<<<<< HEAD +>>>>>>> 5928968 (chore: update schema) ## [0.9.5](https://github.com/gosling-lang/gosling.js/compare/v0.9.4...v0.9.5) (2021-08-27) @@ -52,30 +56,28 @@ ## [0.9.3](https://github.com/gosling-lang/gosling.js/compare/v0.9.2...v0.9.3) (2021-08-18) ## [0.9.3](https://github.com/gosling-lang/gosling.js/compare/v0.9.0...v0.9.3) (2021-08-20) ## [0.9.3](https://github.com/gosling-lang/gosling.js/compare/v0.9.2...v0.9.3) (2021-08-18) - - -### Features - -* inline bam worker to the bundle ([#467](https://github.com/gosling-lang/gosling.js/issues/467)) ([95d4f1f](https://github.com/gosling-lang/gosling.js/commit/95d4f1fb97249835952c42807d2904594d1fa88b)) - - - -## [0.9.2](https://github.com/gosling-lang/gosling.js/compare/v0.9.1...v0.9.2) (2021-08-17) - - -### Features - -* add explicit PartialTrack def to schema ([#466](https://github.com/gosling-lang/gosling.js/issues/466)) ([c5c9be5](https://github.com/gosling-lang/gosling.js/commit/c5c9be599a5fdd9d375495f6e5d71ffdc364bbab)) - - - -## [0.9.1](https://github.com/gosling-lang/gosling.js/compare/v0.9.0...v0.9.1) (2021-08-14) - - -### Features - -* enable showing track titles in circular layouts ([#464](https://github.com/gosling-lang/gosling.js/issues/464)) ([e223377](https://github.com/gosling-lang/gosling.js/commit/e2233778a22bf37ac1ca85fdc7d77e538a1651a7)) -* responsive quantitative color legend for compact tracks ([#462](https://github.com/gosling-lang/gosling.js/issues/462)) ([9d56cbe](https://github.com/gosling-lang/gosling.js/commit/9d56cbe242b3c1ef0e0ec726436b935fc7bd0fe7)) +======= +## [0.9.3](https://github.com/gosling-lang/gosling.js/compare/v0.9.0...v0.9.3) (2021-08-20) +>>>>>>> 3bf2f2c (chore: update schema) + + +### Features + +* add explicit PartialTrack def to schema ([#466](https://github.com/gosling-lang/gosling.js/issues/466)) ([e8cb45f](https://github.com/gosling-lang/gosling.js/commit/e8cb45fe21f34bc044465de0a33771b2d1dbdc54)) +* add explicit PartialTrack def to schema ([#466](https://github.com/gosling-lang/gosling.js/issues/466)) ([ab2d5b0](https://github.com/gosling-lang/gosling.js/commit/ab2d5b03a7bcfd7d9716ea71f055f899e1217b69)) +* add explicit PartialTrack def to schema ([#466](https://github.com/gosling-lang/gosling.js/issues/466)) ([20a2a67](https://github.com/gosling-lang/gosling.js/commit/20a2a678ddf86c2978449cf0769ea466d6157abd)) +* add explicit PartialTrack def to schema ([#466](https://github.com/gosling-lang/gosling.js/issues/466)) ([91cdf3c](https://github.com/gosling-lang/gosling.js/commit/91cdf3ce1a9bb50c5a195b6a08c1d55b96b4dfee)) +* add explicit PartialTrack def to schema ([#466](https://github.com/gosling-lang/gosling.js/issues/466)) ([7f02cd3](https://github.com/gosling-lang/gosling.js/commit/7f02cd3efb8bf3f6840a44f603c9e05d13a77c5a)) +* add yDomain ([a60ccef](https://github.com/gosling-lang/gosling.js/commit/a60ccef666efb5b7d349b03b2b0c448c4929c8c1)) +* add yDomain ([7c07fed](https://github.com/gosling-lang/gosling.js/commit/7c07fed6aa237c6d7fb16181b01cda5dce975241)) +* add yDomain ([a6be28e](https://github.com/gosling-lang/gosling.js/commit/a6be28eb4b3ca8e63ab240e1c4de7695dd9e87ea)) +* enable showing track titles in circular layouts ([#464](https://github.com/gosling-lang/gosling.js/issues/464)) ([e751a62](https://github.com/gosling-lang/gosling.js/commit/e751a624520465f6460628fef4dfe21db183d38c)) +* enable showing track titles in circular layouts ([#464](https://github.com/gosling-lang/gosling.js/issues/464)) ([56cc4db](https://github.com/gosling-lang/gosling.js/commit/56cc4db37f5c5913dfaac524eee485e4bf31af27)) +* enable showing track titles in circular layouts ([#464](https://github.com/gosling-lang/gosling.js/issues/464)) ([9812232](https://github.com/gosling-lang/gosling.js/commit/98122323b688ba8b5b930c1e846f5821ec42e717)) +* enable showing track titles in circular layouts ([#464](https://github.com/gosling-lang/gosling.js/issues/464)) ([9a66dbd](https://github.com/gosling-lang/gosling.js/commit/9a66dbd7ef1f96a906e9af105832b5441cd0cda2)) +* enable showing track titles in circular layouts ([#464](https://github.com/gosling-lang/gosling.js/issues/464)) ([4bbc4f9](https://github.com/gosling-lang/gosling.js/commit/4bbc4f983f81c93a30b0efba673e436a88b6228d)) +* inline bam worker to the bundle ([#467](https://github.com/gosling-lang/gosling.js/issues/467)) ([1a21ff1](https://github.com/gosling-lang/gosling.js/commit/1a21ff1357f24524f4423f17c44f218d9d422341)) +* responsive quantitative color legend for compact tracks ([#462](https://github.com/gosling-lang/gosling.js/issues/462)) ([40c3edf](https://github.com/gosling-lang/gosling.js/commit/40c3edf8e572f0e18b4fca7dc7b1dfc8afb1daaf)) diff --git a/schema/gosling.schema.json b/schema/gosling.schema.json index d2d4a8804..2ecd91a1e 100644 --- a/schema/gosling.schema.json +++ b/schema/gosling.schema.json @@ -2504,15 +2504,6 @@ "properties": { "_invalidTrack": { "type": "boolean" -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -======= -======= ->>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) -======= ->>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) }, "_renderingId": { "type": "string" @@ -2554,9 +2545,6 @@ "innerRadius": { "type": "number" }, - "linkingId": { - "type": "string" - }, "mark": { "$ref": "#/definitions/Mark" }, @@ -2632,13 +2620,6 @@ "x1": { "$ref": "#/definitions/Channel" }, -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -======= ->>>>>>> 944b106 (chore: adjust scales) "x1LinkingId": { "type": "string" }, @@ -2660,163 +2641,6 @@ "$ref": "#/definitions/DomainChr" } ] ->>>>>>> 7f02cd3 (feat: add explicit PartialTrack def to schema (#466)) -======= ->>>>>>> a5dd569 (chore: rebase) - }, - "_renderingId": { - "type": "string" - }, - "assembly": { - "$ref": "#/definitions/Assembly" - }, - "centerRadius": { - "description": "Proportion of the radius of the center white space.", - "type": "number" - }, - "color": { - "$ref": "#/definitions/Channel" - }, - "column": { - "$ref": "#/definitions/Channel" - }, - "data": { - "$ref": "#/definitions/DataDeep" - }, - "dataTransform": { - "items": { - "$ref": "#/definitions/DataTransform" - }, - "type": "array" - }, - "displacement": { - "$ref": "#/definitions/Displacement" - }, - "endAngle": { - "type": "number" - }, - "flipY": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "innerRadius": { - "type": "number" - }, - "mark": { - "$ref": "#/definitions/Mark" - }, - "opacity": { - "$ref": "#/definitions/Channel" - }, - "orientation": { - "$ref": "#/definitions/Orientation" - }, - "outerRadius": { - "type": "number" - }, - "overlayOnPreviousTrack": { - "type": "boolean" - }, - "overrideTemplate": { - "type": "boolean" - }, - "prerelease": { - "additionalProperties": false, - "properties": { - "testUsingNewRectRenderingForBAM": { - "type": "boolean" - } - }, - "type": "object" - }, - "row": { - "$ref": "#/definitions/Channel" - }, - "size": { - "$ref": "#/definitions/Channel" - }, - "spacing": { - "type": "number" - }, - "startAngle": { - "type": "number" - }, - "static": { - "type": "boolean" - }, - "stretch": { - "type": "boolean" - }, - "stroke": { - "$ref": "#/definitions/Channel" - }, - "strokeWidth": { - "$ref": "#/definitions/Channel" - }, - "style": { - "$ref": "#/definitions/Style" - }, - "text": { - "$ref": "#/definitions/Channel" - }, - "tooltip": { - "items": { - "$ref": "#/definitions/Tooltip" - }, - "type": "array" - }, - "visibility": { - "items": { - "$ref": "#/definitions/VisibilityCondition" - }, - "type": "array" - }, - "x": { - "$ref": "#/definitions/Channel" - }, - "x1": { - "$ref": "#/definitions/Channel" - }, - "x1LinkingId": { - "type": "string" - }, -<<<<<<< HEAD -======= ->>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) -======= - "x1LinkingId": { - "type": "string" - }, ->>>>>>> a901e8d (chore: adjust scales) -======= ->>>>>>> 9a3cd64 (chore: rebase) -======= ->>>>>>> c5c9be5 (feat: add explicit PartialTrack def to schema (#466)) -======= ->>>>>>> a5dd569 (chore: rebase) - "x1e": { - "$ref": "#/definitions/Channel" - }, - "xAxis": { - "$ref": "#/definitions/AxisPosition" - }, - "xDomain": { - "anyOf": [ - { - "$ref": "#/definitions/DomainInterval" - }, - { - "$ref": "#/definitions/DomainChrInterval" - }, - { - "$ref": "#/definitions/DomainChr" - } - ] - }, - "xLinkingId": { - "type": "string" }, "xLinkingId": { "type": "string" From be0164214ee7c872c486f5cb7f0c96e7556fb28e Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Fri, 20 Aug 2021 16:44:53 -0400 Subject: [PATCH 22/34] chore: update schema --- CHANGELOG.md | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6068a273c..faa47e934 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ <<<<<<< HEAD +<<<<<<< HEAD ## [0.9.7](https://github.com/gosling-lang/gosling.js/compare/v0.9.6...v0.9.7) (2021-08-28) @@ -25,6 +26,9 @@ ======= <<<<<<< HEAD >>>>>>> 5928968 (chore: update schema) +======= +<<<<<<< HEAD +>>>>>>> a2c0082 (chore: update schema) ## [0.9.5](https://github.com/gosling-lang/gosling.js/compare/v0.9.4...v0.9.5) (2021-08-27) @@ -59,25 +63,33 @@ ======= ## [0.9.3](https://github.com/gosling-lang/gosling.js/compare/v0.9.0...v0.9.3) (2021-08-20) >>>>>>> 3bf2f2c (chore: update schema) +======= +## [0.9.3](https://github.com/gosling-lang/gosling.js/compare/v0.9.2...v0.9.3) (2021-08-18) +>>>>>>> 8ab7ee9 (chore: update schema) + + +### Features + +* inline bam worker to the bundle ([#467](https://github.com/gosling-lang/gosling.js/issues/467)) ([95d4f1f](https://github.com/gosling-lang/gosling.js/commit/95d4f1fb97249835952c42807d2904594d1fa88b)) + + + +## [0.9.2](https://github.com/gosling-lang/gosling.js/compare/v0.9.1...v0.9.2) (2021-08-17) + + +### Features + +* add explicit PartialTrack def to schema ([#466](https://github.com/gosling-lang/gosling.js/issues/466)) ([c5c9be5](https://github.com/gosling-lang/gosling.js/commit/c5c9be599a5fdd9d375495f6e5d71ffdc364bbab)) + + + +## [0.9.1](https://github.com/gosling-lang/gosling.js/compare/v0.9.0...v0.9.1) (2021-08-14) ### Features -* add explicit PartialTrack def to schema ([#466](https://github.com/gosling-lang/gosling.js/issues/466)) ([e8cb45f](https://github.com/gosling-lang/gosling.js/commit/e8cb45fe21f34bc044465de0a33771b2d1dbdc54)) -* add explicit PartialTrack def to schema ([#466](https://github.com/gosling-lang/gosling.js/issues/466)) ([ab2d5b0](https://github.com/gosling-lang/gosling.js/commit/ab2d5b03a7bcfd7d9716ea71f055f899e1217b69)) -* add explicit PartialTrack def to schema ([#466](https://github.com/gosling-lang/gosling.js/issues/466)) ([20a2a67](https://github.com/gosling-lang/gosling.js/commit/20a2a678ddf86c2978449cf0769ea466d6157abd)) -* add explicit PartialTrack def to schema ([#466](https://github.com/gosling-lang/gosling.js/issues/466)) ([91cdf3c](https://github.com/gosling-lang/gosling.js/commit/91cdf3ce1a9bb50c5a195b6a08c1d55b96b4dfee)) -* add explicit PartialTrack def to schema ([#466](https://github.com/gosling-lang/gosling.js/issues/466)) ([7f02cd3](https://github.com/gosling-lang/gosling.js/commit/7f02cd3efb8bf3f6840a44f603c9e05d13a77c5a)) -* add yDomain ([a60ccef](https://github.com/gosling-lang/gosling.js/commit/a60ccef666efb5b7d349b03b2b0c448c4929c8c1)) -* add yDomain ([7c07fed](https://github.com/gosling-lang/gosling.js/commit/7c07fed6aa237c6d7fb16181b01cda5dce975241)) -* add yDomain ([a6be28e](https://github.com/gosling-lang/gosling.js/commit/a6be28eb4b3ca8e63ab240e1c4de7695dd9e87ea)) -* enable showing track titles in circular layouts ([#464](https://github.com/gosling-lang/gosling.js/issues/464)) ([e751a62](https://github.com/gosling-lang/gosling.js/commit/e751a624520465f6460628fef4dfe21db183d38c)) -* enable showing track titles in circular layouts ([#464](https://github.com/gosling-lang/gosling.js/issues/464)) ([56cc4db](https://github.com/gosling-lang/gosling.js/commit/56cc4db37f5c5913dfaac524eee485e4bf31af27)) -* enable showing track titles in circular layouts ([#464](https://github.com/gosling-lang/gosling.js/issues/464)) ([9812232](https://github.com/gosling-lang/gosling.js/commit/98122323b688ba8b5b930c1e846f5821ec42e717)) -* enable showing track titles in circular layouts ([#464](https://github.com/gosling-lang/gosling.js/issues/464)) ([9a66dbd](https://github.com/gosling-lang/gosling.js/commit/9a66dbd7ef1f96a906e9af105832b5441cd0cda2)) -* enable showing track titles in circular layouts ([#464](https://github.com/gosling-lang/gosling.js/issues/464)) ([4bbc4f9](https://github.com/gosling-lang/gosling.js/commit/4bbc4f983f81c93a30b0efba673e436a88b6228d)) -* inline bam worker to the bundle ([#467](https://github.com/gosling-lang/gosling.js/issues/467)) ([1a21ff1](https://github.com/gosling-lang/gosling.js/commit/1a21ff1357f24524f4423f17c44f218d9d422341)) -* responsive quantitative color legend for compact tracks ([#462](https://github.com/gosling-lang/gosling.js/issues/462)) ([40c3edf](https://github.com/gosling-lang/gosling.js/commit/40c3edf8e572f0e18b4fca7dc7b1dfc8afb1daaf)) +* enable showing track titles in circular layouts ([#464](https://github.com/gosling-lang/gosling.js/issues/464)) ([e223377](https://github.com/gosling-lang/gosling.js/commit/e2233778a22bf37ac1ca85fdc7d77e538a1651a7)) +* responsive quantitative color legend for compact tracks ([#462](https://github.com/gosling-lang/gosling.js/issues/462)) ([9d56cbe](https://github.com/gosling-lang/gosling.js/commit/9d56cbe242b3c1ef0e0ec726436b935fc7bd0fe7)) From d68d1fea7f9d8b8ca6235175fd7adaa7aea2f485 Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Tue, 24 Aug 2021 13:07:04 -0400 Subject: [PATCH 23/34] chore: working on compiler for axis-independent scales --- schema/gosling.schema.json | 3 + src/core/example/hg-view-config-1.ts | 111 ++++++------ src/core/gosling-to-higlass.ts | 6 +- src/core/gosling.schema.guards.ts | 18 ++ src/core/gosling.schema.ts | 1 + src/core/higlass.schema.ts | 2 +- src/core/layout/higlass.ts | 58 +++++-- src/core/utils/linking.ts | 73 ++++++-- src/core/utils/spec-preprocess.ts | 5 +- .../csv/higlass-csv-datafetcher.ts | 5 +- src/editor/example/index.ts | 24 +-- src/editor/example/synteny.ts | 164 ++++++++++++++++++ 12 files changed, 369 insertions(+), 101 deletions(-) create mode 100644 src/editor/example/synteny.ts diff --git a/schema/gosling.schema.json b/schema/gosling.schema.json index 2ecd91a1e..8a7806bc5 100644 --- a/schema/gosling.schema.json +++ b/schema/gosling.schema.json @@ -212,6 +212,9 @@ "items": { "additionalProperties": false, "properties": { + "assembly": { + "$ref": "#/definitions/Assembly" + }, "chromosomeField": { "type": "string" }, diff --git a/src/core/example/hg-view-config-1.ts b/src/core/example/hg-view-config-1.ts index 47c652e46..e70d60b22 100644 --- a/src/core/example/hg-view-config-1.ts +++ b/src/core/example/hg-view-config-1.ts @@ -20,7 +20,7 @@ const example = { options: { layout: 'linear', innerRadius: null, - width: 400, + width: 1000, height: 44, theme: { base: 'light', @@ -286,7 +286,7 @@ const example = { contents: [ { type: 'gosling-track', - width: 400, + width: 1000, height: 14, options: { showMousePosition: true, @@ -313,10 +313,10 @@ const example = { x: { field: 'chromStart', type: 'genomic', - domain: { - chromosome: '17', - interval: [20000000, 50000000] - }, + // domain: { + // chromosome: '17', + // interval: [20000000, 50000000] + // }, linkingId: 'top', axis: 'top' }, @@ -325,7 +325,7 @@ const example = { size: { value: 14 }, stroke: { value: 'black' }, strokeWidth: { value: 0.5 }, - width: 400, + width: 1000, height: 44, overlay: [ { @@ -631,8 +631,8 @@ const example = { gallery: [], whole: [] }, - initialXDomain: [2510780562, 2540780562], - initialYDomain: [2510780562, 2540780562], + initialXDomain: [0, 3088269832], + initialYDomain: [0, 3088269832], zoomFixed: false, zoomLimits: [1, null], uid: 'view-1', @@ -653,13 +653,30 @@ const example = { center: [ { type: 'combined', - width: 399, - height: 400, + width: 999, + height: 430, contents: [ { type: 'gosling-2d-track', - width: 400, - height: 400, + width: 1000, + height: 430, + data: { + url: + 'https://s3.amazonaws.com/gosling-lang.org/data/ideogram.js/homo_sapiens-mus_musculus-synteny-v73-adjusted.tsv', + type: 'csv', + genomicFieldsToConvert: [ + { + chromosomeField: 'Chromosome_spec1', + genomicFields: ['Start_spec1', 'End_spec1'] + }, + { + chromosomeField: 'Chromosome_spec2', + genomicFields: ['Start_spec2', 'End_spec2'] + } + ], + separator: '\t', + assembly: 'hg38' + }, options: { showMousePosition: true, mousePositionColor: '#000000', @@ -676,7 +693,7 @@ const example = { backgroundColor: 'transparent', spec: { layout: 'linear', - xDomain: { chromosome: '1' }, + // xDomain: { chromosome: '1' }, assembly: 'hg38', orientation: 'horizontal', static: false, @@ -686,32 +703,39 @@ const example = { style: { outlineWidth: 0 }, data: { url: - 'https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt', + 'https://s3.amazonaws.com/gosling-lang.org/data/ideogram.js/homo_sapiens-mus_musculus-synteny-v73-adjusted.tsv', type: 'csv', - headerNames: ['id', 'chr', 'p1', 'p2'], - chromosomePrefix: 'hs', - chromosomeField: 'chr', - genomicFields: ['p1', 'p2'], - separator: ' ', - longToWideId: 'id' + genomicFieldsToConvert: [ + { + chromosomeField: 'Chromosome_spec1', + genomicFields: ['Start_spec1', 'End_spec1'] + }, + { + chromosomeField: 'Chromosome_spec2', + genomicFields: ['Start_spec2', 'End_spec2'] + } + ], + separator: '\t', + assembly: 'hg38' }, mark: 'betweenLink', x: { - field: 'p1', + field: 'Start_spec1', type: 'genomic', axis: 'none', - linkingId: 'top', - domain: { chromosome: '1' } + linkingId: 'top' + // domain: { chromosome: '1' } }, - xe: { field: 'p2', type: 'genomic' }, + xe: { field: 'End_spec1', type: 'genomic' }, x1: { - field: 'p1_2', + field: 'Start_spec2', type: 'genomic', linkingId: 'bottom' }, - x1e: { field: 'p2_2', type: 'genomic' }, - stroke: { - field: 'chr', + x1e: { field: 'End_spec2', type: 'genomic' }, + strokeWidth: { value: 0 }, + color: { + field: 'Chromosome_spec1', type: 'nominal', domain: [ 'chr1', @@ -741,8 +765,8 @@ const example = { ] }, opacity: { value: 0.5 }, - width: 400, - height: 400, + width: 1000, + height: 430, overlayOnPreviousTrack: false }, theme: { @@ -986,17 +1010,6 @@ const example = { quantitativeSizeRange: [2, 6] } } - }, - data: { - url: 'https://raw.githubusercontent.com/vigsterkr/circos/master/data/5/segdup.txt', - type: 'csv', - headerNames: ['id', 'chr', 'p1', 'p2'], - chromosomePrefix: 'hs', - chromosomeField: 'chr', - genomicFields: ['p1', 'p2'], - separator: ' ', - longToWideId: 'id', - assembly: 'hg38' } } ] @@ -1007,7 +1020,7 @@ const example = { gallery: [], whole: [] }, - initialXDomain: [1, 248956422], + initialXDomain: [1, 3088269832], initialYDomain: [0, 3088269832], zoomFixed: false, zoomLimits: [1, null], @@ -1029,12 +1042,12 @@ const example = { center: [ { type: 'combined', - width: 399, + width: 999, height: 14, contents: [ { type: 'gosling-track', - width: 400, + width: 1000, height: 14, options: { showMousePosition: true, @@ -1062,7 +1075,7 @@ const example = { field: 'chromStart', type: 'genomic', axis: 'bottom', - domain: { chromosome: '3' }, + // domain: { chromosome: '3' }, linkingId: 'bottom' }, xe: { field: 'chromEnd', type: 'genomic' }, @@ -1070,7 +1083,7 @@ const example = { size: { value: 14 }, stroke: { value: 'black' }, strokeWidth: { value: 0.5 }, - width: 400, + width: 1000, height: 44, overlay: [ { @@ -1640,8 +1653,8 @@ const example = { gallery: [], whole: [] }, - initialXDomain: [491149952, 689445510], - initialYDomain: [491149952, 689445510], + initialXDomain: [0, 3088269832], + initialYDomain: [0, 3088269832], zoomFixed: false, zoomLimits: [1, null], uid: 'view-3' diff --git a/src/core/gosling-to-higlass.ts b/src/core/gosling-to-higlass.ts index a5b2f2fd4..91602eea2 100644 --- a/src/core/gosling-to-higlass.ts +++ b/src/core/gosling-to-higlass.ts @@ -147,7 +147,11 @@ export function goslingToHiGlass( .adjustDomain(firstResolvedSpec.orientation, width, height) .setMainTrack(hgTrack) .addTrackSourceServers(server) - .setZoomFixed(firstResolvedSpec.static === true) + .setZoomFixed( + Is2DTrack(firstResolvedSpec) && firstResolvedSpec.mark === 'betweenLink' + ? true + : firstResolvedSpec.static === true + ) .setLayout(layout); } diff --git a/src/core/gosling.schema.guards.ts b/src/core/gosling.schema.guards.ts index b6f00a6c3..22df6fcdc 100644 --- a/src/core/gosling.schema.guards.ts +++ b/src/core/gosling.schema.guards.ts @@ -145,6 +145,24 @@ export function Is2DTrack(track: Track) { ); } +/** + * Is this a between link view with two independent axes? + * TODO: should we include orthorgonal view that use both x and y for genomics fields? + */ +export function IsConnectorView(track: Track) { + return ( + IsSingleTrack(track) && + track.mark === 'betweenLink' && + IsChannelDeep(track['x']) && + track['x'].type === 'genomic' && + IsChannelDeep(track['x1']) && + track['x1'].type === 'genomic' && + track['x'].linkingId && + track['x1'].linkingId && + track['x'].linkingId !== track['x1'].linkingId + ); +} + export function IsChannelValue( channel: ChannelDeep | ChannelValue | ChannelBind | undefined | 'none' ): channel is ChannelValue { diff --git a/src/core/gosling.schema.ts b/src/core/gosling.schema.ts index 6a54a4df1..7dbda5a35 100644 --- a/src/core/gosling.schema.ts +++ b/src/core/gosling.schema.ts @@ -393,6 +393,7 @@ export interface CSVData { genomicFieldsToConvert?: { chromosomeField: string; genomicFields: string[]; + assembly?: Assembly; }[]; } diff --git a/src/core/higlass.schema.ts b/src/core/higlass.schema.ts index 85b907cc9..80029669c 100644 --- a/src/core/higlass.schema.ts +++ b/src/core/higlass.schema.ts @@ -152,7 +152,7 @@ export interface GenericLocks { } export interface LocksByViewUid { - [k: string]: string; + [k: string]: any; // string | { [k: string]: { lock: string, axis: string } }; } export interface ValueScaleLocks { diff --git a/src/core/layout/higlass.ts b/src/core/layout/higlass.ts index 33af5370e..8a61eabee 100644 --- a/src/core/layout/higlass.ts +++ b/src/core/layout/higlass.ts @@ -13,14 +13,12 @@ export function renderHiGlass( theme: CompleteThemeDeep ) { if (trackInfos.length === 0) { - // no tracks to render + // no tracks to render, so no point to render HiGlass. return; } - // HiGlass model + /* Generate/update the HiGlass model by iterating tracks */ const hgModel = new HiGlassModel(); - - /* Update the HiGlass model by iterating tracks */ trackInfos.forEach(tb => { const { track, boundingBox: bb, layout } = tb; goslingToHiGlass(hgModel, track, bb, layout, theme); @@ -29,8 +27,7 @@ export function renderHiGlass( /* Add linking information to the HiGlass model */ const linkingInfos = getLinkingInfo(hgModel); - // Brushing - // (between a view with `brush` and a view having the same linking name) + /* Linking between a brush and a view */ linkingInfos .filter(d => d.isBrush) .forEach(info => { @@ -43,33 +40,60 @@ export function renderHiGlass( ); }); - // location/zoom lock information - // fill `locksByViewUid` + /* + * Linking zoom levels between views + */ + + // Set `locksByViewUid` linkingInfos .filter(d => !d.isBrush) .forEach(d => { - hgModel.spec().zoomLocks.locksByViewUid[d.viewId] = d.linkId; - hgModel.spec().locationLocks.locksByViewUid[d.viewId] = d.linkId; + hgModel.spec().zoomLocks.locksByViewUid[d.viewId] = d.zoomLinkingId; }); - // fill `locksDict` - const uniqueLinkIds = Array.from(new Set(linkingInfos.map(d => d.linkId))); + // Set `locksDict` + const uniqueZoomLinkIds = Array.from(new Set(linkingInfos.map(d => d.zoomLinkingId))); + uniqueZoomLinkIds.forEach(zoomLinkingId => { + hgModel.spec().zoomLocks.locksDict[zoomLinkingId] = { uid: zoomLinkingId }; + linkingInfos + .filter(d => !d.isBrush) + .filter(d => d.zoomLinkingId === zoomLinkingId) + .forEach(d => { + hgModel.spec().zoomLocks.locksDict[zoomLinkingId][d.viewId] = [124625310.5, 124625310.5, 249250.621]; + }); + }); + + /* + * Linking locations between views + */ - uniqueLinkIds.forEach(linkId => { - hgModel.spec().zoomLocks.locksDict[linkId] = { uid: linkId }; - hgModel.spec().locationLocks.locksDict[linkId] = { uid: linkId }; + // Set `locksByViewUid` + linkingInfos + .filter(d => !d.isBrush) + .forEach(d => { + if (!hgModel.spec().locationLocks.locksByViewUid[d.viewId]) { + hgModel.spec().locationLocks.locksByViewUid[d.viewId] = {}; + } + hgModel.spec().locationLocks.locksByViewUid[d.viewId][d.channel === 'x' ? 'x' : 'y'] = { + lock: d.linkId, + axis: d.viewId === 'view-3' ? 'y' : 'x' + }; + }); + // Set `locksDict` + const uniqueLocationLinkIds = Array.from(new Set(linkingInfos.map(d => d.linkId))); + uniqueLocationLinkIds.forEach(linkId => { + hgModel.spec().locationLocks.locksDict[linkId] = { uid: linkId }; linkingInfos .filter(d => !d.isBrush) .filter(d => d.linkId === linkId) .forEach(d => { - hgModel.spec().zoomLocks.locksDict[linkId][d.viewId] = [124625310.5, 124625310.5, 249250.621]; hgModel.spec().locationLocks.locksDict[linkId][d.viewId] = [124625310.5, 124625310.5, 249250.621]; }); }); // !! Uncomment the following code to test with specific HiGlass viewConfig - hgModel.setExampleHiglassViewConfig(); + // hgModel.setExampleHiglassViewConfig(); setHg(hgModel.spec(), getBoundingBox(trackInfos)); } diff --git a/src/core/utils/linking.ts b/src/core/utils/linking.ts index e56604fd5..90f4f2eb4 100644 --- a/src/core/utils/linking.ts +++ b/src/core/utils/linking.ts @@ -1,25 +1,31 @@ +import { Orientation } from '../gosling.schema'; import { IsChannelDeep } from '../gosling.schema.guards'; import { HiGlassModel } from '../higlass-model'; -import { SUPPORTED_CHANNELS } from '../mark'; import { resolveSuperposedTracks } from './overlay'; /** - * + * Construct information for linking views. This is used to generate HiGlass viewConfig and render interactive brushes. */ export function getLinkingInfo(hgModel: HiGlassModel) { - const linkingInfo: { + let linkingInfo: { layout: 'circular' | 'linear'; + orientation: Orientation; + channel: 'x' | 'x1' | 'y'; viewId: string; linkId: string; + zoomLinkingId: string; isBrush: boolean; style: any; }[] = []; + const sharedZoomIds: string[][] = []; + + // TODO: remove duplicated linkingIds before reaching this for the simplicity (e.g., x: { ..., linkingId: 'top'}, x1: {..., linkingId: 'top'}}) hgModel.spec().views.forEach(v => { const viewId = v.uid; // TODO: Better way to get view specifications? - // Get spec of a view + // Get spec of a main track let spec = /* TODO: */ (v.tracks as any).center?.[0]?.contents?.[0]?.options?.spec; if (!spec) { @@ -33,18 +39,23 @@ export function getLinkingInfo(hgModel: HiGlassModel) { if (!viewId || !spec) return; - const resolved = resolveSuperposedTracks(spec); + const resolvedTracks = resolveSuperposedTracks(spec); - resolved.forEach(spec => { - SUPPORTED_CHANNELS.forEach(cKey => { + resolvedTracks.forEach(spec => { + // TODO: support all other channels as well (`SUPPORTED_CHANNELS`) + (['x', 'x1', 'y'] as ('x' | 'x1' | 'y')[]).forEach(cKey => { const channel = spec[cKey]; + const isBrush = spec.mark === 'brush'; - if (IsChannelDeep(channel) && channel.linkingId) { + if (IsChannelDeep(channel) && channel.linkingId && channel.type === 'genomic') { linkingInfo.push({ layout: spec.layout === 'circular' ? 'circular' : 'linear', + orientation: spec.orientation ?? 'horizontal', + channel: cKey, viewId, linkId: channel.linkingId, - isBrush: spec.mark === 'brush', + zoomLinkingId: '', // This will be added very soon below + isBrush, style: { color: (spec as any).color?.value, stroke: (spec as any).stroke?.value, @@ -56,10 +67,52 @@ export function getLinkingInfo(hgModel: HiGlassModel) { outerRadius: spec.outerRadius } }); - return; } }); + + /* Search for the shared zoom locks */ + const { x, x1, y } = spec; // TODO: support all other non-genomic channels as well + + const xLinkingId = IsChannelDeep(x) && x.type === 'genomic' && x.linkingId ? x.linkingId : undefined; + const x1LinkingId = IsChannelDeep(x1) && x1.type === 'genomic' && x1.linkingId ? x1.linkingId : undefined; + const yLinkingId = IsChannelDeep(y) && y.type === 'genomic' && y.linkingId ? y.linkingId : undefined; + + const uniqueLinkingIds = Array.from(new Set([xLinkingId, x1LinkingId, yLinkingId].filter(d => d))); + if (uniqueLinkingIds.length === 2) { + // Store these information so that zoom levels should be locked across all views that use either one of these linkingIds + let foundOrUpdated = false; + sharedZoomIds.forEach((d, i, arr) => { + const combinedUniqueIds = Array.from([...uniqueLinkingIds, ...d]); + if (combinedUniqueIds.length === d.length) { + // This means linkingIds have been already added, so no need additional action + foundOrUpdated = true; + } else if (combinedUniqueIds.length === d.length + 1) { + // This means linkingIds have been already added, so no need to do anything + arr[i] = combinedUniqueIds as string[]; + foundOrUpdated = true; + } else { + // This means we did not find any overlap, so keep iterate + } + }); + + if (!foundOrUpdated) { + // This means we have to add an additional item to the array + sharedZoomIds.push(uniqueLinkingIds as string[]); + } + } else if (uniqueLinkingIds.length === 3) { + // Does not make sense for all three channels to have unique linkingIds + } }); }); + + // Use common `linkingId` for shared zoom levels + linkingInfo = linkingInfo.map(d => { + const sharedIds = sharedZoomIds.find(ids => ids.indexOf(d.linkId) !== -1); + return { + ...d, + zoomLinkingId: sharedIds ? sharedIds.sort().join('-') : d.linkId + }; + }); + return linkingInfo; } diff --git a/src/core/utils/spec-preprocess.ts b/src/core/utils/spec-preprocess.ts index 333cc4838..6060b53f9 100644 --- a/src/core/utils/spec-preprocess.ts +++ b/src/core/utils/spec-preprocess.ts @@ -17,7 +17,8 @@ import { IsOverlaidTrack, IsFlatTracks, IsStackedTracks, - Is2DTrack + Is2DTrack, + IsConnectorView } from '../gosling.schema.guards'; import { DEFAULT_INNER_RADIUS_PROP, @@ -244,7 +245,7 @@ export function traverseToFixSpecDownstream(spec: GoslingSpec | SingleView, pare /** * A track with 2D genomic coordinates is forced to use a linear layout */ - if (Is2DTrack(track)) { + if (Is2DTrack(track) && !IsConnectorView(track)) { // TODO: Add a test for this. track.layout = 'linear'; } diff --git a/src/data-fetcher/csv/higlass-csv-datafetcher.ts b/src/data-fetcher/csv/higlass-csv-datafetcher.ts index f5c581d2f..cd1e628c5 100644 --- a/src/data-fetcher/csv/higlass-csv-datafetcher.ts +++ b/src/data-fetcher/csv/higlass-csv-datafetcher.ts @@ -98,16 +98,17 @@ function CSVDataFetcher(HGC: any, ...args: any): any { // This spec is used when multiple chromosomes are stored in a single row genomicFieldsToConvert.forEach((d: any) => { const cField = d.chromosomeField; + const assembly = d.assembly ?? this.assembly; d.genomicFields.forEach((g: string) => { try { - if (this.assembly !== 'unknown') { + if (assembly !== 'unknown') { // This means we need to use the relative position considering the start position of individual chr. const chr = chromosomePrefix ? row[cField].replace(chromosomePrefix, 'chr') : row[cField].includes('chr') ? row[cField] : `chr${row[cField]}`; - row[g] = GET_CHROM_SIZES(this.assembly).interval[chr][0] + +row[g]; + row[g] = GET_CHROM_SIZES(assembly).interval[chr][0] + +row[g]; } else { // In this case, we use the genomic position as it is w/o adding the cumulative length of chr. // So, nothing to do additionally. diff --git a/src/editor/example/index.ts b/src/editor/example/index.ts index cedf64851..12c8442a9 100644 --- a/src/editor/example/index.ts +++ b/src/editor/example/index.ts @@ -16,8 +16,9 @@ import { EX_SPEC_GIVE } from './give'; import { EX_SPEC_CORCES_ET_AL } from './corces'; import { EX_SPEC_CYTOBANDS } from './ideograms'; import { EX_SPEC_PILEUP } from './pileup'; -import { EX_SPEC_BAND, EX_SPEC_VERTICAL_BAND } from './vertical-band'; +import { EX_SPEC_BAND } from './vertical-band'; import { EX_SPEC_TEMPLATE } from './track-template'; +import { EX_SPEC_ALIGNMENT } from './synteny'; import { EX_SPEC_DEBUG } from './debug'; export const examples: ReadonlyArray<{ @@ -38,8 +39,7 @@ export const examples: ReadonlyArray<{ { name: 'Basic Example: Visual Encoding', id: 'VISUAL_ENCODING', - spec: EX_SPEC_VISUAL_ENCODING, - forceShow: true + spec: EX_SPEC_VISUAL_ENCODING }, { name: 'Basic Example: Circular Visual Encoding', @@ -84,24 +84,10 @@ export const examples: ReadonlyArray<{ id: 'CIRCULAR_OVERVIEW_LINEAR_DETAIL', spec: EX_SPEC_CIRCULAR_OVERVIEW_LINEAR_DETAIL }, - // { - // name: 'Basic Example: Vertical Band Connection w/ Independent Axes', - // id: 'VERTICAL_BAND', - // spec: EX_SPEC_VERTICAL_BAND, - // forceShow: true, - // underDevelopment: true - // }, - { - name: 'Basic Example: Vertical Band Connection w/ Independent Axes', - id: 'VERTICAL_BAND', - spec: EX_SPEC_VERTICAL_BAND, - forceShow: true, - underDevelopment: true - }, { name: 'Basic Example: Vertical Band Connection w/ Independent Axes', - id: 'VERTICAL_BAND', - spec: EX_SPEC_VERTICAL_BAND, + id: 'GENOME_ALIGNMENT', + spec: EX_SPEC_ALIGNMENT, forceShow: true, underDevelopment: true }, diff --git a/src/editor/example/synteny.ts b/src/editor/example/synteny.ts new file mode 100644 index 000000000..2453febfc --- /dev/null +++ b/src/editor/example/synteny.ts @@ -0,0 +1,164 @@ +import { GoslingSpec } from '../../core/gosling.schema'; + +export const EX_SPEC_ALIGNMENT: GoslingSpec = { + title: 'Genome Alignment', + subtitle: 'Reimplementation of Genome Alignment Example in Ideogram.js', + arrangement: 'parallel', + layout: 'circular', + spacing: 0, + style: { outlineWidth: 0 }, + xDomain: { interval: [0, 500000000] }, + views: [ + { + xLinkingId: 'top', + assembly: 'mm10', + tracks: [ + { + id: 'view-1', + template: 'ideogram', + data: { + url: + 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/UCSC.HG38.Human.CytoBandIdeogram.csv', + type: 'csv', + chromosomeField: 'Chromosome', + genomicFields: ['chromStart', 'chromEnd'] + }, + encoding: { + startPosition: { field: 'chromStart' }, + endPosition: { field: 'chromEnd' }, + stainBackgroundColor: { field: 'Stain' }, + stainLabelColor: { field: 'Stain' }, + name: { field: 'Name' }, + stainStroke: { value: 'black' } + }, + width: 1000, + height: 20 + } + ] + }, + { + tracks: [ + { + id: 'view-2', + data: { + url: + 'https://s3.amazonaws.com/gosling-lang.org/data/ideogram.js/homo_sapiens-mus_musculus-synteny-v73-adjusted.tsv', + type: 'csv', + genomicFieldsToConvert: [ + { + assembly: 'mm10', + chromosomeField: 'Chromosome_spec1', + genomicFields: ['Start_spec1', 'End_spec1'] + }, + { + chromosomeField: 'Chromosome_spec2', + genomicFields: ['Start_spec2', 'End_spec2'] + } + ], + separator: '\t' + }, + mark: 'betweenLink', + x: { + field: 'Start_spec1', + type: 'genomic', + axis: 'none', + linkingId: 'top' + }, + xe: { field: 'End_spec1', type: 'genomic' }, + x1: { + field: 'Start_spec2', + type: 'genomic', + linkingId: 'bottom' + }, + x1e: { field: 'End_spec2', type: 'genomic' }, + strokeWidth: { value: 0 }, + color: { + field: 'Chromosome_spec1', + type: 'nominal', + domain: [ + 'chr1', + 'chr2', + 'chr3', + 'chr4', + 'chr5', + 'chr6', + 'chr7', + 'chr8', + 'chr9', + 'chr10', + 'chr11', + 'chr12', + 'chr13', + 'chr14', + 'chr15', + 'chr16', + 'chr17', + 'chr18', + 'chr19', + 'chr20', + 'chr21', + 'chr22', + 'chrX', + 'chrY' + ], + range: [ + 'rgb(153, 102, 0)', + 'rgb(102, 102, 0)', + 'rgb(153, 153, 30)', + 'rgb(204, 0, 0)', + 'rgb(255, 0, 0)', + 'rgb(255, 0, 204)', + 'rgb(255, 204, 204)', + 'rgb(255, 153, 0)', + 'rgb(255, 204, 0)', + 'rgb(255, 255, 0)', + 'rgb(204, 255, 0)', + 'rgb(0, 255, 0)', + 'rgb(53, 128, 0)', + 'rgb(0, 0, 204)', + 'rgb(102, 153, 255)', + 'rgb(153, 204, 255)', + 'rgb(0, 255, 255)', + 'rgb(204, 255, 255)', + 'rgb(153, 0, 204)', + 'rgb(204, 51, 255)', + 'rgb(204, 153, 255)', + 'rgb(102, 102, 102)', + 'rgb(255, 102, 102)', + 'rgb(102, 102, 255)' + ] + }, + opacity: { value: 0.5 }, + width: 1000, + height: 430 + } + ] + }, + { + xLinkingId: 'bottom', + tracks: [ + { + id: 'view-3', + template: 'ideogram', + data: { + url: + 'https://raw.githubusercontent.com/sehilyi/gemini-datasets/master/data/UCSC.HG38.Human.CytoBandIdeogram.csv', + type: 'csv', + chromosomeField: 'Chromosome', + genomicFields: ['chromStart', 'chromEnd'] + }, + encoding: { + startPosition: { field: 'chromStart', axis: 'bottom' }, + endPosition: { field: 'chromEnd' }, + stainBackgroundColor: { field: 'Stain' }, + stainLabelColor: { field: 'Stain' }, + name: { field: 'Name' }, + stainStroke: { value: 'black' } + }, + width: 1000, + height: 20 + } + ] + } + ] +}; From edf97af24bdc9d52a3fd9b157b76413df7dc750e Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Fri, 27 Aug 2021 13:43:16 -0400 Subject: [PATCH 24/34] chore: code clean after conflict resolve --- CHANGELOG.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index faa47e934..7224974b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ## [0.9.7](https://github.com/gosling-lang/gosling.js/compare/v0.9.6...v0.9.7) (2021-08-28) @@ -29,6 +30,8 @@ ======= <<<<<<< HEAD >>>>>>> a2c0082 (chore: update schema) +======= +>>>>>>> bacefc6 (chore: code clean after conflict resolve) ## [0.9.5](https://github.com/gosling-lang/gosling.js/compare/v0.9.4...v0.9.5) (2021-08-27) @@ -58,14 +61,6 @@ ## [0.9.3](https://github.com/gosling-lang/gosling.js/compare/v0.9.2...v0.9.3) (2021-08-18) -## [0.9.3](https://github.com/gosling-lang/gosling.js/compare/v0.9.0...v0.9.3) (2021-08-20) -## [0.9.3](https://github.com/gosling-lang/gosling.js/compare/v0.9.2...v0.9.3) (2021-08-18) -======= -## [0.9.3](https://github.com/gosling-lang/gosling.js/compare/v0.9.0...v0.9.3) (2021-08-20) ->>>>>>> 3bf2f2c (chore: update schema) -======= -## [0.9.3](https://github.com/gosling-lang/gosling.js/compare/v0.9.2...v0.9.3) (2021-08-18) ->>>>>>> 8ab7ee9 (chore: update schema) ### Features From 40feb305b30da9f3a5a466c6625cdc2fd3599c36 Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Sat, 28 Aug 2021 19:28:35 -0400 Subject: [PATCH 25/34] chore: rebase --- CHANGELOG.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7224974b4..a04211cf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,3 @@ -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD ## [0.9.7](https://github.com/gosling-lang/gosling.js/compare/v0.9.6...v0.9.7) (2021-08-28) @@ -24,14 +21,6 @@ -======= -<<<<<<< HEAD ->>>>>>> 5928968 (chore: update schema) -======= -<<<<<<< HEAD ->>>>>>> a2c0082 (chore: update schema) -======= ->>>>>>> bacefc6 (chore: code clean after conflict resolve) ## [0.9.5](https://github.com/gosling-lang/gosling.js/compare/v0.9.4...v0.9.5) (2021-08-27) From 1090482feeb2658f160b1ce4d240f1da1f549976 Mon Sep 17 00:00:00 2001 From: Sehi L'Yi Date: Sat, 28 Aug 2021 21:32:02 -0400 Subject: [PATCH 26/34] feat: support overlaying views --- package.json | 1 - src/core/gosling-to-higlass.ts | 34 +++++++++++--------------- src/core/higlass-component-wrapper.tsx | 3 ++- src/core/higlass-model.ts | 1 + src/core/higlass.schema.ts | 1 + src/editor/example/synteny.ts | 2 +- src/editor/index.css | 5 ++++ src/gosling-track/gosling-track.ts | 3 +++ yarn.lock | 28 ++------------------- 9 files changed, 29 insertions(+), 49 deletions(-) diff --git a/package.json b/package.json index 735127c56..d0f686f81 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,6 @@ "lodash": "^4.17.15", "mixwith": "^0.1.1", "pubsub-js": "^1.9.3", - "react-grid-layout": "^1.2.5", "threads": "^1.6.4", "worker-loader": "^3.0.8" }, diff --git a/src/core/gosling-to-higlass.ts b/src/core/gosling-to-higlass.ts index 91602eea2..ffd118eeb 100644 --- a/src/core/gosling-to-higlass.ts +++ b/src/core/gosling-to-higlass.ts @@ -134,26 +134,20 @@ export function goslingToHiGlass( hgTrack.options.colorbarPosition = (firstResolvedSpec.color as any)?.legend ? 'topRight' : 'hidden'; } - if (firstResolvedSpec.overlayOnPreviousTrack) { - hgModel - .setViewOrientation(firstResolvedSpec.orientation) // TODO: Orientation should be assigned to 'individual' views - .addTrackToCombined(hgTrack); - } else { - hgModel - .setViewOrientation(firstResolvedSpec.orientation) // TODO: Orientation should be assigned to 'individual' views - .setAssembly(assembly) // TODO: Assembly should be assigned to 'individual' views - .addDefaultView(firstResolvedSpec.id ? `${firstResolvedSpec.id}-view` : uuid.v1(), assembly) - .setDomain(xDomain, Is2DTrack(firstResolvedSpec) ? yDomain : xDomain) - .adjustDomain(firstResolvedSpec.orientation, width, height) - .setMainTrack(hgTrack) - .addTrackSourceServers(server) - .setZoomFixed( - Is2DTrack(firstResolvedSpec) && firstResolvedSpec.mark === 'betweenLink' - ? true - : firstResolvedSpec.static === true - ) - .setLayout(layout); - } + hgModel + .setViewOrientation(firstResolvedSpec.orientation) // TODO: Orientation should be assigned to 'individual' views + .setAssembly(assembly) // TODO: Assembly should be assigned to 'individual' views + .addDefaultView(firstResolvedSpec.id ? `${firstResolvedSpec.id}-view` : uuid.v1(), assembly) + .setDomain(xDomain, Is2DTrack(firstResolvedSpec) ? yDomain : xDomain) + .adjustDomain(firstResolvedSpec.orientation, width, height) + .setMainTrack(hgTrack) + .addTrackSourceServers(server) + .setZoomFixed( + Is2DTrack(firstResolvedSpec) && firstResolvedSpec.mark === 'betweenLink' + ? true + : firstResolvedSpec.static === true + ) + .setLayout(layout); // determine the compactness type of an axis considering the size of a track const getAxisNarrowType = ( diff --git a/src/core/higlass-component-wrapper.tsx b/src/core/higlass-component-wrapper.tsx index 004924baf..025a2f4a0 100644 --- a/src/core/higlass-component-wrapper.tsx +++ b/src/core/higlass-component-wrapper.tsx @@ -58,7 +58,8 @@ export const HiGlassComponentWrapper = forwardRef