gosling.js 1.0.1 → 1.0.2

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.
@@ -0,0 +1,12 @@
1
+ import { X } from "./exported-compiler-e419fb4a.js";
2
+ import "pixi.js";
3
+ import "d3-color";
4
+ import "d3-array";
5
+ import "bezier-js";
6
+ import "d3-scale";
7
+ import "lodash-es";
8
+ import "d3-scale-chromatic";
9
+ export {
10
+ X as _compile
11
+ };
12
+ //# sourceMappingURL=compiler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiler.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -18,10 +18,9 @@ var __privateAdd = (obj, member, value) => {
18
18
  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
19
19
  };
20
20
  var _table;
21
- import { group, max, min, bisector } from "d3-array";
22
- import { RemoteFile as RemoteFile$1 } from "generic-filehandle";
23
21
  import * as PIXI from "pixi.js";
24
22
  import { color } from "d3-color";
23
+ import { group, max, min } from "d3-array";
25
24
  import { Bezier } from "bezier-js";
26
25
  import { scaleLinear } from "d3-scale";
27
26
  import { isUndefined } from "lodash-es";
@@ -20788,80 +20787,6 @@ class GenomicPositionHelper {
20788
20787
  return [start + offset - padding, end + offset + padding];
20789
20788
  }
20790
20789
  }
20791
- function filterUsingGenoPos(data2, [minX, maxX], config) {
20792
- const { x, xe, x1, x1e } = config;
20793
- const definedXFields = [x, xe, x1, x1e].filter((f) => f);
20794
- return data2.filter((d) => {
20795
- if (definedXFields.length === 0) {
20796
- return true;
20797
- } else if (definedXFields.length === 1) {
20798
- const value = +d[definedXFields[0]];
20799
- return typeof value === "number" && minX < value && value <= maxX;
20800
- } else {
20801
- const values = definedXFields.map((f) => +d[f]).filter((v) => !isNaN(v));
20802
- const minValue = Math.min(...values);
20803
- const maxValue = Math.max(...values);
20804
- return minX <= maxValue && minValue <= maxX;
20805
- }
20806
- });
20807
- }
20808
- bisector((d) => d.pos).left;
20809
- function sanitizeChrName(chrName, assembly, chromosomePrefix) {
20810
- if (Array.isArray(assembly)) {
20811
- return chrName;
20812
- }
20813
- if (chromosomePrefix) {
20814
- chrName = chrName.replace(chromosomePrefix, "chr");
20815
- } else if (!chrName.includes("chr")) {
20816
- chrName = `chr${chrName}`;
20817
- }
20818
- return chrName;
20819
- }
20820
- class RemoteFile extends RemoteFile$1 {
20821
- constructor() {
20822
- super(...arguments);
20823
- // Overrides `read` to eagerly read 200 or 206 response
20824
- // from https://github.com/GMOD/generic-filehandle/blob/0e8209be25e3097307bd15e964edd8c017e808d7/src/remoteFile.ts#L100-L162
20825
- __publicField(this, "read", async (buffer, offset = 0, length, position = 0, opts = {}) => {
20826
- const { headers = {}, signal, overrides = {} } = opts;
20827
- if (length < Infinity) {
20828
- headers.range = `bytes=${position}-${position + length}`;
20829
- } else if (length === Infinity && position !== 0) {
20830
- headers.range = `bytes=${position}-`;
20831
- }
20832
- const args = {
20833
- // @ts-expect-error private property
20834
- ...this.baseOverrides,
20835
- ...overrides,
20836
- headers: {
20837
- ...headers,
20838
- ...overrides.headers,
20839
- // @ts-expect-error private property
20840
- ...this.baseOverrides.headers
20841
- },
20842
- method: "GET",
20843
- redirect: "follow",
20844
- mode: "cors",
20845
- signal
20846
- };
20847
- const response = await this.fetch(this.url, args);
20848
- if (!response.ok) {
20849
- throw new Error(`HTTP ${response.status} ${response.statusText} ${this.url}`);
20850
- }
20851
- if (response.status === 200 || response.status === 206) {
20852
- const responseData = await this.getBufferFromResponse(response);
20853
- const bytesCopied = responseData.copy(buffer, offset, 0, Math.min(length, responseData.length));
20854
- const res = response.headers.get("content-range");
20855
- const sizeMatch = /\/(\d+)$/.exec(res || "");
20856
- if (sizeMatch && sizeMatch[1]) {
20857
- this._stat = { size: parseInt(sizeMatch[1], 10) };
20858
- }
20859
- return { bytesRead: bytesCopied, buffer };
20860
- }
20861
- throw new Error(`HTTP ${response.status} fetching ${this.url}`);
20862
- });
20863
- }
20864
- }
20865
20790
  const $ref = "#/definitions/HiGlassSpec";
20866
20791
  const $schema = "http://json-schema.org/draft-07/schema#";
