@genome-spy/core 0.59.0 → 0.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/bundle/index.es.js +6170 -5616
  2. package/dist/bundle/index.js +144 -119
  3. package/dist/schema.json +304 -22
  4. package/dist/src/data/collector.d.ts.map +1 -1
  5. package/dist/src/data/collector.js +1 -0
  6. package/dist/src/data/sources/dataUtils.d.ts +2 -1
  7. package/dist/src/data/sources/dataUtils.d.ts.map +1 -1
  8. package/dist/src/data/sources/dataUtils.js +3 -4
  9. package/dist/src/data/sources/inlineSource.d.ts +8 -0
  10. package/dist/src/data/sources/inlineSource.d.ts.map +1 -1
  11. package/dist/src/data/sources/inlineSource.js +17 -1
  12. package/dist/src/data/sources/urlSource.d.ts +1 -0
  13. package/dist/src/data/sources/urlSource.d.ts.map +1 -1
  14. package/dist/src/data/sources/urlSource.js +33 -4
  15. package/dist/src/encoder/encoder.d.ts +1 -1
  16. package/dist/src/genomeSpy.d.ts.map +1 -1
  17. package/dist/src/genomeSpy.js +39 -6
  18. package/dist/src/gl/colorUtils.d.ts +4 -0
  19. package/dist/src/gl/colorUtils.d.ts.map +1 -1
  20. package/dist/src/gl/colorUtils.js +8 -0
  21. package/dist/src/gl/glslScaleGenerator.d.ts +1 -1
  22. package/dist/src/gl/glslScaleGenerator.d.ts.map +1 -1
  23. package/dist/src/gl/glslScaleGenerator.js +1 -9
  24. package/dist/src/gl/includes/common.glsl.js +1 -1
  25. package/dist/src/marks/link.d.ts.map +1 -1
  26. package/dist/src/marks/link.js +8 -0
  27. package/dist/src/marks/mark.d.ts +8 -0
  28. package/dist/src/marks/mark.d.ts.map +1 -1
  29. package/dist/src/marks/mark.js +101 -3
  30. package/dist/src/marks/point.fragment.glsl.js +1 -1
  31. package/dist/src/marks/point.vertex.glsl.js +1 -1
  32. package/dist/src/marks/rect.common.glsl.js +1 -1
  33. package/dist/src/marks/rect.d.ts.map +1 -1
  34. package/dist/src/marks/rect.fragment.glsl.js +1 -1
  35. package/dist/src/marks/rect.js +41 -0
  36. package/dist/src/marks/rect.vertex.glsl.js +1 -1
  37. package/dist/src/selection/selection.d.ts +27 -2
  38. package/dist/src/selection/selection.d.ts.map +1 -1
  39. package/dist/src/selection/selection.js +53 -3
  40. package/dist/src/spec/data.d.ts +18 -1
  41. package/dist/src/spec/mark.d.ts +58 -1
  42. package/dist/src/spec/parameter.d.ts +71 -31
  43. package/dist/src/spec/view.d.ts +9 -2
  44. package/dist/src/styles/genome-spy.css.d.ts +1 -1
  45. package/dist/src/styles/genome-spy.css.d.ts.map +1 -1
  46. package/dist/src/styles/genome-spy.css.js +12 -1
  47. package/dist/src/styles/genome-spy.scss +19 -1
  48. package/dist/src/types/selectionTypes.d.ts +4 -7
  49. package/dist/src/utils/expression.d.ts.map +1 -1
  50. package/dist/src/utils/expression.js +4 -0
  51. package/dist/src/utils/ui/tooltip.d.ts +6 -10
  52. package/dist/src/utils/ui/tooltip.d.ts.map +1 -1
  53. package/dist/src/utils/ui/tooltip.js +74 -42
  54. package/dist/src/view/concatView.d.ts +1 -1
  55. package/dist/src/view/concatView.d.ts.map +1 -1
  56. package/dist/src/view/concatView.js +1 -1
  57. package/dist/src/view/gridView/gridChild.d.ts +53 -0
  58. package/dist/src/view/gridView/gridChild.d.ts.map +1 -0
  59. package/dist/src/view/gridView/gridChild.js +753 -0
  60. package/dist/src/view/gridView/gridView.d.ts +64 -0
  61. package/dist/src/view/gridView/gridView.d.ts.map +1 -0
  62. package/dist/src/view/{gridView.js → gridView/gridView.js} +40 -595
  63. package/dist/src/view/gridView/scrollbar.d.ts +32 -0
  64. package/dist/src/view/gridView/scrollbar.d.ts.map +1 -0
  65. package/dist/src/view/gridView/scrollbar.js +186 -0
  66. package/dist/src/view/gridView/selectionRect.d.ts +10 -0
  67. package/dist/src/view/gridView/selectionRect.d.ts.map +1 -0
  68. package/dist/src/view/gridView/selectionRect.js +182 -0
  69. package/dist/src/view/layout/rectangle.d.ts +11 -1
  70. package/dist/src/view/layout/rectangle.d.ts.map +1 -1
  71. package/dist/src/view/layout/rectangle.js +22 -2
  72. package/dist/src/view/layout/rectangle.test.js +12 -0
  73. package/dist/src/view/paramMediator.d.ts.map +1 -1
  74. package/dist/src/view/paramMediator.js +9 -0
  75. package/dist/src/view/scaleResolution.d.ts +1 -0
  76. package/dist/src/view/scaleResolution.d.ts.map +1 -1
  77. package/dist/src/view/scaleResolution.js +43 -33
  78. package/dist/src/view/view.d.ts +6 -0
  79. package/dist/src/view/view.d.ts.map +1 -1
  80. package/dist/src/view/view.js +19 -0
  81. package/dist/src/view/viewFactory.d.ts.map +1 -1
  82. package/dist/src/view/viewFactory.js +13 -1
  83. package/package.json +2 -2
  84. package/dist/src/view/gridView.d.ts +0 -135
  85. package/dist/src/view/gridView.d.ts.map +0 -1
