gosling.js 0.16.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 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
- - [Roadmap](https://github.com/gosling-lang/gosling.js/projects/1)
23
+ - [Gallery Examples](https://gosling-lang.org/examples/)
24
+ - [How-to & Tutorials](https://gosling-lang.org/tutorials/)
27
25
 
28
- ## Contributing to Gosling.js
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
- - Open [Github Issues](https://github.com/gosling-lang/gosling.js/issues/) to ask questions or request features.
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://osf.io/6evmb)
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,WA+LjC,CAAC"}
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 (IsDataTrack(track) || IsDummyTrack(track)) {
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 (IsDataTrack(t) || !IsOverlaidTrack(t) || t._overlay.length <= 1) {
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,
@@ -9839,17 +9753,27 @@ const CRHOM_SIZES = Object.freeze({
9839
9753
  // just to ensure this does not make crash
9840
9754
  }
9841
9755
  });
9842
- function getAutoCompleteId(assembly) {
9756
+ function getAutoCompleteObject(assembly = "hg38") {
9757
+ const base = {
9758
+ autocompleteServer: "https://server.gosling-lang.org/api/v1",
9759
+ chromInfoServer: "https://server.gosling-lang.org/api/v1",
9760
+ chromInfoId: assembly
9761
+ };
9843
9762
  switch (assembly) {
9844
9763
  case "hg19":
9845
- return "OHJakQICQD6gTD7skx4EWA";
9764
+ return { ...base, autocompleteId: "gene-annotation-hg19" };
9846
9765
  case "mm10":
9847
- return "QDutvmyiSrec5nX4pA5WGQ";
9766
+ return { ...base, autocompleteId: "gene-annotation-mm10" };
9848
9767
  case "mm9":
9849
- return "GUm5aBiLRCyz2PsBea7Yzg";
9768
+ return {
9769
+ ...base,
9770
+ autocompleteServer: "https://higlass.io/api/v1",
9771
+ chromInfoServer: "https://higlass.io/api/v1",
9772
+ autocompleteId: "GUm5aBiLRCyz2PsBea7Yzg"
9773
+ };
9850
9774
  case "hg38":
9851
9775
  default:
9852
- return "P0PLbQMwTYGy-5uPIQid7A";
9776
+ return { ...base, autocompleteId: "gene-annotation" };
9853
9777
  }
9854
9778
  }
9855
9779
  function getChromInterval(chromSize) {
@@ -10009,15 +9933,14 @@ export {
10009
9933
  IsHiGlassMatrix as a4,
10010
9934
  getHiGlassColorRange as a5,
10011
9935
  DEFAULT_TEXT_STYLE as a6,
10012
- overrideDataTemplates as a7,
10013
- traverseToFixSpecDownstream as a8,
10014
- GenomicPositionHelper as a9,
10015
- isObject as aa,
10016
- getChromInterval as ab,
10017
- getChromTotalSize as ac,
10018
- parseGenomicPosition as ad,
10019
- convertToFlatTracks as ae,
10020
- 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,
10021
9944
  cartesianToPolar as b,
10022
9945
  computeChromSizes as c,
10023
9946
  commonjsGlobal as d,
@@ -10040,8 +9963,8 @@ export {
10040
9963
  uuid as u,
10041
9964
  valueToRadian as v,
10042
9965
  insertItemToArray as w,
10043
- getAutoCompleteId as x,
9966
+ getAutoCompleteObject as x,
10044
9967
  IsChannelValue as y,
10045
9968
  getValueUsingChannel as z
10046
9969
  };
10047
- //# sourceMappingURL=exported-utils-ac60e3c5.js.map
9970
+ //# sourceMappingURL=exported-utils-51b5f19f.js.map