@jbrowse/core 2.17.0 → 3.0.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/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +7 -13
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +20 -25
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +3 -7
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +5 -8
- package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +7 -10
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +25 -55
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +3 -4
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +16 -34
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +2 -6
- package/BaseFeatureWidget/BaseFeatureDetail/Position.d.ts +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/Position.js +2 -5
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +3 -5
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +3 -5
- package/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +4 -5
- package/BaseFeatureWidget/BaseFeatureDetail/index.js +6 -14
- package/BaseFeatureWidget/BaseFeatureDetail/util.js +4 -13
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.d.ts +10 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +48 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +33 -41
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +30 -29
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.d.ts +8 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.js +28 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.d.ts +2 -10
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +11 -85
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.d.ts +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +6 -25
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +11 -46
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +101 -96
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +2 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js +49 -53
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.d.ts +2 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +20 -55
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +2 -56
- package/BaseFeatureWidget/SequenceFeatureDetails/model.js +4 -66
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.d.ts +4 -5
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +6 -9
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +6 -7
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +5 -9
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +2 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.d.ts +2 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +3 -10
- package/BaseFeatureWidget/SequenceFeatureDetails/types.d.ts +8 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/types.js +2 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/util.js +1 -5
- package/BaseFeatureWidget/stateModelFactory.d.ts +2 -93
- package/BaseFeatureWidget/stateModelFactory.js +3 -73
- package/BaseFeatureWidget/types.d.ts +3 -3
- package/BaseFeatureWidget/util.js +0 -4
- package/CorePlugin.d.ts +1 -1
- package/CorePlugin.js +19 -12
- package/Plugin.d.ts +2 -5
- package/Plugin.js +0 -3
- package/PluginLoader.d.ts +1 -1
- package/PluginLoader.js +2 -19
- package/PluginManager.d.ts +17 -32
- package/PluginManager.js +15 -41
- package/ReExports/DataGrid.js +0 -1
- package/ReExports/list.d.ts +0 -5
- package/ReExports/list.js +3 -5
- package/ReExports/modules.d.ts +26 -22
- package/ReExports/modules.js +45 -44
- package/TextSearch/BaseResults.d.ts +4 -4
- package/TextSearch/TextSearchManager.d.ts +4 -16
- package/TextSearch/TextSearchManager.js +1 -13
- package/assemblyManager/assembly.d.ts +5 -100
- package/assemblyManager/assembly.js +30 -146
- package/assemblyManager/assemblyConfigSchema.d.ts +1 -34
- package/assemblyManager/assemblyConfigSchema.js +12 -46
- package/assemblyManager/assemblyManager.d.ts +7 -57
- package/assemblyManager/assemblyManager.js +2 -57
- package/configuration/configurationSchema.d.ts +4 -4
- package/configuration/configurationSchema.js +2 -14
- package/configuration/configurationSlot.d.ts +2 -13
- package/configuration/configurationSlot.js +2 -32
- package/configuration/index.d.ts +2 -2
- package/configuration/index.js +2 -2
- package/configuration/types.d.ts +2 -3
- package/configuration/util.d.ts +1 -25
- package/configuration/util.js +19 -56
- package/data_adapters/BaseAdapter/BaseAdapter.d.ts +4 -14
- package/data_adapters/BaseAdapter/BaseAdapter.js +1 -10
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +5 -114
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +3 -79
- package/data_adapters/BaseAdapter/BaseOptions.d.ts +2 -2
- package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.d.ts +2 -2
- package/data_adapters/BaseAdapter/BaseSequenceAdapter.d.ts +3 -6
- package/data_adapters/BaseAdapter/BaseTextSearchAdapter.d.ts +3 -3
- package/data_adapters/BaseAdapter/RegionsAdapter.d.ts +3 -3
- package/data_adapters/BaseAdapter/index.d.ts +4 -4
- package/data_adapters/BaseAdapter/types.d.ts +2 -2
- package/data_adapters/BaseAdapter/util.d.ts +6 -6
- package/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +1 -1
- package/data_adapters/CytobandAdapter/CytobandAdapter.js +2 -6
- package/data_adapters/CytobandAdapter/configSchema.d.ts +0 -3
- package/data_adapters/CytobandAdapter/configSchema.js +1 -7
- package/data_adapters/CytobandAdapter/index.d.ts +1 -1
- package/data_adapters/CytobandAdapter/index.js +21 -8
- package/data_adapters/dataAdapterCache.d.ts +4 -22
- package/data_adapters/dataAdapterCache.js +2 -28
- package/data_adapters/util.d.ts +1 -0
- package/data_adapters/util.js +10 -0
- package/package.json +8 -11
- package/pluggableElementTypes/AdapterType.d.ts +2 -2
- package/pluggableElementTypes/AddTrackWorkflowType.d.ts +2 -2
- package/pluggableElementTypes/ConnectionType.d.ts +3 -3
- package/pluggableElementTypes/DisplayType.d.ts +3 -9
- package/pluggableElementTypes/InternetAccountType.d.ts +2 -2
- package/pluggableElementTypes/PluggableElementBase.d.ts +1 -1
- package/pluggableElementTypes/PluggableElementBase.js +2 -2
- package/pluggableElementTypes/RpcMethodType.d.ts +5 -11
- package/pluggableElementTypes/RpcMethodType.js +7 -19
- package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +9 -0
- package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.js +35 -0
- package/pluggableElementTypes/TextSearchAdapterType.d.ts +2 -2
- package/pluggableElementTypes/TrackType.d.ts +3 -3
- package/pluggableElementTypes/ViewType.d.ts +3 -3
- package/pluggableElementTypes/WidgetType.d.ts +4 -3
- package/pluggableElementTypes/index.d.ts +11 -11
- package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +2 -29
- package/pluggableElementTypes/models/BaseConnectionModelFactory.js +1 -28
- package/pluggableElementTypes/models/BaseDisplayModel.d.ts +3 -83
- package/pluggableElementTypes/models/BaseDisplayModel.js +2 -69
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +4 -46
- package/pluggableElementTypes/models/BaseTrackModel.js +9 -63
- package/pluggableElementTypes/models/BaseViewModel.d.ts +2 -42
- package/pluggableElementTypes/models/BaseViewModel.js +2 -38
- package/pluggableElementTypes/models/InternetAccountModel.d.ts +3 -119
- package/pluggableElementTypes/models/InternetAccountModel.js +3 -123
- package/pluggableElementTypes/models/baseConnectionConfig.d.ts +0 -6
- package/pluggableElementTypes/models/baseConnectionConfig.js +1 -13
- package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +0 -15
- package/pluggableElementTypes/models/baseInternetAccountConfig.js +1 -23
- package/pluggableElementTypes/models/baseTrackConfig.d.ts +2 -53
- package/pluggableElementTypes/models/baseTrackConfig.js +1 -58
- package/pluggableElementTypes/renderers/BoxRendererType.d.ts +7 -15
- package/pluggableElementTypes/renderers/BoxRendererType.js +3 -14
- package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +4 -4
- package/pluggableElementTypes/renderers/CircularChordRendererType.js +3 -8
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.d.ts +6 -21
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +2 -25
- package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +5 -47
- package/pluggableElementTypes/renderers/FeatureRendererType.js +15 -68
- package/pluggableElementTypes/renderers/RendererType.d.ts +5 -9
- package/pluggableElementTypes/renderers/RendererType.js +3 -7
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +3 -4
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +11 -76
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +2 -3
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +10 -74
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +9 -49
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +10 -60
- package/pluggableElementTypes/renderers/index.d.ts +1 -1
- package/pluggableElementTypes/renderers/util/serializableFilterChain.js +1 -3
- package/rpc/BaseRpcDriver.d.ts +3 -4
- package/rpc/BaseRpcDriver.js +20 -80
- package/rpc/MainThreadRpcDriver.d.ts +3 -7
- package/rpc/MainThreadRpcDriver.js +0 -5
- package/rpc/RpcManager.d.ts +3 -3
- package/rpc/RpcManager.js +2 -4
- package/rpc/WebWorkerRpcDriver.d.ts +3 -2
- package/rpc/WebWorkerRpcDriver.js +2 -13
- package/rpc/baseRpcConfig.d.ts +0 -3
- package/rpc/baseRpcConfig.js +1 -7
- package/rpc/configSchema.d.ts +0 -6
- package/rpc/configSchema.js +2 -11
- package/rpc/mainThreadRpcConfig.js +1 -7
- package/rpc/methods/CoreFreeResources.d.ts +0 -6
- package/rpc/methods/CoreFreeResources.js +2 -9
- package/rpc/methods/CoreGetFeatureDensityStats.d.ts +4 -5
- package/rpc/methods/CoreGetFeatureDensityStats.js +1 -1
- package/rpc/methods/CoreGetFeatureDetails.d.ts +2 -7
- package/rpc/methods/CoreGetFeatureDetails.js +0 -5
- package/rpc/methods/CoreGetFeatures.d.ts +5 -5
- package/rpc/methods/CoreGetFeatures.js +4 -5
- package/rpc/methods/CoreGetFileInfo.d.ts +1 -2
- package/rpc/methods/CoreGetFileInfo.js +1 -1
- package/rpc/methods/CoreGetMetadata.d.ts +1 -2
- package/rpc/methods/CoreGetMetadata.js +1 -1
- package/rpc/methods/CoreGetRefNames.d.ts +1 -2
- package/rpc/methods/CoreGetRefNames.js +1 -1
- package/rpc/methods/CoreRender.d.ts +2 -6
- package/rpc/methods/CoreRender.js +5 -7
- package/rpc/methods/util.d.ts +3 -3
- package/rpc/methods/util.js +0 -1
- package/rpc/webWorkerRpcConfig.js +1 -7
- package/stories/JBrowseCore.stories.d.ts +1 -1
- package/stories/JBrowseCore.stories.js +3 -3
- package/stories/examples/WithSequencePanel.d.ts +6 -7
- package/stories/examples/WithSequencePanel.js +9 -9
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AppLogo.d.ts +2 -3
- package/ui/AppLogo.js +2 -7
- package/ui/AssemblySelector.d.ts +5 -5
- package/ui/AssemblySelector.js +11 -36
- package/ui/BaseTooltip.d.ts +1 -2
- package/ui/BaseTooltip.js +10 -17
- package/ui/CascadingMenu.d.ts +3 -4
- package/ui/CascadingMenu.js +18 -57
- package/ui/CascadingMenuButton.d.ts +2 -3
- package/ui/CascadingMenuButton.js +18 -42
- package/ui/ColorPicker.d.ts +3 -4
- package/ui/ColorPicker.js +33 -37
- package/ui/Dialog.d.ts +2 -3
- package/ui/Dialog.js +15 -27
- package/ui/DraggableDialog.d.ts +5 -0
- package/ui/DraggableDialog.js +32 -0
- package/ui/DropDownMenu.d.ts +2 -3
- package/ui/DropDownMenu.js +10 -36
- package/ui/EditableTypography.d.ts +2 -3
- package/ui/EditableTypography.js +30 -59
- package/ui/ErrorBoundary.d.ts +3 -2
- package/ui/ErrorBoundary.js +3 -25
- package/ui/ErrorMessage.d.ts +1 -2
- package/ui/ErrorMessage.js +27 -34
- package/ui/ErrorMessageStackTraceDialog.d.ts +1 -2
- package/ui/ErrorMessageStackTraceDialog.js +13 -54
- package/ui/FactoryResetDialog.d.ts +1 -2
- package/ui/FactoryResetDialog.js +8 -13
- package/ui/FatalErrorDialog.d.ts +1 -2
- package/ui/FatalErrorDialog.js +11 -42
- package/ui/FileSelector/FileSelector.d.ts +5 -5
- package/ui/FileSelector/FileSelector.js +41 -80
- package/ui/FileSelector/LocalFileChooser.d.ts +2 -3
- package/ui/FileSelector/LocalFileChooser.js +17 -29
- package/ui/FileSelector/UrlChooser.d.ts +5 -5
- package/ui/FileSelector/UrlChooser.js +6 -7
- package/ui/Icons.d.ts +10 -11
- package/ui/Icons.js +10 -25
- package/ui/LoadingEllipses.d.ts +2 -3
- package/ui/LoadingEllipses.js +4 -7
- package/ui/Logo.d.ts +2 -3
- package/ui/Logo.js +5 -23
- package/ui/Menu.d.ts +3 -4
- package/ui/Menu.js +85 -122
- package/ui/MenuButton.d.ts +2 -3
- package/ui/MenuButton.js +11 -35
- package/ui/PrerenderedCanvas.d.ts +1 -2
- package/ui/PrerenderedCanvas.js +3 -25
- package/ui/RedErrorMessageBox.d.ts +1 -2
- package/ui/RedErrorMessageBox.js +2 -5
- package/ui/ResizeHandle.d.ts +1 -2
- package/ui/ResizeHandle.js +5 -27
- package/ui/ReturnToImportFormDialog.d.ts +1 -2
- package/ui/ReturnToImportFormDialog.js +8 -13
- package/ui/SanitizedHTML.d.ts +2 -3
- package/ui/SanitizedHTML.js +4 -24
- package/ui/Snackbar.d.ts +3 -4
- package/ui/Snackbar.js +41 -21
- package/ui/SnackbarContents.d.ts +5 -0
- package/ui/SnackbarContents.js +16 -0
- package/ui/SnackbarModel.d.ts +1 -26
- package/ui/SnackbarModel.js +22 -39
- package/ui/colors.d.ts +1 -1
- package/ui/colors.js +2 -2
- package/ui/index.d.ts +0 -2
- package/ui/index.js +1 -5
- package/ui/react-colorful.js +17 -10
- package/ui/theme.d.ts +1 -1
- package/ui/theme.js +7 -40
- package/util/Base1DUtils.d.ts +1 -1
- package/util/Base1DUtils.js +0 -12
- package/util/Base1DViewModel.d.ts +4 -81
- package/util/Base1DViewModel.js +4 -108
- package/util/QuickLRU.js +0 -9
- package/util/TimeTraveller.js +0 -4
- package/util/aborting.d.ts +0 -20
- package/util/aborting.js +0 -31
- package/util/analytics.js +1 -12
- package/util/blockTypes.d.ts +0 -11
- package/util/blockTypes.js +0 -13
- package/util/calculateDynamicBlocks.d.ts +1 -20
- package/util/calculateDynamicBlocks.js +1 -22
- package/util/calculateStaticBlocks.d.ts +2 -2
- package/util/calculateStaticBlocks.js +0 -2
- package/util/color/cssColorsLevel4.js +0 -1
- package/util/color/index.d.ts +0 -19
- package/util/color/index.js +0 -30
- package/util/compositeMap.js +0 -2
- package/util/dedupe.js +0 -1
- package/util/formatFastaStrings.d.ts +0 -13
- package/util/formatFastaStrings.js +0 -13
- package/util/idMaker.d.ts +1 -1
- package/util/idMaker.js +16 -12
- package/util/index.d.ts +27 -173
- package/util/index.js +53 -293
- package/util/io/RemoteFileWithRangeCache.d.ts +4 -5
- package/util/io/RemoteFileWithRangeCache.js +12 -14
- package/util/io/index.d.ts +3 -4
- package/util/io/index.js +5 -19
- package/util/jexl.js +3 -13
- package/util/jexlStrings.d.ts +0 -6
- package/util/jexlStrings.js +0 -8
- package/util/layouts/BaseLayout.d.ts +1 -1
- package/util/layouts/GranularRectLayout.d.ts +1 -17
- package/util/layouts/GranularRectLayout.js +4 -81
- package/util/layouts/MultiLayout.d.ts +1 -6
- package/util/layouts/MultiLayout.js +0 -6
- package/util/layouts/PrecomputedLayout.d.ts +1 -4
- package/util/layouts/PrecomputedLayout.js +0 -5
- package/util/layouts/PrecomputedMultiLayout.js +0 -2
- package/util/layouts/SceneGraph.d.ts +0 -12
- package/util/layouts/SceneGraph.js +0 -13
- package/util/makeAbortableReaction.d.ts +2 -0
- package/util/makeAbortableReaction.js +50 -0
- package/util/map-obj.js +0 -4
- package/util/mst-reflection.d.ts +1 -14
- package/util/mst-reflection.js +1 -28
- package/util/nanoid.d.ts +1 -1
- package/util/nanoid.js +0 -31
- package/util/nextTick.d.ts +1 -0
- package/util/nextTick.js +6 -0
- package/util/offscreenCanvasPonyfill.d.ts +0 -1
- package/util/offscreenCanvasPonyfill.js +1 -9
- package/util/offscreenCanvasUtils.d.ts +2 -3
- package/util/offscreenCanvasUtils.js +22 -21
- package/util/range.d.ts +0 -25
- package/util/range.js +0 -34
- package/util/rxjs.d.ts +3 -7
- package/util/rxjs.js +2 -9
- package/util/simpleFeature.d.ts +0 -50
- package/util/simpleFeature.js +0 -35
- package/util/stats.d.ts +3 -26
- package/util/stats.js +0 -25
- package/util/stopToken.d.ts +3 -0
- package/util/stopToken.js +29 -0
- package/util/tracks.d.ts +4 -26
- package/util/tracks.js +8 -33
- package/util/types/index.d.ts +14 -30
- package/util/types/index.js +5 -14
- package/util/types/mst.js +0 -9
- package/util/types/util.d.ts +2 -9
- package/util/useMeasure.d.ts +1 -1
- package/util/useMeasure.js +0 -1
- package/util/when.d.ts +1 -15
- package/util/when.js +3 -70
- package/rpc/remoteAbortSignals.d.ts +0 -36
- package/rpc/remoteAbortSignals.js +0 -79
package/util/blockTypes.js
CHANGED
|
@@ -24,11 +24,9 @@ class BlockSet {
|
|
|
24
24
|
return this.blocks.map(block => block.toRegion());
|
|
25
25
|
}
|
|
26
26
|
map(func, thisarg) {
|
|
27
|
-
// eslint-disable-next-line unicorn/no-array-method-this-argument
|
|
28
27
|
return this.blocks.map(func, thisarg);
|
|
29
28
|
}
|
|
30
29
|
forEach(func, thisarg) {
|
|
31
|
-
// eslint-disable-next-line unicorn/no-array-method-this-argument
|
|
32
30
|
this.blocks.forEach(func, thisarg);
|
|
33
31
|
}
|
|
34
32
|
get length() {
|
|
@@ -58,9 +56,6 @@ class BlockSet {
|
|
|
58
56
|
}
|
|
59
57
|
exports.BlockSet = BlockSet;
|
|
60
58
|
class BaseBlock {
|
|
61
|
-
/**
|
|
62
|
-
* a block that should be shown as filled with data
|
|
63
|
-
*/
|
|
64
59
|
constructor(data) {
|
|
65
60
|
this.type = 'BaseBlock';
|
|
66
61
|
this.widthPx = 0;
|
|
@@ -90,10 +85,6 @@ class ContentBlock extends BaseBlock {
|
|
|
90
85
|
}
|
|
91
86
|
}
|
|
92
87
|
exports.ContentBlock = ContentBlock;
|
|
93
|
-
/**
|
|
94
|
-
* marker block representing one or more blocks that are
|
|
95
|
-
* too small to be shown at the current zoom level
|
|
96
|
-
*/
|
|
97
88
|
class ElidedBlock extends BaseBlock {
|
|
98
89
|
constructor(data) {
|
|
99
90
|
super(data);
|
|
@@ -110,10 +101,6 @@ class ElidedBlock extends BaseBlock {
|
|
|
110
101
|
}
|
|
111
102
|
}
|
|
112
103
|
exports.ElidedBlock = ElidedBlock;
|
|
113
|
-
/**
|
|
114
|
-
* marker block that sits between two different displayed regions
|
|
115
|
-
* and provides a thick border between them
|
|
116
|
-
*/
|
|
117
104
|
class InterRegionPaddingBlock extends BaseBlock {
|
|
118
105
|
constructor() {
|
|
119
106
|
super(...arguments);
|
|
@@ -1,22 +1,3 @@
|
|
|
1
1
|
import { BlockSet } from './blockTypes';
|
|
2
|
-
import { Base1DViewModel } from './calculateStaticBlocks';
|
|
3
|
-
/**
|
|
4
|
-
* returns a BlockSet of which the `blocks` attribute is an array of 'dynamic
|
|
5
|
-
* blocks', which are blocks representing only the regions that are visible in
|
|
6
|
-
* the view right now. these are mostly used by tracks for which static blocks
|
|
7
|
-
* are not feasible.
|
|
8
|
-
*
|
|
9
|
-
* each block is a plain JS object like:
|
|
10
|
-
* `{ refName, start, end, offsetPx, reversed? }`
|
|
11
|
-
*
|
|
12
|
-
* start and end are in bp, and start is always less than end, but if reversed
|
|
13
|
-
* is true, startBp will be on the right side of the visible region.
|
|
14
|
-
*
|
|
15
|
-
* offsetPx is the number of pixels from the left edge of the view to the left
|
|
16
|
-
* edge of the region
|
|
17
|
-
*
|
|
18
|
-
* NOTE: start, end, and offsetPx may all be fractional!
|
|
19
|
-
*
|
|
20
|
-
* @returns BlockSet of `{ refName, startBp, end, offset, reversed? }`
|
|
21
|
-
*/
|
|
2
|
+
import type { Base1DViewModel } from './calculateStaticBlocks';
|
|
22
3
|
export default function calculateDynamicBlocks(model: Base1DViewModel, padding?: boolean, elision?: boolean): BlockSet;
|
|
@@ -2,28 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = calculateDynamicBlocks;
|
|
4
4
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
5
|
-
const range_1 = require("./range");
|
|
6
5
|
const _1 = require(".");
|
|
7
6
|
const blockTypes_1 = require("./blockTypes");
|
|
8
|
-
|
|
9
|
-
* returns a BlockSet of which the `blocks` attribute is an array of 'dynamic
|
|
10
|
-
* blocks', which are blocks representing only the regions that are visible in
|
|
11
|
-
* the view right now. these are mostly used by tracks for which static blocks
|
|
12
|
-
* are not feasible.
|
|
13
|
-
*
|
|
14
|
-
* each block is a plain JS object like:
|
|
15
|
-
* `{ refName, start, end, offsetPx, reversed? }`
|
|
16
|
-
*
|
|
17
|
-
* start and end are in bp, and start is always less than end, but if reversed
|
|
18
|
-
* is true, startBp will be on the right side of the visible region.
|
|
19
|
-
*
|
|
20
|
-
* offsetPx is the number of pixels from the left edge of the view to the left
|
|
21
|
-
* edge of the region
|
|
22
|
-
*
|
|
23
|
-
* NOTE: start, end, and offsetPx may all be fractional!
|
|
24
|
-
*
|
|
25
|
-
* @returns BlockSet of `{ refName, startBp, end, offset, reversed? }`
|
|
26
|
-
*/
|
|
7
|
+
const range_1 = require("./range");
|
|
27
8
|
function calculateDynamicBlocks(model, padding = true, elision = true) {
|
|
28
9
|
const { offsetPx, displayedRegions, bpPerPx, width, minimumBlockWidth, interRegionPaddingWidth, } = model;
|
|
29
10
|
if (!width) {
|
|
@@ -41,7 +22,6 @@ function calculateDynamicBlocks(model, padding = true, elision = true) {
|
|
|
41
22
|
const parentRegion = (0, mobx_state_tree_1.isStateTreeNode)(region) ? (0, mobx_state_tree_1.getSnapshot)(region) : region;
|
|
42
23
|
const [leftPx, rightPx] = (0, range_1.intersection2)(windowLeftPx, windowRightPx, displayedRegionLeftPx, displayedRegionRightPx);
|
|
43
24
|
if (leftPx !== undefined && rightPx !== undefined) {
|
|
44
|
-
// this displayed region overlaps the view, so make a record for it
|
|
45
25
|
let start;
|
|
46
26
|
let end;
|
|
47
27
|
let isLeftEndOfDisplayedRegion;
|
|
@@ -92,7 +72,6 @@ function calculateDynamicBlocks(model, padding = true, elision = true) {
|
|
|
92
72
|
blocks.push(new blockTypes_1.ContentBlock(blockData));
|
|
93
73
|
}
|
|
94
74
|
if (padding) {
|
|
95
|
-
// insert a inter-region padding block if we are crossing a displayed region
|
|
96
75
|
if (regionWidthPx >= minimumBlockWidth &&
|
|
97
76
|
blockData.isRightEndOfDisplayedRegion &&
|
|
98
77
|
regionNumber < displayedRegions.length - 1) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Instance } from 'mobx-state-tree';
|
|
2
1
|
import { BlockSet } from './blockTypes';
|
|
3
|
-
import { Region } from './types';
|
|
2
|
+
import type { Region } from './types';
|
|
4
3
|
import type { Region as RegionModel } from './types/mst';
|
|
4
|
+
import type { Instance } from 'mobx-state-tree';
|
|
5
5
|
export interface Base1DViewModel {
|
|
6
6
|
offsetPx: number;
|
|
7
7
|
width: number;
|
|
@@ -10,7 +10,6 @@ function calculateStaticBlocks(model, padding = true, elision = true, extra = 0,
|
|
|
10
10
|
const windowRightBp = (offsetPx + modelWidth) * bpPerPx;
|
|
11
11
|
const blockSizePx = width;
|
|
12
12
|
const blockSizeBp = Math.ceil(blockSizePx * bpPerPx);
|
|
13
|
-
// for each displayed region
|
|
14
13
|
let regionBpOffset = 0;
|
|
15
14
|
const blocks = new blockTypes_1.BlockSet();
|
|
16
15
|
for (let regionNumber = 0; regionNumber < displayedRegions.length; regionNumber++) {
|
|
@@ -75,7 +74,6 @@ function calculateStaticBlocks(model, padding = true, elision = true, extra = 0,
|
|
|
75
74
|
blocks.push(new blockTypes_1.ContentBlock(blockData));
|
|
76
75
|
}
|
|
77
76
|
if (padding) {
|
|
78
|
-
// insert a inter-region padding block if we are crossing a displayed region
|
|
79
77
|
if (regionWidthPx >= minimumBlockWidth &&
|
|
80
78
|
blockData.isRightEndOfDisplayedRegion &&
|
|
81
79
|
regionNumber < displayedRegions.length - 1) {
|
package/util/color/index.d.ts
CHANGED
|
@@ -1,23 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Algorithmically pick a contrasting text color that will
|
|
3
|
-
* be visible on top of the given background color. Either
|
|
4
|
-
* black or white.
|
|
5
|
-
*
|
|
6
|
-
* @param color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(),
|
|
7
|
-
* hsl(), hsla(), or named color
|
|
8
|
-
* @returns 'black' or 'white'
|
|
9
|
-
*/
|
|
10
1
|
export declare function contrastingTextColor(color: string): string;
|
|
11
|
-
/**
|
|
12
|
-
* Darken or lighten a color, depending on its luminance.
|
|
13
|
-
* Light colors are darkened, dark colors are lightened.
|
|
14
|
-
* Uses MUI's `emphasize`, but adds support for named colors
|
|
15
|
-
*
|
|
16
|
-
* @param color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(),
|
|
17
|
-
* hsl(), hsla(), or named color
|
|
18
|
-
* @param coefficient - multiplier in the range 0 - 1, defaults to 0.15
|
|
19
|
-
* @returns A CSS color string. Hex input values are returned as rgb
|
|
20
|
-
*/
|
|
21
2
|
export declare function emphasize(color: string, coefficient?: number): string;
|
|
22
3
|
export declare function makeContrasting(foreground: string, background?: string, minContrastRatio?: number): string;
|
|
23
4
|
export { isNamedColor, namedColorToHex } from './cssColorsLevel4';
|
package/util/color/index.js
CHANGED
|
@@ -6,44 +6,14 @@ exports.emphasize = emphasize;
|
|
|
6
6
|
exports.makeContrasting = makeContrasting;
|
|
7
7
|
const styles_1 = require("@mui/material/styles");
|
|
8
8
|
const cssColorsLevel4_1 = require("./cssColorsLevel4");
|
|
9
|
-
/**
|
|
10
|
-
* Algorithmically pick a contrasting text color that will
|
|
11
|
-
* be visible on top of the given background color. Either
|
|
12
|
-
* black or white.
|
|
13
|
-
*
|
|
14
|
-
* @param color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(),
|
|
15
|
-
* hsl(), hsla(), or named color
|
|
16
|
-
* @returns 'black' or 'white'
|
|
17
|
-
*/
|
|
18
9
|
function contrastingTextColor(color) {
|
|
19
10
|
const luminance = getLuminance(color);
|
|
20
11
|
return luminance > 0.5 ? 'black' : 'white';
|
|
21
12
|
}
|
|
22
|
-
/**
|
|
23
|
-
* The relative brightness of any point in a color space,
|
|
24
|
-
* normalized to 0 for darkest black and 1 for lightest white.
|
|
25
|
-
* Uses MUI's `getLuminance`, but adds support for named colors
|
|
26
|
-
*
|
|
27
|
-
* Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
28
|
-
*
|
|
29
|
-
* @param color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(),
|
|
30
|
-
* hsl(), hsla(), or named color
|
|
31
|
-
* @returns The relative brightness of the color in the range 0 - 1
|
|
32
|
-
*/
|
|
33
13
|
function getLuminance(color) {
|
|
34
14
|
const convertedColor = (0, cssColorsLevel4_1.namedColorToHex)(color);
|
|
35
15
|
return (0, styles_1.getLuminance)(convertedColor || color);
|
|
36
16
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Darken or lighten a color, depending on its luminance.
|
|
39
|
-
* Light colors are darkened, dark colors are lightened.
|
|
40
|
-
* Uses MUI's `emphasize`, but adds support for named colors
|
|
41
|
-
*
|
|
42
|
-
* @param color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(),
|
|
43
|
-
* hsl(), hsla(), or named color
|
|
44
|
-
* @param coefficient - multiplier in the range 0 - 1, defaults to 0.15
|
|
45
|
-
* @returns A CSS color string. Hex input values are returned as rgb
|
|
46
|
-
*/
|
|
47
17
|
function emphasize(color, coefficient = 0.15) {
|
|
48
18
|
const convertedColor = (0, cssColorsLevel4_1.namedColorToHex)(color);
|
|
49
19
|
return (0, styles_1.emphasize)(convertedColor || color, coefficient);
|
package/util/compositeMap.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// takes an array or Map or Set (anything iterable with values()) of Maps and
|
|
4
|
-
// lets you query them as one Map
|
|
5
3
|
class CompositeMap {
|
|
6
4
|
constructor(submaps) {
|
|
7
5
|
this.submaps = submaps;
|
package/util/dedupe.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dedupe = dedupe;
|
|
4
|
-
// from https://github.com/seriousManual/dedupe/blob/master/LICENSE
|
|
5
4
|
function dedupe(list, hasher = JSON.stringify) {
|
|
6
5
|
const clone = [];
|
|
7
6
|
const lookup = new Set();
|
|
@@ -2,18 +2,5 @@ export interface SeqChunk {
|
|
|
2
2
|
header: string;
|
|
3
3
|
seq: string;
|
|
4
4
|
}
|
|
5
|
-
/**
|
|
6
|
-
* Returns sequence with new line every 80 characters
|
|
7
|
-
* ref https://stackoverflow.com/a/51506718/2129219
|
|
8
|
-
*
|
|
9
|
-
* @param seqString - string
|
|
10
|
-
* @returns formatted sequence string
|
|
11
|
-
*/
|
|
12
5
|
export declare function formatFastaLines(seqString: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* Formats the sequences chunks into Fasta format
|
|
15
|
-
*
|
|
16
|
-
* @param chunks - array of seq chunks of the form `{ header: string, seq: string }`
|
|
17
|
-
* @returns formatted sequence in fasta format
|
|
18
|
-
*/
|
|
19
6
|
export declare function formatSeqFasta(chunks: SeqChunk[]): string;
|
|
@@ -2,22 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatFastaLines = formatFastaLines;
|
|
4
4
|
exports.formatSeqFasta = formatSeqFasta;
|
|
5
|
-
/**
|
|
6
|
-
* Returns sequence with new line every 80 characters
|
|
7
|
-
* ref https://stackoverflow.com/a/51506718/2129219
|
|
8
|
-
*
|
|
9
|
-
* @param seqString - string
|
|
10
|
-
* @returns formatted sequence string
|
|
11
|
-
*/
|
|
12
5
|
function formatFastaLines(seqString) {
|
|
13
6
|
return seqString.replaceAll(/(.{1,80})/g, '$1\n').trimEnd();
|
|
14
7
|
}
|
|
15
|
-
/**
|
|
16
|
-
* Formats the sequences chunks into Fasta format
|
|
17
|
-
*
|
|
18
|
-
* @param chunks - array of seq chunks of the form `{ header: string, seq: string }`
|
|
19
|
-
* @returns formatted sequence in fasta format
|
|
20
|
-
*/
|
|
21
8
|
function formatSeqFasta(chunks) {
|
|
22
9
|
return chunks
|
|
23
10
|
.map(chunk => `>${chunk.header}\n${formatFastaLines(chunk.seq)}`)
|
package/util/idMaker.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function idMaker(args:
|
|
1
|
+
export default function idMaker(args: Record<string, unknown>, id?: string, len?: number): number;
|
package/util/idMaker.js
CHANGED
|
@@ -2,19 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = idMaker;
|
|
4
4
|
const _1 = require("./");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
function idMaker(args, id = '', len = 5000) {
|
|
6
|
+
const stack = [args];
|
|
7
|
+
while (stack.length) {
|
|
8
|
+
const obj = stack.pop();
|
|
9
|
+
for (const [key, val] of Object.entries(obj)) {
|
|
10
|
+
if (id.length > len) {
|
|
11
|
+
return (0, _1.hashCode)(id);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
if (typeof val === 'object' && val !== null) {
|
|
15
|
+
stack.push(val);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
id += `${key}-${val}`;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
13
21
|
}
|
|
14
|
-
id +=
|
|
15
|
-
typeof args[key] === 'object' && args[key]
|
|
16
|
-
? idMaker(args[key], id)
|
|
17
|
-
: `${key}-${args[key]};`;
|
|
18
22
|
}
|
|
19
23
|
return (0, _1.hashCode)(id);
|
|
20
24
|
}
|
package/util/index.d.ts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PluginManager from '../PluginManager';
|
|
3
|
-
import type {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { Feature } from './simpleFeature';
|
|
7
|
-
import { AssemblyManager, Region, TypeTestedByPredicate } from './types';
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type PluginManager from '../PluginManager';
|
|
3
|
+
import type { BaseBlock } from './blockTypes';
|
|
4
|
+
import type { Feature } from './simpleFeature';
|
|
5
|
+
import type { AssemblyManager, Region, TypeTestedByPredicate } from './types';
|
|
8
6
|
import type { Region as MUIRegion } from './types/mst';
|
|
9
|
-
import {
|
|
10
|
-
import { GenericFilehandle } from 'generic-
|
|
11
|
-
import {
|
|
7
|
+
import type { BaseOptions } from '../data_adapters/BaseAdapter';
|
|
8
|
+
import type { GenericFilehandle } from 'generic-filehandle2';
|
|
9
|
+
import type { IAnyStateTreeNode, IStateTreeNode, Instance } from 'mobx-state-tree';
|
|
12
10
|
export * from './types';
|
|
13
|
-
export * from './aborting';
|
|
14
11
|
export * from './when';
|
|
15
12
|
export * from './range';
|
|
16
13
|
export * from './dedupe';
|
|
@@ -19,72 +16,15 @@ export * from './offscreenCanvasUtils';
|
|
|
19
16
|
export declare function useDebounce<T>(value: T, delay: number): T;
|
|
20
17
|
export declare function useWidthSetter(view: {
|
|
21
18
|
setWidth: (arg: number) => void;
|
|
22
|
-
}, padding: string): React.RefObject<HTMLDivElement>;
|
|
19
|
+
}, padding: string): React.RefObject<HTMLDivElement | null>;
|
|
23
20
|
export declare function useDebouncedCallback<T>(callback: (...args: T[]) => void, wait?: number): (...args: T[]) => void;
|
|
24
|
-
/**
|
|
25
|
-
* find the first node in the hierarchy that matches the given predicate
|
|
26
|
-
*/
|
|
27
21
|
export declare function findParentThat(node: IAnyStateTreeNode, predicate: (thing: IAnyStateTreeNode) => boolean): IAnyStateTreeNode;
|
|
28
22
|
export declare function springAnimate(fromValue: number, toValue: number, setValue: (value: number) => void, onFinish?: () => void, precision?: number, tension?: number, friction?: number, clamp?: boolean): (() => void)[];
|
|
29
|
-
/**
|
|
30
|
-
* find the first node in the hierarchy that matches the given 'is' typescript
|
|
31
|
-
* type guard predicate
|
|
32
|
-
*/
|
|
33
23
|
export declare function findParentThatIs<T extends (a: IAnyStateTreeNode) => boolean>(node: IAnyStateTreeNode, predicate: T): TypeTestedByPredicate<T>;
|
|
34
|
-
/**
|
|
35
|
-
* get the current JBrowse session model, starting at any node in the state
|
|
36
|
-
* tree
|
|
37
|
-
*/
|
|
38
24
|
export declare function getSession(node: IAnyStateTreeNode): import("./types").AbstractSessionModel;
|
|
39
|
-
/**
|
|
40
|
-
* get the state model of the view in the state tree that contains the given
|
|
41
|
-
* node
|
|
42
|
-
*/
|
|
43
25
|
export declare function getContainingView(node: IAnyStateTreeNode): import("./types").AbstractViewModel;
|
|
44
|
-
/**
|
|
45
|
-
* get the state model of the view in the state tree that contains the given
|
|
46
|
-
* node
|
|
47
|
-
*/
|
|
48
26
|
export declare function getContainingTrack(node: IAnyStateTreeNode): import("./types").AbstractTrackModel;
|
|
49
|
-
/**
|
|
50
|
-
* get the state model of the display in the state tree that contains the given
|
|
51
|
-
* node
|
|
52
|
-
*/
|
|
53
27
|
export declare function getContainingDisplay(node: IAnyStateTreeNode): import("./types").AbstractDisplayModel;
|
|
54
|
-
/**
|
|
55
|
-
* Assemble a 1-based "locString" from an interbase genomic location
|
|
56
|
-
* @param region - Region
|
|
57
|
-
* @example
|
|
58
|
-
* ```ts
|
|
59
|
-
* assembleLocString({ refName: 'chr1', start: 0, end: 100 })
|
|
60
|
-
* // ↳ 'chr1:1..100'
|
|
61
|
-
* ```
|
|
62
|
-
* @example
|
|
63
|
-
* ```ts
|
|
64
|
-
* assembleLocString({ assemblyName: 'hg19', refName: 'chr1', start: 0, end: 100 })
|
|
65
|
-
* // ↳ '{hg19}chr1:1..100'
|
|
66
|
-
* ```
|
|
67
|
-
* @example
|
|
68
|
-
* ```ts
|
|
69
|
-
* assembleLocString({ refName: 'chr1' })
|
|
70
|
-
* // ↳ 'chr1'
|
|
71
|
-
* ```
|
|
72
|
-
* @example
|
|
73
|
-
* ```ts
|
|
74
|
-
* assembleLocString({ refName: 'chr1', start: 0 })
|
|
75
|
-
* // ↳ 'chr1:1..'
|
|
76
|
-
* ```
|
|
77
|
-
* @example
|
|
78
|
-
* ```ts
|
|
79
|
-
* assembleLocString({ refName: 'chr1', end: 100 })
|
|
80
|
-
* // ↳ 'chr1:1..100'
|
|
81
|
-
* ```
|
|
82
|
-
* @example
|
|
83
|
-
* ```ts
|
|
84
|
-
* assembleLocString({ refName: 'chr1', start: 0, end: 1 })
|
|
85
|
-
* // ↳ 'chr1:1'
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
28
|
export declare function assembleLocString(region: ParsedLocString): string;
|
|
89
29
|
export declare function assembleLocStringFast(region: ParsedLocString, cb?: (n: number) => string | number): string;
|
|
90
30
|
export interface ParsedLocString {
|
|
@@ -95,59 +35,10 @@ export interface ParsedLocString {
|
|
|
95
35
|
reversed?: boolean;
|
|
96
36
|
}
|
|
97
37
|
export declare function parseLocStringOneBased(locString: string, isValidRefName: (refName: string, assemblyName?: string) => boolean): ParsedLocString;
|
|
98
|
-
/**
|
|
99
|
-
* Parse a 1-based location string into an interbase genomic location
|
|
100
|
-
* @param locString - Location string
|
|
101
|
-
* @param isValidRefName - Function that checks if a refName exists in the set
|
|
102
|
-
* of all known refNames, or in the set of refNames for an assembly if
|
|
103
|
-
* assemblyName is given
|
|
104
|
-
* @example
|
|
105
|
-
* ```ts
|
|
106
|
-
* parseLocString('chr1:1..100', isValidRefName)
|
|
107
|
-
* // ↳ { refName: 'chr1', start: 0, end: 100 }
|
|
108
|
-
* ```
|
|
109
|
-
* @example
|
|
110
|
-
* ```ts
|
|
111
|
-
* parseLocString('chr1:1-100', isValidRefName)
|
|
112
|
-
* // ↳ { refName: 'chr1', start: 0, end: 100 }
|
|
113
|
-
* ```
|
|
114
|
-
* @example
|
|
115
|
-
* ```ts
|
|
116
|
-
* parseLocString(`{hg19}chr1:1..100`, isValidRefName)
|
|
117
|
-
* // ↳ { assemblyName: 'hg19', refName: 'chr1', start: 0, end: 100 }
|
|
118
|
-
* ```
|
|
119
|
-
* @example
|
|
120
|
-
* ```ts
|
|
121
|
-
* parseLocString('chr1', isValidRefName)
|
|
122
|
-
* // ↳ { refName: 'chr1' }
|
|
123
|
-
* ```
|
|
124
|
-
* @example
|
|
125
|
-
* ```ts
|
|
126
|
-
* parseLocString('chr1:1', isValidRefName)
|
|
127
|
-
* // ↳ { refName: 'chr1', start: 0, end: 1 }
|
|
128
|
-
* ```
|
|
129
|
-
* @example
|
|
130
|
-
* ```ts
|
|
131
|
-
* parseLocString('chr1:1..', isValidRefName)
|
|
132
|
-
* // ↳ { refName: 'chr1', start: 0}
|
|
133
|
-
* ```
|
|
134
|
-
*/
|
|
135
38
|
export declare function parseLocString(locString: string, isValidRefName: (refName: string, assemblyName?: string) => boolean): ParsedLocString;
|
|
136
39
|
export declare function compareLocs(locA: ParsedLocString, locB: ParsedLocString): number;
|
|
137
40
|
export declare function compareLocStrings(a: string, b: string, isValidRefName: (refName: string, assemblyName?: string) => boolean): number;
|
|
138
|
-
/**
|
|
139
|
-
* Ensure that a number is at least min and at most max.
|
|
140
|
-
*
|
|
141
|
-
* @param num -
|
|
142
|
-
* @param min -
|
|
143
|
-
* @param max -
|
|
144
|
-
*/
|
|
145
41
|
export declare function clamp(num: number, min: number, max: number): number;
|
|
146
|
-
/**
|
|
147
|
-
* @param bp -
|
|
148
|
-
* @param region -
|
|
149
|
-
* @param bpPerPx -
|
|
150
|
-
*/
|
|
151
42
|
export declare function bpToPx(bp: number, { reversed, end, start, }: {
|
|
152
43
|
start?: number;
|
|
153
44
|
end?: number;
|
|
@@ -155,15 +46,7 @@ export declare function bpToPx(bp: number, { reversed, end, start, }: {
|
|
|
155
46
|
}, bpPerPx: number): number;
|
|
156
47
|
export declare function radToDeg(radians: number): number;
|
|
157
48
|
export declare function degToRad(degrees: number): number;
|
|
158
|
-
/**
|
|
159
|
-
* @returns [x, y]
|
|
160
|
-
*/
|
|
161
49
|
export declare function polarToCartesian(rho: number, theta: number): [number, number];
|
|
162
|
-
/**
|
|
163
|
-
* @param x - the x
|
|
164
|
-
* @param y - the y
|
|
165
|
-
* @returns [rho, theta]
|
|
166
|
-
*/
|
|
167
50
|
export declare function cartesianToPolar(x: number, y: number): [number, number];
|
|
168
51
|
interface MinimalRegion {
|
|
169
52
|
start: number;
|
|
@@ -173,45 +56,15 @@ interface MinimalRegion {
|
|
|
173
56
|
export declare function featureSpanPx(feature: Feature, region: MinimalRegion, bpPerPx: number): readonly [number, number];
|
|
174
57
|
export declare function bpSpanPx(leftBp: number, rightBp: number, region: MinimalRegion, bpPerPx: number): readonly [number, number];
|
|
175
58
|
export declare function iterMap<T, U>(iter: Iterable<T>, func: (arg: T) => U, sizeHint?: number): U[];
|
|
176
|
-
/**
|
|
177
|
-
* Returns the index of the last element in the array where predicate is true,
|
|
178
|
-
* and -1 otherwise. Based on https://stackoverflow.com/a/53187807
|
|
179
|
-
*
|
|
180
|
-
* @param array - The source array to search in
|
|
181
|
-
*
|
|
182
|
-
* @param predicate - find calls predicate once for each element of the array, in
|
|
183
|
-
* descending order, until it finds one where predicate returns true.
|
|
184
|
-
*
|
|
185
|
-
* @returns findLastIndex returns element index where predicate is true.
|
|
186
|
-
* Otherwise, findLastIndex returns -1.
|
|
187
|
-
*/
|
|
188
59
|
export declare function findLastIndex<T>(array: T[], predicate: (value: T, index: number, obj: T[]) => boolean): number;
|
|
189
60
|
export declare function findLast<T>(array: T[], predicate: (value: T, index: number, obj: T[]) => boolean): T | undefined;
|
|
190
|
-
/**
|
|
191
|
-
* makes a mobx reaction with the given functions, that calls actions on the
|
|
192
|
-
* model for each stage of execution, and to abort the reaction function when
|
|
193
|
-
* the model is destroyed.
|
|
194
|
-
*
|
|
195
|
-
* Will call startedFunction(signal), successFunction(result), and
|
|
196
|
-
* errorFunction(error) when the async reaction function starts, completes, and
|
|
197
|
-
* errors respectively.
|
|
198
|
-
*
|
|
199
|
-
* @param self -
|
|
200
|
-
* @param dataFunction -
|
|
201
|
-
* @param asyncReactionFunction -
|
|
202
|
-
* @param reactionOptions -
|
|
203
|
-
* @param startedFunction -
|
|
204
|
-
* @param successFunction -
|
|
205
|
-
* @param errorFunction -
|
|
206
|
-
*/
|
|
207
|
-
export declare function makeAbortableReaction<T, U, V>(self: T, dataFunction: (arg: T) => U, asyncReactionFunction: (arg: U | undefined, signal: AbortSignal, model: T, handle: IReactionPublic) => Promise<V>, reactionOptions: IReactionOptions, startedFunction: (aborter: AbortController) => void, successFunction: (arg: V) => void, errorFunction: (err: unknown) => void): void;
|
|
208
61
|
export declare function renameRegionIfNeeded(refNameMap: Record<string, string> | undefined, region: Region | Instance<typeof MUIRegion>): Region & {
|
|
209
62
|
originalRefName?: string;
|
|
210
63
|
};
|
|
211
64
|
export declare function renameRegionsIfNeeded<ARGTYPE extends {
|
|
212
65
|
assemblyName?: string;
|
|
213
66
|
regions?: Region[];
|
|
214
|
-
|
|
67
|
+
stopToken?: string;
|
|
215
68
|
adapterConfig: Record<string, unknown>;
|
|
216
69
|
sessionId: string;
|
|
217
70
|
statusCallback?: (arg: string) => void;
|
|
@@ -305,12 +158,9 @@ export declare const defaultCodonTable: {
|
|
|
305
158
|
GGG: string;
|
|
306
159
|
GGT: string;
|
|
307
160
|
};
|
|
308
|
-
/**
|
|
309
|
-
* take CodonTable above and generate larger codon table that includes all
|
|
310
|
-
* permutations of upper and lower case nucleotides
|
|
311
|
-
*/
|
|
312
161
|
export declare function generateCodonTable(table: any): Record<string, string>;
|
|
313
162
|
export declare function updateStatus<U>(msg: string, cb: (arg: string) => void, fn: () => U | Promise<U>): Promise<U>;
|
|
163
|
+
export declare function updateStatus2<U>(msg: string, cb: (arg: string) => void, stopToken: string | undefined, fn: () => U | Promise<U>): Promise<U>;
|
|
314
164
|
export declare function hashCode(str: string): number;
|
|
315
165
|
export declare function objectHash(obj: Record<string, any>): string;
|
|
316
166
|
interface VirtualOffset {
|
|
@@ -375,9 +225,9 @@ export declare function getEnv(obj: any): {
|
|
|
375
225
|
};
|
|
376
226
|
export declare function localStorageGetItem(item: string): string | null | undefined;
|
|
377
227
|
export declare function localStorageSetItem(str: string, item: string): void;
|
|
378
|
-
export declare function max(arr: number
|
|
379
|
-
export declare function min(arr: number
|
|
380
|
-
export declare function sum(arr: number
|
|
228
|
+
export declare function max(arr: Iterable<number>, init?: number): number;
|
|
229
|
+
export declare function min(arr: Iterable<number>, init?: number): number;
|
|
230
|
+
export declare function sum(arr: Iterable<number>): number;
|
|
381
231
|
export declare function avg(arr: number[]): number;
|
|
382
232
|
export declare function groupBy<T>(array: Iterable<T>, predicate: (v: T) => string): Record<string, T[]>;
|
|
383
233
|
export declare function notEmpty<T>(value: T | null | undefined): value is T;
|
|
@@ -385,13 +235,12 @@ export declare function mergeIntervals<T extends {
|
|
|
385
235
|
start: number;
|
|
386
236
|
end: number;
|
|
387
237
|
}>(intervals: T[], w?: number): T[];
|
|
388
|
-
interface BasicFeature {
|
|
238
|
+
export interface BasicFeature {
|
|
389
239
|
end: number;
|
|
390
240
|
start: number;
|
|
391
241
|
refName: string;
|
|
392
|
-
assemblyName?: string;
|
|
393
242
|
}
|
|
394
|
-
export declare function gatherOverlaps(regions:
|
|
243
|
+
export declare function gatherOverlaps<T extends BasicFeature>(regions: T[], w?: number): T[];
|
|
395
244
|
export declare function stripAlpha(str: string): string;
|
|
396
245
|
export declare function getStrokeProps(str: string): {
|
|
397
246
|
strokeOpacity: number;
|
|
@@ -401,10 +250,15 @@ export declare function getFillProps(str: string): {
|
|
|
401
250
|
fillOpacity: number;
|
|
402
251
|
fill: string;
|
|
403
252
|
};
|
|
404
|
-
export declare function renderToStaticMarkup(node: React.ReactElement
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
export declare function
|
|
408
|
-
export declare function
|
|
409
|
-
export
|
|
253
|
+
export declare function renderToStaticMarkup(node: React.ReactElement): string;
|
|
254
|
+
export declare function isGzip(buf: Uint8Array): boolean;
|
|
255
|
+
export declare function fetchAndMaybeUnzip(loc: GenericFilehandle, opts?: BaseOptions): Promise<Uint8Array<ArrayBufferLike>>;
|
|
256
|
+
export declare function fetchAndMaybeUnzipText(loc: GenericFilehandle, opts?: BaseOptions): Promise<string>;
|
|
257
|
+
export declare function isObject(x: unknown): x is Record<string | symbol | number, unknown>;
|
|
258
|
+
export declare function localStorageGetNumber(key: string, defaultVal: number): number;
|
|
259
|
+
export declare function localStorageGetBoolean(key: string, defaultVal: boolean): boolean;
|
|
260
|
+
export declare function testAdapter(fileName: string, regex: RegExp, adapterHint: string | undefined, expected: string): boolean;
|
|
261
|
+
export { type Feature, type SimpleFeatureSerialized, type SimpleFeatureSerializedNoId, default as SimpleFeature, isFeature, } from './simpleFeature';
|
|
410
262
|
export { blobToDataURL } from './blobToDataURL';
|
|
263
|
+
export { makeAbortableReaction } from './makeAbortableReaction';
|
|
264
|
+
export * from './aborting';
|