gosling.js 0.17.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -15
- package/dist/editor/example/json-spec/mouse-event.d.ts.map +1 -1
- package/dist/{exported-utils-c7f92c46.js → exported-utils-51b5f19f.js} +11 -98
- package/dist/exported-utils-51b5f19f.js.map +1 -0
- package/dist/gosling.js +190 -393
- package/dist/gosling.js.map +1 -1
- package/dist/src/compiler/compile.d.ts.map +1 -1
- package/dist/src/compiler/spec-preprocess.d.ts +1 -13
- package/dist/src/compiler/spec-preprocess.d.ts.map +1 -1
- package/dist/src/core/gosling-component.d.ts +4 -4
- package/dist/src/core/gosling-component.d.ts.map +1 -1
- package/dist/src/core/utils/overlay.d.ts.map +1 -1
- package/dist/src/core/utils/template.d.ts.map +1 -1
- package/dist/src/gosling-schema/gosling.schema.d.ts +3 -18
- package/dist/src/gosling-schema/gosling.schema.d.ts.map +1 -1
- package/dist/src/gosling-schema/gosling.schema.guards.d.ts +1 -3
- package/dist/src/gosling-schema/gosling.schema.guards.d.ts.map +1 -1
- package/dist/src/tracks/gosling-track/gosling-track.d.ts.map +1 -1
- package/dist/utils.js +6 -6
- package/package.json +1 -1
- package/dist/exported-utils-c7f92c46.js.map +0 -1
package/README.md
CHANGED
|
@@ -6,9 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
<img width="1549" alt="teaser" src="https://user-images.githubusercontent.com/9922882/109852545-e05f3400-7c22-11eb-90f3-7371e4ddeb42.png">
|
|
8
8
|
|
|
9
|
-
> [!WARNING]
|
|
10
|
-
> Please be aware that the grammar of Gosling.js is subject to change before the v1.0.0 release.
|
|
11
|
-
|
|
12
9
|
## Why Gosling?
|
|
13
10
|
|
|
14
11
|
The Gosling's key features compared to existing visualization libraries and grammars are as follows:
|
|
@@ -23,27 +20,20 @@ The Gosling's key features compared to existing visualization libraries and gram
|
|
|
23
20
|
|
|
24
21
|
- [Documentation](http://gosling-lang.org/)
|
|
25
22
|
- [Gosling.js Editor](https://gosling.js.org/)
|
|
26
|
-
- [
|
|
23
|
+
- [Gallery Examples](https://gosling-lang.org/examples/)
|
|
24
|
+
- [How-to & Tutorials](https://gosling-lang.org/tutorials/)
|
|
27
25
|
|
|
28
|
-
##
|
|
26
|
+
## Contribute to Gosling.js
|
|
29
27
|
|
|
30
28
|
We welcome and greatly appreciate your contribution to this project! Please read [CONTRIBUTING.md](/CONTRIBUTING.md) to find guidelines.
|
|
31
29
|
|
|
32
30
|
## Contact
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
## Team
|
|
37
|
-
|
|
38
|
-
- Sehi L'Yi ([@sehi_lyi](https://twitter.com/sehi_lyi) | <sehi_lyi@hms.harvard.edu>)
|
|
39
|
-
- Qianwen Wang ([@WangQianwenToo](https://twitter.com/WangQianwenToo) | <qianwen_wang@hms.harvard.edu>)
|
|
40
|
-
- Fritz Lekschas ([@flekschas](https://twitter.com/flekschas) | [lekschas.de](https://lekschas.de))
|
|
41
|
-
- Trevor Manz ([@trevmanz](https://twitter.com/trevmanz) | <trevor_manz@g.harvard.edu>)
|
|
42
|
-
- Nils Gehlenborg ([@ngehlenborg](https://twitter.com/ngehlenborg) | <nils@hms.harvard.edu>)
|
|
32
|
+
Open [Github Issues](https://github.com/gosling-lang/gosling.js/issues/) to ask questions or request features.
|
|
43
33
|
|
|
44
34
|
## Citation
|
|
45
35
|
|
|
46
|
-
[L'Yi et al., 2021. “Gosling: A Grammar-based Toolkit for Scalable and Interactive Genomics Data Visualization.”](https://
|
|
36
|
+
[L'Yi et al., 2021. “Gosling: A Grammar-based Toolkit for Scalable and Interactive Genomics Data Visualization.”](https://pmc.ncbi.nlm.nih.gov/articles/PMC8826597/)
|
|
47
37
|
|
|
48
38
|
```bib
|
|
49
39
|
@article{lyi2021gosling,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mouse-event.d.ts","sourceRoot":"","sources":["../../../../editor/example/json-spec/mouse-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAI7E,eAAO,MAAM,GAAG,EAAE,WA6BjB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"mouse-event.d.ts","sourceRoot":"","sources":["../../../../editor/example/json-spec/mouse-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAI7E,eAAO,MAAM,GAAG,EAAE,WA6BjB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,WAqLjC,CAAC"}
|
|
@@ -2751,7 +2751,7 @@ function drawPostEmbellishment(HGC, trackInfo, tile, model, theme) {
|
|
|
2751
2751
|
drawColorLegend(HGC, trackInfo, tile, model, theme);
|
|
2752
2752
|
}
|
|
2753
2753
|
function resolveSuperposedTracks(track) {
|
|
2754
|
-
if (
|
|
2754
|
+
if (IsTemplateTrack(track) || IsDummyTrack(track)) {
|
|
2755
2755
|
return [];
|
|
2756
2756
|
}
|
|
2757
2757
|
if (!IsOverlaidTrack(track)) {
|
|
@@ -2787,7 +2787,7 @@ function resolveSuperposedTracks(track) {
|
|
|
2787
2787
|
function spreadTracksByData(tracks) {
|
|
2788
2788
|
return [].concat(
|
|
2789
2789
|
...tracks.map((t) => {
|
|
2790
|
-
if (
|
|
2790
|
+
if (!IsOverlaidTrack(t) || t._overlay.length <= 1) {
|
|
2791
2791
|
return [t];
|
|
2792
2792
|
}
|
|
2793
2793
|
if (t._overlay.filter((s) => s.data).length === 0) {
|
|
@@ -2880,15 +2880,9 @@ function IsOverlaidTracks(_) {
|
|
|
2880
2880
|
function IsStackedTracks(_) {
|
|
2881
2881
|
return !IsFlatTracks(_) && !IsOverlaidTracks(_);
|
|
2882
2882
|
}
|
|
2883
|
-
function IsDataTrack(_) {
|
|
2884
|
-
return !IsOverlaidTrack(_) && "data" in _ && !("mark" in _);
|
|
2885
|
-
}
|
|
2886
2883
|
function IsDummyTrack(_) {
|
|
2887
2884
|
return "type" in _ && _.type == "dummy-track";
|
|
2888
2885
|
}
|
|
2889
|
-
function IsDataTemplate(_) {
|
|
2890
|
-
return !!("data" in _ && "overrideTemplate" in _ && _.overrideTemplate);
|
|
2891
|
-
}
|
|
2892
2886
|
function IsDataDeep(data2) {
|
|
2893
2887
|
return typeof data2 === "object";
|
|
2894
2888
|
}
|
|
@@ -9475,86 +9469,6 @@ function traverseToFixSpecDownstream(spec, parentDef) {
|
|
|
9475
9469
|
});
|
|
9476
9470
|
}
|
|
9477
9471
|
}
|
|
9478
|
-
function getVectorTemplate(column, value) {
|
|
9479
|
-
return {
|
|
9480
|
-
data: {
|
|
9481
|
-
type: "vector",
|
|
9482
|
-
url: "",
|
|
9483
|
-
column,
|
|
9484
|
-
value
|
|
9485
|
-
},
|
|
9486
|
-
mark: "bar",
|
|
9487
|
-
x: { field: column, type: "genomic", axis: "top" },
|
|
9488
|
-
y: { field: value, type: "quantitative" },
|
|
9489
|
-
width: 400,
|
|
9490
|
-
height: 100
|
|
9491
|
-
};
|
|
9492
|
-
}
|
|
9493
|
-
function getMultivecTemplate(row, column, value, categories) {
|
|
9494
|
-
return categories && categories.length < 10 ? {
|
|
9495
|
-
data: {
|
|
9496
|
-
type: "multivec",
|
|
9497
|
-
url: "",
|
|
9498
|
-
row,
|
|
9499
|
-
column,
|
|
9500
|
-
value,
|
|
9501
|
-
categories
|
|
9502
|
-
},
|
|
9503
|
-
mark: "bar",
|
|
9504
|
-
x: { field: column, type: "genomic", axis: "top" },
|
|
9505
|
-
y: { field: value, type: "quantitative" },
|
|
9506
|
-
row: { field: row, type: "nominal", legend: true },
|
|
9507
|
-
color: { field: row, type: "nominal" },
|
|
9508
|
-
width: 400,
|
|
9509
|
-
height: 100
|
|
9510
|
-
} : {
|
|
9511
|
-
data: {
|
|
9512
|
-
type: "multivec",
|
|
9513
|
-
url: "",
|
|
9514
|
-
row,
|
|
9515
|
-
column,
|
|
9516
|
-
value,
|
|
9517
|
-
categories
|
|
9518
|
-
},
|
|
9519
|
-
mark: "rect",
|
|
9520
|
-
x: { field: column, type: "genomic", axis: "top" },
|
|
9521
|
-
row: { field: row, type: "nominal", legend: true },
|
|
9522
|
-
color: { field: value, type: "quantitative" },
|
|
9523
|
-
width: 400,
|
|
9524
|
-
height: 100
|
|
9525
|
-
};
|
|
9526
|
-
}
|
|
9527
|
-
function overrideDataTemplates(spec) {
|
|
9528
|
-
traverseTracks(spec, (t, i, ts) => {
|
|
9529
|
-
var _a, _b, _c, _d, _e;
|
|
9530
|
-
if (!("data" in t) || !t.data || !IsDataDeepTileset(t.data)) {
|
|
9531
|
-
return;
|
|
9532
|
-
}
|
|
9533
|
-
if ("alignment" in t) {
|
|
9534
|
-
return;
|
|
9535
|
-
}
|
|
9536
|
-
if (!IsDataTemplate(t)) {
|
|
9537
|
-
return;
|
|
9538
|
-
}
|
|
9539
|
-
switch (t.data.type) {
|
|
9540
|
-
case "vector":
|
|
9541
|
-
case "bigwig":
|
|
9542
|
-
ts[i] = Object.assign(getVectorTemplate((_a = t.data.column) != null ? _a : "position", (_b = t.data.value) != null ? _b : "value"), t);
|
|
9543
|
-
break;
|
|
9544
|
-
case "multivec":
|
|
9545
|
-
ts[i] = Object.assign(
|
|
9546
|
-
getMultivecTemplate(
|
|
9547
|
-
(_c = t.data.row) != null ? _c : "category",
|
|
9548
|
-
(_d = t.data.column) != null ? _d : "position",
|
|
9549
|
-
(_e = t.data.value) != null ? _e : "value",
|
|
9550
|
-
t.data.categories
|
|
9551
|
-
),
|
|
9552
|
-
t
|
|
9553
|
-
);
|
|
9554
|
-
break;
|
|
9555
|
-
}
|
|
9556
|
-
});
|
|
9557
|
-
}
|
|
9558
9472
|
const CHROM_SIZE_HG38 = {
|
|
9559
9473
|
chr1: 248956422,
|
|
9560
9474
|
chr2: 242193529,
|
|
@@ -10019,15 +9933,14 @@ export {
|
|
|
10019
9933
|
IsHiGlassMatrix as a4,
|
|
10020
9934
|
getHiGlassColorRange as a5,
|
|
10021
9935
|
DEFAULT_TEXT_STYLE as a6,
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
|
|
10027
|
-
|
|
10028
|
-
|
|
10029
|
-
|
|
10030
|
-
spreadTracksByData as af,
|
|
9936
|
+
traverseToFixSpecDownstream as a7,
|
|
9937
|
+
GenomicPositionHelper as a8,
|
|
9938
|
+
isObject as a9,
|
|
9939
|
+
getChromInterval as aa,
|
|
9940
|
+
getChromTotalSize as ab,
|
|
9941
|
+
parseGenomicPosition as ac,
|
|
9942
|
+
convertToFlatTracks as ad,
|
|
9943
|
+
spreadTracksByData as ae,
|
|
10031
9944
|
cartesianToPolar as b,
|
|
10032
9945
|
computeChromSizes as c,
|
|
10033
9946
|
commonjsGlobal as d,
|
|
@@ -10054,4 +9967,4 @@ export {
|
|
|
10054
9967
|
IsChannelValue as y,
|
|
10055
9968
|
getValueUsingChannel as z
|
|
10056
9969
|
};
|
|
10057
|
-
//# sourceMappingURL=exported-utils-
|
|
9970
|
+
//# sourceMappingURL=exported-utils-51b5f19f.js.map
|