@genome-spy/core 0.74.0 → 0.76.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/dist/bundle/{esm-CgfVIRJ-.js → esm-BimDEpBb.js} +1 -1
- package/dist/bundle/{esm-DtE8VqAv.js → esm-Bvlm1uVk.js} +1 -1
- package/dist/bundle/{esm-sIoQYZ21.js → esm-CngqBe45.js} +17 -17
- package/dist/bundle/{esm-DQiq2Zhd.js → esm-D_euN86T.js} +43 -43
- package/dist/bundle/index.es.js +6064 -5756
- package/dist/bundle/index.js +104 -103
- package/dist/schema.json +572 -12
- package/dist/src/config/defaults/markDefaults.d.ts.map +1 -1
- package/dist/src/config/defaults/markDefaults.js +1 -12
- package/dist/src/config/defaults/scaleDefaults.d.ts.map +1 -1
- package/dist/src/config/defaults/scaleDefaults.js +1 -0
- package/dist/src/config/markConfig.d.ts.map +1 -1
- package/dist/src/config/markConfig.js +16 -8
- package/dist/src/config/themes.d.ts.map +1 -1
- package/dist/src/config/themes.js +15 -2
- package/dist/src/data/sources/dataUtils.d.ts +25 -0
- package/dist/src/data/sources/dataUtils.d.ts.map +1 -1
- package/dist/src/data/sources/dataUtils.js +23 -0
- package/dist/src/data/sources/inlineSource.js +2 -2
- package/dist/src/data/sources/lazy/registerBuiltInLazySources.js +2 -2
- package/dist/src/data/sources/lazy/registerCoreLazySources.d.ts +2 -0
- package/dist/src/data/sources/lazy/registerCoreLazySources.d.ts.map +1 -0
- package/dist/src/data/sources/lazy/registerCoreLazySources.js +2 -0
- package/dist/src/data/sources/lazy/tabixSource.d.ts +7 -0
- package/dist/src/data/sources/lazy/tabixSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/tabixSource.js +18 -0
- package/dist/src/data/sources/lazy/tabixTsvSource.d.ts +37 -0
- package/dist/src/data/sources/lazy/tabixTsvSource.d.ts.map +1 -0
- package/dist/src/data/sources/lazy/tabixTsvSource.js +163 -0
- package/dist/src/data/sources/urlSource.d.ts.map +1 -1
- package/dist/src/data/sources/urlSource.js +8 -3
- package/dist/src/encoder/encoder.d.ts +2 -2
- package/dist/src/encoder/encoder.d.ts.map +1 -1
- package/dist/src/genome/scaleLocus.d.ts.map +1 -1
- package/dist/src/genome/scaleLocus.js +8 -3
- package/dist/src/genomeSpy/interactionController.d.ts.map +1 -1
- package/dist/src/genomeSpy/interactionController.js +91 -51
- package/dist/src/genomeSpyBase.d.ts.map +1 -1
- package/dist/src/genomeSpyBase.js +4 -1
- package/dist/src/gl/dataToVertices.d.ts +12 -14
- package/dist/src/gl/dataToVertices.d.ts.map +1 -1
- package/dist/src/gl/dataToVertices.js +116 -95
- package/dist/src/gl/glslScaleGenerator.d.ts +3 -0
- package/dist/src/gl/glslScaleGenerator.d.ts.map +1 -1
- package/dist/src/gl/glslScaleGenerator.js +10 -8
- package/dist/src/gl/vertexRangeIndex.d.ts +23 -0
- package/dist/src/gl/vertexRangeIndex.d.ts.map +1 -0
- package/dist/src/gl/vertexRangeIndex.js +150 -0
- package/dist/src/gl/webGLHelper.d.ts +5 -2
- package/dist/src/gl/webGLHelper.d.ts.map +1 -1
- package/dist/src/gl/webGLHelper.js +20 -3
- package/dist/src/marks/__snapshots__/shaderSnapshot.test.js.snap +1082 -0
- package/dist/src/marks/link.vertex.glsl.js +1 -1
- package/dist/src/marks/mark.d.ts +1 -1
- package/dist/src/minimal.d.ts.map +1 -1
- package/dist/src/minimal.js +5 -4
- package/dist/src/paramRuntime/expressionCompiler.d.ts +2 -1
- package/dist/src/paramRuntime/expressionCompiler.d.ts.map +1 -1
- package/dist/src/paramRuntime/expressionCompiler.js +3 -2
- package/dist/src/paramRuntime/expressionRef.d.ts +4 -1
- package/dist/src/paramRuntime/expressionRef.d.ts.map +1 -1
- package/dist/src/paramRuntime/expressionRef.js +10 -3
- package/dist/src/paramRuntime/graphRuntime.d.ts.map +1 -1
- package/dist/src/paramRuntime/graphRuntime.js +15 -6
- package/dist/src/paramRuntime/paramRuntime.d.ts +8 -2
- package/dist/src/paramRuntime/paramRuntime.d.ts.map +1 -1
- package/dist/src/paramRuntime/paramRuntime.js +10 -5
- package/dist/src/paramRuntime/types.d.ts +1 -0
- package/dist/src/paramRuntime/types.d.ts.map +1 -1
- package/dist/src/paramRuntime/types.js +1 -0
- package/dist/src/paramRuntime/viewParamRuntime.d.ts +5 -4
- package/dist/src/paramRuntime/viewParamRuntime.d.ts.map +1 -1
- package/dist/src/paramRuntime/viewParamRuntime.js +17 -6
- package/dist/src/scale/scale.d.ts.map +1 -1
- package/dist/src/scale/scale.js +11 -2
- package/dist/src/scales/domainPlanner.d.ts +57 -11
- package/dist/src/scales/domainPlanner.d.ts.map +1 -1
- package/dist/src/scales/domainPlanner.js +183 -84
- package/dist/src/scales/scaleInstanceManager.d.ts.map +1 -1
- package/dist/src/scales/scaleInstanceManager.js +7 -2
- package/dist/src/scales/scalePropsResolver.d.ts +3 -3
- package/dist/src/scales/scalePropsResolver.d.ts.map +1 -1
- package/dist/src/scales/scalePropsResolver.js +28 -5
- package/dist/src/scales/scaleResolution.d.ts +12 -1
- package/dist/src/scales/scaleResolution.d.ts.map +1 -1
- package/dist/src/scales/scaleResolution.js +180 -21
- package/dist/src/scales/selectionDomainUtils.d.ts +10 -0
- package/dist/src/scales/selectionDomainUtils.d.ts.map +1 -1
- package/dist/src/scales/selectionDomainUtils.js +32 -3
- package/dist/src/screenshotExport.d.ts +23 -0
- package/dist/src/screenshotExport.d.ts.map +1 -0
- package/dist/src/screenshotExport.js +44 -0
- package/dist/src/screenshotHarness.d.ts.map +1 -1
- package/dist/src/screenshotHarness.js +26 -24
- package/dist/src/spec/axis.d.ts +2 -2
- package/dist/src/spec/channel.d.ts +34 -4
- package/dist/src/spec/data.d.ts +52 -0
- package/dist/src/spec/parameter.d.ts +6 -0
- package/dist/src/spec/scale.d.ts +13 -1
- package/dist/src/spec/transform.d.ts +6 -0
- package/dist/src/utils/expression.d.ts +16 -8
- package/dist/src/utils/expression.d.ts.map +1 -1
- package/dist/src/utils/expression.js +291 -11
- package/dist/src/view/axisGridView.d.ts.map +1 -1
- package/dist/src/view/axisGridView.js +2 -1
- package/dist/src/view/axisView.d.ts.map +1 -1
- package/dist/src/view/axisView.js +2 -1
- package/dist/src/view/facetView.d.ts.map +1 -1
- package/dist/src/view/facetView.js +2 -1
- package/dist/src/view/flowBuilder.d.ts +1 -1
- package/dist/src/view/flowBuilder.d.ts.map +1 -1
- package/dist/src/view/flowBuilder.js +11 -7
- package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
- package/dist/src/view/gridView/gridChild.js +9 -1
- package/dist/src/view/gridView/gridView.d.ts.map +1 -1
- package/dist/src/view/gridView/gridView.js +198 -32
- package/dist/src/view/gridView/scrollbar.d.ts.map +1 -1
- package/dist/src/view/gridView/scrollbar.js +5 -1
- package/dist/src/view/gridView/selectionRect.d.ts.map +1 -1
- package/dist/src/view/gridView/selectionRect.js +5 -1
- package/dist/src/view/gridView/separatorView.d.ts.map +1 -1
- package/dist/src/view/gridView/separatorView.js +5 -1
- package/dist/src/view/resolutionPlanner.d.ts +9 -0
- package/dist/src/view/resolutionPlanner.d.ts.map +1 -0
- package/dist/src/view/resolutionPlanner.js +302 -0
- package/dist/src/view/testUtils.d.ts +30 -3
- package/dist/src/view/testUtils.d.ts.map +1 -1
- package/dist/src/view/testUtils.js +51 -2
- package/dist/src/view/unitView.d.ts +1 -1
- package/dist/src/view/unitView.d.ts.map +1 -1
- package/dist/src/view/unitView.js +5 -152
- package/dist/src/view/view.d.ts.map +1 -1
- package/dist/src/view/view.js +2 -1
- package/dist/src/view/viewSelectors.d.ts +38 -10
- package/dist/src/view/viewSelectors.d.ts.map +1 -1
- package/dist/src/view/viewSelectors.js +67 -2
- package/dist/src/view/viewUtilTypes.d.ts +15 -0
- package/dist/src/view/viewUtils.d.ts.map +1 -1
- package/dist/src/view/viewUtils.js +10 -0
- package/package.json +2 -2
- package/LICENSE +0 -21
- /package/dist/bundle/{esm-BDFRLEuD.js → esm-C49STiCR.js} +0 -0
- /package/dist/bundle/{esm-CGX-qz1d.js → esm-CuVa5T98.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markDefaults.d.ts","sourceRoot":"","sources":["../../../../src/config/defaults/markDefaults.js"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,4BADW,OAAO,sBAAsB,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"markDefaults.d.ts","sourceRoot":"","sources":["../../../../src/config/defaults/markDefaults.js"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,4BADW,OAAO,sBAAsB,EAAE,UAAU,CAMlD;AAEF,yDAAyD;AACzD,kCADW,OAAO,sBAAsB,EAAE,WAAW,CAgBnD;AAEF,wDAAwD;AACxD,iCADW,OAAO,sBAAsB,EAAE,UAAU,CAUlD;AAEF,wDAAwD;AACxD,iCADW,OAAO,sBAAsB,EAAE,UAAU,CASlD;AAEF,wDAAwD;AACxD,iCADW,OAAO,sBAAsB,EAAE,UAAU,CAQlD;AAEF,wDAAwD;AACxD,iCADW,OAAO,sBAAsB,EAAE,UAAU,CA+BlD;AAEF,wDAAwD;AACxD,iCADW,OAAO,sBAAsB,EAAE,UAAU,CAiBlD"}
|
|
@@ -3,15 +3,14 @@ export const MARK_DEFAULTS = {
|
|
|
3
3
|
xOffset: 0,
|
|
4
4
|
yOffset: 0,
|
|
5
5
|
minBufferSize: 0,
|
|
6
|
+
opacity: 1.0,
|
|
6
7
|
};
|
|
7
8
|
|
|
8
9
|
/** @type {import("../../spec/config.js").PointConfig} */
|
|
9
10
|
export const POINT_MARK_DEFAULTS = {
|
|
10
11
|
x: 0.5,
|
|
11
12
|
y: 0.5,
|
|
12
|
-
color: "#4c78a8",
|
|
13
13
|
filled: true,
|
|
14
|
-
opacity: 1.0,
|
|
15
14
|
size: 100.0,
|
|
16
15
|
semanticScore: 0.0,
|
|
17
16
|
shape: "circle",
|
|
@@ -30,8 +29,6 @@ export const RECT_MARK_DEFAULTS = {
|
|
|
30
29
|
x2: undefined,
|
|
31
30
|
y2: undefined,
|
|
32
31
|
filled: true,
|
|
33
|
-
color: "#4c78a8",
|
|
34
|
-
opacity: 1.0,
|
|
35
32
|
strokeWidth: 3,
|
|
36
33
|
cornerRadius: 0.0,
|
|
37
34
|
minWidth: 0.5,
|
|
@@ -44,8 +41,6 @@ export const RULE_MARK_DEFAULTS = {
|
|
|
44
41
|
x2: undefined,
|
|
45
42
|
y2: undefined,
|
|
46
43
|
size: 1,
|
|
47
|
-
color: "black",
|
|
48
|
-
opacity: 1.0,
|
|
49
44
|
minLength: 0.0,
|
|
50
45
|
strokeDash: null,
|
|
51
46
|
strokeDashOffset: 0,
|
|
@@ -54,8 +49,6 @@ export const RULE_MARK_DEFAULTS = {
|
|
|
54
49
|
|
|
55
50
|
/** @type {import("../../spec/config.js").TickConfig} */
|
|
56
51
|
export const TICK_MARK_DEFAULTS = {
|
|
57
|
-
color: "black",
|
|
58
|
-
opacity: 1.0,
|
|
59
52
|
minLength: 0.0,
|
|
60
53
|
strokeDash: null,
|
|
61
54
|
strokeDashOffset: 0,
|
|
@@ -72,8 +65,6 @@ export const TEXT_MARK_DEFAULTS = {
|
|
|
72
65
|
y2: undefined,
|
|
73
66
|
text: "",
|
|
74
67
|
size: 11.0,
|
|
75
|
-
color: "black",
|
|
76
|
-
opacity: 1.0,
|
|
77
68
|
font: undefined,
|
|
78
69
|
fontStyle: undefined,
|
|
79
70
|
fontWeight: undefined,
|
|
@@ -106,8 +97,6 @@ export const LINK_MARK_DEFAULTS = {
|
|
|
106
97
|
y: 0.0,
|
|
107
98
|
y2: undefined,
|
|
108
99
|
size: 1.0,
|
|
109
|
-
color: "black",
|
|
110
|
-
opacity: 1.0,
|
|
111
100
|
segments: 101,
|
|
112
101
|
arcHeightFactor: 1.0,
|
|
113
102
|
minArcHeight: 1.5,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaleDefaults.d.ts","sourceRoot":"","sources":["../../../../src/config/defaults/scaleDefaults.js"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,6BADW,OAAO,sBAAsB,EAAE,WAAW,CAUnD;AAEF,yDAAyD;AACzD,6BADW,OAAO,sBAAsB,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"scaleDefaults.d.ts","sourceRoot":"","sources":["../../../../src/config/defaults/scaleDefaults.js"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,6BADW,OAAO,sBAAsB,EAAE,WAAW,CAUnD;AAEF,yDAAyD;AACzD,6BADW,OAAO,sBAAsB,EAAE,WAAW,CAMnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markConfig.d.ts","sourceRoot":"","sources":["../../../src/config/markConfig.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,kDALW,OAAO,mBAAmB,EAAE,eAAe,EAAE,YAC7C,OAAO,iBAAiB,EAAE,QAAQ,SAClC,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAC3B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"markConfig.d.ts","sourceRoot":"","sources":["../../../src/config/markConfig.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,kDALW,OAAO,mBAAmB,EAAE,eAAe,EAAE,YAC7C,OAAO,iBAAiB,EAAE,QAAQ,SAClC,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAC3B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CA2B/B"}
|
|
@@ -12,16 +12,24 @@ export function getConfiguredMarkDefaults(scopes, markType, style) {
|
|
|
12
12
|
// part of style resolution, and explicit mark.style entries augment it.
|
|
13
13
|
const styles = [markType, ...normalizeStyle(style)];
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const genericBuckets = scopes.map(
|
|
16
|
+
(scope) => /** @type {Record<string, any> | undefined} */ (scope.mark)
|
|
17
|
+
);
|
|
18
|
+
const markTypeBuckets = scopes.map(
|
|
19
|
+
(scope) =>
|
|
20
|
+
/** @type {Record<string, any> | undefined} */ (scope[markType])
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
return mergeConfigScopes([
|
|
24
|
+
...genericBuckets,
|
|
25
|
+
...markTypeBuckets,
|
|
26
|
+
...scopes.flatMap((scope) =>
|
|
27
|
+
styles.map(
|
|
20
28
|
(styleName) =>
|
|
21
29
|
/** @type {Record<string, any> | undefined} */ (
|
|
22
30
|
scope.style?.[styleName]
|
|
23
31
|
)
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
);
|
|
32
|
+
)
|
|
33
|
+
),
|
|
34
|
+
]);
|
|
27
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../../src/config/themes.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../../src/config/themes.js"],"names":[],"mappings":"AA4RA;;;GAGG;AACH,gDAHW,OAAO,mBAAmB,EAAE,gBAAgB,GAC1C,MAAM,GAAG,SAAS,CAI9B;AAED;;;GAGG;AACH,iDAHW,OAAO,mBAAmB,EAAE,gBAAgB,GAAG,OAAO,mBAAmB,EAAE,gBAAgB,EAAE,GAAG,SAAS,GACvG,OAAO,mBAAmB,EAAE,eAAe,GAAG,SAAS,CAWnE;AA1BD;;GAEG;AACH,iCAFU,OAAO,mBAAmB,EAAE,gBAAgB,CAER"}
|
|
@@ -39,7 +39,7 @@ const VEGALITE_THEME = {
|
|
|
39
39
|
quantitativeColorScheme: "blues",
|
|
40
40
|
},
|
|
41
41
|
range: {
|
|
42
|
-
heatmap: "
|
|
42
|
+
heatmap: "yellowgreenblue",
|
|
43
43
|
ramp: "blues",
|
|
44
44
|
diverging: "blueorange",
|
|
45
45
|
},
|
|
@@ -59,7 +59,20 @@ const VEGALITE_THEME = {
|
|
|
59
59
|
* @type {Record<import("../spec/config.js").BuiltInThemeName, import("../spec/config.js").GenomeSpyConfig & { background?: string}>}
|
|
60
60
|
*/
|
|
61
61
|
const BUILT_IN_THEME_DEFINITIONS = {
|
|
62
|
-
genomespy: {
|
|
62
|
+
genomespy: {
|
|
63
|
+
mark: {
|
|
64
|
+
color: "#4c78a8",
|
|
65
|
+
},
|
|
66
|
+
rule: {
|
|
67
|
+
color: "black",
|
|
68
|
+
},
|
|
69
|
+
text: {
|
|
70
|
+
color: "black",
|
|
71
|
+
},
|
|
72
|
+
link: {
|
|
73
|
+
color: "black",
|
|
74
|
+
},
|
|
75
|
+
},
|
|
63
76
|
vegalite: VEGALITE_THEME,
|
|
64
77
|
quartz: mergeConfigScopes([
|
|
65
78
|
VEGALITE_THEME,
|
|
@@ -8,10 +8,12 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export function getFormat(params: import("../../spec/data.js").DataSource, urls?: string | string[]): {
|
|
10
10
|
type?: "csv" | "tsv";
|
|
11
|
+
columns?: string[];
|
|
11
12
|
parse?: import("../../spec/data.js").Parse | null;
|
|
12
13
|
} | {
|
|
13
14
|
type?: "dsv";
|
|
14
15
|
delimiter: string;
|
|
16
|
+
columns?: string[];
|
|
15
17
|
parse?: import("../../spec/data.js").Parse | null;
|
|
16
18
|
} | {
|
|
17
19
|
type?: "json";
|
|
@@ -28,6 +30,29 @@ export function getFormat(params: import("../../spec/data.js").DataSource, urls?
|
|
|
28
30
|
type: string;
|
|
29
31
|
parse?: import("../../spec/data.js").Parse | null;
|
|
30
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Vega's DSV readers support synthetic header rows via `format.header`.
|
|
35
|
+
* GenomeSpy exposes the user-facing option as `format.columns`.
|
|
36
|
+
*
|
|
37
|
+
* @param {import("../../spec/data.js").DataFormat} format
|
|
38
|
+
*/
|
|
39
|
+
export function toVegaLoaderFormat(format: import("../../spec/data.js").DataFormat): {
|
|
40
|
+
type?: "csv" | "tsv";
|
|
41
|
+
columns?: string[];
|
|
42
|
+
parse?: import("../../spec/data.js").Parse | null;
|
|
43
|
+
} | {
|
|
44
|
+
type?: "dsv";
|
|
45
|
+
delimiter: string;
|
|
46
|
+
columns?: string[];
|
|
47
|
+
parse?: import("../../spec/data.js").Parse | null;
|
|
48
|
+
} | {
|
|
49
|
+
type?: "json";
|
|
50
|
+
property?: string;
|
|
51
|
+
parse?: import("../../spec/data.js").Parse | null;
|
|
52
|
+
} | {
|
|
53
|
+
type: string;
|
|
54
|
+
parse?: import("../../spec/data.js").Parse | null;
|
|
55
|
+
};
|
|
31
56
|
/**
|
|
32
57
|
* @param {string} type
|
|
33
58
|
* @returns {string}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataUtils.d.ts","sourceRoot":"","sources":["../../../../src/data/sources/dataUtils.js"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,kCAJW,OAAO,oBAAoB,EAAE,UAAU,SAEvC,MAAM,GAAG,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"dataUtils.d.ts","sourceRoot":"","sources":["../../../../src/data/sources/dataUtils.js"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,kCAJW,OAAO,oBAAoB,EAAE,UAAU,SAEvC,MAAM,GAAG,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;EAsB3B;AAED;;;;;GAKG;AACH,2CAFW,OAAO,oBAAoB,EAAE,UAAU;;;;;;;;;;;;;;;;EAiBjD;AAED;;;GAGG;AACH,mCAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;GAEG;AACH,wCAFW,MAAM,GAAG,MAAM,EAAE,UA2B3B;AAED;;GAEG;AACH,sCAFW,MAAM,WAWhB;AAkBD;;;GAGG;AACH,4CAHW,OAAO,oBAAoB,EAAE,UAAU,GACtC,UAAU,IAAI,OAAO,oBAAoB,EAAE,aAAa,CAInE;AAED;;;GAGG;AACH,4CAHW,OAAO,oBAAoB,EAAE,UAAU,GACtC,UAAU,IAAI,OAAO,oBAAoB,EAAE,aAAa,CAInE;AAED;;;GAGG;AACH,6CAHW,OAAO,oBAAoB,EAAE,UAAU,GACtC,UAAU,IAAI,OAAO,oBAAoB,EAAE,cAAc,CAIpE;AAED;;;;GAIG;AACH,sCAHW,OAAO,oBAAoB,EAAE,UAAU,GACtC,UAAU,IAAI,OAAO,oBAAoB,EAAE,OAAO,CAI7D;AAED;;GAEG;AACH,wCAFW,MAAM,GAAG,SAAS,WAI5B;AA/CM,+BAAgC,GAAG,QAI3B,OAAO,uBAAuB,EAAE,MAAM;;UAGtB,OAAO,gBAAgB,EAAE,KAAK,qCANR"}
|
|
@@ -34,6 +34,29 @@ export function getFormat(params, urls = []) {
|
|
|
34
34
|
return format;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Vega's DSV readers support synthetic header rows via `format.header`.
|
|
39
|
+
* GenomeSpy exposes the user-facing option as `format.columns`.
|
|
40
|
+
*
|
|
41
|
+
* @param {import("../../spec/data.js").DataFormat} format
|
|
42
|
+
*/
|
|
43
|
+
export function toVegaLoaderFormat(format) {
|
|
44
|
+
const readFormat = { ...format };
|
|
45
|
+
|
|
46
|
+
if (
|
|
47
|
+
(isCsvDataFormat(readFormat) || isDsvDataFormat(readFormat)) &&
|
|
48
|
+
readFormat.columns &&
|
|
49
|
+
!("header" in readFormat)
|
|
50
|
+
) {
|
|
51
|
+
// @ts-ignore Vega loader supports `header`, but the public data format
|
|
52
|
+
// type intentionally exposes the GenomeSpy-level `columns` property
|
|
53
|
+
// instead.
|
|
54
|
+
readFormat.header = readFormat.columns;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return readFormat;
|
|
58
|
+
}
|
|
59
|
+
|
|
37
60
|
/**
|
|
38
61
|
* @param {string} type
|
|
39
62
|
* @returns {string}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { read } from "vega-loader";
|
|
2
|
-
import { getFormat, makeWrapper } from "./dataUtils.js";
|
|
2
|
+
import { getFormat, makeWrapper, toVegaLoaderFormat } from "./dataUtils.js";
|
|
3
3
|
import DataSource from "./dataSource.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -79,7 +79,7 @@ export default class InlineSource extends DataSource {
|
|
|
79
79
|
data = [values];
|
|
80
80
|
} else if (typeof values == "string") {
|
|
81
81
|
// It's a string that needs to be parsed
|
|
82
|
-
data = read(values, getFormat(this.params));
|
|
82
|
+
data = read(values, toVegaLoaderFormat(getFormat(this.params)));
|
|
83
83
|
} else {
|
|
84
84
|
throw new Error(
|
|
85
85
|
'"values" in data configuration is not an array, object, or a string!'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./axisGenomeSource.js";
|
|
1
|
+
import "./registerCoreLazySources.js";
|
|
3
2
|
import "./indexedFastaSource.js";
|
|
4
3
|
import "./bigWigSource.js";
|
|
5
4
|
import "./bigBedSource.js";
|
|
6
5
|
import "./bamSource.js";
|
|
6
|
+
import "./tabixTsvSource.js";
|
|
7
7
|
import "./gff3Source.js";
|
|
8
8
|
import "./vcfSource.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerCoreLazySources.d.ts","sourceRoot":"","sources":["../../../../../src/data/sources/lazy/registerCoreLazySources.js"],"names":[],"mappings":""}
|
|
@@ -14,6 +14,13 @@ export default class TabixSource<T> extends SingleAxisWindowedSource {
|
|
|
14
14
|
* @protected
|
|
15
15
|
*/
|
|
16
16
|
protected _handleHeader(header: string): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Read a prefix of the Tabix file and decode it as text.
|
|
19
|
+
*
|
|
20
|
+
* @returns {Promise<string>}
|
|
21
|
+
* @protected
|
|
22
|
+
*/
|
|
23
|
+
protected _readFilePrefix(): Promise<string>;
|
|
17
24
|
/**
|
|
18
25
|
* @abstract
|
|
19
26
|
* @protected
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabixSource.d.ts","sourceRoot":"","sources":["../../../../../src/data/sources/lazy/tabixSource.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tabixSource.d.ts","sourceRoot":"","sources":["../../../../../src/data/sources/lazy/tabixSource.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH,iCAHa,CAAC;IAOV;;;OAGG;IACH,oBAHW,OAAO,uBAAuB,EAAE,SAAS,QACzC,OAAO,uBAAuB,EAAE,OAAO,EAyCjD;IAzBG,kDAgBC;IA0FL;;;OAGG;IACH,gCAHW,MAAM,iBAKhB;IAED;;;;;OAKG;IACH,6BAHa,OAAO,CAAC,MAAM,CAAC,CAY3B;IAED;;;;;OAKG;IACH,gCAHW,MAAM,EAAE,GACN,CAAC,EAAE,CAKf;;CACJ;qCAzKoC,+BAA+B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { unzip } from "@gmod/bgzf-filehandle";
|
|
1
2
|
import {
|
|
2
3
|
activateExprRefProps,
|
|
3
4
|
withoutExprRef,
|
|
@@ -145,6 +146,23 @@ export default class TabixSource extends SingleAxisWindowedSource {
|
|
|
145
146
|
//
|
|
146
147
|
}
|
|
147
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Read a prefix of the Tabix file and decode it as text.
|
|
151
|
+
*
|
|
152
|
+
* @returns {Promise<string>}
|
|
153
|
+
* @protected
|
|
154
|
+
*/
|
|
155
|
+
async _readFilePrefix() {
|
|
156
|
+
const { maxBlockSize } = await this.#tbiIndex.getMetadata();
|
|
157
|
+
const tbiIndex = /** @type {any} */ (this.#tbiIndex);
|
|
158
|
+
const compressedPrefix = await tbiIndex.filehandle.read(
|
|
159
|
+
maxBlockSize,
|
|
160
|
+
0
|
|
161
|
+
);
|
|
162
|
+
const bytes = await unzip(compressedPrefix);
|
|
163
|
+
return new TextDecoder("utf-8").decode(bytes);
|
|
164
|
+
}
|
|
165
|
+
|
|
148
166
|
/**
|
|
149
167
|
* @abstract
|
|
150
168
|
* @protected
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract a TSV header from a tabix file header.
|
|
3
|
+
*
|
|
4
|
+
* Tabix headers commonly end with a commented column line such as
|
|
5
|
+
* `#chrom\tstart\tend\tvalue`.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} header
|
|
8
|
+
* @returns {string[] | undefined}
|
|
9
|
+
*/
|
|
10
|
+
export function extractTabixTsvColumns(header: string): string[] | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Extract a TSV header from the first line of a plain tabix file prefix.
|
|
13
|
+
*
|
|
14
|
+
* This is used when the file does not have a commented header line, but the
|
|
15
|
+
* first physical line still contains column names.
|
|
16
|
+
*
|
|
17
|
+
* @param {string} text
|
|
18
|
+
* @returns {string[] | undefined}
|
|
19
|
+
*/
|
|
20
|
+
export function extractTabixTsvColumnsFromFirstLine(text: string): string[] | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Parse tabix TSV records into plain objects.
|
|
23
|
+
*
|
|
24
|
+
* @param {string[]} lines
|
|
25
|
+
* @param {string[]} columns
|
|
26
|
+
* @param {import("../../../spec/data.js").Parse | null | undefined} [parse]
|
|
27
|
+
*/
|
|
28
|
+
export function parseTabixTsvLines(lines: string[], columns: string[], parse?: import("../../../spec/data.js").Parse | null | undefined): Record<string, any>[];
|
|
29
|
+
/**
|
|
30
|
+
* @extends {TabixSource<Record<string, any>>}
|
|
31
|
+
*/
|
|
32
|
+
export default class TabixTsvSource extends TabixSource<Record<string, any>> {
|
|
33
|
+
constructor(params: import("../../../spec/data.js").TabixData, view: import("../../../view/view.js").default);
|
|
34
|
+
#private;
|
|
35
|
+
}
|
|
36
|
+
import TabixSource from "./tabixSource.js";
|
|
37
|
+
//# sourceMappingURL=tabixTsvSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabixTsvSource.d.ts","sourceRoot":"","sources":["../../../../../src/data/sources/lazy/tabixTsvSource.js"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,+CAHW,MAAM,GACJ,MAAM,EAAE,GAAG,SAAS,CAsBhC;AAED;;;;;;;;GAQG;AACH,0DAHW,MAAM,GACJ,MAAM,EAAE,GAAG,SAAS,CAkBhC;AAED;;;;;;GAMG;AACH,0CAJW,MAAM,EAAE,WACR,MAAM,EAAE,UACR,OAAO,uBAAuB,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,yBAgClE;AAED;;GAEG;AACH;;;CA8CC;wBApJuB,kBAAkB"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { read } from "vega-loader";
|
|
2
|
+
import { withoutExprRef } from "../../../paramRuntime/paramUtils.js";
|
|
3
|
+
import { toVegaLoaderFormat } from "../dataUtils.js";
|
|
4
|
+
import { registerBuiltInLazyDataSource } from "./lazyDataSourceRegistry.js";
|
|
5
|
+
import TabixSource from "./tabixSource.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Extract a TSV header from a tabix file header.
|
|
9
|
+
*
|
|
10
|
+
* Tabix headers commonly end with a commented column line such as
|
|
11
|
+
* `#chrom\tstart\tend\tvalue`.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} header
|
|
14
|
+
* @returns {string[] | undefined}
|
|
15
|
+
*/
|
|
16
|
+
export function extractTabixTsvColumns(header) {
|
|
17
|
+
const lines = header.split(/\r?\n/);
|
|
18
|
+
|
|
19
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
20
|
+
const line = lines[i].trimEnd().replace(/\r$/, "");
|
|
21
|
+
|
|
22
|
+
if (!line || line.startsWith("##")) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (!line.startsWith("#")) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const columns = line.slice(1).split("\t");
|
|
31
|
+
|
|
32
|
+
if (columns.length > 1) {
|
|
33
|
+
return columns;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Extract a TSV header from the first line of a plain tabix file prefix.
|
|
40
|
+
*
|
|
41
|
+
* This is used when the file does not have a commented header line, but the
|
|
42
|
+
* first physical line still contains column names.
|
|
43
|
+
*
|
|
44
|
+
* @param {string} text
|
|
45
|
+
* @returns {string[] | undefined}
|
|
46
|
+
*/
|
|
47
|
+
export function extractTabixTsvColumnsFromFirstLine(text) {
|
|
48
|
+
const lines = text.split(/\r?\n/);
|
|
49
|
+
|
|
50
|
+
const firstLine = lines.find((line) => {
|
|
51
|
+
const trimmed = line.trimStart();
|
|
52
|
+
return trimmed !== "" && !trimmed.startsWith("#");
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
if (!firstLine) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const columns = firstLine.trimEnd().replace(/\r$/, "").split("\t");
|
|
60
|
+
if (columns.length > 1) {
|
|
61
|
+
return columns;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Parse tabix TSV records into plain objects.
|
|
67
|
+
*
|
|
68
|
+
* @param {string[]} lines
|
|
69
|
+
* @param {string[]} columns
|
|
70
|
+
* @param {import("../../../spec/data.js").Parse | null | undefined} [parse]
|
|
71
|
+
*/
|
|
72
|
+
export function parseTabixTsvLines(lines, columns, parse) {
|
|
73
|
+
if (lines.length == 0) {
|
|
74
|
+
return [];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** @type {any} */
|
|
78
|
+
const format = {
|
|
79
|
+
type: "tsv",
|
|
80
|
+
columns,
|
|
81
|
+
parse: parse ?? "auto",
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** @type {Record<string, any>[]} */
|
|
85
|
+
const data = read(lines.join("\n"), toVegaLoaderFormat(format));
|
|
86
|
+
|
|
87
|
+
const chromField = columns[0];
|
|
88
|
+
/** @type {unknown} */
|
|
89
|
+
let prev = null;
|
|
90
|
+
let stringChrom = "";
|
|
91
|
+
|
|
92
|
+
for (const datum of data) {
|
|
93
|
+
const value = datum[chromField];
|
|
94
|
+
if (value != prev) {
|
|
95
|
+
prev = value;
|
|
96
|
+
stringChrom = String(value);
|
|
97
|
+
}
|
|
98
|
+
datum[chromField] = stringChrom;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return data;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @extends {TabixSource<Record<string, any>>}
|
|
106
|
+
*/
|
|
107
|
+
export default class TabixTsvSource extends TabixSource {
|
|
108
|
+
/** @type {string[] | undefined} */
|
|
109
|
+
#columns;
|
|
110
|
+
|
|
111
|
+
get label() {
|
|
112
|
+
return "tabixSource";
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @param {string} header
|
|
117
|
+
*/
|
|
118
|
+
async _handleHeader(header) {
|
|
119
|
+
const params =
|
|
120
|
+
/** @type {import("../../../spec/data.js").TabixTsvData} */ (
|
|
121
|
+
this.params
|
|
122
|
+
);
|
|
123
|
+
const columns = withoutExprRef(params.columns);
|
|
124
|
+
this.#columns = columns ?? extractTabixTsvColumns(header);
|
|
125
|
+
|
|
126
|
+
if (!this.#columns?.length) {
|
|
127
|
+
this.#columns = extractTabixTsvColumnsFromFirstLine(
|
|
128
|
+
await this._readFilePrefix()
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (!this.#columns?.length) {
|
|
133
|
+
throw new Error(
|
|
134
|
+
"No columns available for Tabix TSV source. Provide data.lazy.columns or a tabix header line such as #chrom\\tstart\\tend, or a plain first row such as chrom\\tstart\\tend."
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @param {string[]} lines
|
|
141
|
+
*/
|
|
142
|
+
_parseFeatures(lines) {
|
|
143
|
+
const params =
|
|
144
|
+
/** @type {import("../../../spec/data.js").TabixTsvData} */ (
|
|
145
|
+
this.params
|
|
146
|
+
);
|
|
147
|
+
return parseTabixTsvLines(
|
|
148
|
+
lines,
|
|
149
|
+
this.#columns ?? [],
|
|
150
|
+
withoutExprRef(params.parse)
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @param {import("../../../spec/data.js").LazyDataParams} params
|
|
157
|
+
* @returns {params is import("../../../spec/data.js").TabixTsvData}
|
|
158
|
+
*/
|
|
159
|
+
function isTabixTsvSource(params) {
|
|
160
|
+
return params?.type == "tabix";
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
registerBuiltInLazyDataSource(isTabixTsvSource, TabixTsvSource);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlSource.d.ts","sourceRoot":"","sources":["../../../../src/data/sources/urlSource.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"urlSource.d.ts","sourceRoot":"","sources":["../../../../src/data/sources/urlSource.js"],"names":[],"mappings":"AAuJA;;;GAGG;AACH,gCAHW,OAAO,CAAC,OAAO,oBAAoB,EAAE,IAAI,CAAC,GACxC,IAAI,IAAI,OAAO,oBAAoB,EAAE,OAAO,CAIxD;AA5ID;;;GAGG;AACH;IACI;;;OAGG;IACH,oBAHW,OAAO,oBAAoB,EAAE,OAAO,QACpC,OAAO,oBAAoB,EAAE,OAAO,EAc9C;IATG,6CAMC;IAED,gBAAiC;;CAgHxC;uBA9IsB,iBAAiB"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { read } from "vega-loader";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
getFormat,
|
|
4
|
+
hasGzipExtension,
|
|
5
|
+
responseType,
|
|
6
|
+
toVegaLoaderFormat,
|
|
7
|
+
} from "./dataUtils.js";
|
|
3
8
|
import DataSource from "./dataSource.js";
|
|
4
9
|
import {
|
|
5
10
|
activateExprRefProps,
|
|
@@ -63,7 +68,7 @@ export default class UrlSource extends DataSource {
|
|
|
63
68
|
);
|
|
64
69
|
|
|
65
70
|
const files = /** @type {string[] | {url: string}[]} */ (
|
|
66
|
-
read(content, format)
|
|
71
|
+
read(content, toVegaLoaderFormat(format))
|
|
67
72
|
)
|
|
68
73
|
.map((u) => (typeof u === "string" ? u : u.url))
|
|
69
74
|
.map((u) => concatUrl(listUrl, u));
|
|
@@ -114,7 +119,7 @@ export default class UrlSource extends DataSource {
|
|
|
114
119
|
const readAndParse = async (content, url) => {
|
|
115
120
|
try {
|
|
116
121
|
/** @type {any[] | Promise<any[]>} */
|
|
117
|
-
const dataOrPromise = read(content, format);
|
|
122
|
+
const dataOrPromise = read(content, toVegaLoaderFormat(format));
|
|
118
123
|
const data =
|
|
119
124
|
dataOrPromise instanceof Promise
|
|
120
125
|
? await dataOrPromise
|
|
@@ -97,12 +97,12 @@ export function isChannelDefWithScale(channelDef: import("../spec/channel.js").C
|
|
|
97
97
|
/**
|
|
98
98
|
* @param {import("../spec/channel.js").ChannelDef} channelDef
|
|
99
99
|
*/
|
|
100
|
-
export function findChannelDefWithScale(channelDef: import("../spec/channel.js").ChannelDef): import("../spec/channel.js").FieldOrDatumDefWithCondition<import("../spec/channel.js").MarkPropFieldDef<import("../spec/channel.js").Type>, number> | import("../spec/channel.js").FieldOrDatumDefWithCondition<import("../spec/channel.js").MarkPropFieldDef<import("../spec/channel.js").Type>, string> | import("../spec/channel.js").PositionFieldDef | import("../spec/channel.js").ChromPosDef | import("../spec/channel.js").PositionDatumDef | import("../spec/channel.js").
|
|
100
|
+
export function findChannelDefWithScale(channelDef: import("../spec/channel.js").ChannelDef): import("../spec/channel.js").FieldOrDatumDefWithCondition<import("../spec/channel.js").MarkPropFieldDef<import("../spec/channel.js").Type>, number> | import("../spec/channel.js").FieldOrDatumDefWithCondition<import("../spec/channel.js").MarkPropFieldDef<import("../spec/channel.js").Type>, string> | import("../spec/channel.js").PositionFieldDef | import("../spec/channel.js").ChromPosDef | import("../spec/channel.js").PositionDatumDef | import("../spec/channel.js").MarkPropExprDef<import("../spec/channel.js").Type> | import("../spec/channel.js").Conditional<import("../spec/channel.js").MarkPropFieldDef<import("../spec/channel.js").Type>>;
|
|
101
101
|
/**
|
|
102
102
|
* @param {import("../view/unitView.js").default} view
|
|
103
103
|
* @param {import("../spec/channel.js").Channel} channel
|
|
104
104
|
*/
|
|
105
|
-
export function getChannelDefWithScale(view: import("../view/unitView.js").default, channel: import("../spec/channel.js").Channel): import("../spec/channel.js").FieldOrDatumDefWithCondition<import("../spec/channel.js").MarkPropFieldDef<import("../spec/channel.js").Type>, number> | import("../spec/channel.js").FieldOrDatumDefWithCondition<import("../spec/channel.js").MarkPropFieldDef<import("../spec/channel.js").Type>, string> | import("../spec/channel.js").PositionFieldDef | import("../spec/channel.js").ChromPosDef | import("../spec/channel.js").PositionDatumDef | import("../spec/channel.js").
|
|
105
|
+
export function getChannelDefWithScale(view: import("../view/unitView.js").default, channel: import("../spec/channel.js").Channel): import("../spec/channel.js").FieldOrDatumDefWithCondition<import("../spec/channel.js").MarkPropFieldDef<import("../spec/channel.js").Type>, number> | import("../spec/channel.js").FieldOrDatumDefWithCondition<import("../spec/channel.js").MarkPropFieldDef<import("../spec/channel.js").Type>, string> | import("../spec/channel.js").PositionFieldDef | import("../spec/channel.js").ChromPosDef | import("../spec/channel.js").PositionDatumDef | import("../spec/channel.js").MarkPropExprDef<import("../spec/channel.js").Type> | import("../spec/channel.js").Conditional<import("../spec/channel.js").MarkPropFieldDef<import("../spec/channel.js").Type>>;
|
|
106
106
|
/**
|
|
107
107
|
* @param {import("../spec/channel.js").ChannelDef} channelDef
|
|
108
108
|
* @returns {channelDef is import("../spec/channel.js").TypeMixins<import("../spec/channel.js").Type>}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encoder.d.ts","sourceRoot":"","sources":["../../../src/encoder/encoder.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;GAWG;AACH,gDANW,MAAM,YACN,OAAO,oBAAoB,EAAE,QAAQ,gBACrC;IAAE,SAAS,EA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AAE,CAsBjB;AAED;;;GAGG;AACH,gDAHW,OAAO,oBAAoB,EAAE,OAAO,GAClC,CAAS,IAAG,EAAH,GAAG,KAAE,MAAM,CAmBhC;AA7LD;;GAEG;AACH,wCAFU,OAAO,oBAAoB,EAAE,wBAAwB,EAAE,CAEb;AAEpD;;GAEG;AACH,0CAFU,OAAO,oBAAoB,EAAE,0BAA0B,EAAE,CAEX;AAExD;;GAEG;AACH,iCAFU,OAAO,oBAAoB,EAAE,iBAAiB,EAAE,CAKxD;AAoBF;;;;GAIG;AACH,gCAFU,OAAO,CAAC,MAAM,CAAC,OAAO,oBAAoB,EAAE,OAAO,EAAE,OAAO,oBAAoB,EAAE,0BAA0B,CAAC,CAAC,CAKtH;AAEF;;;;GAIG;AACH,8BAFU,OAAO,CAAC,MAAM,CAAC,OAAO,oBAAoB,EAAE,OAAO,EAAE,OAAO,oBAAoB,EAAE,OAAO,CAAC,CAAC,CAInG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaleLocus.d.ts","sourceRoot":"","sources":["../../../src/genome/scaleLocus.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scaleLocus.d.ts","sourceRoot":"","sources":["../../../src/genome/scaleLocus.js"],"names":[],"mappings":"AASA,2EA2HC;;AASD;;;;GAIG;AACH,8CAJW,OAAO,aAAa,EAAE,OAAO,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,OAAO,aAAa,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,SAC5F,MAAM,GACJ,MAAM,GAAG,OAAO,aAAa,EAAE,gBAAgB,CAK3D;AAED;;;;GAIG;AACH,gDAJW,OAAO,aAAa,EAAE,OAAO,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,OAAO,aAAa,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,WAC5F,MAAM,GAAG,OAAO,aAAa,EAAE,gBAAgB,GAC7C,MAAM,CAQlB;AAED;;;;GAIG;AACH,mDAJW,OAAO,aAAa,EAAE,OAAO,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,OAAO,aAAa,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,YAC5F,OAAO,kBAAkB,EAAE,YAAY,GAAG,OAAO,kBAAkB,EAAE,aAAa,GAChF,MAAM,EAAE,CAQpB;AAED;;;;GAIG;AACH,iDAJW,OAAO,aAAa,EAAE,OAAO,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,OAAO,aAAa,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,YAC5F,OAAO,kBAAkB,EAAE,YAAY,GAAG,OAAO,kBAAkB,EAAE,aAAa,GAChF,OAAO,kBAAkB,EAAE,YAAY,GAAG,OAAO,kBAAkB,EAAE,aAAa,CAO9F;AAED;;;GAGG;AACH,+CAHW,OAAO,aAAa,EAAE,OAAO,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,OAAO,aAAa,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,GAC1F,MAAM,EAAE,CAQpB"}
|
|
@@ -5,6 +5,7 @@ import scaleIndex from "./scaleIndex.js";
|
|
|
5
5
|
import { isChromosomalLocus, isChromosomalLocusInterval } from "./genome.js";
|
|
6
6
|
|
|
7
7
|
const EXACT_LOCUS_LABEL_STEP_THRESHOLD = 1e6;
|
|
8
|
+
const EXACT_LOCUS_LABEL_THINNING_FACTOR = 0.65;
|
|
8
9
|
|
|
9
10
|
export default function scaleLocus() {
|
|
10
11
|
/** @type {import("./scaleLocus.js").ScaleLocus} */
|
|
@@ -39,13 +40,17 @@ export default function scaleLocus() {
|
|
|
39
40
|
|
|
40
41
|
const requestedCount = Math.max(
|
|
41
42
|
1,
|
|
42
|
-
Math.min(count ?? 10, Math.
|
|
43
|
+
Math.min(count ?? 10, Math.floor(domainSpan))
|
|
43
44
|
);
|
|
44
45
|
|
|
45
46
|
let step = tickStep(domain[0], domain[1], requestedCount);
|
|
46
47
|
|
|
47
48
|
if (step < EXACT_LOCUS_LABEL_STEP_THRESHOLD) {
|
|
48
|
-
step = tickStep(
|
|
49
|
+
step = tickStep(
|
|
50
|
+
domain[0],
|
|
51
|
+
domain[1],
|
|
52
|
+
requestedCount * EXACT_LOCUS_LABEL_THINNING_FACTOR
|
|
53
|
+
);
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
step = Math.max(1, step);
|
|
@@ -89,7 +94,7 @@ export default function scaleLocus() {
|
|
|
89
94
|
const step = tickStep(
|
|
90
95
|
domain[0],
|
|
91
96
|
domain[1],
|
|
92
|
-
Math.max(1, Math.min(count ?? 10, Math.
|
|
97
|
+
Math.max(1, Math.min(count ?? 10, Math.floor(domainSpan)))
|
|
93
98
|
);
|
|
94
99
|
// Use higher display precision for smaller spans
|
|
95
100
|
// TODO: max absolute value should be taken into account too. 2.00M vs 200M
|