@genome-spy/core 0.64.0 → 0.66.1
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/{index-CCJIjehY.js → AbortablePromiseCache-CcuMrnn7.js} +22 -91
- package/dist/bundle/browser-BRemItdO.js +138 -0
- package/dist/bundle/index-BatuyGAI.js +271 -0
- package/dist/bundle/index-ByuE8dvu.js +332 -0
- package/dist/bundle/index-Cq3QFUxX.js +1781 -0
- package/dist/bundle/{index-C08YCM2T.js → index-D-w7Mmt9.js} +246 -126
- package/dist/bundle/index-D28m8tSW.js +1607 -0
- package/dist/bundle/index-D74H8TTz.js +508 -0
- package/dist/bundle/index-DbJ0oeYM.js +631 -0
- package/dist/bundle/index.es.js +15034 -13842
- package/dist/bundle/index.js +223 -237
- package/dist/bundle/inflate-GtwLkvSP.js +1048 -0
- package/dist/bundle/unzip-NywezaRR.js +1492 -0
- package/dist/schema.json +22 -4
- package/dist/src/config/scaleDefaults.d.ts +8 -0
- package/dist/src/config/scaleDefaults.d.ts.map +1 -0
- package/dist/src/config/scaleDefaults.js +45 -0
- package/dist/src/data/collector.d.ts +7 -2
- package/dist/src/data/collector.d.ts.map +1 -1
- package/dist/src/data/collector.js +13 -2
- package/dist/src/data/dataFlow.d.ts +20 -42
- package/dist/src/data/dataFlow.d.ts.map +1 -1
- package/dist/src/data/dataFlow.js +57 -80
- package/dist/src/data/flowHandle.d.ts +15 -0
- package/dist/src/data/flowHandle.d.ts.map +1 -0
- package/dist/src/data/flowHandle.js +13 -0
- package/dist/src/data/flowInit.d.ts +85 -0
- package/dist/src/data/flowInit.d.ts.map +1 -0
- package/dist/src/data/flowInit.js +238 -0
- package/dist/src/data/flowInit.test.d.ts +2 -0
- package/dist/src/data/flowInit.test.d.ts.map +1 -0
- package/dist/src/data/flowOptimizer.d.ts +6 -4
- package/dist/src/data/flowOptimizer.d.ts.map +1 -1
- package/dist/src/data/flowOptimizer.js +29 -14
- package/dist/src/data/sources/lazy/axisTickSource.js +1 -1
- package/dist/src/data/sources/lazy/bamSource.js +1 -1
- package/dist/src/data/sources/lazy/bigBedSource.js +1 -1
- package/dist/src/data/sources/lazy/bigWigSource.js +1 -1
- package/dist/src/data/sources/lazy/gff3Source.d.ts +2 -6
- package/dist/src/data/sources/lazy/gff3Source.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/gff3Source.js +4 -8
- package/dist/src/data/sources/lazy/indexedFastaSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/indexedFastaSource.js +17 -17
- package/dist/src/data/sources/lazy/singleAxisLazySource.d.ts +1 -1
- package/dist/src/data/sources/lazy/singleAxisLazySource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/singleAxisLazySource.js +10 -3
- package/dist/src/data/sources/lazy/singleAxisWindowedSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/singleAxisWindowedSource.js +5 -1
- package/dist/src/data/sources/lazy/tabixSource.js +1 -1
- package/dist/src/data/transforms/filterScoredLabels.d.ts +1 -1
- package/dist/src/data/transforms/filterScoredLabels.d.ts.map +1 -1
- package/dist/src/data/transforms/filterScoredLabels.js +1 -1
- package/dist/src/data/transforms/linearizeGenomicCoordinate.d.ts.map +1 -1
- package/dist/src/data/transforms/linearizeGenomicCoordinate.js +2 -1
- package/dist/src/encoder/encoder.d.ts +1 -1
- package/dist/src/encoder/encoder.d.ts.map +1 -1
- package/dist/src/encoder/encoder.js +1 -1
- package/dist/src/genome/scaleLocus.d.ts +39 -0
- package/dist/src/genome/scaleLocus.d.ts.map +1 -1
- package/dist/src/genome/scaleLocus.js +76 -0
- package/dist/src/genomeSpy/canvasExport.d.ts +19 -0
- package/dist/src/genomeSpy/canvasExport.d.ts.map +1 -0
- package/dist/src/genomeSpy/canvasExport.js +66 -0
- package/dist/src/genomeSpy/containerUi.d.ts +17 -0
- package/dist/src/genomeSpy/containerUi.d.ts.map +1 -0
- package/dist/src/genomeSpy/containerUi.js +78 -0
- package/dist/src/genomeSpy/eventListenerRegistry.d.ts +19 -0
- package/dist/src/genomeSpy/eventListenerRegistry.d.ts.map +1 -0
- package/dist/src/genomeSpy/eventListenerRegistry.js +38 -0
- package/dist/src/genomeSpy/inputBindingManager.d.ts +14 -0
- package/dist/src/genomeSpy/inputBindingManager.d.ts.map +1 -0
- package/dist/src/genomeSpy/inputBindingManager.js +63 -0
- package/dist/src/genomeSpy/interactionController.d.ts +40 -0
- package/dist/src/genomeSpy/interactionController.d.ts.map +1 -0
- package/dist/src/genomeSpy/interactionController.js +371 -0
- package/dist/src/genomeSpy/keyboardListenerManager.d.ts +10 -0
- package/dist/src/genomeSpy/keyboardListenerManager.d.ts.map +1 -0
- package/dist/src/genomeSpy/keyboardListenerManager.js +31 -0
- package/dist/src/genomeSpy/loadingIndicatorManager.d.ts +15 -0
- package/dist/src/genomeSpy/loadingIndicatorManager.d.ts.map +1 -0
- package/dist/src/genomeSpy/loadingIndicatorManager.js +92 -0
- package/dist/src/genomeSpy/renderCoordinator.d.ts +22 -0
- package/dist/src/genomeSpy/renderCoordinator.d.ts.map +1 -0
- package/dist/src/genomeSpy/renderCoordinator.js +118 -0
- package/dist/src/genomeSpy/viewContextFactory.d.ts +18 -0
- package/dist/src/genomeSpy/viewContextFactory.d.ts.map +1 -0
- package/dist/src/genomeSpy/viewContextFactory.js +79 -0
- package/dist/src/genomeSpy/viewDataInit.d.ts +12 -0
- package/dist/src/genomeSpy/viewDataInit.d.ts.map +1 -0
- package/dist/src/genomeSpy/viewDataInit.js +41 -0
- package/dist/src/genomeSpy/viewHierarchyConfig.d.ts +14 -0
- package/dist/src/genomeSpy/viewHierarchyConfig.d.ts.map +1 -0
- package/dist/src/genomeSpy/viewHierarchyConfig.js +24 -0
- package/dist/src/genomeSpy/viewHighlight.d.ts +5 -0
- package/dist/src/genomeSpy/viewHighlight.d.ts.map +1 -0
- package/dist/src/genomeSpy/viewHighlight.js +30 -0
- package/dist/src/genomeSpy.d.ts +17 -72
- package/dist/src/genomeSpy.d.ts.map +1 -1
- package/dist/src/genomeSpy.js +180 -789
- package/dist/src/gl/glslScaleGenerator.d.ts +1 -1
- package/dist/src/gl/webGLHelper.d.ts +2 -2
- package/dist/src/gl/webGLHelper.d.ts.map +1 -1
- package/dist/src/gl/webGLHelper.js +4 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -12
- package/dist/src/marks/mark.d.ts +1 -0
- package/dist/src/marks/mark.d.ts.map +1 -1
- package/dist/src/marks/mark.js +26 -3
- package/dist/src/{view → scales}/axisResolution.d.ts +12 -14
- package/dist/src/scales/axisResolution.d.ts.map +1 -0
- package/dist/src/{view → scales}/axisResolution.js +38 -12
- package/dist/src/scales/axisResolution.test.d.ts.map +1 -0
- package/dist/src/scales/scaleDomainAggregator.d.ts +57 -0
- package/dist/src/scales/scaleDomainAggregator.d.ts.map +1 -0
- package/dist/src/scales/scaleDomainAggregator.js +162 -0
- package/dist/src/scales/scaleDomainAggregator.test.d.ts +2 -0
- package/dist/src/scales/scaleDomainAggregator.test.d.ts.map +1 -0
- package/dist/src/scales/scaleInstanceManager.d.ts +40 -0
- package/dist/src/scales/scaleInstanceManager.d.ts.map +1 -0
- package/dist/src/scales/scaleInstanceManager.js +313 -0
- package/dist/src/scales/scaleInstanceManager.test.d.ts +2 -0
- package/dist/src/scales/scaleInstanceManager.test.d.ts.map +1 -0
- package/dist/src/scales/scaleInteractionController.d.ts +73 -0
- package/dist/src/scales/scaleInteractionController.d.ts.map +1 -0
- package/dist/src/scales/scaleInteractionController.js +336 -0
- package/dist/src/scales/scaleInteractionController.test.d.ts +2 -0
- package/dist/src/scales/scaleInteractionController.test.d.ts.map +1 -0
- package/dist/src/scales/scalePropsResolver.d.ts +23 -0
- package/dist/src/scales/scalePropsResolver.d.ts.map +1 -0
- package/dist/src/scales/scalePropsResolver.js +74 -0
- package/dist/src/{view → scales}/scaleResolution.d.ts +53 -31
- package/dist/src/scales/scaleResolution.d.ts.map +1 -0
- package/dist/src/scales/scaleResolution.js +658 -0
- package/dist/src/scales/scaleResolution.test.d.ts.map +1 -0
- package/dist/src/scales/scaleResolutionConstants.d.ts +6 -0
- package/dist/src/scales/scaleResolutionConstants.d.ts.map +1 -0
- package/dist/src/scales/scaleResolutionConstants.js +5 -0
- package/dist/src/scales/scaleRules.d.ts +16 -0
- package/dist/src/scales/scaleRules.d.ts.map +1 -0
- package/dist/src/scales/scaleRules.js +103 -0
- package/dist/src/scales/scaleRules.test.d.ts +2 -0
- package/dist/src/scales/scaleRules.test.d.ts.map +1 -0
- package/dist/src/spec/channel.d.ts +13 -18
- package/dist/src/spec/sampleView.d.ts +3 -2
- package/dist/src/spec/scale.d.ts +6 -0
- package/dist/src/types/embedApi.d.ts +5 -0
- package/dist/src/types/scaleResolutionApi.d.ts +1 -1
- package/dist/src/types/viewContext.d.ts +1 -1
- package/dist/src/view/concatView.d.ts +18 -0
- package/dist/src/view/concatView.d.ts.map +1 -1
- package/dist/src/view/concatView.js +73 -0
- package/dist/src/view/concatView.test.d.ts +2 -0
- package/dist/src/view/concatView.test.d.ts.map +1 -0
- package/dist/src/view/containerMutationHelper.d.ts +74 -0
- package/dist/src/view/containerMutationHelper.d.ts.map +1 -0
- package/dist/src/view/containerMutationHelper.js +114 -0
- package/dist/src/view/containerView.d.ts +0 -7
- package/dist/src/view/containerView.d.ts.map +1 -1
- package/dist/src/view/containerView.js +0 -10
- package/dist/src/view/facetView.d.ts.map +1 -1
- package/dist/src/view/facetView.js +0 -14
- package/dist/src/view/flowBuilder.d.ts +2 -2
- package/dist/src/view/flowBuilder.d.ts.map +1 -1
- package/dist/src/view/flowBuilder.js +21 -4
- package/dist/src/view/gridView/gridChild.d.ts +11 -0
- package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
- package/dist/src/view/gridView/gridChild.js +32 -6
- package/dist/src/view/gridView/gridView.d.ts +39 -1
- package/dist/src/view/gridView/gridView.d.ts.map +1 -1
- package/dist/src/view/gridView/gridView.js +113 -42
- package/dist/src/view/gridView/gridView.test.d.ts +2 -0
- package/dist/src/view/gridView/gridView.test.d.ts.map +1 -0
- package/dist/src/view/gridView/scrollbar.d.ts +39 -8
- package/dist/src/view/gridView/scrollbar.d.ts.map +1 -1
- package/dist/src/view/gridView/scrollbar.js +184 -69
- package/dist/src/view/gridView/selectionRect.d.ts +8 -4
- package/dist/src/view/gridView/selectionRect.d.ts.map +1 -1
- package/dist/src/view/gridView/selectionRect.js +28 -3
- package/dist/src/view/gridView/selectionRect.test.d.ts +2 -0
- package/dist/src/view/gridView/selectionRect.test.d.ts.map +1 -0
- package/dist/src/view/layerView.d.ts +14 -0
- package/dist/src/view/layerView.d.ts.map +1 -1
- package/dist/src/view/layerView.js +66 -0
- package/dist/src/view/layerView.test.d.ts +2 -0
- package/dist/src/view/layerView.test.d.ts.map +1 -0
- package/dist/src/view/paramMediator.d.ts +2 -1
- package/dist/src/view/paramMediator.d.ts.map +1 -1
- package/dist/src/view/paramMediator.js +13 -1
- package/dist/src/view/testUtils.d.ts.map +1 -1
- package/dist/src/view/testUtils.js +18 -5
- package/dist/src/view/unitView.d.ts.map +1 -1
- package/dist/src/view/unitView.js +52 -12
- package/dist/src/view/view.d.ts +23 -7
- package/dist/src/view/view.d.ts.map +1 -1
- package/dist/src/view/view.js +61 -5
- package/dist/src/view/viewDispose.test.d.ts +2 -0
- package/dist/src/view/viewDispose.test.d.ts.map +1 -0
- package/dist/src/view/viewUtils.d.ts +4 -4
- package/dist/src/view/viewUtils.d.ts.map +1 -1
- package/dist/src/view/viewUtils.js +19 -15
- package/dist/src/view/viewUtils.test.d.ts +2 -0
- package/dist/src/view/viewUtils.test.d.ts.map +1 -0
- package/package.json +10 -10
- package/dist/bundle/__vite-browser-external-C--ziKoh.js +0 -8
- package/dist/bundle/_commonjsHelpers-DjF3Plf2.js +0 -26
- package/dist/bundle/index-5ajWdKly.js +0 -1319
- package/dist/bundle/index-B03-Om4z.js +0 -274
- package/dist/bundle/index-BftNdA0O.js +0 -27
- package/dist/bundle/index-Bg7C4Xat.js +0 -2750
- package/dist/bundle/index-C3QR8Lv6.js +0 -2131
- package/dist/bundle/index-DTcHjAHp.js +0 -505
- package/dist/bundle/index-DnIkxb0L.js +0 -1025
- package/dist/bundle/index-Ww3TAo6_.js +0 -71
- package/dist/bundle/index-g8iXgW0W.js +0 -651
- package/dist/bundle/long-B-FASCSo.js +0 -2387
- package/dist/bundle/remoteFile-BuaqFGWk.js +0 -94
- package/dist/src/data/collector.test.js +0 -138
- package/dist/src/data/dataFlow.test.js +0 -5
- package/dist/src/data/flow.test.js +0 -81
- package/dist/src/data/flowNode.test.js +0 -50
- package/dist/src/data/flowOptimizer.test.js +0 -204
- package/dist/src/data/formats/fasta.test.js +0 -27
- package/dist/src/data/sources/inlineSource.test.js +0 -63
- package/dist/src/data/sources/sequenceSource.test.js +0 -81
- package/dist/src/data/transforms/aggregate.test.js +0 -134
- package/dist/src/data/transforms/clone.test.js +0 -11
- package/dist/src/data/transforms/coverage.test.js +0 -238
- package/dist/src/data/transforms/filter.test.js +0 -20
- package/dist/src/data/transforms/flatten.test.js +0 -96
- package/dist/src/data/transforms/flattenDelimited.test.js +0 -90
- package/dist/src/data/transforms/flattenSequence.test.js +0 -34
- package/dist/src/data/transforms/formula.test.js +0 -25
- package/dist/src/data/transforms/identifier.test.js +0 -92
- package/dist/src/data/transforms/pileup.test.js +0 -70
- package/dist/src/data/transforms/project.test.js +0 -32
- package/dist/src/data/transforms/regexExtract.test.js +0 -70
- package/dist/src/data/transforms/regexFold.test.js +0 -201
- package/dist/src/data/transforms/sample.test.js +0 -38
- package/dist/src/data/transforms/stack.test.js +0 -91
- package/dist/src/encoder/accessor.test.js +0 -162
- package/dist/src/encoder/encoder.test.js +0 -105
- package/dist/src/genome/genome.test.js +0 -268
- package/dist/src/genome/genomes.test.js +0 -8
- package/dist/src/genome/scaleIndex.test.js +0 -78
- package/dist/src/genome/scaleLocus.test.js +0 -4
- package/dist/src/scale/scale.test.js +0 -326
- package/dist/src/scale/ticks.test.js +0 -46
- package/dist/src/selection/selection.test.js +0 -14
- package/dist/src/utils/addBaseUrl.test.js +0 -30
- package/dist/src/utils/binnedIndex.test.js +0 -201
- package/dist/src/utils/cloner.test.js +0 -35
- package/dist/src/utils/coalesce.test.js +0 -16
- package/dist/src/utils/concatIterables.test.js +0 -8
- package/dist/src/utils/domainArray.test.js +0 -130
- package/dist/src/utils/indexer.test.js +0 -49
- package/dist/src/utils/interactionEvent.test.js +0 -35
- package/dist/src/utils/iterateNestedMaps.test.js +0 -33
- package/dist/src/utils/kWayMerge.test.js +0 -30
- package/dist/src/utils/mergeObjects.test.js +0 -42
- package/dist/src/utils/numberExtractor.test.js +0 -6
- package/dist/src/utils/propertyCacher.test.js +0 -89
- package/dist/src/utils/propertyCoalescer.test.js +0 -25
- package/dist/src/utils/radixSort.test.js +0 -51
- package/dist/src/utils/reservationMap.test.js +0 -20
- package/dist/src/utils/ringBuffer.test.js +0 -39
- package/dist/src/utils/topK.test.js +0 -54
- package/dist/src/utils/trees.test.js +0 -135
- package/dist/src/utils/url.test.js +0 -28
- package/dist/src/utils/variableTools.test.js +0 -13
- package/dist/src/view/axisResolution.d.ts.map +0 -1
- package/dist/src/view/axisResolution.test.d.ts.map +0 -1
- package/dist/src/view/axisResolution.test.js +0 -206
- package/dist/src/view/flowBuilder.test.js +0 -125
- package/dist/src/view/layout/flexLayout.test.js +0 -323
- package/dist/src/view/layout/grid.test.js +0 -71
- package/dist/src/view/layout/rectangle.test.js +0 -192
- package/dist/src/view/paramMediator.test.js +0 -260
- package/dist/src/view/scaleResolution.d.ts.map +0 -1
- package/dist/src/view/scaleResolution.js +0 -1049
- package/dist/src/view/scaleResolution.test.d.ts.map +0 -1
- package/dist/src/view/scaleResolution.test.js +0 -645
- package/dist/src/view/view.test.js +0 -245
- package/dist/src/view/viewFactory.test.js +0 -25
- /package/dist/src/{view → scales}/axisResolution.test.d.ts +0 -0
- /package/dist/src/{view → scales}/scaleResolution.test.d.ts +0 -0
package/dist/schema.json
CHANGED
|
@@ -2353,7 +2353,9 @@
|
|
|
2353
2353
|
"type": "object"
|
|
2354
2354
|
},
|
|
2355
2355
|
"FieldOrDatumDefWithCondition<MarkPropFieldDef<Type>,(string|null)>": {
|
|
2356
|
-
"additionalProperties":
|
|
2356
|
+
"additionalProperties": {
|
|
2357
|
+
"not": {}
|
|
2358
|
+
},
|
|
2357
2359
|
"description": "A FieldDef with Condition<ValueDef> { condition: {value: ...}, field: ..., ... }",
|
|
2358
2360
|
"properties": {
|
|
2359
2361
|
"condition": {
|
|
@@ -2410,7 +2412,9 @@
|
|
|
2410
2412
|
"type": "object"
|
|
2411
2413
|
},
|
|
2412
2414
|
"FieldOrDatumDefWithCondition<MarkPropFieldDef<Type>,number>": {
|
|
2413
|
-
"additionalProperties":
|
|
2415
|
+
"additionalProperties": {
|
|
2416
|
+
"not": {}
|
|
2417
|
+
},
|
|
2414
2418
|
"description": "A FieldDef with Condition<ValueDef> { condition: {value: ...}, field: ..., ... }",
|
|
2415
2419
|
"properties": {
|
|
2416
2420
|
"condition": {
|
|
@@ -2467,7 +2471,9 @@
|
|
|
2467
2471
|
"type": "object"
|
|
2468
2472
|
},
|
|
2469
2473
|
"FieldOrDatumDefWithCondition<MarkPropFieldDef<TypeForShape>,(string|null)>": {
|
|
2470
|
-
"additionalProperties":
|
|
2474
|
+
"additionalProperties": {
|
|
2475
|
+
"not": {}
|
|
2476
|
+
},
|
|
2471
2477
|
"description": "A FieldDef with Condition<ValueDef> { condition: {value: ...}, field: ..., ... }",
|
|
2472
2478
|
"properties": {
|
|
2473
2479
|
"condition": {
|
|
@@ -8183,7 +8189,7 @@
|
|
|
8183
8189
|
"type": "string"
|
|
8184
8190
|
},
|
|
8185
8191
|
"type": {
|
|
8186
|
-
"$ref": "#/definitions/
|
|
8192
|
+
"$ref": "#/definitions/SampleAttributeType",
|
|
8187
8193
|
"description": "The attribute type. One of `\"nominal\"`, `\"ordinal\"`, or `\"quantitative\"`."
|
|
8188
8194
|
},
|
|
8189
8195
|
"visible": {
|
|
@@ -8197,6 +8203,14 @@
|
|
|
8197
8203
|
},
|
|
8198
8204
|
"type": "object"
|
|
8199
8205
|
},
|
|
8206
|
+
"SampleAttributeType": {
|
|
8207
|
+
"enum": [
|
|
8208
|
+
"nominal",
|
|
8209
|
+
"ordinal",
|
|
8210
|
+
"quantitative"
|
|
8211
|
+
],
|
|
8212
|
+
"type": "string"
|
|
8213
|
+
},
|
|
8200
8214
|
"SampleDef": {
|
|
8201
8215
|
"additionalProperties": false,
|
|
8202
8216
|
"properties": {
|
|
@@ -8659,6 +8673,10 @@
|
|
|
8659
8673
|
"description": "The alignment of the steps within the scale range.\n\nThis value must lie in the range `[0,1]`. A value of `0.5` indicates that the steps should be centered within the range. A value of `0` or `1` may be used to shift the bands to one side, say to position them adjacent to an axis.\n\n__Default value:__ `0.5`",
|
|
8660
8674
|
"type": "number"
|
|
8661
8675
|
},
|
|
8676
|
+
"assembly": {
|
|
8677
|
+
"description": "The genome assembly name for locus scales. If undefined, the default genome from the genome store is used.",
|
|
8678
|
+
"type": "string"
|
|
8679
|
+
},
|
|
8662
8680
|
"base": {
|
|
8663
8681
|
"description": "The logarithm base of the `log` scale (default `10`).",
|
|
8664
8682
|
"type": "number"
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {import("../spec/channel.js").Channel} channel
|
|
3
|
+
* @param {import("../spec/channel.js").Type} dataType
|
|
4
|
+
* @param {boolean} isExplicitDomain
|
|
5
|
+
* @returns {import("../spec/scale.js").Scale}
|
|
6
|
+
*/
|
|
7
|
+
export function getDefaultScaleProperties(channel: import("../spec/channel.js").Channel, dataType: import("../spec/channel.js").Type, isExplicitDomain: boolean): import("../spec/scale.js").Scale;
|
|
8
|
+
//# sourceMappingURL=scaleDefaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaleDefaults.d.ts","sourceRoot":"","sources":["../../../src/config/scaleDefaults.js"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,mDALW,OAAO,oBAAoB,EAAE,OAAO,YACpC,OAAO,oBAAoB,EAAE,IAAI,oBACjC,OAAO,GACL,OAAO,kBAAkB,EAAE,KAAK,CAiC5C"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isColorChannel,
|
|
3
|
+
isDiscreteChannel,
|
|
4
|
+
isPositionalChannel,
|
|
5
|
+
} from "../encoder/encoder.js";
|
|
6
|
+
import { NOMINAL, ORDINAL } from "../scales/scaleResolutionConstants.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @param {import("../spec/channel.js").Channel} channel
|
|
10
|
+
* @param {import("../spec/channel.js").Type} dataType
|
|
11
|
+
* @param {boolean} isExplicitDomain
|
|
12
|
+
* @returns {import("../spec/scale.js").Scale}
|
|
13
|
+
*/
|
|
14
|
+
export function getDefaultScaleProperties(channel, dataType, isExplicitDomain) {
|
|
15
|
+
/** @type {import("../spec/scale.js").Scale} */
|
|
16
|
+
const props = {};
|
|
17
|
+
|
|
18
|
+
if (isExplicitDomain) {
|
|
19
|
+
props.zero = false;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (isPositionalChannel(channel)) {
|
|
23
|
+
props.nice = !isExplicitDomain;
|
|
24
|
+
} else if (isColorChannel(channel)) {
|
|
25
|
+
// TODO: Named ranges
|
|
26
|
+
props.scheme =
|
|
27
|
+
dataType == NOMINAL
|
|
28
|
+
? "tableau10"
|
|
29
|
+
: dataType == ORDINAL
|
|
30
|
+
? "blues"
|
|
31
|
+
: "viridis";
|
|
32
|
+
} else if (isDiscreteChannel(channel)) {
|
|
33
|
+
// Shapes of point mark, for example
|
|
34
|
+
props.range =
|
|
35
|
+
channel == "shape"
|
|
36
|
+
? ["circle", "square", "triangle-up", "cross", "diamond"]
|
|
37
|
+
: [];
|
|
38
|
+
} else if (channel == "size") {
|
|
39
|
+
props.range = [0, 400]; // TODO: Configurable default. This is currently optimized for points.
|
|
40
|
+
} else if (channel == "angle") {
|
|
41
|
+
props.range = [0, 360];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return props;
|
|
45
|
+
}
|
|
@@ -10,10 +10,15 @@ export default class Collector extends FlowNode {
|
|
|
10
10
|
*/
|
|
11
11
|
constructor(params?: import("../spec/transform.js").CollectParams);
|
|
12
12
|
params: import("../spec/transform.js").CollectParams;
|
|
13
|
-
/** @type {
|
|
14
|
-
observers: (
|
|
13
|
+
/** @type {Set<function(Collector):void>} */
|
|
14
|
+
observers: Set<(arg0: Collector) => void>;
|
|
15
15
|
/** @type {Map<import("../spec/channel.js").Scalar[], Data>} TODO: proper type for key */
|
|
16
16
|
facetBatches: Map<import("../spec/channel.js").Scalar[], import("./flowNode.js").Data>;
|
|
17
|
+
/**
|
|
18
|
+
* @param {function(Collector):void} listener
|
|
19
|
+
* @returns {() => void}
|
|
20
|
+
*/
|
|
21
|
+
observe(listener: (arg0: Collector) => void): () => void;
|
|
17
22
|
/**
|
|
18
23
|
* @returns {Iterable<Datum>}
|
|
19
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../../src/data/collector.js"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH;IAuCI;;OAEG;IACH,qBAFW,OAAO,sBAAsB,EAAE,aAAa,EAiBtD;IAZG,qDAA2C;IAE3C,
|
|
1
|
+
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../../src/data/collector.js"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH;IAuCI;;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;IAmFzD;;;OAGG;IACH,kBAHW,CAAS,IAAS,EAAT,SAAS,KAAE,IAAI,GACtB,MAAM,IAAI,CAOtB;IA+BD;;OAEG;IACH,WAFa,QAAQ,+BAAO,CAqB3B;IAED;;;OAGG;IACH,mBAFW,CAAC,KAAK,+BAAO,KAAK,IAAI,QAUhC;IAED;;OAEG;IACH,uBAMC;IA8CD;;;;OAIG;IACH,8BAFW,MAAM,iCA4BhB;;CACJ;qBAxTyD,eAAe"}
|
|
@@ -61,8 +61,8 @@ export default class Collector extends FlowNode {
|
|
|
61
61
|
|
|
62
62
|
this.params = params ?? { type: "collect" };
|
|
63
63
|
|
|
64
|
-
/** @type {
|
|
65
|
-
this.observers =
|
|
64
|
+
/** @type {Set<function(Collector):void>} */
|
|
65
|
+
this.observers = new Set();
|
|
66
66
|
|
|
67
67
|
// TODO: Consider nested maps instead of InternMap
|
|
68
68
|
/** @type {Map<import("../spec/channel.js").Scalar[], Data>} TODO: proper type for key */
|
|
@@ -149,6 +149,17 @@ export default class Collector extends FlowNode {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
/**
|
|
153
|
+
* @param {function(Collector):void} listener
|
|
154
|
+
* @returns {() => void}
|
|
155
|
+
*/
|
|
156
|
+
observe(listener) {
|
|
157
|
+
this.observers.add(listener);
|
|
158
|
+
return () => {
|
|
159
|
+
this.observers.delete(listener);
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
152
163
|
#propagateToChildren() {
|
|
153
164
|
if (this.children.length) {
|
|
154
165
|
for (const [facetId, data] of this.facetBatches.entries()) {
|
|
@@ -1,65 +1,43 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* data sources and collectors.
|
|
2
|
+
* DataFlow holds data sources and collectors for optimization and initialization.
|
|
4
3
|
*/
|
|
5
|
-
export default class DataFlow
|
|
6
|
-
|
|
7
|
-
_dataSourcesByHost: Map<H, import("./sources/dataSource.js").default>;
|
|
8
|
-
/** @type {Map<H, import("./collector.js").default>} */
|
|
9
|
-
_collectorsByHost: Map<H, import("./collector.js").default>;
|
|
10
|
-
/** @type {Map<H, (function(import("./collector.js").default):void)[]>} */
|
|
11
|
-
_observers: Map<H, ((arg0: import("./collector.js").default) => void)[]>;
|
|
12
|
-
get dataSources(): import("./sources/dataSource.js").default[];
|
|
4
|
+
export default class DataFlow {
|
|
5
|
+
get dataSources(): DataSource[];
|
|
13
6
|
get collectors(): import("./collector.js").default[];
|
|
14
7
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* @param {function(import("./collector.js").default):void} callback
|
|
18
|
-
* @param {H} key
|
|
19
|
-
*/
|
|
20
|
-
addObserver(callback: (arg0: import("./collector.js").default) => void, key: H): void;
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
* @param {import("./collector.js").default} collector
|
|
24
|
-
* @param {H} key
|
|
8
|
+
* @param {Iterable<import("./sources/dataSource.js").default>} dataSources
|
|
25
9
|
*/
|
|
26
|
-
|
|
10
|
+
replaceDataSources(dataSources: Iterable<import("./sources/dataSource.js").default>): void;
|
|
27
11
|
/**
|
|
28
|
-
*
|
|
29
12
|
* @param {import("./sources/dataSource.js").default} dataSource
|
|
30
|
-
* @param {H} key
|
|
31
13
|
*/
|
|
32
|
-
addDataSource(dataSource: import("./sources/dataSource.js").default
|
|
14
|
+
addDataSource(dataSource: import("./sources/dataSource.js").default): void;
|
|
33
15
|
/**
|
|
34
|
-
*
|
|
35
|
-
* @param {H} key
|
|
16
|
+
* @param {import("./sources/dataSource.js").default} dataSource
|
|
36
17
|
*/
|
|
37
|
-
|
|
18
|
+
removeDataSource(dataSource: import("./sources/dataSource.js").default): void;
|
|
38
19
|
/**
|
|
39
|
-
*
|
|
40
|
-
* @param {string} name
|
|
20
|
+
* @param {import("./collector.js").default} collector
|
|
41
21
|
*/
|
|
42
|
-
|
|
43
|
-
dataSource: NamedSource;
|
|
44
|
-
hosts: H[];
|
|
45
|
-
};
|
|
22
|
+
addCollector(collector: import("./collector.js").default): void;
|
|
46
23
|
/**
|
|
47
|
-
*
|
|
48
24
|
* @param {import("./collector.js").default} collector
|
|
49
|
-
* @param {H} key
|
|
50
25
|
*/
|
|
51
|
-
|
|
26
|
+
removeCollector(collector: import("./collector.js").default): void;
|
|
52
27
|
/**
|
|
28
|
+
* Prune a collector branch from the flow graph, removing empty ancestors.
|
|
53
29
|
*
|
|
54
|
-
* @param {
|
|
30
|
+
* @param {import("./collector.js").default} collector
|
|
55
31
|
*/
|
|
56
|
-
|
|
32
|
+
pruneCollectorBranch(collector: import("./collector.js").default): void;
|
|
57
33
|
/**
|
|
58
|
-
*
|
|
59
|
-
* structure has been built and optimized.
|
|
60
|
-
* Must be called before any data are to be propagated.
|
|
34
|
+
* @param {string} name
|
|
61
35
|
*/
|
|
62
|
-
|
|
36
|
+
findNamedDataSource(name: string): {
|
|
37
|
+
dataSource: NamedSource;
|
|
38
|
+
};
|
|
39
|
+
#private;
|
|
63
40
|
}
|
|
41
|
+
import DataSource from "./sources/dataSource.js";
|
|
64
42
|
import NamedSource from "./sources/namedSource.js";
|
|
65
43
|
//# sourceMappingURL=dataFlow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataFlow.d.ts","sourceRoot":"","sources":["../../../src/data/dataFlow.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dataFlow.d.ts","sourceRoot":"","sources":["../../../src/data/dataFlow.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IAeI,gCAEC;IAED,qDAEC;IAED;;OAEG;IACH,gCAFW,QAAQ,CAAC,OAAO,yBAAyB,EAAE,OAAO,CAAC,QAI7D;IAED;;OAEG;IACH,0BAFW,OAAO,yBAAyB,EAAE,OAAO,QAInD;IAED;;OAEG;IACH,6BAFW,OAAO,yBAAyB,EAAE,OAAO,QAInD;IAED;;OAEG;IACH,wBAFW,OAAO,gBAAgB,EAAE,OAAO,QAI1C;IAED;;OAEG;IACH,2BAFW,OAAO,gBAAgB,EAAE,OAAO,QAK1C;IAED;;;;OAIG;IACH,gCAFW,OAAO,gBAAgB,EAAE,OAAO,QAiB1C;IAED;;OAEG;IACH,0BAFW,MAAM;;MA2BhB;;CAGJ;uBAtHsB,yBAAyB;wBACxB,0BAA0B"}
|
|
@@ -1,92 +1,100 @@
|
|
|
1
|
+
import DataSource from "./sources/dataSource.js";
|
|
1
2
|
import NamedSource from "./sources/namedSource.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
* data sources and collectors.
|
|
5
|
+
* DataFlow holds data sources and collectors for optimization and initialization.
|
|
6
6
|
*/
|
|
7
7
|
export default class DataFlow {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
/** @type {Set<import("./sources/dataSource.js").default>} */
|
|
9
|
+
#dataSources;
|
|
10
|
+
|
|
11
|
+
/** @type {Set<import("./collector.js").default>} */
|
|
12
|
+
#collectors;
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
constructor() {
|
|
15
|
+
/** @type {Set<import("./sources/dataSource.js").default>} */
|
|
16
|
+
this.#dataSources = new Set();
|
|
14
17
|
|
|
15
|
-
/** @type {
|
|
16
|
-
this
|
|
18
|
+
/** @type {Set<import("./collector.js").default>} */
|
|
19
|
+
this.#collectors = new Set();
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
get dataSources() {
|
|
20
|
-
return [...
|
|
23
|
+
return [...this.#dataSources];
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
get collectors() {
|
|
24
|
-
return [...this
|
|
27
|
+
return [...this.#collectors];
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* @param {function(import("./collector.js").default):void} callback
|
|
31
|
-
* @param {H} key
|
|
31
|
+
* @param {Iterable<import("./sources/dataSource.js").default>} dataSources
|
|
32
32
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
arr = [];
|
|
37
|
-
this._observers.set(key, arr);
|
|
38
|
-
}
|
|
33
|
+
replaceDataSources(dataSources) {
|
|
34
|
+
this.#dataSources = new Set(dataSources);
|
|
35
|
+
}
|
|
39
36
|
|
|
40
|
-
|
|
37
|
+
/**
|
|
38
|
+
* @param {import("./sources/dataSource.js").default} dataSource
|
|
39
|
+
*/
|
|
40
|
+
addDataSource(dataSource) {
|
|
41
|
+
this.#dataSources.add(dataSource);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @param {import("./sources/dataSource.js").default} dataSource
|
|
46
|
+
*/
|
|
47
|
+
removeDataSource(dataSource) {
|
|
48
|
+
this.#dataSources.delete(dataSource);
|
|
41
49
|
}
|
|
42
50
|
|
|
43
51
|
/**
|
|
44
|
-
*
|
|
45
52
|
* @param {import("./collector.js").default} collector
|
|
46
|
-
* @param {H} key
|
|
47
53
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (arr) {
|
|
51
|
-
for (const callback of arr) {
|
|
52
|
-
// eslint-disable-next-line callback-return
|
|
53
|
-
callback(collector);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
54
|
+
addCollector(collector) {
|
|
55
|
+
this.#collectors.add(collector);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
60
|
-
* @param {import("./sources/dataSource.js").default} dataSource
|
|
61
|
-
* @param {H} key
|
|
59
|
+
* @param {import("./collector.js").default} collector
|
|
62
60
|
*/
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
removeCollector(collector) {
|
|
62
|
+
collector.observers.clear();
|
|
63
|
+
this.#collectors.delete(collector);
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
/**
|
|
67
|
+
* Prune a collector branch from the flow graph, removing empty ancestors.
|
|
68
68
|
*
|
|
69
|
-
* @param {
|
|
69
|
+
* @param {import("./collector.js").default} collector
|
|
70
70
|
*/
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
pruneCollectorBranch(collector) {
|
|
72
|
+
let parent = collector.parent;
|
|
73
|
+
if (parent) {
|
|
74
|
+
parent.removeChild(collector);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
while (parent && parent.children.length === 0) {
|
|
78
|
+
const current = parent;
|
|
79
|
+
parent = current.parent;
|
|
80
|
+
if (parent) {
|
|
81
|
+
parent.removeChild(current);
|
|
82
|
+
} else if (current instanceof DataSource) {
|
|
83
|
+
this.removeDataSource(current);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
73
86
|
}
|
|
74
87
|
|
|
75
88
|
/**
|
|
76
|
-
*
|
|
77
89
|
* @param {string} name
|
|
78
90
|
*/
|
|
79
91
|
findNamedDataSource(name) {
|
|
80
92
|
/** @type {NamedSource} */
|
|
81
93
|
let namedSource;
|
|
82
|
-
/** @type {H[]} */
|
|
83
|
-
let hosts = [];
|
|
84
|
-
|
|
85
|
-
// Note: If a named sources with the same name are present at multiple locations in the
|
|
86
|
-
// view hierarchy, the should actually be exactly the same instance. It's arranged that
|
|
87
|
-
// way in the data flow optimization phase.
|
|
88
94
|
|
|
89
|
-
|
|
95
|
+
// Note: If named sources with the same name are present at multiple locations in the
|
|
96
|
+
// view hierarchy, they should actually be exactly the same instance.
|
|
97
|
+
for (const dataSource of this.#dataSources.values()) {
|
|
90
98
|
if (dataSource instanceof NamedSource) {
|
|
91
99
|
if (name == dataSource.identifier) {
|
|
92
100
|
if (namedSource && namedSource !== dataSource) {
|
|
@@ -96,7 +104,6 @@ export default class DataFlow {
|
|
|
96
104
|
);
|
|
97
105
|
}
|
|
98
106
|
namedSource = dataSource;
|
|
99
|
-
hosts.push(host);
|
|
100
107
|
}
|
|
101
108
|
}
|
|
102
109
|
}
|
|
@@ -104,39 +111,9 @@ export default class DataFlow {
|
|
|
104
111
|
if (namedSource) {
|
|
105
112
|
return {
|
|
106
113
|
dataSource: namedSource,
|
|
107
|
-
hosts,
|
|
108
114
|
};
|
|
109
115
|
}
|
|
110
116
|
}
|
|
111
117
|
|
|
112
|
-
|
|
113
|
-
*
|
|
114
|
-
* @param {import("./collector.js").default} collector
|
|
115
|
-
* @param {H} key
|
|
116
|
-
*/
|
|
117
|
-
addCollector(collector, key) {
|
|
118
|
-
this._collectorsByHost.set(key, collector);
|
|
119
|
-
collector.observers.push((collector) =>
|
|
120
|
-
this._relayObserverCallback(collector, key)
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
*
|
|
126
|
-
* @param {H} key
|
|
127
|
-
*/
|
|
128
|
-
findCollectorByKey(key) {
|
|
129
|
-
return this._collectorsByHost.get(key);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Allows the flow nodes to perform final initialization after the flow
|
|
134
|
-
* structure has been built and optimized.
|
|
135
|
-
* Must be called before any data are to be propagated.
|
|
136
|
-
*/
|
|
137
|
-
initialize() {
|
|
138
|
-
for (const ds of this.dataSources) {
|
|
139
|
-
ds.visit((node) => node.initialize());
|
|
140
|
-
}
|
|
141
|
-
}
|
|
118
|
+
// Initialization is handled by subtree helpers to avoid global init order.
|
|
142
119
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {object} FlowHandle
|
|
3
|
+
* @prop {import("./sources/dataSource.js").default} [dataSource]
|
|
4
|
+
* @prop {import("./collector.js").default} [collector]
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @param {FlowHandle} [handle]
|
|
8
|
+
* @returns {FlowHandle}
|
|
9
|
+
*/
|
|
10
|
+
export function createFlowHandle(handle?: FlowHandle): FlowHandle;
|
|
11
|
+
export type FlowHandle = {
|
|
12
|
+
dataSource?: import("./sources/dataSource.js").default;
|
|
13
|
+
collector?: import("./collector.js").default;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=flowHandle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowHandle.d.ts","sourceRoot":"","sources":["../../../src/data/flowHandle.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,0CAHW,UAAU,GACR,UAAU,CAItB;;iBAVS,OAAO,yBAAyB,EAAE,OAAO;gBACzC,OAAO,gBAAgB,EAAE,OAAO"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {object} FlowHandle
|
|
3
|
+
* @prop {import("./sources/dataSource.js").default} [dataSource]
|
|
4
|
+
* @prop {import("./collector.js").default} [collector]
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @param {FlowHandle} [handle]
|
|
9
|
+
* @returns {FlowHandle}
|
|
10
|
+
*/
|
|
11
|
+
export function createFlowHandle(handle = {}) {
|
|
12
|
+
return handle;
|
|
13
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Synchronize flow handles after data flow optimization.
|
|
3
|
+
*
|
|
4
|
+
* @param {import("../view/view.js").default} root
|
|
5
|
+
* @param {Map<import("./sources/dataSource.js").default, import("./sources/dataSource.js").default>} canonicalBySource
|
|
6
|
+
*/
|
|
7
|
+
export function syncFlowHandles(root: import("../view/view.js").default, canonicalBySource: Map<import("./sources/dataSource.js").default, import("./sources/dataSource.js").default>): void;
|
|
8
|
+
/**
|
|
9
|
+
* Initializes data flow and mark wiring for a subtree without rebuilding the
|
|
10
|
+
* entire view hierarchy. This is the primary entry point for dynamic view
|
|
11
|
+
* insertion: build the subtree fully, call this, then attach the subtree to
|
|
12
|
+
* the live hierarchy.
|
|
13
|
+
*
|
|
14
|
+
* What it does:
|
|
15
|
+
* - builds/extends the dataflow graph for the subtree
|
|
16
|
+
* - runs flow optimization and syncs flow handles to canonical data sources
|
|
17
|
+
* - discovers the nearest data sources for views in the subtree
|
|
18
|
+
* - initializes dataflow nodes (initialize) for those sources
|
|
19
|
+
* - initializes mark encoders for unit views
|
|
20
|
+
* - queues graphics initialization (if a GL context exists)
|
|
21
|
+
* - wires collector observers so marks update on data arrival
|
|
22
|
+
*
|
|
23
|
+
* How to use it:
|
|
24
|
+
* - call after the subtree is fully constructed (post-order build)
|
|
25
|
+
* - do not attach the subtree to the live hierarchy until after this call
|
|
26
|
+
* - dispose the old subtree before replacing it to prevent observer leaks
|
|
27
|
+
* - follow up with finalizeSubtreeGraphics(...) once graphics promises resolve
|
|
28
|
+
* - reconfigure scales for the subtree when data loads complete
|
|
29
|
+
*
|
|
30
|
+
* Considerations:
|
|
31
|
+
* - this does not trigger data loading; callers decide when to load
|
|
32
|
+
* - data sources are derived by walking to the nearest ancestor source; nested
|
|
33
|
+
* sources should be treated as boundaries (do not walk past them)
|
|
34
|
+
* - only call updateGraphicsData when graphics are initialized or a GL context
|
|
35
|
+
* is available; headless/test contexts must avoid WebGL usage
|
|
36
|
+
* - loadViewSubtreeData emits a subtree-scoped "subtreeDataReady" broadcast
|
|
37
|
+
*
|
|
38
|
+
* TODO:
|
|
39
|
+
* - promote in-flight load caching to a persistent load-state per source
|
|
40
|
+
* - replace global dataLoaded usage with subtree-scoped readiness
|
|
41
|
+
* - integrate with async font readiness for text marks
|
|
42
|
+
* - unify observer wiring via a disposable registry across view types
|
|
43
|
+
*
|
|
44
|
+
* @param {import("../view/view.js").default} subtreeRoot
|
|
45
|
+
* @param {import("./dataFlow.js").default} flow
|
|
46
|
+
* @returns {{
|
|
47
|
+
* dataFlow: import("./dataFlow.js").default,
|
|
48
|
+
* unitViews: UnitView[],
|
|
49
|
+
* dataSources: Set<import("./sources/dataSource.js").default>,
|
|
50
|
+
* graphicsPromises: Promise<import("../marks/mark.js").default>[]
|
|
51
|
+
* }}
|
|
52
|
+
*/
|
|
53
|
+
export function initializeViewSubtree(subtreeRoot: import("../view/view.js").default, flow: import("./dataFlow.js").default): {
|
|
54
|
+
dataFlow: import("./dataFlow.js").default;
|
|
55
|
+
unitViews: UnitView[];
|
|
56
|
+
dataSources: Set<import("./sources/dataSource.js").default>;
|
|
57
|
+
graphicsPromises: Promise<import("../marks/mark.js").default>[];
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Collects data sources needed to initialize all views in the subtree.
|
|
61
|
+
* This includes sources that are overridden deeper in the hierarchy.
|
|
62
|
+
*
|
|
63
|
+
* @param {import("../view/view.js").default | import("../view/view.js").default[]} subtreeRoot
|
|
64
|
+
* @returns {Set<import("./sources/dataSource.js").default>}
|
|
65
|
+
*/
|
|
66
|
+
export function collectViewSubtreeDataSources(subtreeRoot: import("../view/view.js").default | import("../view/view.js").default[]): Set<import("./sources/dataSource.js").default>;
|
|
67
|
+
/**
|
|
68
|
+
* Collects the nearest data sources under a subtree root.
|
|
69
|
+
* These sources define data-ready boundaries for subtree-level loading.
|
|
70
|
+
*
|
|
71
|
+
* @param {import("../view/view.js").default} subtreeRoot
|
|
72
|
+
* @returns {Set<import("./sources/dataSource.js").default>}
|
|
73
|
+
*/
|
|
74
|
+
export function collectNearestViewSubtreeDataSources(subtreeRoot: import("../view/view.js").default): Set<import("./sources/dataSource.js").default>;
|
|
75
|
+
/**
|
|
76
|
+
* Loads the nearest data sources for a subtree.
|
|
77
|
+
* Use the returned promise as a subtree-level "data ready" signal.
|
|
78
|
+
*
|
|
79
|
+
* @param {import("../view/view.js").default} subtreeRoot
|
|
80
|
+
* @param {Set<import("./sources/dataSource.js").default>} [dataSources]
|
|
81
|
+
* @returns {Promise<void[]>}
|
|
82
|
+
*/
|
|
83
|
+
export function loadViewSubtreeData(subtreeRoot: import("../view/view.js").default, dataSources?: Set<import("./sources/dataSource.js").default>): Promise<void[]>;
|
|
84
|
+
import UnitView from "../view/unitView.js";
|
|
85
|
+
//# sourceMappingURL=flowInit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowInit.d.ts","sourceRoot":"","sources":["../../../src/data/flowInit.js"],"names":[],"mappings":"AAoCA;;;;;GAKG;AACH,sCAHW,OAAO,iBAAiB,EAAE,OAAO,qBACjC,GAAG,CAAC,OAAO,yBAAyB,EAAE,OAAO,EAAE,OAAO,yBAAyB,EAAE,OAAO,CAAC,QAcnG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,mDATW,OAAO,iBAAiB,EAAE,OAAO,QACjC,OAAO,eAAe,EAAE,OAAO,GAC7B;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,CAsDH;AAED;;;;;;GAMG;AACH,2DAHW,OAAO,iBAAiB,EAAE,OAAO,GAAG,OAAO,iBAAiB,EAAE,OAAO,EAAE,GACrE,GAAG,CAAC,OAAO,yBAAyB,EAAE,OAAO,CAAC,CAmB1D;AAED;;;;;;GAMG;AACH,kEAHW,OAAO,iBAAiB,EAAE,OAAO,GAC/B,GAAG,CAAC,OAAO,yBAAyB,EAAE,OAAO,CAAC,CAY1D;AAED;;;;;;;GAOG;AACH,iDAJW,OAAO,iBAAiB,EAAE,OAAO,gBACjC,GAAG,CAAC,OAAO,yBAAyB,EAAE,OAAO,CAAC,GAC5C,OAAO,CAAC,IAAI,EAAE,CAAC,CAe3B;qBA7NoB,qBAAqB"}
|