20867
20792
  const definitions = {
@@ -23718,66 +23643,63 @@ function compile(spec, callback, templates = GoslingTemplates, theme = getTheme(
23718
23643
  renderHiGlass(specCopy, trackInfos, callback, theme, urlToFetchOptions);
23719
23644
  }
23720
23645
  export {
23721
- GoslingTemplates as $,
23722
- IsStackedChannel as A,
23723
- IsDomainArray as B,
23724
- getNumericDomain as C,
23725
- IsRangeArray as D,
23726
- validateTrack as E,
23727
- Is2DTrack as F,
23728
- isTabularDataFetcher as G,
23646
+ getChromInterval as $,
23647
+ IsRangeArray as A,
23648
+ validateTrack as B,
23649
+ Is2DTrack as C,
23650
+ isTabularDataFetcher as D,
23651
+ drawPreEmbellishment as E,
23652
+ drawMark as F,
23653
+ drawPostEmbellishment as G,
23729
23654
  HIGLASS_AXIS_SIZE as H,
23730
23655
  IsOneOfFilter as I,
23731
- drawPreEmbellishment as J,
23732
- drawMark as K,
23733
- drawPostEmbellishment as L,
23734
- getRelativeGenomicPosition as M,
23735
- shareScaleAcrossTracks as N,
23736
- hasDataTransform as O,
23656
+ getRelativeGenomicPosition as J,
23657
+ shareScaleAcrossTracks as K,
23658
+ hasDataTransform as L,
23659
+ resolveSuperposedTracks as M,
23660
+ IsXAxis as N,
23661
+ IsMouseEventsDeep as O,
23737
23662
  PREDEFINED_COLOR_STR_MAP as P,
23738
- resolveSuperposedTracks as Q,
23663
+ colorToHex as Q,
23739
23664
  RADIAN_GAP as R,
23740
23665
  SUPPORTED_CHANNELS as S,
23741
- IsXAxis as T,
23742
- IsMouseEventsDeep as U,
23743
- colorToHex as V,
23744
- flatArrayToPairArray as W,
23745
- GenomicPositionHelper as X,
23746
- isObject as Y,
23747
- validateGoslingSpec as Z,
23748
- compile as _,
23666
+ flatArrayToPairArray as T,
23667
+ GenomicPositionHelper as U,
23668
+ isObject as V,
23669
+ validateGoslingSpec as W,
23670
+ compile as X,
23671
+ GoslingTemplates as Y,
23672
+ GoslingSchema as Z,
23673
+ Themes as _,
23749
23674
  cartesianToPolar as a,
23750
- GoslingSchema as a0,
23751
- Themes as a1,
23752
- getChromInterval as a2,
23753
- getChromTotalSize as a3,
23754
- parseGenomicPosition as a4,
23755
- convertToFlatTracks as a5,
23756
- spreadTracksByData as a6,
23675
+ getChromTotalSize as a0,
23676
+ parseGenomicPosition as a1,
23677
+ convertToFlatTracks as a2,
23678
+ spreadTracksByData as a3,
23757
23679
  commonjsGlobal as b,
23758
23680
  computeChromSizes as c,
23759
- RemoteFile as d,
23760
- IsRangeFilter as e,
23761
- IsIncludeFilter as f,
23681
+ IsRangeFilter as d,
23682
+ IsIncludeFilter as e,
23683
+ getChannelKeysByAggregateFnc as f,
23762
23684
  getTextStyle as g,
23763
- getChannelKeysByAggregateFnc as h,
23764
- getChannelKeysByType as i,
23765
- IsChannelDeep as j,
23766
- filterUsingGenoPos as k,
23767
- IsDataDeepTileset as l,
23768
- isThereTheme as m,
23769
- getTheme as n,
23770
- getGenomicChannelKeyFromTrack as o,
23685
+ getChannelKeysByType as h,
23686
+ IsChannelDeep as i,
23687
+ IsDataDeepTileset as j,
23688
+ isThereTheme as k,
23689
+ getTheme as l,
23690
+ getGenomicChannelKeyFromTrack as m,
23691
+ getGenomicChannelFromTrack as n,
23692
+ IsChannelValue as o,
23771
23693
  pointsToDegree as p,
23772
- getGenomicChannelFromTrack as q,
23773
- IsChannelValue as r,
23774
- sanitizeChrName as s,
23775
- logicalComparison as t,
23694
+ logicalComparison as q,
23695
+ getValueUsingChannel as r,
23696
+ rectProperty as s,
23697
+ pointProperty as t,
23776
23698
  uuid as u,
23777
23699
  valueToRadian as v,
23778
- getValueUsingChannel as w,
23779
- rectProperty as x,
23780
- pointProperty as y,
23781
- barProperty as z
23700
+ barProperty as w,
23701
+ IsStackedChannel as x,
23702
+ IsDomainArray as y,
23703
+ getNumericDomain as z
23782
23704
  };
23783
- //# sourceMappingURL=exported-utils-ce57b459.js.map
23705
+ //# sourceMappingURL=exported-compiler-e419fb4a.js.map