@jbrowse/core 5.0.0-beta.4 → 5.0.0-beta.8

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 (110) hide show
  1. package/README.md +278 -250
  2. package/esm/PluginManager.js +1 -1
  3. package/esm/ReExports/publicUi.d.ts +1 -1
  4. package/esm/ReExports/publicUi.js +1 -1
  5. package/esm/ReExports/publicUtil.d.ts +1 -1
  6. package/esm/ReExports/publicUtil.js +1 -1
  7. package/esm/ReExports/workerNamespaceNames.js +3 -9
  8. package/esm/assemblyManager/assemblyConfigSchema.d.ts +2 -1
  9. package/esm/assemblyManager/assemblyConfigSchema.js +2 -1
  10. package/esm/assemblyManager/expandAssemblyConfigShorthand.d.ts +15 -15
  11. package/esm/assemblyManager/expandAssemblyConfigShorthand.js +34 -18
  12. package/esm/configuration/configurationSchema.d.ts +1 -2
  13. package/esm/configuration/configurationSchema.js +3 -8
  14. package/esm/configuration/configurationSlot.d.ts +0 -47
  15. package/esm/configuration/configurationSlot.js +4 -54
  16. package/esm/configuration/fillLocations.d.ts +14 -0
  17. package/esm/configuration/fillLocations.js +14 -0
  18. package/esm/configuration/fullConfSnapshot.d.ts +0 -15
  19. package/esm/configuration/fullConfSnapshot.js +0 -28
  20. package/esm/configuration/getConf.d.ts +4 -34
  21. package/esm/configuration/getConf.js +3 -38
  22. package/esm/configuration/index.d.ts +3 -4
  23. package/esm/configuration/index.js +3 -2
  24. package/esm/configuration/schemaRegistry.d.ts +1 -2
  25. package/esm/configuration/schemaRegistry.js +1 -2
  26. package/esm/configuration/slotFacade.d.ts +1 -16
  27. package/esm/configuration/slotFacade.js +1 -2
  28. package/esm/configuration/tabixShorthand.js +3 -3
  29. package/esm/configuration/types.d.ts +4 -16
  30. package/esm/data_adapters/CytobandAdapter/configSchema.js +3 -4
  31. package/esm/pluggableElementTypes/DisplayType.d.ts +5 -3
  32. package/esm/pluggableElementTypes/DisplayType.js +3 -1
  33. package/esm/pluggableElementTypes/models/BaseTrackModel.d.ts +30 -0
  34. package/esm/pluggableElementTypes/models/BaseTrackModel.js +45 -17
  35. package/esm/rpc/RpcRegistry.d.ts +7 -1
  36. package/esm/rpc/coreRpcMethods.d.ts +1 -0
  37. package/esm/rpc/coreRpcMethods.js +1 -0
  38. package/esm/rpc/methods/CoreEncodeFeatures.d.ts +15 -0
  39. package/esm/rpc/methods/CoreEncodeFeatures.js +62 -0
  40. package/esm/svg/svgId.d.ts +1 -1
  41. package/esm/svg/svgId.js +1 -1
  42. package/esm/ui/LegendSwatchGlyph.js +26 -21
  43. package/esm/ui/MenuTypes.d.ts +5 -52
  44. package/esm/ui/SizeSliderRow.d.ts +1 -3
  45. package/esm/ui/SizeSliderRow.js +4 -6
  46. package/esm/ui/SvgColorLegend.d.ts +9 -3
  47. package/esm/ui/SvgColorLegend.js +74 -33
  48. package/esm/ui/colorScale.d.ts +64 -0
  49. package/esm/ui/colorScale.js +41 -0
  50. package/esm/ui/colors.d.ts +11 -0
  51. package/esm/ui/colors.js +7 -0
  52. package/esm/ui/index.d.ts +5 -7
  53. package/esm/ui/index.js +3 -13
  54. package/esm/ui/legendMenuItem.d.ts +5 -16
  55. package/esm/ui/legendMenuItem.js +3 -14
  56. package/esm/ui/legendSpec.d.ts +11 -5
  57. package/esm/ui/legendSpec.js +8 -11
  58. package/esm/ui/makeSizeMenu.d.ts +0 -6
  59. package/esm/ui/makeSizeMenu.js +6 -30
  60. package/esm/ui/measureLegendText.js +1 -1
  61. package/esm/ui/menuItemAdornment.d.ts +9 -19
  62. package/esm/ui/menuItemAdornment.js +10 -31
  63. package/esm/ui/menuItems.d.ts +2 -6
  64. package/esm/ui/menuItems.js +0 -4
  65. package/esm/ui/palette.js +2 -1
  66. package/esm/ui/toggleMenuItems.d.ts +6 -13
  67. package/esm/ui/toggleMenuItems.js +13 -29
  68. package/esm/util/colorRamp.d.ts +3 -3
  69. package/esm/util/colorRamp.js +2 -2
  70. package/esm/util/featureTransforms.d.ts +15 -0
  71. package/esm/util/featureTransforms.js +342 -0
  72. package/esm/util/freezeDeep.d.ts +8 -10
  73. package/esm/util/freezeDeep.js +8 -10
  74. package/esm/util/glyphNames.d.ts +8 -0
  75. package/esm/util/glyphNames.js +12 -0
  76. package/esm/util/index.d.ts +0 -1
  77. package/esm/util/index.js +0 -1
  78. package/esm/util/markEncoding.d.ts +76 -0
  79. package/esm/util/markEncoding.js +436 -0
  80. package/esm/util/markEncodingTypes.d.ts +331 -0
  81. package/esm/util/markEncodingTypes.js +8 -0
  82. package/esm/util/renderToStaticMarkup.js +1 -1
  83. package/esm/util/starFusion.d.ts +26 -0
  84. package/esm/util/starFusion.js +37 -0
  85. package/esm/util/trackConfigDelta.d.ts +4 -8
  86. package/esm/util/trackConfigDelta.js +2 -4
  87. package/esm/util/tracks.d.ts +7 -1
  88. package/esm/util/tracks.js +72 -7
  89. package/esm/util/types/index.d.ts +12 -4
  90. package/esm/util/whenViewSettled.d.ts +9 -0
  91. package/esm/util/whenViewSettled.js +12 -4
  92. package/package.json +13 -3
  93. package/esm/configuration/promotableDefaults.d.ts +0 -234
  94. package/esm/configuration/promotableDefaults.js +0 -395
  95. package/esm/configuration/promotablePin.d.ts +0 -65
  96. package/esm/configuration/promotablePin.js +0 -1
  97. package/esm/configuration/promotableResolve.d.ts +0 -108
  98. package/esm/configuration/promotableResolve.js +0 -117
  99. package/esm/configuration/promotableSlots.d.ts +0 -12
  100. package/esm/configuration/promotableSlots.js +0 -45
  101. package/esm/configuration/slotShape.d.ts +0 -12
  102. package/esm/configuration/slotShape.js +0 -84
  103. package/esm/ui/PinAdornment.d.ts +0 -5
  104. package/esm/ui/PinAdornment.js +0 -67
  105. package/esm/ui/SvgGradientLegend.d.ts +0 -26
  106. package/esm/ui/SvgGradientLegend.js +0 -26
  107. package/esm/ui/promotablePinCoverage.d.ts +0 -58
  108. package/esm/ui/promotablePinCoverage.js +0 -124
  109. package/esm/util/openDisplays.d.ts +0 -23
  110. package/esm/util/openDisplays.js +0 -79
