gosling.js 0.15.0 → 0.16.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.
Files changed (67) hide show
  1. package/dist/editor/example/json-spec/basic-semantic-zoom.d.ts +3 -0
  2. package/dist/editor/example/json-spec/basic-semantic-zoom.d.ts.map +1 -0
  3. package/dist/editor/example/json-spec/cancer-variant.d.ts +5 -0
  4. package/dist/editor/example/json-spec/cancer-variant.d.ts.map +1 -0
  5. package/dist/editor/example/json-spec/circos.d.ts +5 -0
  6. package/dist/editor/example/json-spec/circos.d.ts.map +1 -0
  7. package/dist/editor/example/json-spec/circular-overview-linear-detail-views.d.ts +3 -0
  8. package/dist/editor/example/json-spec/circular-overview-linear-detail-views.d.ts.map +1 -0
  9. package/dist/editor/example/json-spec/debug.d.ts +3 -0
  10. package/dist/editor/example/json-spec/debug.d.ts.map +1 -0
  11. package/dist/editor/example/json-spec/gene-annotation.d.ts +14 -0
  12. package/dist/editor/example/json-spec/gene-annotation.d.ts.map +1 -0
  13. package/dist/editor/example/json-spec/gene-transcript.d.ts +3 -0
  14. package/dist/editor/example/json-spec/gene-transcript.d.ts.map +1 -0
  15. package/dist/editor/example/json-spec/give.d.ts +3 -0
  16. package/dist/editor/example/json-spec/give.d.ts.map +1 -0
  17. package/dist/editor/example/json-spec/gosling-data.d.ts +17 -0
  18. package/dist/editor/example/json-spec/gosling-data.d.ts.map +1 -0
  19. package/dist/editor/example/json-spec/gremlin.d.ts +3 -0
  20. package/dist/editor/example/json-spec/gremlin.d.ts.map +1 -0
  21. package/dist/editor/example/json-spec/ideograms.d.ts +4 -0
  22. package/dist/editor/example/json-spec/ideograms.d.ts.map +1 -0
  23. package/dist/editor/example/json-spec/index.d.ts +35 -0
  24. package/dist/editor/example/json-spec/index.d.ts.map +1 -0
  25. package/dist/editor/example/json-spec/layout-and-arrangement.d.ts +6 -0
  26. package/dist/editor/example/json-spec/layout-and-arrangement.d.ts.map +1 -0
  27. package/dist/editor/example/json-spec/mark-displacement.d.ts +3 -0
  28. package/dist/editor/example/json-spec/mark-displacement.d.ts.map +1 -0
  29. package/dist/editor/example/json-spec/matrix-hffc6.d.ts +3 -0
  30. package/dist/editor/example/json-spec/matrix-hffc6.d.ts.map +1 -0
  31. package/dist/editor/example/json-spec/matrix.d.ts +4 -0
  32. package/dist/editor/example/json-spec/matrix.d.ts.map +1 -0
  33. package/dist/editor/example/json-spec/mouse-event.d.ts +4 -0
  34. package/dist/editor/example/json-spec/mouse-event.d.ts.map +1 -0
  35. package/dist/editor/example/json-spec/pathogenic.d.ts +4 -0
  36. package/dist/editor/example/json-spec/pathogenic.d.ts.map +1 -0
  37. package/dist/editor/example/json-spec/perf-alignment.d.ts +3 -0
  38. package/dist/editor/example/json-spec/perf-alignment.d.ts.map +1 -0
  39. package/dist/editor/example/json-spec/pileup.d.ts +4 -0
  40. package/dist/editor/example/json-spec/pileup.d.ts.map +1 -0
  41. package/dist/editor/example/json-spec/responsive-alignment.d.ts +24 -0
  42. package/dist/editor/example/json-spec/responsive-alignment.d.ts.map +1 -0
  43. package/dist/editor/example/json-spec/responsive-track-wise-comparison.d.ts +4 -0
  44. package/dist/editor/example/json-spec/responsive-track-wise-comparison.d.ts.map +1 -0
  45. package/dist/editor/example/json-spec/responsive.d.ts +7 -0
  46. package/dist/editor/example/json-spec/responsive.d.ts.map +1 -0
  47. package/dist/editor/example/json-spec/sars-cov-2.d.ts +4 -0
  48. package/dist/editor/example/json-spec/sars-cov-2.d.ts.map +1 -0
  49. package/dist/editor/example/json-spec/semantic-zoom.d.ts +9 -0
  50. package/dist/editor/example/json-spec/semantic-zoom.d.ts.map +1 -0
  51. package/dist/editor/example/json-spec/track-template.d.ts +3 -0
  52. package/dist/editor/example/json-spec/track-template.d.ts.map +1 -0
  53. package/dist/editor/example/json-spec/visual-linking.d.ts +3 -0
  54. package/dist/editor/example/json-spec/visual-linking.d.ts.map +1 -0
  55. package/dist/editor/example/spec/visual-encoding.d.ts +5 -0
  56. package/dist/editor/example/spec/visual-encoding.d.ts.map +1 -0
  57. package/dist/{exported-utils-d4f1abea.js → exported-utils-ac60e3c5.js} +11 -7
  58. package/dist/exported-utils-ac60e3c5.js.map +1 -0
  59. package/dist/gosling.js +15 -5
  60. package/dist/gosling.js.map +1 -1
  61. package/dist/src/core/gosling-component.test.d.ts +2 -0
  62. package/dist/src/core/gosling-component.test.d.ts.map +1 -0
  63. package/dist/src/core/mark/bar.d.ts.map +1 -1
  64. package/dist/src/tracks/gosling-track/gosling-track.d.ts.map +1 -1
  65. package/dist/utils.js +1 -1
  66. package/package.json +4 -4
  67. package/dist/exported-utils-d4f1abea.js.map +0 -1
