@jbrowse/core 2.17.0 → 2.18.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.js +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +4 -8
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +22 -25
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +2 -2
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +6 -8
- package/BaseFeatureWidget/BaseFeatureDetail/Position.d.ts +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/index.js +1 -7
- package/BaseFeatureWidget/BaseFeatureDetail/util.js +0 -5
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +0 -7
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +1 -7
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.d.ts +3 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +24 -33
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +3 -6
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.d.ts +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +2 -2
- 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 +1 -56
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.d.ts +3 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +5 -6
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +0 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +0 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.d.ts +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +1 -3
- 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 +2 -5
- 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 +15 -31
- package/PluginManager.js +11 -39
- package/ReExports/DataGrid.js +0 -1
- package/ReExports/list.d.ts +0 -5
- package/ReExports/list.js +0 -5
- package/ReExports/modules.d.ts +22 -20
- package/ReExports/modules.js +16 -25
- package/TextSearch/BaseResults.d.ts +3 -3
- package/TextSearch/TextSearchManager.d.ts +4 -16
- package/TextSearch/TextSearchManager.js +1 -13
- package/assemblyManager/assembly.d.ts +5 -100
- package/assemblyManager/assembly.js +27 -143
- 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 +1 -12
- 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 +1 -2
- 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 +1 -1
- package/data_adapters/dataAdapterCache.d.ts +4 -21
- package/data_adapters/dataAdapterCache.js +0 -19
- package/package.json +3 -4
- 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 +0 -58
- 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 +3 -2
- package/pluggableElementTypes/renderers/CircularChordRendererType.js +1 -6
- 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 +4 -8
- package/pluggableElementTypes/renderers/RendererType.js +1 -5
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +2 -2
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +3 -12
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +1 -1
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +6 -14
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +9 -49
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +7 -57
- 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 +1 -1
- package/stories/examples/WithSequencePanel.js +3 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AppLogo.d.ts +1 -1
- package/ui/AppLogo.js +0 -2
- package/ui/AssemblySelector.d.ts +2 -2
- package/ui/AssemblySelector.js +0 -3
- package/ui/BaseTooltip.js +2 -6
- package/ui/CascadingMenu.d.ts +2 -2
- package/ui/CascadingMenu.js +3 -4
- package/ui/CascadingMenuButton.d.ts +1 -1
- package/ui/CascadingMenuButton.js +1 -1
- package/ui/ColorPicker.js +1 -7
- package/ui/Dialog.d.ts +1 -1
- package/ui/Dialog.js +2 -6
- package/ui/DropDownMenu.d.ts +1 -1
- package/ui/DropDownMenu.js +2 -2
- package/ui/EditableTypography.d.ts +1 -1
- package/ui/EditableTypography.js +1 -5
- package/ui/ErrorBoundary.d.ts +2 -1
- package/ui/ErrorMessage.js +2 -9
- package/ui/ErrorMessageStackTraceDialog.js +2 -10
- package/ui/FactoryResetDialog.js +1 -1
- package/ui/FatalErrorDialog.js +1 -1
- package/ui/FileSelector/FileSelector.d.ts +4 -3
- package/ui/FileSelector/FileSelector.js +40 -40
- package/ui/FileSelector/LocalFileChooser.d.ts +1 -1
- package/ui/FileSelector/LocalFileChooser.js +0 -1
- package/ui/FileSelector/UrlChooser.d.ts +4 -3
- package/ui/FileSelector/UrlChooser.js +5 -3
- package/ui/Icons.d.ts +1 -1
- package/ui/Icons.js +1 -7
- package/ui/LoadingEllipses.d.ts +1 -1
- package/ui/LoadingEllipses.js +3 -3
- package/ui/Menu.d.ts +1 -1
- package/ui/Menu.js +3 -10
- package/ui/MenuButton.d.ts +1 -1
- package/ui/ResizeHandle.js +2 -2
- package/ui/ReturnToImportFormDialog.js +1 -1
- package/ui/SanitizedHTML.js +1 -21
- package/ui/Snackbar.d.ts +2 -2
- package/ui/Snackbar.js +1 -2
- package/ui/SnackbarModel.d.ts +1 -26
- package/ui/SnackbarModel.js +2 -30
- package/ui/colors.d.ts +1 -1
- package/ui/colors.js +1 -1
- package/ui/react-colorful.js +0 -3
- package/ui/theme.d.ts +1 -1
- package/ui/theme.js +0 -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 +16 -164
- package/util/index.js +22 -282
- package/util/io/RemoteFileWithRangeCache.d.ts +3 -2
- package/util/io/RemoteFileWithRangeCache.js +6 -10
- package/util/io/index.d.ts +3 -4
- package/util/io/index.js +3 -17
- 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.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.js +1 -8
- 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 +3 -25
- package/util/tracks.js +0 -30
- 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.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/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,14 @@
|
|
|
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 {
|
|
11
|
-
import {
|
|
7
|
+
import type { BaseOptions } from '../data_adapters/BaseAdapter';
|
|
8
|
+
import type { Buffer } from 'buffer';
|
|
9
|
+
import type { GenericFilehandle } from 'generic-filehandle';
|
|
10
|
+
import type { IAnyStateTreeNode, IStateTreeNode, Instance } from 'mobx-state-tree';
|
|
12
11
|
export * from './types';
|
|
13
|
-
export * from './aborting';
|
|
14
12
|
export * from './when';
|
|
15
13
|
export * from './range';
|
|
16
14
|
export * from './dedupe';
|
|
@@ -21,70 +19,13 @@ export declare function useWidthSetter(view: {
|
|
|
21
19
|
setWidth: (arg: number) => void;
|
|
22
20
|
}, padding: string): React.RefObject<HTMLDivElement>;
|
|
23
21
|
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
22
|
export declare function findParentThat(node: IAnyStateTreeNode, predicate: (thing: IAnyStateTreeNode) => boolean): IAnyStateTreeNode;
|
|
28
23
|
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
24
|
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
25
|
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
26
|
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
27
|
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
28
|
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
29
|
export declare function assembleLocString(region: ParsedLocString): string;
|
|
89
30
|
export declare function assembleLocStringFast(region: ParsedLocString, cb?: (n: number) => string | number): string;
|
|
90
31
|
export interface ParsedLocString {
|
|
@@ -95,59 +36,10 @@ export interface ParsedLocString {
|
|
|
95
36
|
reversed?: boolean;
|
|
96
37
|
}
|
|
97
38
|
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
39
|
export declare function parseLocString(locString: string, isValidRefName: (refName: string, assemblyName?: string) => boolean): ParsedLocString;
|
|
136
40
|
export declare function compareLocs(locA: ParsedLocString, locB: ParsedLocString): number;
|
|
137
41
|
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
42
|
export declare function clamp(num: number, min: number, max: number): number;
|
|
146
|
-
/**
|
|
147
|
-
* @param bp -
|
|
148
|
-
* @param region -
|
|
149
|
-
* @param bpPerPx -
|
|
150
|
-
*/
|
|
151
43
|
export declare function bpToPx(bp: number, { reversed, end, start, }: {
|
|
152
44
|
start?: number;
|
|
153
45
|
end?: number;
|
|
@@ -155,15 +47,7 @@ export declare function bpToPx(bp: number, { reversed, end, start, }: {
|
|
|
155
47
|
}, bpPerPx: number): number;
|
|
156
48
|
export declare function radToDeg(radians: number): number;
|
|
157
49
|
export declare function degToRad(degrees: number): number;
|
|
158
|
-
/**
|
|
159
|
-
* @returns [x, y]
|
|
160
|
-
*/
|
|
161
50
|
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
51
|
export declare function cartesianToPolar(x: number, y: number): [number, number];
|
|
168
52
|
interface MinimalRegion {
|
|
169
53
|
start: number;
|
|
@@ -173,45 +57,15 @@ interface MinimalRegion {
|
|
|
173
57
|
export declare function featureSpanPx(feature: Feature, region: MinimalRegion, bpPerPx: number): readonly [number, number];
|
|
174
58
|
export declare function bpSpanPx(leftBp: number, rightBp: number, region: MinimalRegion, bpPerPx: number): readonly [number, number];
|
|
175
59
|
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
60
|
export declare function findLastIndex<T>(array: T[], predicate: (value: T, index: number, obj: T[]) => boolean): number;
|
|
189
61
|
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
62
|
export declare function renameRegionIfNeeded(refNameMap: Record<string, string> | undefined, region: Region | Instance<typeof MUIRegion>): Region & {
|
|
209
63
|
originalRefName?: string;
|
|
210
64
|
};
|
|
211
65
|
export declare function renameRegionsIfNeeded<ARGTYPE extends {
|
|
212
66
|
assemblyName?: string;
|
|
213
67
|
regions?: Region[];
|
|
214
|
-
|
|
68
|
+
stopToken?: string;
|
|
215
69
|
adapterConfig: Record<string, unknown>;
|
|
216
70
|
sessionId: string;
|
|
217
71
|
statusCallback?: (arg: string) => void;
|
|
@@ -305,12 +159,9 @@ export declare const defaultCodonTable: {
|
|
|
305
159
|
GGG: string;
|
|
306
160
|
GGT: string;
|
|
307
161
|
};
|
|
308
|
-
/**
|
|
309
|
-
* take CodonTable above and generate larger codon table that includes all
|
|
310
|
-
* permutations of upper and lower case nucleotides
|
|
311
|
-
*/
|
|
312
162
|
export declare function generateCodonTable(table: any): Record<string, string>;
|
|
313
163
|
export declare function updateStatus<U>(msg: string, cb: (arg: string) => void, fn: () => U | Promise<U>): Promise<U>;
|
|
164
|
+
export declare function updateStatus2<U>(msg: string, cb: (arg: string) => void, stopToken: string | undefined, fn: () => U | Promise<U>): Promise<U>;
|
|
314
165
|
export declare function hashCode(str: string): number;
|
|
315
166
|
export declare function objectHash(obj: Record<string, any>): string;
|
|
316
167
|
interface VirtualOffset {
|
|
@@ -385,13 +236,12 @@ export declare function mergeIntervals<T extends {
|
|
|
385
236
|
start: number;
|
|
386
237
|
end: number;
|
|
387
238
|
}>(intervals: T[], w?: number): T[];
|
|
388
|
-
interface BasicFeature {
|
|
239
|
+
export interface BasicFeature {
|
|
389
240
|
end: number;
|
|
390
241
|
start: number;
|
|
391
242
|
refName: string;
|
|
392
|
-
assemblyName?: string;
|
|
393
243
|
}
|
|
394
|
-
export declare function gatherOverlaps(regions:
|
|
244
|
+
export declare function gatherOverlaps<T extends BasicFeature>(regions: T[], w?: number): T[];
|
|
395
245
|
export declare function stripAlpha(str: string): string;
|
|
396
246
|
export declare function getStrokeProps(str: string): {
|
|
397
247
|
strokeOpacity: number;
|
|
@@ -406,5 +256,7 @@ export declare function renderToStaticMarkup(node: React.ReactElement, createRoo
|
|
|
406
256
|
}): string;
|
|
407
257
|
export declare function isGzip(buf: Buffer): boolean;
|
|
408
258
|
export declare function fetchAndMaybeUnzip(loc: GenericFilehandle, opts?: BaseOptions): Promise<Buffer>;
|
|
409
|
-
export {
|
|
259
|
+
export { type Feature, type SimpleFeatureSerialized, type SimpleFeatureSerializedNoId, default as SimpleFeature, isFeature, } from './simpleFeature';
|
|
410
260
|
export { blobToDataURL } from './blobToDataURL';
|
|
261
|
+
export { makeAbortableReaction } from './makeAbortableReaction';
|
|
262
|
+
export * from './aborting';
|