@genome-spy/core 0.78.0 → 0.79.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/{browser-KWU9rWZT.js → browser-CETrb2cm.js} +53 -33
- package/dist/bundle/esm-BdLYkz-m.js +248 -0
- package/dist/bundle/esm-BwiDsqSb.js +1367 -0
- package/dist/bundle/esm-CDFd1cjk.js +441 -0
- package/dist/bundle/{esm-DVOHLB1e.js → esm-CTUHLDbv.js} +30 -30
- package/dist/bundle/{esm-NIYEaYkc.js → esm-Cx-EbkOj.js} +13 -13
- package/dist/bundle/esm-DlYGqi79.js +128 -0
- package/dist/bundle/{esm-BygJiwh0.js → esm-k9p3oHkt.js} +133 -158
- package/dist/bundle/{esm-CT3ygiMq.js → esm-zAZJQO6D.js} +226 -212
- package/dist/bundle/index.es.js +14840 -11661
- package/dist/bundle/index.js +119 -108
- package/dist/bundle/{parquetRead-DG_-F5j5.js → parquetRead-Cad1SOVV.js} +473 -399
- package/dist/schema.json +18940 -6914
- package/dist/src/config/axisConfig.d.ts +2 -2
- package/dist/src/config/axisConfig.d.ts.map +1 -1
- package/dist/src/config/axisConfig.js +28 -44
- package/dist/src/config/configLayers.d.ts +45 -0
- package/dist/src/config/configLayers.d.ts.map +1 -0
- package/dist/src/config/configLayers.js +110 -0
- package/dist/src/config/defaultConfig.d.ts.map +1 -1
- package/dist/src/config/defaultConfig.js +8 -1
- package/dist/src/config/defaults/legendDefaults.d.ts +14 -0
- package/dist/src/config/defaults/legendDefaults.d.ts.map +1 -0
- package/dist/src/config/defaults/legendDefaults.js +46 -0
- package/dist/src/config/defaults/titleDefaults.d.ts.map +1 -1
- package/dist/src/config/defaults/titleDefaults.js +26 -18
- package/dist/src/config/legendConfig.d.ts +11 -0
- package/dist/src/config/legendConfig.d.ts.map +1 -0
- package/dist/src/config/legendConfig.js +63 -0
- package/dist/src/config/styleUtils.d.ts +8 -2
- package/dist/src/config/styleUtils.d.ts.map +1 -1
- package/dist/src/config/styleUtils.js +25 -1
- package/dist/src/config/themes.d.ts.map +1 -1
- package/dist/src/config/themes.js +21 -2
- package/dist/src/config/titleConfig.d.ts.map +1 -1
- package/dist/src/config/titleConfig.js +2 -18
- package/dist/src/data/collector.d.ts.map +1 -1
- package/dist/src/data/collector.js +40 -18
- package/dist/src/data/flowInit.d.ts +6 -0
- package/dist/src/data/flowInit.d.ts.map +1 -1
- package/dist/src/data/flowInit.js +1 -1
- package/dist/src/data/flowNode.d.ts +32 -0
- package/dist/src/data/flowNode.d.ts.map +1 -1
- package/dist/src/data/flowNode.js +59 -0
- package/dist/src/data/sources/lazy/bamSource.d.ts +0 -1
- package/dist/src/data/sources/lazy/bamSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/bamSource.js +39 -30
- package/dist/src/data/sources/lazy/bigBedSource.d.ts +0 -10
- package/dist/src/data/sources/lazy/bigBedSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/bigBedSource.js +127 -62
- package/dist/src/data/sources/lazy/bigWigSource.d.ts +2 -2
- package/dist/src/data/sources/lazy/bigWigSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/bigWigSource.js +234 -81
- package/dist/src/data/sources/lazy/gff3Source.d.ts +7 -3
- package/dist/src/data/sources/lazy/gff3Source.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/gff3Source.js +7 -8
- package/dist/src/data/sources/lazy/indexedFastaSource.d.ts +1 -1
- package/dist/src/data/sources/lazy/indexedFastaSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/indexedFastaSource.js +28 -19
- package/dist/src/data/sources/lazy/legendEntriesSource.d.ts +24 -0
- package/dist/src/data/sources/lazy/legendEntriesSource.d.ts.map +1 -0
- package/dist/src/data/sources/lazy/legendEntriesSource.js +217 -0
- package/dist/src/data/sources/lazy/legendGradientSource.d.ts +30 -0
- package/dist/src/data/sources/lazy/legendGradientSource.d.ts.map +1 -0
- package/dist/src/data/sources/lazy/legendGradientSource.js +388 -0
- package/dist/src/data/sources/lazy/mockLazySource.d.ts +4 -1
- package/dist/src/data/sources/lazy/mockLazySource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/mockLazySource.js +49 -4
- package/dist/src/data/sources/lazy/registerCoreLazySources.js +2 -0
- package/dist/src/data/sources/lazy/singleAxisWindowedSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/singleAxisWindowedSource.js +3 -4
- package/dist/src/data/sources/lazy/tabixSource.d.ts +9 -4
- package/dist/src/data/sources/lazy/tabixSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/tabixSource.js +201 -70
- package/dist/src/data/sources/lazy/tabixTsvSource.d.ts +2 -3
- package/dist/src/data/sources/lazy/tabixTsvSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/tabixTsvSource.js +14 -12
- package/dist/src/data/sources/lazy/vcfSource.d.ts +7 -3
- package/dist/src/data/sources/lazy/vcfSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/vcfSource.js +7 -8
- package/dist/src/data/sources/urlDescriptor.d.ts +165 -0
- package/dist/src/data/sources/urlDescriptor.d.ts.map +1 -0
- package/dist/src/data/sources/urlDescriptor.js +473 -0
- package/dist/src/data/sources/urlDescriptorController.d.ts +25 -0
- package/dist/src/data/sources/urlDescriptorController.d.ts.map +1 -0
- package/dist/src/data/sources/urlDescriptorController.js +72 -0
- package/dist/src/data/sources/urlDescriptorState.d.ts +47 -0
- package/dist/src/data/sources/urlDescriptorState.d.ts.map +1 -0
- package/dist/src/data/sources/urlDescriptorState.js +129 -0
- package/dist/src/data/sources/urlSource.d.ts.map +1 -1
- package/dist/src/data/sources/urlSource.js +101 -61
- package/dist/src/data/transforms/packLegendLabels.d.ts +21 -0
- package/dist/src/data/transforms/packLegendLabels.d.ts.map +1 -0
- package/dist/src/data/transforms/packLegendLabels.js +189 -0
- package/dist/src/data/transforms/transformFactory.d.ts.map +1 -1
- package/dist/src/data/transforms/transformFactory.js +4 -0
- package/dist/src/data/transforms/truncateText.d.ts +27 -0
- package/dist/src/data/transforms/truncateText.d.ts.map +1 -0
- package/dist/src/data/transforms/truncateText.js +94 -0
- package/dist/src/debug/dataflowDebugSnapshot.d.ts +58 -0
- package/dist/src/debug/dataflowDebugSnapshot.d.ts.map +1 -0
- package/dist/src/debug/dataflowDebugSnapshot.js +159 -0
- package/dist/src/debug/markDebugSnapshot.d.ts +54 -0
- package/dist/src/debug/markDebugSnapshot.d.ts.map +1 -0
- package/dist/src/debug/markDebugSnapshot.js +100 -0
- package/dist/src/debug/paramDebugSnapshot.d.ts +53 -0
- package/dist/src/debug/paramDebugSnapshot.d.ts.map +1 -0
- package/dist/src/debug/paramDebugSnapshot.js +86 -0
- package/dist/src/debug/resolutionDebugSnapshot.d.ts +155 -0
- package/dist/src/debug/resolutionDebugSnapshot.d.ts.map +1 -0
- package/dist/src/debug/resolutionDebugSnapshot.js +291 -0
- package/dist/src/debug/valuePreview.d.ts +9 -0
- package/dist/src/debug/valuePreview.d.ts.map +1 -0
- package/dist/src/debug/valuePreview.js +57 -0
- package/dist/src/debug/viewDebugSnapshot.d.ts +131 -0
- package/dist/src/debug/viewDebugSnapshot.d.ts.map +1 -0
- package/dist/src/debug/viewDebugSnapshot.js +390 -0
- package/dist/src/embedFactory.d.ts.map +1 -1
- package/dist/src/embedFactory.js +6 -1
- package/dist/src/encoder/encoder.d.ts +2 -2
- package/dist/src/encoder/encoder.d.ts.map +1 -1
- package/dist/src/encoder/encoder.js +5 -4
- package/dist/src/fonts/bmFontManager.d.ts +1 -1
- package/dist/src/fonts/bmFontManager.d.ts.map +1 -1
- package/dist/src/fonts/bmFontManager.js +45 -10
- package/dist/src/fonts/textMetrics.d.ts +69 -0
- package/dist/src/fonts/textMetrics.d.ts.map +1 -0
- package/dist/src/fonts/textMetrics.js +73 -0
- package/dist/src/genomeSpy/headlessBootstrap.d.ts.map +1 -1
- package/dist/src/genomeSpy/headlessBootstrap.js +6 -0
- package/dist/src/genomeSpy/renderCoordinator.d.ts.map +1 -1
- package/dist/src/genomeSpy/renderCoordinator.js +25 -3
- package/dist/src/genomeSpy/viewDataInit.d.ts +14 -0
- package/dist/src/genomeSpy/viewDataInit.d.ts.map +1 -1
- package/dist/src/genomeSpy/viewDataInit.js +45 -8
- package/dist/src/genomeSpyBase.d.ts +6 -0
- package/dist/src/genomeSpyBase.d.ts.map +1 -1
- package/dist/src/genomeSpyBase.js +20 -3
- package/dist/src/gl/glslScaleGenerator.d.ts +17 -0
- package/dist/src/gl/glslScaleGenerator.d.ts.map +1 -1
- package/dist/src/gl/glslScaleGenerator.js +39 -2
- package/dist/src/gl/includes/common.glsl.js +1 -1
- package/dist/src/gl/vertexRangeIndex.d.ts.map +1 -1
- package/dist/src/gl/vertexRangeIndex.js +4 -2
- package/dist/src/gl/webGLHelper.d.ts +1 -1
- package/dist/src/gl/webGLHelper.d.ts.map +1 -1
- package/dist/src/gl/webGLHelper.js +13 -8
- package/dist/src/marks/__snapshots__/shaderSnapshot.test.js.snap +140 -3
- package/dist/src/marks/mark.d.ts +47 -4
- package/dist/src/marks/mark.d.ts.map +1 -1
- package/dist/src/marks/mark.js +158 -54
- package/dist/src/marks/point.d.ts.map +1 -1
- package/dist/src/marks/point.js +4 -0
- package/dist/src/marks/point.vertex.glsl.js +1 -1
- package/dist/src/marks/text.d.ts +1 -1
- package/dist/src/marks/text.d.ts.map +1 -1
- package/dist/src/marks/text.js +2 -7
- package/dist/src/marks/text.vertex.glsl.js +1 -1
- package/dist/src/paramRuntime/paramUtils.d.ts +43 -9
- package/dist/src/paramRuntime/paramUtils.d.ts.map +1 -1
- package/dist/src/paramRuntime/paramUtils.js +61 -1
- package/dist/src/paramRuntime/viewParamRuntime.d.ts +32 -0
- package/dist/src/paramRuntime/viewParamRuntime.d.ts.map +1 -1
- package/dist/src/paramRuntime/viewParamRuntime.js +63 -0
- package/dist/src/scales/axisResolution.d.ts +35 -0
- package/dist/src/scales/axisResolution.d.ts.map +1 -1
- package/dist/src/scales/axisResolution.js +115 -7
- package/dist/src/scales/legendResolution.d.ts +83 -0
- package/dist/src/scales/legendResolution.d.ts.map +1 -0
- package/dist/src/scales/legendResolution.js +461 -0
- package/dist/src/scales/scaleResolution.d.ts +36 -0
- package/dist/src/scales/scaleResolution.d.ts.map +1 -1
- package/dist/src/scales/scaleResolution.js +59 -0
- package/dist/src/scales/viewLevelGuideConfig.d.ts +53 -0
- package/dist/src/scales/viewLevelGuideConfig.d.ts.map +1 -0
- package/dist/src/scales/viewLevelGuideConfig.js +224 -0
- package/dist/src/scales/viewLevelScaleConfig.d.ts.map +1 -1
- package/dist/src/scales/viewLevelScaleConfig.js +13 -2
- package/dist/src/spec/axis.d.ts +109 -3
- package/dist/src/spec/channel.d.ts +23 -4
- package/dist/src/spec/config.d.ts +59 -4
- package/dist/src/spec/data.d.ts +177 -17
- package/dist/src/spec/legend.d.ts +246 -0
- package/dist/src/spec/mark.d.ts +16 -4
- package/dist/src/spec/title.d.ts +58 -1
- package/dist/src/spec/transform.d.ts +149 -0
- package/dist/src/spec/view.d.ts +39 -6
- package/dist/src/types/embedApi.d.ts +262 -6
- package/dist/src/types/rendering.d.ts +19 -3
- package/dist/src/types/viewContext.d.ts +18 -2
- package/dist/src/utils/arrayUtils.d.ts +11 -0
- package/dist/src/utils/arrayUtils.d.ts.map +1 -1
- package/dist/src/utils/arrayUtils.js +23 -0
- package/dist/src/utils/suspension.d.ts +17 -0
- package/dist/src/utils/suspension.d.ts.map +1 -0
- package/dist/src/utils/suspension.js +41 -0
- package/dist/src/view/axisGridView.d.ts.map +1 -1
- package/dist/src/view/axisGridView.js +1 -4
- package/dist/src/view/axisView.d.ts +18 -2
- package/dist/src/view/axisView.d.ts.map +1 -1
- package/dist/src/view/axisView.js +180 -75
- package/dist/src/view/concatView.d.ts +10 -2
- package/dist/src/view/concatView.d.ts.map +1 -1
- package/dist/src/view/concatView.js +46 -9
- package/dist/src/view/containerMutationHelper.d.ts +20 -1
- package/dist/src/view/containerMutationHelper.d.ts.map +1 -1
- package/dist/src/view/containerMutationHelper.js +196 -33
- package/dist/src/view/facetView.d.ts +1 -1
- package/dist/src/view/gridView/gridChild.d.ts +54 -4
- package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
- package/dist/src/view/gridView/gridChild.js +301 -120
- package/dist/src/view/gridView/gridChildLegends.d.ts +57 -0
- package/dist/src/view/gridView/gridChildLegends.d.ts.map +1 -0
- package/dist/src/view/gridView/gridChildLegends.js +503 -0
- package/dist/src/view/gridView/gridView.d.ts +25 -0
- package/dist/src/view/gridView/gridView.d.ts.map +1 -1
- package/dist/src/view/gridView/gridView.js +454 -78
- package/dist/src/view/gridView/legendLayout.d.ts +26 -0
- package/dist/src/view/gridView/legendLayout.d.ts.map +1 -0
- package/dist/src/view/gridView/legendLayout.js +111 -0
- package/dist/src/view/gridView/scrollbar.d.ts.map +1 -1
- package/dist/src/view/gridView/scrollbar.js +1 -4
- package/dist/src/view/gridView/selectionRect.d.ts.map +1 -1
- package/dist/src/view/gridView/selectionRect.js +1 -4
- package/dist/src/view/gridView/separatorView.d.ts.map +1 -1
- package/dist/src/view/gridView/separatorView.js +1 -4
- package/dist/src/view/layerView.d.ts +9 -2
- package/dist/src/view/layerView.d.ts.map +1 -1
- package/dist/src/view/layerView.js +18 -1
- package/dist/src/view/layout/flexLayout.d.ts +20 -4
- package/dist/src/view/layout/flexLayout.d.ts.map +1 -1
- package/dist/src/view/layout/flexLayout.js +331 -31
- package/dist/src/view/layout/rectangle.d.ts +14 -0
- package/dist/src/view/layout/rectangle.d.ts.map +1 -1
- package/dist/src/view/layout/rectangle.js +40 -0
- package/dist/src/view/legend/legendEntries.d.ts +20 -0
- package/dist/src/view/legend/legendEntries.d.ts.map +1 -0
- package/dist/src/view/legend/legendEntries.js +21 -0
- package/dist/src/view/legendView.d.ts +134 -0
- package/dist/src/view/legendView.d.ts.map +1 -0
- package/dist/src/view/legendView.js +1611 -0
- package/dist/src/view/renderingContext/bufferedViewRenderingContext.d.ts.map +1 -1
- package/dist/src/view/renderingContext/bufferedViewRenderingContext.js +26 -4
- package/dist/src/view/renderingContext/clipOptions.d.ts +44 -0
- package/dist/src/view/renderingContext/clipOptions.d.ts.map +1 -0
- package/dist/src/view/renderingContext/clipOptions.js +140 -0
- package/dist/src/view/renderingContext/simpleViewRenderingContext.d.ts.map +1 -1
- package/dist/src/view/renderingContext/simpleViewRenderingContext.js +12 -1
- package/dist/src/view/resolutionPlanner.d.ts +2 -1
- package/dist/src/view/resolutionPlanner.d.ts.map +1 -1
- package/dist/src/view/resolutionPlanner.js +89 -25
- package/dist/src/view/testUtils.d.ts +4 -2
- package/dist/src/view/testUtils.d.ts.map +1 -1
- package/dist/src/view/testUtils.js +29 -7
- package/dist/src/view/titleView.d.ts +37 -0
- package/dist/src/view/titleView.d.ts.map +1 -0
- package/dist/src/view/titleView.js +584 -0
- package/dist/src/view/unitView.d.ts +3 -3
- package/dist/src/view/unitView.d.ts.map +1 -1
- package/dist/src/view/unitView.js +3 -2
- package/dist/src/view/view.d.ts +25 -24
- package/dist/src/view/view.d.ts.map +1 -1
- package/dist/src/view/view.js +121 -16
- package/dist/src/view/viewFactory.d.ts +2 -5
- package/dist/src/view/viewFactory.d.ts.map +1 -1
- package/dist/src/view/viewFactory.js +1 -2
- package/dist/src/view/viewIdentityRegistry.d.ts +37 -0
- package/dist/src/view/viewIdentityRegistry.d.ts.map +1 -0
- package/dist/src/view/viewIdentityRegistry.js +71 -0
- package/dist/src/view/viewMutationAcidTestUtils.d.ts +112 -0
- package/dist/src/view/viewMutationAcidTestUtils.d.ts.map +1 -0
- package/dist/src/view/viewMutationAcidTestUtils.js +234 -0
- package/dist/src/view/viewMutationApi.d.ts +42 -0
- package/dist/src/view/viewMutationApi.d.ts.map +1 -0
- package/dist/src/view/viewMutationApi.js +811 -0
- package/dist/src/view/viewSelectors.d.ts +10 -0
- package/dist/src/view/viewSelectors.d.ts.map +1 -1
- package/dist/src/view/viewSelectors.js +23 -1
- package/package.json +4 -4
- package/dist/bundle/esm-CuMSzCHy.js +0 -298
- package/dist/bundle/esm-DAnOffpD.js +0 -1426
- package/dist/bundle/esm-DMXpJXM4.js +0 -369
- package/dist/bundle/esm-DNtC3H80.js +0 -121
- package/dist/src/view/title.d.ts +0 -13
- package/dist/src/view/title.d.ts.map +0 -1
- package/dist/src/view/title.js +0 -154
- /package/dist/bundle/{AbortablePromiseCache-3gHJdF3E.js → AbortablePromiseCache-BTmAcN-t.js} +0 -0
- /package/dist/bundle/{esm-CuVa5T98.js → esm-VvpZ9hsq.js} +0 -0
- /package/dist/bundle/{chunk-DmhlhrBa.js → rolldown-runtime-Dy4uBu1J.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mergeConfigScopes } from "./mergeConfig.js";
|
|
2
|
-
import {
|
|
2
|
+
import { getConfiguredStyleConfig as getStyleConfig } from "./styleUtils.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @param {import("../spec/config.js").GenomeSpyConfig[]} scopes
|
|
@@ -22,21 +22,5 @@ export function getConfiguredTitleConfig(scopes) {
|
|
|
22
22
|
* @returns {import("../spec/config.js").StyleConfig}
|
|
23
23
|
*/
|
|
24
24
|
export function getConfiguredStyleConfig(scopes, styleName) {
|
|
25
|
-
|
|
26
|
-
if (styles.length == 0) {
|
|
27
|
-
return {};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return /** @type {import("../spec/config.js").StyleConfig} */ (
|
|
31
|
-
mergeConfigScopes(
|
|
32
|
-
scopes.flatMap((scope) =>
|
|
33
|
-
styles.map(
|
|
34
|
-
(name) =>
|
|
35
|
-
/** @type {Record<string, any> | undefined} */ (
|
|
36
|
-
scope.style?.[name]
|
|
37
|
-
)
|
|
38
|
-
)
|
|
39
|
-
)
|
|
40
|
-
)
|
|
41
|
-
);
|
|
25
|
+
return getStyleConfig(scopes, styleName);
|
|
42
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../../src/data/collector.js"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH;IA6CI;;OAEG;IACH,qBAFW,OAAO,sBAAsB,EAAE,aAAa,EAiBtD;IAZG,qDAA2C;IAE3C,4CAA4C;IAC5C,WADW,GAAG,CAAC,CAAS,IAAS,EAAT,SAAS,KAAE,IAAI,CAAC,CACd;IAG1B,yFAAyF;IACzF,cADW,GAAG,CAAC,OAAO,oBAAoB,EAAE,MAAM,EAAE,+BAAO,CACN;
|
|
1
|
+
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../../src/data/collector.js"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH;IA6CI;;OAEG;IACH,qBAFW,OAAO,sBAAsB,EAAE,aAAa,EAiBtD;IAZG,qDAA2C;IAE3C,4CAA4C;IAC5C,WADW,GAAG,CAAC,CAAS,IAAS,EAAT,SAAS,KAAE,IAAI,CAAC,CACd;IAG1B,yFAAyF;IACzF,cADW,GAAG,CAAC,OAAO,oBAAoB,EAAE,MAAM,EAAE,+BAAO,CACN;IA+EzD;;;OAGG;IACH,kBAHW,CAAS,IAAS,EAAT,SAAS,KAAE,IAAI,GACtB,MAAM,IAAI,CAOtB;IAiCD;;;;;OAKG;IACH,qBALW,MAAM,QACN,OAAO,oBAAoB,EAAE,IAAI,YACjC,OAAO,qBAAqB,EAAE,QAAQ,GACpC,OAAO,yBAAyB,EAAE,WAAW,CAkBzD;IAED;;;;OAIG;IACH,kCAJW,MAAM,YACN,MAAM,IAAI,GACR,MAAM,IAAI,CAItB;IAED;;OAEG;IACH,WAFa,QAAQ,+BAAO,CAqB3B;IAED;;;OAGG;IACH,mBAFW,CAAC,KAAK,+BAAO,KAAK,IAAI,QAUhC;IAED;;OAEG;IACH,uBAMC;IAqDD;;;;OAIG;IACH,8BAFW,MAAM,iCA4BhB;IAED;;;;;OAKG;IACH,0BAHW,MAAM,EAAE,YACR,OAAO,oBAAoB,EAAE,MAAM,EAAE,iCAS/C;;CACJ;qBArXyD,eAAe"}
|
|
@@ -119,23 +119,14 @@ export default class Collector extends FlowNode {
|
|
|
119
119
|
this.#buffer = [];
|
|
120
120
|
|
|
121
121
|
if (this.params.groupby?.length) {
|
|
122
|
-
if (this.facetBatches.size > 1) {
|
|
123
|
-
throw new Error("TODO: Support faceted data!");
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
const data = this.facetBatches.get(undefined);
|
|
127
|
-
|
|
128
122
|
const accessors = this.params.groupby.map((fieldName) =>
|
|
129
123
|
field(fieldName)
|
|
130
124
|
);
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
?
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
)
|
|
137
|
-
: // D3's group is SLOW!
|
|
138
|
-
groupBy(data, accessors[0]);
|
|
125
|
+
const data =
|
|
126
|
+
this.facetBatches.size > 1
|
|
127
|
+
? iterateFacetBatchData(this.facetBatches.values())
|
|
128
|
+
: this.facetBatches.get(undefined);
|
|
129
|
+
const groups = groupData(data, accessors);
|
|
139
130
|
|
|
140
131
|
this.facetBatches.clear();
|
|
141
132
|
for (const [key, data] of iterateNestedMaps(groups)) {
|
|
@@ -464,17 +455,44 @@ class DomainCache {
|
|
|
464
455
|
}
|
|
465
456
|
}
|
|
466
457
|
|
|
458
|
+
/**
|
|
459
|
+
* @param {Iterable<Data>} batches
|
|
460
|
+
* @returns {Iterable<Datum>}
|
|
461
|
+
*/
|
|
462
|
+
function iterateFacetBatchData(batches) {
|
|
463
|
+
return {
|
|
464
|
+
[Symbol.iterator]: function* generator() {
|
|
465
|
+
for (const data of batches) {
|
|
466
|
+
yield* data;
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* @param {Iterable<Datum>} data
|
|
474
|
+
* @param {((data: Datum) => import("../spec/channel.js").Scalar)[]} accessors
|
|
475
|
+
*/
|
|
476
|
+
function groupData(data, accessors) {
|
|
477
|
+
return accessors.length > 1
|
|
478
|
+
? // There's something strange in d3-array's typings
|
|
479
|
+
/** @type {Map<any, any>} */ /** @type {any} */ (
|
|
480
|
+
group(data, ...accessors)
|
|
481
|
+
)
|
|
482
|
+
: // D3's group is SLOW!
|
|
483
|
+
groupBy(data, accessors[0]);
|
|
484
|
+
}
|
|
485
|
+
|
|
467
486
|
/**
|
|
468
487
|
* Like D3's group but without InternMap, which is slow.
|
|
469
488
|
* TODO: Implement multi-level grouping
|
|
470
489
|
*
|
|
471
|
-
* @param {Datum
|
|
490
|
+
* @param {Iterable<Datum>} data
|
|
472
491
|
* @param {(data: Datum) => import("../spec/channel.js").Scalar} accessor
|
|
473
492
|
*/
|
|
474
493
|
function groupBy(data, accessor) {
|
|
475
494
|
const groups = new Map();
|
|
476
|
-
for (
|
|
477
|
-
const datum = data[i];
|
|
495
|
+
for (const datum of data) {
|
|
478
496
|
const key = accessor(datum);
|
|
479
497
|
let group = groups.get(key);
|
|
480
498
|
if (!group) {
|
|
@@ -505,7 +523,11 @@ function makeComparator(sort) {
|
|
|
505
523
|
new Function(
|
|
506
524
|
"a",
|
|
507
525
|
"b",
|
|
508
|
-
`return
|
|
526
|
+
`return ${
|
|
527
|
+
order === "ascending"
|
|
528
|
+
? `a[${fieldName}] - b[${fieldName}]`
|
|
529
|
+
: `b[${fieldName}] - a[${fieldName}]`
|
|
530
|
+
};`
|
|
509
531
|
)
|
|
510
532
|
);
|
|
511
533
|
}
|
|
@@ -89,5 +89,11 @@ export function collectNearestViewSubtreeDataSources(subtreeRoot: import("../vie
|
|
|
89
89
|
export function loadViewSubtreeData(subtreeRoot: import("../view/view.js").default, dataSources?: Set<import("./sources/dataSource.js").default>, viewFilter?: (view: import("../view/view.js").default) => boolean, loadOptions?: {
|
|
90
90
|
queueReload?: boolean;
|
|
91
91
|
}): Promise<void[]>;
|
|
92
|
+
/**
|
|
93
|
+
* Broadcasts a subtree-scoped data-ready event to views within the subtree.
|
|
94
|
+
*
|
|
95
|
+
* @param {import("../view/view.js").default} subtreeRoot
|
|
96
|
+
*/
|
|
97
|
+
export function broadcastSubtreeDataReady(subtreeRoot: import("../view/view.js").default): void;
|
|
92
98
|
import UnitView from "../view/unitView.js";
|
|
93
99
|
//# sourceMappingURL=flowInit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowInit.d.ts","sourceRoot":"","sources":["../../../src/data/flowInit.js"],"names":[],"mappings":"AAwDA;;;;;GAKG;AACH,sCAHW,OAAO,iBAAiB,EAAE,OAAO,qBACjC,GAAG,CAAC,OAAO,yBAAyB,EAAE,OAAO,EAAE,OAAO,yBAAyB,EAAE,OAAO,CAAC,QAcnG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,mDAXW,OAAO,iBAAiB,EAAE,OAAO,QACjC,OAAO,eAAe,EAAE,OAAO,eAC/B,CAAC,IAAI,EAAE,OAAO,iBAAiB,EAAE,OAAO,KAAK,OAAO,gCACpD,CAAC,IAAI,EAAE,OAAO,iBAAiB,EAAE,OAAO,KAAK,OAAO,GAClD;IACN,QAAQ,EAAE,OAAO,eAAe,EAAE,OAAO,CAAC;IAC1C,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,WAAW,EAAE,GAAG,CAAC,OAAO,yBAAyB,EAAE,OAAO,CAAC,CAAC;IAC5D,gBAAgB,EAAE,OAAO,CAAC,OAAO,kBAAkB,EAAE,OAAO,CAAC,EAAE,CAAA;CAClE,CA6FH;AAED;;;;;;;GAOG;AACH,2DAJW,OAAO,iBAAiB,EAAE,OAAO,GAAG,OAAO,iBAAiB,EAAE,OAAO,EAAE,eACvE,CAAC,IAAI,EAAE,OAAO,iBAAiB,EAAE,OAAO,KAAK,OAAO,GAClD,GAAG,CAAC,OAAO,yBAAyB,EAAE,OAAO,CAAC,CAsB1D;AAED;;;;;;;GAOG;AACH,kEAJW,OAAO,iBAAiB,EAAE,OAAO,eACjC,CAAC,IAAI,EAAE,OAAO,iBAAiB,EAAE,OAAO,KAAK,OAAO,GAClD,GAAG,CAAC,OAAO,yBAAyB,EAAE,OAAO,CAAC,CAe1D;AAED;;;;;;;;;GASG;AACH,iDANW,OAAO,iBAAiB,EAAE,OAAO,gBACjC,GAAG,CAAC,OAAO,yBAAyB,EAAE,OAAO,CAAC,eAC9C,CAAC,IAAI,EAAE,OAAO,iBAAiB,EAAE,OAAO,KAAK,OAAO,gBACpD;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GACvB,OAAO,CAAC,IAAI,EAAE,CAAC,CAsB3B;
|
|
1
|
+
{"version":3,"file":"flowInit.d.ts","sourceRoot":"","sources":["../../../src/data/flowInit.js"],"names":[],"mappings":"AAwDA;;;;;GAKG;AACH,sCAHW,OAAO,iBAAiB,EAAE,OAAO,qBACjC,GAAG,CAAC,OAAO,yBAAyB,EAAE,OAAO,EAAE,OAAO,yBAAyB,EAAE,OAAO,CAAC,QAcnG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,mDAXW,OAAO,iBAAiB,EAAE,OAAO,QACjC,OAAO,eAAe,EAAE,OAAO,eAC/B,CAAC,IAAI,EAAE,OAAO,iBAAiB,EAAE,OAAO,KAAK,OAAO,gCACpD,CAAC,IAAI,EAAE,OAAO,iBAAiB,EAAE,OAAO,KAAK,OAAO,GAClD;IACN,QAAQ,EAAE,OAAO,eAAe,EAAE,OAAO,CAAC;IAC1C,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,WAAW,EAAE,GAAG,CAAC,OAAO,yBAAyB,EAAE,OAAO,CAAC,CAAC;IAC5D,gBAAgB,EAAE,OAAO,CAAC,OAAO,kBAAkB,EAAE,OAAO,CAAC,EAAE,CAAA;CAClE,CA6FH;AAED;;;;;;;GAOG;AACH,2DAJW,OAAO,iBAAiB,EAAE,OAAO,GAAG,OAAO,iBAAiB,EAAE,OAAO,EAAE,eACvE,CAAC,IAAI,EAAE,OAAO,iBAAiB,EAAE,OAAO,KAAK,OAAO,GAClD,GAAG,CAAC,OAAO,yBAAyB,EAAE,OAAO,CAAC,CAsB1D;AAED;;;;;;;GAOG;AACH,kEAJW,OAAO,iBAAiB,EAAE,OAAO,eACjC,CAAC,IAAI,EAAE,OAAO,iBAAiB,EAAE,OAAO,KAAK,OAAO,GAClD,GAAG,CAAC,OAAO,yBAAyB,EAAE,OAAO,CAAC,CAe1D;AAED;;;;;;;;;GASG;AACH,iDANW,OAAO,iBAAiB,EAAE,OAAO,gBACjC,GAAG,CAAC,OAAO,yBAAyB,EAAE,OAAO,CAAC,eAC9C,CAAC,IAAI,EAAE,OAAO,iBAAiB,EAAE,OAAO,KAAK,OAAO,gBACpD;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GACvB,OAAO,CAAC,IAAI,EAAE,CAAC,CAsB3B;AAsBD;;;;GAIG;AACH,uDAFW,OAAO,iBAAiB,EAAE,OAAO,QAW3C;qBA/UoB,qBAAqB"}
|
|
@@ -324,7 +324,7 @@ function collectSubtreeViews(subtreeRoot, viewFilter) {
|
|
|
324
324
|
*
|
|
325
325
|
* @param {import("../view/view.js").default} subtreeRoot
|
|
326
326
|
*/
|
|
327
|
-
function broadcastSubtreeDataReady(subtreeRoot) {
|
|
327
|
+
export function broadcastSubtreeDataReady(subtreeRoot) {
|
|
328
328
|
/** @type {import("../view/view.js").BroadcastMessage} */
|
|
329
329
|
const message = {
|
|
330
330
|
type: /** @type {import("../genomeSpy.js").BroadcastEventType} */ (
|
|
@@ -38,6 +38,19 @@ export const BEHAVIOR_COLLECTS: number;
|
|
|
38
38
|
* @prop {import("../paramRuntime/viewParamRuntime.js").default} [paramRuntime]
|
|
39
39
|
* @prop {import("../types/viewContext.js").default} [context]
|
|
40
40
|
*/
|
|
41
|
+
/**
|
|
42
|
+
* @typedef {object} FlowNodeDebugState
|
|
43
|
+
* @prop {string} label
|
|
44
|
+
* @prop {FlowNode[]} children
|
|
45
|
+
* @prop {FlowNode | undefined} parent
|
|
46
|
+
* @prop {{ count: number, first: Datum | null }} stats
|
|
47
|
+
* @prop {boolean} completed
|
|
48
|
+
* @prop {boolean} initialized
|
|
49
|
+
* @prop {boolean} disposed
|
|
50
|
+
* @prop {Record<string, any> | undefined} params
|
|
51
|
+
* @prop {import("../view/view.js").default | undefined} view
|
|
52
|
+
* @prop {import("../spec/channel.js").ChannelWithScale[]} domainSensitiveScaleChannels
|
|
53
|
+
*/
|
|
41
54
|
/**
|
|
42
55
|
* This is heavily inspired by Vega's and Vega-Lite's data flow system.
|
|
43
56
|
*
|
|
@@ -82,6 +95,10 @@ export default class FlowNode {
|
|
|
82
95
|
/** True if all data have been processed */
|
|
83
96
|
completed: boolean;
|
|
84
97
|
get disposed(): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* @returns {FlowNodeDebugState}
|
|
100
|
+
*/
|
|
101
|
+
getDebugState(): FlowNodeDebugState;
|
|
85
102
|
/**
|
|
86
103
|
* Resets the node and all its descendants to their initial state, i.e., preparing
|
|
87
104
|
* for a new batch of data.
|
|
@@ -195,6 +212,21 @@ export type ParamRuntimeProvider = {
|
|
|
195
212
|
paramRuntime?: import("../paramRuntime/viewParamRuntime.js").default;
|
|
196
213
|
context?: import("../types/viewContext.js").default;
|
|
197
214
|
};
|
|
215
|
+
export type FlowNodeDebugState = {
|
|
216
|
+
label: string;
|
|
217
|
+
children: FlowNode[];
|
|
218
|
+
parent: FlowNode | undefined;
|
|
219
|
+
stats: {
|
|
220
|
+
count: number;
|
|
221
|
+
first: Datum | null;
|
|
222
|
+
};
|
|
223
|
+
completed: boolean;
|
|
224
|
+
initialized: boolean;
|
|
225
|
+
disposed: boolean;
|
|
226
|
+
params: Record<string, any> | undefined;
|
|
227
|
+
view: import("../view/view.js").default | undefined;
|
|
228
|
+
domainSensitiveScaleChannels: import("../spec/channel.js").ChannelWithScale[];
|
|
229
|
+
};
|
|
198
230
|
/**
|
|
199
231
|
* This is heavily inspired by Vega's and Vega-Lite's data flow system.
|
|
200
232
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowNode.d.ts","sourceRoot":"","sources":["../../../src/data/flowNode.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flowNode.d.ts","sourceRoot":"","sources":["../../../src/data/flowNode.js"],"names":[],"mappings":"AAsdA;;;;;;;;GAQG;AACH,0DAHW,QAAQ,GAAG,SAAS,GAClB,GAAG,CAAC,OAAO,oBAAoB,EAAE,gBAAgB,CAAC,CAc9D;AAED;;;GAGG;AACH,uCAHW,OAAO,uBAAuB,EAAE,SAAS,GACvC,SAAS,IAAI,OAAO,uBAAuB,EAAE,SAAS,CAIlE;AAED;;;GAGG;AACH,wCAHW,OAAO,uBAAuB,EAAE,SAAS,GACvC,SAAS,IAAI,OAAO,uBAAuB,EAAE,UAAU,CAInE;AAzfD;;;GAGG;AACH,qCAAsC;AAEtC;;;GAGG;AACH,uCAAwC;AAExC;;;GAGG;AACH,uCAAwC;AAExC;;;;GAIG;AAEH;;;;;;;;;;;;GAYG;AAEH;;;;;GAKG;AACH;IA+CI;;OAEG;IACH,mCAFW,oBAAoB,EAa9B;IA5DD;;QAEI,oBAAoB;eAAT,KAAK;MAElB;IAWF;;;;OAIG;IACH,sBAFU,oBAAoB,CAEF;IAE5B,uBAEC;IAED;;;;;;OAMG;IACH,oCAFa,OAAO,oBAAoB,EAAE,gBAAgB,EAAE,CAI3D;IAED;;;;OAIG;IACH,aAFa,MAAM,CAIlB;IAQG,yBAAyB;IACzB,UADW,QAAQ,EAAE,CACH;IAElB,uBAAuB;IACvB,QADW,QAAQ,CACI;IAEvB,2CAA2C;IAC3C,mBAAsB;IAG1B,wBAEC;IAED;;OAEG;IACH,iBAFa,kBAAkB,CAsB9B;IAED;;;OAGG;IACH,cASC;IAED;;;;;;OAMG;IACH,mBAEC;IAED;;;OAGG;IACH,uBAMC;IA2QD;;;OAGG;IACH,4BAHW,KAAK,QAKf;IAxPD;;;OAGG;IACH,kBAFW,QAAQ,QAIlB;IAED;;;OAGG;IACH,gBAFW,QAAQ,QAUlB;IAED;;OAEG;IACH,YAFW,QAAQ,QAQlB;IAED;;OAEG;IACH,6BAFW,QAAQ,QAMlB;IAED;;OAEG;IACH,0BAFW,QAAQ,QAalB;IAED;;;OAGG;IACH,mBAFW,QAAQ,QAWlB;IAED;;OAEG;IACH,eAiBC;IAED,kBAEC;IAED,uBAEC;IAED,sBAEC;IAED;;;;OAIG;IACH,eAFW,CAAC,CAAS,IAAQ,EAAR,QAAQ,KAAE,IAAI,CAAC,GAAG;QAAE,aAAa,CAAC,EAAE,CAAS,IAAQ,EAAR,QAAQ,KAAE,IAAI,CAAA;KAAC,QAchF;IAED;;;OAGG;IACH,wBAHW,MAAM,GACJ,MAAM,CAWlB;IAED;;;OAGG;IACH,cAFW,KAAK,QAKf;IAED,iBAMC;IAED;;;;OAIG;IACH,2BAFW,MAAM,IAAI,QAQpB;IAED;;OAEG;IACH,gBAWC;IAED;;OAEG;IACH,uBAOC;IAED;;;;OAIG;IACH,sBAFW,OAAO,uBAAuB,EAAE,SAAS,QAMnD;IAED;;;OAGG;IACH,8BAHa,OAAO,qCAAqC,EAAE,OAAO,CAcjE;IAED;;;;OAIG;IACH,8BAQC;;CASJ;;mBA1aS,OAAO,qCAAqC,EAAE,OAAO;cACrD,OAAO,yBAAyB,EAAE,OAAO;;;WAKzC,MAAM;cACN,QAAQ,EAAE;YACV,QAAQ,GAAG,SAAS;WACpB;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;KAAE;eACtC,OAAO;iBACP,OAAO;cACP,OAAO;YACP,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS;UAC/B,OAAO,iBAAiB,EAAE,OAAO,GAAG,SAAS;kCAC7C,OAAO,oBAAoB,EAAE,gBAAgB,EAAE;;;;;oBAM5C,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;;mBACnB,KAAK,EAAE"}
|
|
@@ -24,6 +24,20 @@ export const BEHAVIOR_COLLECTS = 1 << 2;
|
|
|
24
24
|
* @prop {import("../types/viewContext.js").default} [context]
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* @typedef {object} FlowNodeDebugState
|
|
29
|
+
* @prop {string} label
|
|
30
|
+
* @prop {FlowNode[]} children
|
|
31
|
+
* @prop {FlowNode | undefined} parent
|
|
32
|
+
* @prop {{ count: number, first: Datum | null }} stats
|
|
33
|
+
* @prop {boolean} completed
|
|
34
|
+
* @prop {boolean} initialized
|
|
35
|
+
* @prop {boolean} disposed
|
|
36
|
+
* @prop {Record<string, any> | undefined} params
|
|
37
|
+
* @prop {import("../view/view.js").default | undefined} view
|
|
38
|
+
* @prop {import("../spec/channel.js").ChannelWithScale[]} domainSensitiveScaleChannels
|
|
39
|
+
*/
|
|
40
|
+
|
|
27
41
|
/**
|
|
28
42
|
* This is heavily inspired by Vega's and Vega-Lite's data flow system.
|
|
29
43
|
*
|
|
@@ -97,6 +111,31 @@ export default class FlowNode {
|
|
|
97
111
|
return this.#disposed;
|
|
98
112
|
}
|
|
99
113
|
|
|
114
|
+
/**
|
|
115
|
+
* @returns {FlowNodeDebugState}
|
|
116
|
+
*/
|
|
117
|
+
getDebugState() {
|
|
118
|
+
const flowNode = /** @type {any} */ (this);
|
|
119
|
+
return {
|
|
120
|
+
label: this.label,
|
|
121
|
+
children: this.children.slice(),
|
|
122
|
+
parent: this.parent,
|
|
123
|
+
stats: {
|
|
124
|
+
count: this.stats.count,
|
|
125
|
+
first: this.stats.first,
|
|
126
|
+
},
|
|
127
|
+
completed: this.completed,
|
|
128
|
+
initialized: this.#initialized,
|
|
129
|
+
disposed: this.#disposed,
|
|
130
|
+
params:
|
|
131
|
+
"params" in flowNode
|
|
132
|
+
? structuredClone(flowNode.params)
|
|
133
|
+
: undefined,
|
|
134
|
+
view: getDebugView(flowNode, this.paramRuntimeProvider),
|
|
135
|
+
domainSensitiveScaleChannels: this.domainSensitiveScaleChannels,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
100
139
|
/**
|
|
101
140
|
* Resets the node and all its descendants to their initial state, i.e., preparing
|
|
102
141
|
* for a new batch of data.
|
|
@@ -409,6 +448,26 @@ export default class FlowNode {
|
|
|
409
448
|
}
|
|
410
449
|
}
|
|
411
450
|
|
|
451
|
+
/**
|
|
452
|
+
* @param {any} flowNode
|
|
453
|
+
* @param {ParamRuntimeProvider | undefined} paramRuntimeProvider
|
|
454
|
+
* @returns {import("../view/view.js").default | undefined}
|
|
455
|
+
*/
|
|
456
|
+
function getDebugView(flowNode, paramRuntimeProvider) {
|
|
457
|
+
if ("view" in flowNode) {
|
|
458
|
+
return flowNode.view;
|
|
459
|
+
} else if (
|
|
460
|
+
paramRuntimeProvider &&
|
|
461
|
+
"getPathString" in paramRuntimeProvider
|
|
462
|
+
) {
|
|
463
|
+
return /** @type {import("../view/view.js").default} */ (
|
|
464
|
+
paramRuntimeProvider
|
|
465
|
+
);
|
|
466
|
+
} else {
|
|
467
|
+
return undefined;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
412
471
|
/**
|
|
413
472
|
* Walks upstream from a flow node and collects scale channels whose current
|
|
414
473
|
* domain affects the produced data. Downstream encodings on these channels
|
|
@@ -15,7 +15,6 @@ export default class BamSource extends SingleAxisWindowedSource {
|
|
|
15
15
|
*/
|
|
16
16
|
chrPrefixFixer: (chr: string) => string;
|
|
17
17
|
params: import("../../../spec/data.js").BamData;
|
|
18
|
-
initializedPromise: Promise<any>;
|
|
19
18
|
#private;
|
|
20
19
|
}
|
|
21
20
|
import SingleAxisWindowedSource from "./singleAxisWindowedSource.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bamSource.d.ts","sourceRoot":"","sources":["../../../../../src/data/sources/lazy/bamSource.js"],"names":[],"mappings":"AAIA;IAeI;;;OAGG;IACH,oBAHW,OAAO,uBAAuB,EAAE,OAAO,QACvC,OAAO,uBAAuB,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"bamSource.d.ts","sourceRoot":"","sources":["../../../../../src/data/sources/lazy/bamSource.js"],"names":[],"mappings":"AAIA;IAeI;;;OAGG;IACH,oBAHW,OAAO,uBAAuB,EAAE,OAAO,QACvC,OAAO,uBAAuB,EAAE,OAAO,EAuBjD;IApCD;;;;;;;;OAQG;IACH,gBAFU,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAEH;IAkB1B,gDAAgC;;CAoFvC;qCArHoC,+BAA+B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { normalizeSingleUrlDescriptor } from "../urlDescriptor.js";
|
|
2
2
|
import { registerBuiltInLazyDataSource } from "./lazyDataSourceRegistry.js";
|
|
3
3
|
import SingleAxisWindowedSource from "./singleAxisWindowedSource.js";
|
|
4
4
|
|
|
@@ -41,41 +41,50 @@ export default class BamSource extends SingleAxisWindowedSource {
|
|
|
41
41
|
|
|
42
42
|
this.setupDebouncing(this.params);
|
|
43
43
|
|
|
44
|
-
this
|
|
45
|
-
Promise.all([
|
|
46
|
-
import("@gmod/bam"),
|
|
47
|
-
import("generic-filehandle2"),
|
|
48
|
-
]).then(([{ BamFile }, { RemoteFile }]) => {
|
|
49
|
-
const withBase = (/** @type {string} */ uri) =>
|
|
50
|
-
new RemoteFile(addBaseUrl(uri, this.view.getBaseUrl()));
|
|
51
|
-
|
|
52
|
-
this.#bam = new BamFile({
|
|
53
|
-
bamFilehandle: withBase(this.params.url),
|
|
54
|
-
baiFilehandle: withBase(
|
|
55
|
-
this.params.indexUrl ?? this.params.url + ".bai"
|
|
56
|
-
),
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
this.#bam.getHeader().then((_header) => {
|
|
60
|
-
const g = this.genome.hasChrPrefix();
|
|
61
|
-
const b =
|
|
62
|
-
this.#bam.indexToChr?.[0]?.refName.startsWith("chr");
|
|
63
|
-
if (g && !b) {
|
|
64
|
-
this.chrPrefixFixer = (chr) => chr.replace("chr", "");
|
|
65
|
-
} else if (!g && b) {
|
|
66
|
-
this.chrPrefixFixer = (chr) => "chr" + chr;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
resolve();
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
});
|
|
44
|
+
this.#initialize();
|
|
73
45
|
}
|
|
74
46
|
|
|
75
47
|
get label() {
|
|
76
48
|
return "bamSource";
|
|
77
49
|
}
|
|
78
50
|
|
|
51
|
+
#initialize() {
|
|
52
|
+
this.initializedPromise = this.#doInitialize();
|
|
53
|
+
return this.initializedPromise;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async #doInitialize() {
|
|
57
|
+
const descriptor = await normalizeSingleUrlDescriptor(
|
|
58
|
+
{
|
|
59
|
+
url: this.params.url,
|
|
60
|
+
indexUrl: this.params.indexUrl,
|
|
61
|
+
baseUrl: this.view.getBaseUrl(),
|
|
62
|
+
paramRuntime: this.paramRuntime,
|
|
63
|
+
},
|
|
64
|
+
"BamSource"
|
|
65
|
+
);
|
|
66
|
+
const [{ BamFile }, { RemoteFile }] = await Promise.all([
|
|
67
|
+
import("@gmod/bam"),
|
|
68
|
+
import("generic-filehandle2"),
|
|
69
|
+
]);
|
|
70
|
+
|
|
71
|
+
this.#bam = new BamFile({
|
|
72
|
+
bamFilehandle: new RemoteFile(descriptor.url),
|
|
73
|
+
baiFilehandle: new RemoteFile(
|
|
74
|
+
descriptor.indexUrl ?? descriptor.url + ".bai"
|
|
75
|
+
),
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
await this.#bam.getHeader();
|
|
79
|
+
const g = this.genome.hasChrPrefix();
|
|
80
|
+
const b = this.#bam.indexToChr?.[0]?.refName.startsWith("chr");
|
|
81
|
+
if (g && !b) {
|
|
82
|
+
this.chrPrefixFixer = (chr) => chr.replace("chr", "");
|
|
83
|
+
} else if (!g && b) {
|
|
84
|
+
this.chrPrefixFixer = (chr) => "chr" + chr;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
79
88
|
/**
|
|
80
89
|
* @param {number[]} interval linearized domain
|
|
81
90
|
*/
|
|
@@ -4,16 +4,6 @@ export default class BigBedSource extends SingleAxisWindowedSource {
|
|
|
4
4
|
* @param {import("../../../view/view.js").default} view
|
|
5
5
|
*/
|
|
6
6
|
constructor(params: import("../../../spec/data.js").BigBedData, view: import("../../../view/view.js").default);
|
|
7
|
-
/** @type {import("@gmod/bed").default} */
|
|
8
|
-
parser: import("@gmod/bed").default;
|
|
9
|
-
/** @type {import("@gmod/bbi").BigBed} */
|
|
10
|
-
bbi: import("@gmod/bbi").BigBed;
|
|
11
|
-
/** @type {(chrom: string, fields: { start: number, end: number, rest?: string }) => Record<string, any>} */
|
|
12
|
-
parseLine: (chrom: string, fields: {
|
|
13
|
-
start: number;
|
|
14
|
-
end: number;
|
|
15
|
-
rest?: string;
|
|
16
|
-
}) => Record<string, any>;
|
|
17
7
|
params: import("../../../spec/data.js").BigBedData;
|
|
18
8
|
#private;
|
|
19
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bigBedSource.d.ts","sourceRoot":"","sources":["../../../../../src/data/sources/lazy/bigBedSource.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bigBedSource.d.ts","sourceRoot":"","sources":["../../../../../src/data/sources/lazy/bigBedSource.js"],"names":[],"mappings":"AAYA;IAeI;;;OAGG;IACH,oBAHW,OAAO,uBAAuB,EAAE,UAAU,QAC1C,OAAO,uBAAuB,EAAE,OAAO,EAyCjD;IA1BG,mDAYC;;CAuIR;qCArLoC,+BAA+B"}
|