@@ -1,79 +0,0 @@
1
- /**
2
- * @module
3
- * One walk of "every display on an open track, across all open views".
4
- *
5
- * Lives here rather than in `configuration/promotableDefaults.ts`, where it grew:
6
- * nothing about it is a cascade concern — it answers "the tracks the user is
7
- * looking at", and its two callers want that for different reasons (the promoted
8
- * default's "apply to open tracks", and `product-core`'s share/export bake). It
9
- * cannot move next to either one: `product-core` imports `@jbrowse/core`, never
10
- * the reverse.
11
- *
12
- * The displays are typed `ResolvableDisplay` because both callers immediately
13
- * resolve config off them, and that shape (`IStateTreeNode` + `type` +
14
- * `configuration`) is the smallest thing either needs.
15
- */
16
- import { isObject } from './objectUtils.js';
17
- import { isViewContainer } from './types/index.js';
18
- // A view whose open tracks we can enumerate. The generic view interface doesn't
19
- // surface `tracks`, so narrow structurally — the declared display shape is the
20
- // same ResolvableDisplay the cascade already operates on.
21
- //
22
- // Checks the elements, not just that `tracks` is an array: this narrowing is
23
- // what every consumer downstream trusts, and an element without `displays`
24
- // would put `undefined` in the walk and throw at the first `display.type` —
25
- // inside a share/export bake, i.e. as far from the cause as it gets. Every
26
- // `tracks`-bearing view today holds real track models, so this only ever
27
- // confirms what is already true.
28
- function hasOpenTracks(view) {
29
- return ('tracks' in view &&
30
- Array.isArray(view.tracks) &&
31
- view.tracks.every(t => isObject(t) && Array.isArray(t.displays)));
32
- }
33
- // A composite view holding child views in a `views` array: breakpoint-split and
34
- // the linear-comparative family incl. synteny. Not exclusive with
35
- // `hasOpenTracks`: LinearComparativeView has both its own synteny tracks and two
36
- // child LGVs.
37
- //
38
- // A view that holds its children under *named* props instead (SvInspectorView's
39
- // `spreadsheetView`/`circularView`) is NOT reached. Enumerating a view's own
40
- // properties to find them isn't an option — reading every key of an MST node
41
- // invokes every computed view on it, several of which throw before the view is
42
- // initialized. No display reachable that way declares a promotable slot today,
43
- // so nothing is currently missed; if one ever does, give that view a `views`
44
- // getter returning its children rather than duck-typing harder here.
45
- function hasChildViews(view) {
46
- return ('views' in view &&
47
- Array.isArray(view.views) &&
48
- view.views.every(v => typeof v === 'object' && v !== null));
49
- }
50
- function displaysInView(view) {
51
- return [
52
- ...(hasOpenTracks(view) ? view.tracks.flatMap(t => t.displays) : []),
53
- ...(hasChildViews(view) ? view.views.flatMap(displaysInView) : []),
54
- ];
55
- }
56
- /**
57
- * #api core/util
58
- * Every display on an open track, across all open views — the reach of anything
59
- * that acts on "the tracks the user is looking at": a promoted default's "apply
60
- * to open tracks", and the share/export bake. One walk so those can't drift
61
- * apart.
62
- *
63
- * Recurses into composite views. A display nested in one resolves the cascade
64
- * like any other but was invisible to both callers, so the share/export bake
65
- * didn't bake its inherited values and a shared session containing a
66
- * breakpoint-split or synteny view rendered differently for the recipient.
67
- * `LGVSyntenyDisplay` is only ever reached through this branch, so don't flatten
68
- * the recursion away. `hasChildViews` names the one composite shape it does not
69
- * cover.
70
- *
71
- * A view holding neither (e.g. spreadsheet) drops out via the structural guards.
72
- * A view whose displays declare no promotable slot (e.g. dotplot, which does
73
- * hold tracks) is walked and contributes nothing — harmless, and cheaper than
74
- * asking each display whether it has anything to promote.
75
- */
76
- export function openPromotableDisplays(session) {
77
- const views = isViewContainer(session) ? session.views : [];
78
- return views.flatMap(displaysInView);
79
- }