package/dist/gosling.js CHANGED
@@ -34,7 +34,7 @@ import "bezier-js";
34
34
  import { scaleLinear, scaleSequential, scaleOrdinal, scaleBand } from "d3-scale";
35
35
  import { sampleSize, isEqual, uniqBy, cloneDeepWith } from "lodash-es";
36
36
  import { interpolateViridis } from "d3-scale-chromatic";
37
- import { A as Ajv, I as IsChannelDeep, r as resolveSuperposedTracks, t as traverseTracks, a as IsTemplateTrack, g as getTextStyle, c as computeChromSizes, b as cartesianToPolar, u as uuid, R as RADIAN_GAP, v as valueToRadian, p as pointsToDegree, d as commonjsGlobal, e as RemoteFile, f as IsOneOfFilter, h as IsRangeFilter, i as IsIncludeFilter, j as getChannelKeysByAggregateFnc, k as getChannelKeysByType, s as sanitizeChrName, l as filterUsingGenoPos, m as IsDataDeepTileset, n as IsDomainChr, o as IsDomainInterval, q as IsDomainChrInterval, S as SUPPORTED_CHANNELS, w as insertItemToArray, x as getAutoCompleteId, y as IsChannelValue, z as getValueUsingChannel, B as rectProperty, C as pointProperty, D as barProperty, E as IsStackedChannel, F as IsDomainArray, P as PREDEFINED_COLOR_STR_MAP, G as IsRangeArray, H as Is2DTrack, J as isTabularDataFetcher, K as drawPreEmbellishment, L as drawMark, M as drawPostEmbellishment, N as getRelativeGenomicPosition, O as hasDataTransform, Q as IsXAxis, T as IsMouseEventsDeep, U as colorToHex, V as flatArrayToPairArray, W as DEWFAULT_TITLE_PADDING_ON_TOP_AND_BOTTOM, X as traverseTracksAndViews, Y as traverseViewArrangements, Z as DEFAULT_VIEW_SPACING, _ as DEFAULT_INNER_RADIUS_PROP, $ as IsDummyTrack, a0 as IsOverlaidTrack, a1 as IsYAxis, a2 as DEFAULT_CIRCULAR_VIEW_PADDING, a3 as IsDataDeep, a4 as IsHiGlassMatrix, a5 as getHiGlassColorRange, a6 as DEFAULT_TEXT_STYLE, a7 as overrideDataTemplates, a8 as traverseToFixSpecDownstream, a9 as GenomicPositionHelper, aa as isObject } from "./exported-utils-d4f1abea.js";
37
+ import { A as Ajv, I as IsChannelDeep, r as resolveSuperposedTracks, t as traverseTracks, a as IsTemplateTrack, g as getTextStyle, c as computeChromSizes, b as cartesianToPolar, u as uuid, R as RADIAN_GAP, v as valueToRadian, p as pointsToDegree, d as commonjsGlobal, e as RemoteFile, f as IsOneOfFilter, h as IsRangeFilter, i as IsIncludeFilter, j as getChannelKeysByAggregateFnc, k as getChannelKeysByType, s as sanitizeChrName, l as filterUsingGenoPos, m as IsDataDeepTileset, n as IsDomainChr, o as IsDomainInterval, q as IsDomainChrInterval, S as SUPPORTED_CHANNELS, w as insertItemToArray, x as getAutoCompleteId, y as IsChannelValue, z as getValueUsingChannel, B as rectProperty, C as pointProperty, D as barProperty, E as IsStackedChannel, F as IsDomainArray, P as PREDEFINED_COLOR_STR_MAP, G as IsRangeArray, H as Is2DTrack, J as isTabularDataFetcher, K as drawPreEmbellishment, L as drawMark, M as drawPostEmbellishment, N as getRelativeGenomicPosition, O as hasDataTransform, Q as IsXAxis, T as IsMouseEventsDeep, U as colorToHex, V as flatArrayToPairArray, W as DEWFAULT_TITLE_PADDING_ON_TOP_AND_BOTTOM, X as traverseTracksAndViews, Y as traverseViewArrangements, Z as DEFAULT_VIEW_SPACING, _ as DEFAULT_INNER_RADIUS_PROP, $ as IsDummyTrack, a0 as IsOverlaidTrack, a1 as IsYAxis, a2 as DEFAULT_CIRCULAR_VIEW_PADDING, a3 as IsDataDeep, a4 as IsHiGlassMatrix, a5 as getHiGlassColorRange, a6 as DEFAULT_TEXT_STYLE, a7 as overrideDataTemplates, a8 as traverseToFixSpecDownstream, a9 as GenomicPositionHelper, aa as isObject } from "./exported-utils-ac60e3c5.js";
38
38
  import higlassRegister from "higlass-register";