package/dist/schema.json CHANGED
@@ -670,6 +670,96 @@
670
670
  }
671
671
  ]
672
672
  },
673
+ "BrushConfig": {
674
+ "additionalProperties": false,
675
+ "properties": {
676
+ "fill": {
677
+ "description": "The fill color of the interval mark.\n\n__Default value:__ `\"#808080\"`",
678
+ "type": "string"
679
+ },
680
+ "fillOpacity": {
681
+ "description": "The fill opacity of the interval mark (a value between `0` and `1`).\n\n__Default value:__ `0.05`",
682
+ "type": "number"
683
+ },
684
+ "measure": {
685
+ "description": "Where to display the measurement text (e.g., number of base pairs) for the interval selection.\n\n- `\"none\"` -- do not show the measurement.\n- `\"inside\"` -- show inside the brush rectangle.\n- `\"outside\"` -- show outside the brush rectangle.\n\n__Default value:__ `\"none\"`",
686
+ "enum": [
687
+ "none",
688
+ "inside",
689
+ "outside"
690
+ ],
691
+ "type": "string"
692
+ },
693
+ "shadowBlur": {
694
+ "anyOf": [
695
+ {
696
+ "type": "number"
697
+ },
698
+ {
699
+ "$ref": "#/definitions/ExprRef"
700
+ }
701
+ ],
702
+ "description": "The blur radius of the drop shadow in pixels. Higher values produce a more diffuse shadow.\n\n**Default value:** `0`"
703
+ },
704
+ "shadowColor": {
705
+ "anyOf": [
706
+ {
707
+ "type": "string"
708
+ },
709
+ {
710
+ "$ref": "#/definitions/ExprRef"
711
+ }
712
+ ],
713
+ "description": "The color of the drop shadow. Any valid CSS color string is allowed.\n\n**Default value:** `\"black\"`"
714
+ },
715
+ "shadowOffsetX": {
716
+ "anyOf": [
717
+ {
718
+ "type": "number"
719
+ },
720
+ {
721
+ "$ref": "#/definitions/ExprRef"
722
+ }
723
+ ],
724
+ "description": "The horizontal offset of the drop shadow in pixels. Positive values move the shadow to the right.\n\n**Default value:** `0`"
725
+ },
726
+ "shadowOffsetY": {
727
+ "anyOf": [
728
+ {
729
+ "type": "number"
730
+ },
731
+ {
732
+ "$ref": "#/definitions/ExprRef"
733
+ }
734
+ ],
735
+ "description": "The vertical offset of the drop shadow in pixels. Positive values move the shadow downward.\n\n**Default value:** `0`"
736
+ },
737
+ "shadowOpacity": {
738
+ "anyOf": [
739
+ {
740
+ "type": "number"
741
+ },
742
+ {
743
+ "$ref": "#/definitions/ExprRef"
744
+ }
745
+ ],
746
+ "description": "The opacity of the drop shadow. Value between `0` (fully transparent) and `1` (fully opaque).\n\n**Default value:** `0` (disabled)"
747
+ },
748
+ "stroke": {
749
+ "description": "The stroke color of the interval mark.\n\n__Default value:__ `\"black\"`",
750
+ "type": "string"
751
+ },
752
+ "strokeOpacity": {
753
+ "description": "The stroke opacity of the interval mark (a value between `0` and `1`).\n\n__Default value:__ `0.2`",
754
+ "type": "number"
755
+ },
756
+ "strokeWidth": {
757
+ "description": "The stroke width of the interval mark.\n\n__Default value:__ `1`",
758
+ "type": "number"
759
+ }
760
+ },
761
+ "type": "object"
762
+ },
673
763
  "ChannelWithScale": {
674
764
  "anyOf": [
675
765
  {
@@ -3354,18 +3444,15 @@
3354
3444
  "additionalProperties": false,
3355
3445
  "properties": {
3356
3446
  "encodings": {
3357
- "description": "An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.",
3447
+ "description": "An array of encoding channels that define the interval selection.",
3358
3448
  "items": {
3359
- "$ref": "#/definitions/ChannelWithScale"
3449
+ "$ref": "#/definitions/PrimaryPositionalChannel"
3360
3450
  },
3361
3451
  "type": "array"
3362
3452
  },
3363
- "fields": {
3364
- "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.",
3365
- "items": {
3366
- "type": "string"
3367
- },
3368
- "type": "array"
3453
+ "mark": {
3454
+ "$ref": "#/definitions/BrushConfig",
3455
+ "description": "Interval selections display a rectangle mark to show the selected range. Use the `mark` property to adjust the appearance of this rectangle."
3369
3456
  },
3370
3457
  "on": {
3371
3458
  "enum": [
@@ -4500,20 +4587,6 @@
4500
4587
  "PointSelectionConfig": {
4501
4588
  "additionalProperties": false,
4502
4589
  "properties": {
4503
- "encodings": {
4504
- "description": "An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.",
4505
- "items": {
4506
- "$ref": "#/definitions/ChannelWithScale"
4507
- },
4508
- "type": "array"
4509
- },
4510
- "fields": {
4511
- "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.",
4512
- "items": {
4513
- "type": "string"
4514
- },
4515
- "type": "array"
4516
- },
4517
4590
  "on": {
4518
4591
  "enum": [
4519
4592
  "click",
@@ -4992,6 +5065,54 @@
4992
5065
  "description": "Whether the `color` represents the `fill` color (`true`) or the `stroke` color (`false`).",
4993
5066
  "type": "boolean"
4994
5067
  },
5068
+ "hatch": {
5069
+ "anyOf": [
5070
+ {
5071
+ "const": "none",
5072
+ "type": "string"
5073
+ },
5074
+ {
5075
+ "const": "diagonal",
5076
+ "type": "string"
5077
+ },
5078
+ {
5079
+ "const": "antiDiagonal",
5080
+ "type": "string"
5081
+ },
5082
+ {
5083
+ "const": "cross",
5084
+ "type": "string"
5085
+ },
5086
+ {
5087
+ "const": "vertical",
5088
+ "type": "string"
5089
+ },
5090
+ {
5091
+ "const": "horizontal",
5092
+ "type": "string"
5093
+ },
5094
+ {
5095
+ "const": "grid",
5096
+ "type": "string"
5097
+ },
5098
+ {
5099
+ "const": "dots",
5100
+ "type": "string"
5101
+ },
5102
+ {
5103
+ "const": "rings",
5104
+ "type": "string"
5105
+ },
5106
+ {
5107
+ "const": "ringsLarge",
5108
+ "type": "string"
5109
+ },
5110
+ {
5111
+ "$ref": "#/definitions/ExprRef"
5112
+ }
5113
+ ],
5114
+ "description": "A hatch pattern drawn inside the mark using the stroke width, color, and opacity. The pattern is aligned in screen space and scaled by the stroke width.\n\n**Default value:** `\"none\"`"
5115
+ },
4995
5116
  "minBufferSize": {
4996
5117
  "description": "Minimum size for WebGL buffers (number of data items). Allows for using `bufferSubData()` to update graphics.\n\nThis property is intended for internal use.",
4997
5118
  "type": "number"
@@ -5040,6 +5161,61 @@
5040
5161
  ],
5041
5162
  "description": "Opacity of the mark. Affects `fillOpacity` or `strokeOpacity`, depending on the `filled` property."
5042
5163
  },
5164
+ "shadowBlur": {
5165
+ "anyOf": [
5166
+ {
5167
+ "type": "number"
5168
+ },
5169
+ {
5170
+ "$ref": "#/definitions/ExprRef"
5171
+ }
5172
+ ],
5173
+ "description": "The blur radius of the drop shadow in pixels. Higher values produce a more diffuse shadow.\n\n**Default value:** `0`"
5174
+ },
5175
+ "shadowColor": {
5176
+ "anyOf": [
5177
+ {
5178
+ "type": "string"
5179
+ },
5180
+ {
5181
+ "$ref": "#/definitions/ExprRef"
5182
+ }
5183
+ ],
5184
+ "description": "The color of the drop shadow. Any valid CSS color string is allowed.\n\n**Default value:** `\"black\"`"
5185
+ },
5186
+ "shadowOffsetX": {
5187
+ "anyOf": [
5188
+ {
5189
+ "type": "number"
5190
+ },
5191
+ {
5192
+ "$ref": "#/definitions/ExprRef"
5193
+ }
5194
+ ],
5195
+ "description": "The horizontal offset of the drop shadow in pixels. Positive values move the shadow to the right.\n\n**Default value:** `0`"
5196
+ },
5197
+ "shadowOffsetY": {
5198
+ "anyOf": [
5199
+ {
5200
+ "type": "number"
5201
+ },
5202
+ {
5203
+ "$ref": "#/definitions/ExprRef"
5204
+ }
5205
+ ],
5206
+ "description": "The vertical offset of the drop shadow in pixels. Positive values move the shadow downward.\n\n**Default value:** `0`"
5207
+ },
5208
+ "shadowOpacity": {
5209
+ "anyOf": [
5210
+ {
5211
+ "type": "number"
5212
+ },
5213
+ {
5214
+ "$ref": "#/definitions/ExprRef"
5215
+ }
5216
+ ],
5217
+ "description": "The opacity of the drop shadow. Value between `0` (fully transparent) and `1` (fully opaque).\n\n**Default value:** `0` (disabled)"
5218
+ },
5043
5219
  "stroke": {
5044
5220
  "anyOf": [
5045
5221
  {
@@ -7420,6 +7596,28 @@
7420
7596
  ],
7421
7597
  "type": "object"
7422
7598
  },
7599
+ "SelectionInitIntervalMapping": {
7600
+ "additionalProperties": false,
7601
+ "properties": {
7602
+ "x": {
7603
+ "items": {
7604
+ "type": "number"
7605
+ },
7606
+ "maxItems": 2,
7607
+ "minItems": 2,
7608
+ "type": "array"
7609
+ },
7610
+ "y": {
7611
+ "items": {
7612
+ "type": "number"
7613
+ },
7614
+ "maxItems": 2,
7615
+ "minItems": 2,
7616
+ "type": "array"
7617
+ }
7618
+ },
7619
+ "type": "object"
7620
+ },
7423
7621
  "SelectionParameter": {
7424
7622
  "additionalProperties": false,
7425
7623
  "properties": {
@@ -7444,6 +7642,10 @@
7444
7642
  }
7445
7643
  ],
7446
7644
  "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports two selection types:\n\n- `\"point\"` -- to select multiple discrete data values; the first value is selected on `click` and additional values toggled on shift-click.\n- `\"interval\"` -- to select a continuous range of data values on `drag`."
7645
+ },
7646
+ "value": {
7647
+ "$ref": "#/definitions/SelectionInitIntervalMapping",
7648
+ "description": "Initial value for the selection."
7447
7649
  }
7448
7650
  },
7449
7651
  "required": [
@@ -8451,6 +8653,9 @@
8451
8653
  },
8452
8654
  {
8453
8655
  "$ref": "#/definitions/ExprRef"
8656
+ },
8657
+ {
8658
+ "$ref": "#/definitions/UrlList"
8454
8659
  }
8455
8660
  ],
8456
8661
  "description": "An URL or an array of URLs from which to load the data set. Use the `format.type` property to ensure the loaded data is correctly parsed."
@@ -8492,6 +8697,28 @@
8492
8697
  ],
8493
8698
  "type": "object"
8494
8699
  },
8700
+ "UrlList": {
8701
+ "additionalProperties": false,
8702
+ "properties": {
8703
+ "type": {
8704
+ "description": "The format of the data in the list. If the type is `\"json\"`, the list is expected to be an array of strings. If the type is `\"csv\"` or `\"tsv\"`, the list is expected to be a table with a single column named `file`.\n\n__Default value:__ `\"txt\"`",
8705
+ "enum": [
8706
+ "json",
8707
+ "csv",
8708
+ "tsv"
8709
+ ],
8710
+ "type": "string"
8711
+ },
8712
+ "urlsFromFile": {
8713
+ "description": "A URL that returns a list of URLs to load the data set. The URLs in the list can be absolute or relative to the URL of the list.",
8714
+ "type": "string"
8715
+ }
8716
+ },
8717
+ "required": [
8718
+ "urlsFromFile"
8719
+ ],
8720
+ "type": "object"
8721
+ },
8495
8722
  "VConcatSpec": {
8496
8723
  "additionalProperties": false,
8497
8724
  "properties": {
@@ -8917,6 +9144,61 @@
8917
9144
  ],
8918
9145
  "description": "The fill opacity. Value between `0` and `1`."
8919
9146
  },
9147
+ "shadowBlur": {
9148
+ "anyOf": [
9149
+ {
9150
+ "type": "number"
9151
+ },
9152
+ {
9153
+ "$ref": "#/definitions/ExprRef"
9154
+ }
9155
+ ],
9156
+ "description": "The blur radius of the drop shadow in pixels. Higher values produce a more diffuse shadow.\n\n**Default value:** `0`"
9157
+ },
9158
+ "shadowColor": {
9159
+ "anyOf": [
9160
+ {
9161
+ "type": "string"
9162
+ },
9163
+ {
9164
+ "$ref": "#/definitions/ExprRef"
9165
+ }
9166
+ ],
9167
+ "description": "The color of the drop shadow. Any valid CSS color string is allowed.\n\n**Default value:** `\"black\"`"
9168
+ },
9169
+ "shadowOffsetX": {
9170
+ "anyOf": [
9171
+ {
9172
+ "type": "number"
9173
+ },
9174
+ {
9175
+ "$ref": "#/definitions/ExprRef"
9176
+ }
9177
+ ],
9178
+ "description": "The horizontal offset of the drop shadow in pixels. Positive values move the shadow to the right.\n\n**Default value:** `0`"
9179
+ },
9180
+ "shadowOffsetY": {
9181
+ "anyOf": [
9182
+ {
9183
+ "type": "number"
9184
+ },
9185
+ {
9186
+ "$ref": "#/definitions/ExprRef"
9187
+ }
9188
+ ],
9189
+ "description": "The vertical offset of the drop shadow in pixels. Positive values move the shadow downward.\n\n**Default value:** `0`"
9190
+ },
9191
+ "shadowOpacity": {
9192
+ "anyOf": [
9193
+ {
9194
+ "type": "number"
9195
+ },
9196
+ {
9197
+ "$ref": "#/definitions/ExprRef"
9198
+ }
9199
+ ],
9200
+ "description": "The opacity of the drop shadow. Value between `0` (fully transparent) and `1` (fully opaque).\n\n**Default value:** `0` (disabled)"
9201
+ },
8920
9202
  "stroke": {
8921
9203
  "anyOf": [
8922
9204
  {
@@ -1 +1 @@
1
- {"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../../src/data/collector.js"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH;IAkCI;;OAEG;IACH,qBAFW,OAAO,sBAAsB,EAAE,aAAa,EAetD;IAVG,qDAA2C;IAE3C,2CAA2C;IAC3C,WADW,CAAC,CAAS,IAAS,EAAT,SAAS,KAAE,IAAI,CAAC,EAAE,CACpB;IAGnB,yFAAyF;IACzF,cADW,GAAG,CAAC,OAAO,oBAAoB,EAAE,MAAM,EAAE,+BAAO,CACN;IAuHzD;;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;qBA/SyD,eAAe"}
1
+ {"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../../src/data/collector.js"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH;IAkCI;;OAEG;IACH,qBAFW,OAAO,sBAAsB,EAAE,aAAa,EAetD;IAVG,qDAA2C;IAE3C,2CAA2C;IAC3C,WADW,CAAC,CAAS,IAAS,EAAT,SAAS,KAAE,IAAI,CAAC,EAAE,CACpB;IAGnB,yFAAyF;IACzF,cADW,GAAG,CAAC,OAAO,oBAAoB,EAAE,MAAM,EAAE,+BAAO,CACN;IAwHzD;;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;qBAhTyD,eAAe"}
@@ -68,6 +68,7 @@ export default class Collector extends FlowNode {
68
68
 
69
69
  #init() {
70
70
  this.#buffer = [];
71
+ this.#uniqueIdIndex = [];
71
72
 
72
73
  this.facetBatches.clear();
73
74
  this.facetBatches.set(undefined, this.#buffer);
@@ -4,8 +4,9 @@
4
4
  *
5
5
  * @param {import("../../spec/data.js").DataSource} params
6
6
  * DataSource parameters
7
+ * @param {string | string[]} [urls]
7
8
  */
8
- export function getFormat(params: import("../../spec/data.js").DataSource): {
9
+ export function getFormat(params: import("../../spec/data.js").DataSource, urls?: string | string[]): {
9
10
  type?: "csv" | "tsv";
10
11
  parse?: import("../../spec/data.js").Parse | null;
11
12
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"dataUtils.d.ts","sourceRoot":"","sources":["../../../../src/data/sources/dataUtils.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,kCAHW,OAAO,oBAAoB,EAAE,UAAU;;;;;;;;;;;;;EAsBjD;AAED;;;GA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;AACH,sCAHW,OAAO,oBAAoB,EAAE,UAAU,GACtC,UAAU,IAAI,OAAO,oBAAoB,EAAE,OAAO,CAI7D;AAxCM,+BAAgC,GAAG,QAI3B,OAAO,uBAAuB,EAAE,MAAM;;UAGtB,OAAO,gBAAgB,EAAE,KAAK,qCANR"}
@@ -1,5 +1,4 @@
1
1
  import { formats } from "vega-loader";
2
- import { withoutExprRef } from "../../view/paramMediator.js";
3
2
  import { isInlineData } from "./inlineSource.js";
4
3
 
5
4
  /**
@@ -8,15 +7,15 @@ import { isInlineData } from "./inlineSource.js";
8
7
  *
9
8
  * @param {import("../../spec/data.js").DataSource} params
10
9
  * DataSource parameters
10
+ * @param {string | string[]} [urls]
11
11
  */
12
- export function getFormat(params) {
12
+ export function getFormat(params, urls = []) {
13
13
  if (!isInlineData(params) && !isUrlData(params)) {
14
14
  return;
15
15
  }
16
16
  const format = { ...params.format };
17
17
 
18
- format.type ??=
19
- isUrlData(params) && extractTypeFromUrl(withoutExprRef(params.url));
18
+ format.type ??= isUrlData(params) && extractTypeFromUrl(urls);
20
19
  // @ts-ignore TODO: Fix typing
21
20
  format.parse ??= "auto";
22
21
 
@@ -12,9 +12,17 @@ export default class InlineSource extends DataSource {
12
12
  params: import("../../spec/data.js").InlineData;
13
13
  /**
14
14
  * Returns true if the data source emits a single dummy datum.
15
+ * The behavior is unspecified if `updateDynamicData` is used.
15
16
  */
16
17
  isTrivial(): boolean;
18
+ /**
19
+ * Programmatically updates the inline-provided data with new data.
20
+ *
21
+ * @param {import("../flowNode.js").Datum[]} data
22
+ */
23
+ updateDynamicData(data: import("../flowNode.js").Datum[]): void;
17
24
  loadSynchronously(): void;
25
+ #private;
18
26
  }
19
27
  import DataSource from "./dataSource.js";
20
28
  //# sourceMappingURL=inlineSource.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inlineSource.d.ts","sourceRoot":"","sources":["../../../../src/data/sources/inlineSource.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH,mCAHW,OAAO,CAAC,OAAO,oBAAoB,EAAE,IAAI,CAAC,GACxC,IAAI,IAAI,OAAO,oBAAoB,EAAE,UAAU,CAI3D;AAED;IACI;;;OAGG;IACH,oBAHW,OAAO,oBAAoB,EAAE,UAAU,QACvC,OAAO,oBAAoB,EAAE,OAAO,EAY9C;IAPG,gDAAoB;IAaxB;;OAEG;IACH,qBASC;IAED,0BAiCC;CAKJ;uBAnFsB,iBAAiB"}
1
+ {"version":3,"file":"inlineSource.d.ts","sourceRoot":"","sources":["../../../../src/data/sources/inlineSource.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH,mCAHW,OAAO,CAAC,OAAO,oBAAoB,EAAE,IAAI,CAAC,GACxC,IAAI,IAAI,OAAO,oBAAoB,EAAE,UAAU,CAI3D;AAED;IACI;;;OAGG;IACH,oBAHW,OAAO,oBAAoB,EAAE,UAAU,QACvC,OAAO,oBAAoB,EAAE,OAAO,EAY9C;IAPG,gDAAoB;IAaxB;;;OAGG;IACH,qBASC;IAED;;;;OAIG;IACH,wBAFW,OAAO,gBAAgB,EAAE,KAAK,EAAE,QAI1C;IAED,0BAEC;;CA0CJ;uBAnGsB,iBAAiB"}
@@ -33,6 +33,7 @@ export default class InlineSource extends DataSource {
33
33
 
34
34
  /**
35
35
  * Returns true if the data source emits a single dummy datum.
36
+ * The behavior is unspecified if `updateDynamicData` is used.
36
37
  */
37
38
  isTrivial() {
38
39
  const values = this.params.values;
@@ -45,9 +46,24 @@ export default class InlineSource extends DataSource {
45
46
  );
46
47
  }
47
48
 
49
+ /**
50
+ * Programmatically updates the inline-provided data with new data.
51
+ *
52
+ * @param {import("../flowNode.js").Datum[]} data
53
+ */
54
+ updateDynamicData(data) {
55
+ this.#loadValuesSynchronously(data);
56
+ }
57
+
48
58
  loadSynchronously() {
49
- const values = this.params.values;
59
+ this.#loadValuesSynchronously(this.params.values);
60
+ }
50
61
 
62
+ /**
63
+ *
64
+ * @param {import("../../spec/data.js").InlineDataset} values
65
+ */
66
+ #loadValuesSynchronously(values) {
51
67
  let data = [];
52
68
 
53
69
  /** @type {(x: any) => import("../flowNode.js").Datum} */
@@ -11,6 +11,7 @@ export default class UrlSource extends DataSource {
11
11
  constructor(params: import("../../spec/data.js").UrlData, view: import("../../view/view.js").default);
12
12
  params: import("../../spec/data.js").UrlData;
13
13
  baseUrl: string;
14
+ #private;
14
15
  }
15
16
  import DataSource from "./dataSource.js";
16
17
  //# sourceMappingURL=urlSource.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"urlSource.d.ts","sourceRoot":"","sources":["../../../../src/data/sources/urlSource.js"],"names":[],"mappings":"AASA;;;GAGG;AACH,gCAHW,OAAO,CAAC,OAAO,oBAAoB,EAAE,IAAI,CAAC,GACxC,IAAI,IAAI,OAAO,oBAAoB,EAAE,OAAO,CAIxD;AAED;IACI;;;OAGG;IACH,oBAHW,OAAO,oBAAoB,EAAE,OAAO,QACpC,OAAO,oBAAoB,EAAE,OAAO,EAU9C;IALG,6CAEC;IAED,gBAAiC;CA0ExC;uBArGsB,iBAAiB"}
1
+ {"version":3,"file":"urlSource.d.ts","sourceRoot":"","sources":["../../../../src/data/sources/urlSource.js"],"names":[],"mappings":"AASA;;;GAGG;AACH,gCAHW,OAAO,CAAC,OAAO,oBAAoB,EAAE,IAAI,CAAC,GACxC,IAAI,IAAI,OAAO,oBAAoB,EAAE,OAAO,CAIxD;AAED;IACI;;;OAGG;IACH,oBAHW,OAAO,oBAAoB,EAAE,OAAO,QACpC,OAAO,oBAAoB,EAAE,OAAO,EAU9C;IALG,6CAEC;IAED,gBAAiC;;CAuGxC;uBAlIsB,iBAAiB"}
@@ -38,13 +38,43 @@ export default class UrlSource extends DataSource {
38
38
  return "urlSource";
39
39
  }
40
40
 
41
+ /**
42
+ *
43
+ * @param {import("../../spec/data.js").UrlList} props
44
+ */
45
+ async #loadUrlsFromFile(props) {
46
+ const listUrl = concatUrl(this.baseUrl, props.urlsFromFile);
47
+
48
+ const result = await fetch(listUrl);
49
+
50
+ if (!result.ok) {
51
+ throw new Error(
52
+ `Cannot load "${listUrl}": ${result.status} ${result.statusText}`
53
+ );
54
+ }
55
+ const text = await result.text();
56
+
57
+ const files = /** @type {string[] | {url: string}[]} */ (
58
+ read(text, { type: props.type ?? "tsv" })
59
+ )
60
+ .map((u) => (typeof u === "string" ? u : u.url))
61
+ .map((u) => concatUrl(listUrl, u));
62
+
63
+ return files;
64
+ }
65
+
41
66
  async load() {
42
67
  const url = withoutExprRef(this.params.url);
43
68
 
44
69
  /** @type {string[]} */
45
- const urls = Array.isArray(url) ? url : [url];
70
+ const urls =
71
+ typeof url == "object" && "urlsFromFile" in url
72
+ ? await this.#loadUrlsFromFile(url)
73
+ : (Array.isArray(url) ? url : [url]).map((u) =>
74
+ concatUrl(this.baseUrl, u)
75
+ );
46
76
 
47
- const format = getFormat(this.params);
77
+ const format = getFormat(this.params, urls);
48
78
  const type = responseType(format.type);
49
79
 
50
80
  if (urls.length === 0 || !urls[0]) {
@@ -56,8 +86,7 @@ export default class UrlSource extends DataSource {
56
86
  /** @param {string} url */
57
87
  const load = async (url) => {
58
88
  try {
59
- const fullUrl = concatUrl(this.baseUrl, url);
60
- const result = await fetch(fullUrl);
89
+ const result = await fetch(url);
61
90
  if (!result.ok) {
62
91
  throw new Error(`${result.status} ${result.statusText}`);
63
92
  }
@@ -105,7 +105,7 @@ export function getPrimaryChannel(channel: import("../spec/channel.js").Channel)
105
105
  *
106
106
  * @param {import("../spec/channel.js").Channel} channel
107
107
  */
108
- export function getChannelWithSecondarys(channel: import("../spec/channel.js").Channel): ("search" | "fill" | "stroke" | "angle" | "sample" | "color" | "fillOpacity" | "opacity" | "strokeOpacity" | "strokeWidth" | "x" | "y" | "text" | "size" | "x2" | "y2" | "shape" | "dx" | "dy" | "uniqueId" | "facetIndex" | "semanticScore")[];
108
+ export function getChannelWithSecondarys(channel: import("../spec/channel.js").Channel): ("search" | "fill" | "stroke" | "angle" | "sample" | "color" | "fillOpacity" | "opacity" | "strokeOpacity" | "strokeWidth" | "x" | "y" | "text" | "size" | "x2" | "y2" | "dx" | "dy" | "shape" | "uniqueId" | "facetIndex" | "semanticScore")[];
109
109
  /**
110
110
  * @param {import("../spec/channel.js").Channel} channel
111
111
  */
@@ -1 +1 @@
1
- {"version":3,"file":"genomeSpy.d.ts","sourceRoot":"","sources":["../../src/genomeSpy.js"],"names":[],"mappings":"AA6CA;IACI;;;;;OAKG;IAEH;;;;;OAKG;IACH,uBAJW,WAAW,qDAEX,OAAO,qBAAqB,EAAE,YAAY,EA6FpD;IA1FG,uBAA0B;IAC1B,oDAAsB;IAItB,6BAA6B;IAC7B,uBADW,CAAC,MAAM,IAAI,CAAC,EAAE,CACM;IAE/B,sCAAsC;IACtC,wCAAgB;IAEhB,yBAAoC;IAEpC,4CAA4C;IAC5C,oBADW,CAAC,CAAS,IAAM,EAAN,MAAM,KAAE,MAAM,EAAE,CAAC,EAAE,CACZ;IAE5B,mBAAoD;IAEpD,0BAA0B;IAC1B,aADW,WAAW,CACM;IAE5B;;;;;OAKG;IACH,yBAFU,CAAC,IAAI,kCAAM,KAAK,OAAO,CAE8B;IAE/D,2CAA2C;IAC3C,mBADW,4BAA4B,CACL;IAClC,2CAA2C;IAC3C,iBADW,4BAA4B,CACP;IAEhC,oDAAoD;IACpD,6BAAgC;IAEhC;;;OAGG;IACH,eAFU;QAAE,IAAI,EAAE,OAAO,iBAAiB,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,OAAO,oBAAoB,EAAE,KAAK,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAEpF;IAE9B,uBAA+C;IAE/C;;;OAGG;IACH,oBAFU,GAAG,CAAC,MAAM,EAAE,CAAC,CAAS,IAAa,EAAb,aAAa,KAAE,IAAI,CAAC,EAAE,CAAC,CAEpB;IAEnC;;;;;;OAMG;IACH,iBAFU,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC,CAEhB;I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