@jbrowse/core 5.0.0-beta.4 → 5.0.0-beta.7
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/README.md +278 -250
- package/esm/PluginManager.js +1 -1
- package/esm/ReExports/publicUi.d.ts +1 -1
- package/esm/ReExports/publicUi.js +1 -1
- package/esm/ReExports/publicUtil.d.ts +1 -1
- package/esm/ReExports/publicUtil.js +1 -1
- package/esm/ReExports/workerNamespaceNames.js +3 -9
- package/esm/assemblyManager/assemblyConfigSchema.d.ts +2 -1
- package/esm/assemblyManager/assemblyConfigSchema.js +2 -1
- package/esm/assemblyManager/expandAssemblyConfigShorthand.d.ts +15 -15
- package/esm/assemblyManager/expandAssemblyConfigShorthand.js +34 -18
- package/esm/configuration/configurationSchema.d.ts +1 -2
- package/esm/configuration/configurationSchema.js +3 -8
- package/esm/configuration/configurationSlot.d.ts +0 -47
- package/esm/configuration/configurationSlot.js +4 -54
- package/esm/configuration/fillLocations.d.ts +14 -0
- package/esm/configuration/fillLocations.js +14 -0
- package/esm/configuration/fullConfSnapshot.d.ts +0 -15
- package/esm/configuration/fullConfSnapshot.js +0 -28
- package/esm/configuration/getConf.d.ts +4 -34
- package/esm/configuration/getConf.js +3 -38
- package/esm/configuration/index.d.ts +3 -4
- package/esm/configuration/index.js +3 -2
- package/esm/configuration/schemaRegistry.d.ts +1 -2
- package/esm/configuration/schemaRegistry.js +1 -2
- package/esm/configuration/slotFacade.d.ts +1 -16
- package/esm/configuration/slotFacade.js +1 -2
- package/esm/configuration/tabixShorthand.js +3 -3
- package/esm/configuration/types.d.ts +4 -16
- package/esm/data_adapters/CytobandAdapter/configSchema.js +3 -4
- package/esm/pluggableElementTypes/DisplayType.d.ts +5 -3
- package/esm/pluggableElementTypes/DisplayType.js +3 -1
- package/esm/pluggableElementTypes/models/BaseTrackModel.d.ts +30 -0
- package/esm/pluggableElementTypes/models/BaseTrackModel.js +45 -17
- package/esm/rpc/RpcRegistry.d.ts +7 -1
- package/esm/rpc/coreRpcMethods.d.ts +1 -0
- package/esm/rpc/coreRpcMethods.js +1 -0
- package/esm/rpc/methods/CoreEncodeFeatures.d.ts +15 -0
- package/esm/rpc/methods/CoreEncodeFeatures.js +62 -0
- package/esm/svg/svgId.d.ts +1 -1
- package/esm/svg/svgId.js +1 -1
- package/esm/ui/LegendSwatchGlyph.js +26 -21
- package/esm/ui/MenuTypes.d.ts +5 -52
- package/esm/ui/SizeSliderRow.d.ts +1 -3
- package/esm/ui/SizeSliderRow.js +4 -6
- package/esm/ui/SvgColorLegend.d.ts +9 -3
- package/esm/ui/SvgColorLegend.js +74 -33
- package/esm/ui/colorScale.d.ts +64 -0
- package/esm/ui/colorScale.js +41 -0
- package/esm/ui/colors.d.ts +11 -0
- package/esm/ui/colors.js +7 -0
- package/esm/ui/index.d.ts +5 -7
- package/esm/ui/index.js +3 -13
- package/esm/ui/legendMenuItem.d.ts +5 -16
- package/esm/ui/legendMenuItem.js +3 -14
- package/esm/ui/legendSpec.d.ts +11 -5
- package/esm/ui/legendSpec.js +8 -11
- package/esm/ui/makeSizeMenu.d.ts +0 -6
- package/esm/ui/makeSizeMenu.js +6 -30
- package/esm/ui/measureLegendText.js +1 -1
- package/esm/ui/menuItemAdornment.d.ts +9 -19
- package/esm/ui/menuItemAdornment.js +10 -31
- package/esm/ui/menuItems.d.ts +2 -6
- package/esm/ui/menuItems.js +0 -4
- package/esm/ui/palette.js +2 -1
- package/esm/ui/toggleMenuItems.d.ts +6 -13
- package/esm/ui/toggleMenuItems.js +13 -29
- package/esm/util/colorRamp.d.ts +3 -3
- package/esm/util/colorRamp.js +2 -2
- package/esm/util/featureTransforms.d.ts +15 -0
- package/esm/util/featureTransforms.js +342 -0
- package/esm/util/freezeDeep.d.ts +8 -10
- package/esm/util/freezeDeep.js +8 -10
- package/esm/util/glyphNames.d.ts +8 -0
- package/esm/util/glyphNames.js +12 -0
- package/esm/util/index.d.ts +0 -1
- package/esm/util/index.js +0 -1
- package/esm/util/markEncoding.d.ts +76 -0
- package/esm/util/markEncoding.js +436 -0
- package/esm/util/markEncodingTypes.d.ts +331 -0
- package/esm/util/markEncodingTypes.js +8 -0
- package/esm/util/renderToStaticMarkup.js +1 -1
- package/esm/util/starFusion.d.ts +26 -0
- package/esm/util/starFusion.js +37 -0
- package/esm/util/trackConfigDelta.d.ts +4 -8
- package/esm/util/trackConfigDelta.js +2 -4
- package/esm/util/tracks.d.ts +7 -1
- package/esm/util/tracks.js +72 -7
- package/esm/util/types/index.d.ts +12 -4
- package/esm/util/whenViewSettled.d.ts +9 -0
- package/esm/util/whenViewSettled.js +12 -4
- package/package.json +13 -3
- package/esm/configuration/promotableDefaults.d.ts +0 -234
- package/esm/configuration/promotableDefaults.js +0 -395
- package/esm/configuration/promotablePin.d.ts +0 -65
- package/esm/configuration/promotablePin.js +0 -1
- package/esm/configuration/promotableResolve.d.ts +0 -108
- package/esm/configuration/promotableResolve.js +0 -117
- package/esm/configuration/promotableSlots.d.ts +0 -12
- package/esm/configuration/promotableSlots.js +0 -45
- package/esm/configuration/slotShape.d.ts +0 -12
- package/esm/configuration/slotShape.js +0 -84
- package/esm/ui/PinAdornment.d.ts +0 -5
- package/esm/ui/PinAdornment.js +0 -67
- package/esm/ui/SvgGradientLegend.d.ts +0 -26
- package/esm/ui/SvgGradientLegend.js +0 -26
- package/esm/ui/promotablePinCoverage.d.ts +0 -58
- package/esm/ui/promotablePinCoverage.js +0 -124
- package/esm/util/openDisplays.d.ts +0 -23
- package/esm/util/openDisplays.js +0 -79
package/esm/util/openDisplays.js
DELETED
|
@@ -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
|
-
}
|