39
39
  import { TextTrack } from "higlass-text";
40
40
  import RBush from "rbush";
@@ -52,7 +52,7 @@ import require$$0 from "react-dom";
52
52
  import { HiGlassComponent } from "higlass";
53
53
  import { ResizeSensor } from "css-element-queries";
54
54
  const name = "gosling.js";
55
- const version = "0.15.0";
55
+ const version = "0.16.0";
56
56
  const $ref$2 = "#/definitions/GoslingSpec";
57
57
  const $schema$2 = "http://json-schema.org/draft-07/schema#";
58
58
  const definitions$2 = {
@@ -23764,7 +23764,7 @@ class GoslingTrackModel {
23764
23764
  this.theme = theme != null ? theme : getTheme();
23765
23765
  this.dataAggregated = data;
23766
23766
  this.specOriginal = spec;
23767
- this.specComplete = structuredClone(spec);
23767
+ this.specComplete = JSON.parse(JSON.stringify(spec));
23768
23768
  this.channelScales = {};
23769
23769
  this.mouseEventModel = new MouseEventModel();
23770
23770
  const validity = this.validateSpec();
@@ -24432,7 +24432,7 @@ const config$1 = {
24432
24432
  }
24433
24433
  };
24434
24434
  const factory$1 = (HGC, context, options) => {
24435
- var _assembly2, _processedTileInfo, _mouseDownX, _mouseDownY, _isRangeBrushActivated, _gBrush, _loadingTextStyleObj, _loadingTextBg, _loadingText, _tilesToId, tilesToId_fn, _binsPerTile, binsPerTile_get, _generateTabularData, generateTabularData_fn, _onMouseDown, onMouseDown_fn, _onMouseMove, onMouseMove_fn, _onMouseUp, onMouseUp_fn, _onMouseOut, onMouseOut_fn, _getElementsWithinMouse, getElementsWithinMouse_fn, _publishTrackEvents, publishTrackEvents_fn, _onRangeBrush, onRangeBrush_fn, _highlightMarks, highlightMarks_fn, _publishOnNewTrack, publishOnNewTrack_fn, _hasStretchableGraphics, hasStretchableGraphics_fn, _isTooStretched, isTooStretched_fn;
24435
+ var _assembly2, _processedTileInfo, _mouseDownX, _mouseDownY, _isRangeBrushActivated, _gBrush, _loadingTextStyleObj, _loadingTextBg, _loadingText, _processedTileMap, _tilesToId, tilesToId_fn, _binsPerTile, binsPerTile_get, _generateTabularData, generateTabularData_fn, _onMouseDown, onMouseDown_fn, _onMouseMove, onMouseMove_fn, _onMouseUp, onMouseUp_fn, _onMouseOut, onMouseOut_fn, _getElementsWithinMouse, getElementsWithinMouse_fn, _publishTrackEvents, publishTrackEvents_fn, _onRangeBrush, onRangeBrush_fn, _highlightMarks, highlightMarks_fn, _publishOnNewTrack, publishOnNewTrack_fn, _hasStretchableGraphics, hasStretchableGraphics_fn, _isTooStretched, isTooStretched_fn;
24436
24436
  const { tileProxy } = HGC.services;
24437
24437
  const { BarTrack } = HGC.tracks;
24438
24438
  const loadingTextStyle = getTextStyle({ color: "black", size: 12 });
@@ -24523,6 +24523,8 @@ const factory$1 = (HGC, context, options) => {
24523
24523
  __privateAdd(this, _loadingText, new HGC.libraries.PIXI.Text("", loadingTextStyle));
24524
24524
  __publicField(this, "prevVisibleAndFetchedTiles");
24525
24525
  __publicField(this, "resolvedTracks");
24526
+ // This is used to persist processed tile data across draw() calls.
24527
+ __privateAdd(this, _processedTileMap, /* @__PURE__ */ new WeakMap());
24526
24528
  __publicField(this, "hideMousePosition");
24527
24529
  context.dataFetcher.track = this;
24528
24530
  __privateSet(this, _processedTileInfo, {});
@@ -24679,6 +24681,7 @@ const factory$1 = (HGC, context, options) => {
24679
24681
  this.getResolvedTracks(true);
24680
24682
  this.clearMouseEventData();
24681
24683
  this.textsBeingUsed = 0;
24684
+ __privateSet(this, _processedTileMap, /* @__PURE__ */ new WeakMap());
24682
24685
  this.processAllTiles(true);
24683
24686
  this.draw();
24684
24687
  this.forceDraw();
@@ -24790,6 +24793,9 @@ const factory$1 = (HGC, context, options) => {
24790
24793
  var _a, _b;
24791
24794
  this.tileSize = (_b = (_a = this.tilesetInfo) == null ? void 0 : _a.tile_size) != null ? _b : 1024;
24792
24795
  const tiles = this.visibleAndFetchedTiles();
24796
+ if (tiles.every((tile) => __privateGet(this, _processedTileMap).get(tile) !== void 0)) {
24797
+ return;
24798
+ }
24793
24799
  tiles.forEach((tile) => __privateMethod(this, _generateTabularData, generateTabularData_fn).call(this, tile, force));
24794
24800
  this.combineAllTilesIfNeeded();
24795
24801
  const models = tiles.flatMap((tile) => this.transformDataAndCreateModels(tile));
@@ -24798,6 +24804,9 @@ const factory$1 = (HGC, context, options) => {
24798
24804
  if (flatTileData.length !== 0) {
24799
24805
  this.options.siblingIds.forEach((id) => publish("rawData", { id, data: flatTileData }));
24800
24806
  }
24807
+ tiles.forEach((tile) => {
24808
+ __privateGet(this, _processedTileMap).set(tile, true);
24809
+ });
24801
24810
  }
24802
24811
  /**
24803
24812
  * This is currently for testing the new way of rendering visual elements. Called by this.draw()
@@ -25076,7 +25085,7 @@ const factory$1 = (HGC, context, options) => {
25076
25085
  } catch (e) {
25077
25086
  }
25078
25087
  const [trackWidth, trackHeight] = this.dimensions;
25079
- const axisSize = IsXAxis(resolvedSpec) ? HIGLASS_AXIS_SIZE : 0;
25088
+ const axisSize = IsXAxis(resolvedSpec) && this.options.spec.layout === "linear" ? HIGLASS_AXIS_SIZE : 0;
25080
25089
  const [w, h] = [trackWidth, trackHeight + axisSize];
25081
25090
  const circularFactor = Math.min(w, h) / Math.min(resolvedSpec.width, resolvedSpec.height);
25082
25091
  if (resolvedSpec.innerRadius) {
@@ -25248,6 +25257,7 @@ const factory$1 = (HGC, context, options) => {
25248
25257
  _loadingTextStyleObj = new WeakMap();
25249
25258
  _loadingTextBg = new WeakMap();
25250
25259
  _loadingText = new WeakMap();
25260
+ _processedTileMap = new WeakMap();
25251
25261
  _tilesToId = new WeakSet();
25252
25262
  tilesToId_fn = function(xTiles, yTiles, zoomLevel) {
25253
25263
  if (!yTiles) {