@jbrowse/core 3.6.5 → 4.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/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +32 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +13 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +43 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseAttributes.d.ts +8 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseAttributes.js +7 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +2 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +17 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCoreDetails.d.ts +2 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCoreDetails.js +7 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +20 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +2 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +24 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +57 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +11 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +42 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +24 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Position.d.ts +2 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Position.js +14 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +14 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/UriField.js +22 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +7 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/index.js +24 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/types.d.ts +7 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/types.js +1 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/util.js +26 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.d.ts +10 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +41 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +7 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +44 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.d.ts +7 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +34 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.d.ts +8 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.js +26 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.d.ts +3 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +29 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/consts.d.ts +6 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/consts.js +6 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +11 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +8 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +40 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.d.ts +8 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +105 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +5 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js +64 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.d.ts +6 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +48 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/index.d.ts +1 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/index.js +1 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +31 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/model.js +83 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.d.ts +16 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +83 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.d.ts +8 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +16 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.d.ts +10 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +52 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.d.ts +9 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +21 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.d.ts +10 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +22 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.d.ts +80 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.js +583 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.d.ts +141 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.js +1116 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/types.d.ts +8 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/types.js +1 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/useSequenceData.d.ts +13 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/useSequenceData.js +73 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/util.d.ts +10 -0
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/util.js +42 -0
- package/esm/BaseFeatureWidget/configSchema.d.ts +2 -0
- package/esm/BaseFeatureWidget/configSchema.js +3 -0
- package/esm/BaseFeatureWidget/index.d.ts +2 -0
- package/esm/BaseFeatureWidget/index.js +2 -0
- package/esm/BaseFeatureWidget/stateModelFactory.d.ts +101 -0
- package/esm/BaseFeatureWidget/stateModelFactory.js +96 -0
- package/esm/BaseFeatureWidget/types.d.ts +22 -0
- package/esm/BaseFeatureWidget/types.js +1 -0
- package/esm/BaseFeatureWidget/util.d.ts +51 -0
- package/esm/BaseFeatureWidget/util.js +95 -0
- package/esm/CorePlugin.d.ts +6 -0
- package/esm/CorePlugin.js +24 -0
- package/esm/PhasedScheduler.js +25 -0
- package/esm/Plugin.d.ts +13 -0
- package/esm/Plugin.js +9 -0
- package/esm/PluginLoader.d.ts +64 -0
- package/esm/PluginLoader.js +164 -0
- package/esm/PluginManager.d.ts +125 -0
- package/esm/PluginManager.js +414 -0
- package/esm/ReExports/BaseFeatureDetails.js +9 -0
- package/esm/ReExports/DataGrid.js +1 -0
- package/esm/ReExports/MuiDataGridReExports.js +131 -0
- package/esm/ReExports/MuiReExports.d.ts +134 -0
- package/esm/ReExports/MuiReExports.js +115 -0
- package/esm/ReExports/index.d.ts +1 -0
- package/esm/ReExports/index.js +1 -0
- package/esm/ReExports/lazify.js +10 -0
- package/esm/ReExports/list.js +275 -0
- package/esm/ReExports/modules.js +149 -0
- package/esm/TextSearch/BaseResults.d.ts +46 -0
- package/esm/TextSearch/BaseResults.js +67 -0
- package/esm/TextSearch/TextSearchManager.d.ts +48 -0
- package/esm/TextSearch/TextSearchManager.js +77 -0
- package/esm/assemblyManager/assembly.d.ts +75 -0
- package/esm/assemblyManager/assembly.js +328 -0
- package/esm/assemblyManager/assemblyConfigSchema.d.ts +27 -0
- package/esm/assemblyManager/assemblyConfigSchema.js +51 -0
- package/esm/assemblyManager/assemblyManager.d.ts +528 -0
- package/esm/assemblyManager/assemblyManager.js +131 -0
- package/esm/assemblyManager/index.d.ts +3 -0
- package/esm/assemblyManager/index.js +2 -0
- package/esm/configuration/configurationSchema.d.ts +37 -0
- package/esm/configuration/configurationSchema.js +230 -0
- package/esm/configuration/configurationSlot.d.ts +33 -0
- package/esm/configuration/configurationSlot.js +239 -0
- package/esm/configuration/index.d.ts +3 -0
- package/esm/configuration/index.js +2 -0
- package/esm/configuration/types.d.ts +14 -0
- package/esm/configuration/types.js +1 -0
- package/esm/configuration/util.d.ts +10 -0
- package/esm/configuration/util.js +123 -0
- package/esm/data_adapters/BaseAdapter/BaseAdapter.d.ts +16 -0
- package/esm/data_adapters/BaseAdapter/BaseAdapter.js +31 -0
- package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +24 -0
- package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +68 -0
- package/esm/data_adapters/BaseAdapter/BaseOptions.d.ts +18 -0
- package/esm/data_adapters/BaseAdapter/BaseOptions.js +1 -0
- package/esm/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.d.ts +10 -0
- package/esm/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.js +1 -0
- package/esm/data_adapters/BaseAdapter/BaseSequenceAdapter.d.ts +11 -0
- package/esm/data_adapters/BaseAdapter/BaseSequenceAdapter.js +12 -0
- package/esm/data_adapters/BaseAdapter/BaseTextSearchAdapter.d.ts +6 -0
- package/esm/data_adapters/BaseAdapter/BaseTextSearchAdapter.js +1 -0
- package/esm/data_adapters/BaseAdapter/RegionsAdapter.d.ts +6 -0
- package/esm/data_adapters/BaseAdapter/RegionsAdapter.js +1 -0
- package/esm/data_adapters/BaseAdapter/index.d.ts +13 -0
- package/esm/data_adapters/BaseAdapter/index.js +5 -0
- package/esm/data_adapters/BaseAdapter/stats.d.ts +10 -0
- package/esm/data_adapters/BaseAdapter/stats.js +48 -0
- package/esm/data_adapters/BaseAdapter/types.d.ts +23 -0
- package/esm/data_adapters/BaseAdapter/types.js +1 -0
- package/esm/data_adapters/BaseAdapter/util.d.ts +12 -0
- package/esm/data_adapters/BaseAdapter/util.js +15 -0
- package/esm/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +6 -0
- package/esm/data_adapters/CytobandAdapter/CytobandAdapter.js +28 -0
- package/esm/data_adapters/CytobandAdapter/configSchema.d.ts +9 -0
- package/esm/data_adapters/CytobandAdapter/configSchema.js +24 -0
- package/esm/data_adapters/CytobandAdapter/index.d.ts +2 -0
- package/esm/data_adapters/CytobandAdapter/index.js +12 -0
- package/esm/data_adapters/dataAdapterCache.d.ts +14 -0
- package/esm/data_adapters/dataAdapterCache.js +54 -0
- package/esm/data_adapters/util.js +4 -0
- package/esm/pluggableElementTypes/AdapterType.d.ts +25 -0
- package/esm/pluggableElementTypes/AdapterType.js +17 -0
- package/esm/pluggableElementTypes/AddTrackWorkflowType.d.ts +17 -0
- package/esm/pluggableElementTypes/AddTrackWorkflowType.js +10 -0
- package/esm/pluggableElementTypes/ConnectionType.d.ts +20 -0
- package/esm/pluggableElementTypes/ConnectionType.js +16 -0
- package/esm/pluggableElementTypes/DisplayType.d.ts +30 -0
- package/esm/pluggableElementTypes/DisplayType.js +20 -0
- package/esm/pluggableElementTypes/GlyphType.d.ts +43 -0
- package/esm/pluggableElementTypes/GlyphType.js +18 -0
- package/esm/pluggableElementTypes/InternetAccountType.d.ts +12 -0
- package/esm/pluggableElementTypes/InternetAccountType.js +10 -0
- package/esm/pluggableElementTypes/PluggableElementBase.js +11 -0
- package/esm/pluggableElementTypes/RpcMethodType.d.ts +19 -0
- package/esm/pluggableElementTypes/RpcMethodType.js +88 -0
- package/esm/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +11 -0
- package/esm/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.js +28 -0
- package/esm/pluggableElementTypes/TextSearchAdapterType.d.ts +18 -0
- package/esm/pluggableElementTypes/TextSearchAdapterType.js +15 -0
- package/esm/pluggableElementTypes/TrackType.d.ts +16 -0
- package/esm/pluggableElementTypes/TrackType.js +14 -0
- package/esm/pluggableElementTypes/ViewType.d.ts +29 -0
- package/esm/pluggableElementTypes/ViewType.js +18 -0
- package/esm/pluggableElementTypes/WidgetType.d.ts +27 -0
- package/esm/pluggableElementTypes/WidgetType.js +18 -0
- package/esm/pluggableElementTypes/index.d.ts +27 -0
- package/esm/pluggableElementTypes/index.js +14 -0
- package/esm/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +29 -0
- package/esm/pluggableElementTypes/models/BaseConnectionModelFactory.js +35 -0
- package/esm/pluggableElementTypes/models/BaseDisplayModel.d.ts +180 -0
- package/esm/pluggableElementTypes/models/BaseDisplayModel.js +104 -0
- package/esm/pluggableElementTypes/models/BaseTrackModel.d.ts +74 -0
- package/esm/pluggableElementTypes/models/BaseTrackModel.js +203 -0
- package/esm/pluggableElementTypes/models/BaseViewModel.d.ts +52 -0
- package/esm/pluggableElementTypes/models/BaseViewModel.js +42 -0
- package/esm/pluggableElementTypes/models/InternetAccountModel.d.ts +86 -0
- package/esm/pluggableElementTypes/models/InternetAccountModel.js +151 -0
- package/esm/pluggableElementTypes/models/baseConnectionConfig.d.ts +16 -0
- package/esm/pluggableElementTypes/models/baseConnectionConfig.js +18 -0
- package/esm/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +27 -0
- package/esm/pluggableElementTypes/models/baseInternetAccountConfig.js +32 -0
- package/esm/pluggableElementTypes/models/baseTrackConfig.d.ts +87 -0
- package/esm/pluggableElementTypes/models/baseTrackConfig.js +134 -0
- package/esm/pluggableElementTypes/models/components/SaveTrackData.d.ts +11 -0
- package/esm/pluggableElementTypes/models/components/SaveTrackData.js +158 -0
- package/esm/pluggableElementTypes/models/index.d.ts +14 -0
- package/esm/pluggableElementTypes/models/index.js +8 -0
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/bed.d.ts +4 -0
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/bed.js +9 -0
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/fetchSequence.d.ts +5 -0
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/fetchSequence.js +17 -0
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/genbank.d.ts +7 -0
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/genbank.js +108 -0
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/gff3.d.ts +5 -0
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/gff3.js +91 -0
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/types.d.ts +11 -0
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/types.js +1 -0
- package/esm/pluggableElementTypes/renderers/BoxRendererType.d.ts +52 -0
- package/esm/pluggableElementTypes/renderers/BoxRendererType.js +78 -0
- package/esm/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +4 -0
- package/esm/pluggableElementTypes/renderers/CircularChordRendererType.js +4 -0
- package/esm/pluggableElementTypes/renderers/FeatureRendererType.d.ts +58 -0
- package/esm/pluggableElementTypes/renderers/FeatureRendererType.js +77 -0
- package/esm/pluggableElementTypes/renderers/LayoutSession.d.ts +31 -0
- package/esm/pluggableElementTypes/renderers/LayoutSession.js +37 -0
- package/esm/pluggableElementTypes/renderers/RendererType.d.ts +28 -0
- package/esm/pluggableElementTypes/renderers/RendererType.js +20 -0
- package/esm/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +57 -0
- package/esm/pluggableElementTypes/renderers/ServerSideRendererType.js +113 -0
- package/esm/pluggableElementTypes/renderers/index.d.ts +6 -0
- package/esm/pluggableElementTypes/renderers/index.js +6 -0
- package/esm/pluggableElementTypes/renderers/util/serializableFilterChain.js +30 -0
- package/esm/pluggableElementTypes/renderers/util.d.ts +3 -0
- package/esm/pluggableElementTypes/renderers/util.js +14 -0
- package/esm/rpc/BaseRpcDriver.d.ts +40 -0
- package/esm/rpc/BaseRpcDriver.js +116 -0
- package/esm/rpc/MainThreadRpcDriver.d.ts +14 -0
- package/esm/rpc/MainThreadRpcDriver.js +33 -0
- package/esm/rpc/RpcManager.d.ts +35 -0
- package/esm/rpc/RpcManager.js +63 -0
- package/esm/rpc/WebWorkerRpcDriver.d.ts +31 -0
- package/esm/rpc/WebWorkerRpcDriver.js +77 -0
- package/esm/rpc/baseRpcConfig.d.ts +8 -0
- package/esm/rpc/baseRpcConfig.js +10 -0
- package/esm/rpc/configSchema.d.ts +9 -0
- package/esm/rpc/configSchema.js +22 -0
- package/esm/rpc/coreRpcMethods.d.ts +12 -0
- package/esm/rpc/coreRpcMethods.js +12 -0
- package/esm/rpc/mainThreadRpcConfig.d.ts +8 -0
- package/esm/rpc/mainThreadRpcConfig.js +8 -0
- package/esm/rpc/methods/CoreFreeResources.d.ts +6 -0
- package/esm/rpc/methods/CoreFreeResources.js +14 -0
- package/esm/rpc/methods/CoreGetExportData.d.ts +19 -0
- package/esm/rpc/methods/CoreGetExportData.js +18 -0
- package/esm/rpc/methods/CoreGetFeatureDensityStats.d.ts +17 -0
- package/esm/rpc/methods/CoreGetFeatureDensityStats.js +25 -0
- package/esm/rpc/methods/CoreGetFeatureDetails.d.ts +11 -0
- package/esm/rpc/methods/CoreGetFeatureDetails.js +24 -0
- package/esm/rpc/methods/CoreGetFeatures.d.ts +18 -0
- package/esm/rpc/methods/CoreGetFeatures.js +31 -0
- package/esm/rpc/methods/CoreGetFileInfo.d.ts +9 -0
- package/esm/rpc/methods/CoreGetFileInfo.js +15 -0
- package/esm/rpc/methods/CoreGetMetadata.d.ts +9 -0
- package/esm/rpc/methods/CoreGetMetadata.js +15 -0
- package/esm/rpc/methods/CoreGetRefNames.d.ts +10 -0
- package/esm/rpc/methods/CoreGetRefNames.js +19 -0
- package/esm/rpc/methods/CoreGetRegions.d.ts +8 -0
- package/esm/rpc/methods/CoreGetRegions.js +15 -0
- package/esm/rpc/methods/CoreGetSequence.d.ts +13 -0
- package/esm/rpc/methods/CoreGetSequence.js +17 -0
- package/esm/rpc/methods/CoreRender.d.ts +14 -0
- package/esm/rpc/methods/CoreRender.js +35 -0
- package/esm/rpc/methods/CoreSaveFeatureData.d.ts +16 -0
- package/esm/rpc/methods/CoreSaveFeatureData.js +32 -0
- package/esm/rpc/methods/util.d.ts +15 -0
- package/esm/rpc/methods/util.js +7 -0
- package/esm/rpc/webWorkerRpcConfig.d.ts +8 -0
- package/esm/rpc/webWorkerRpcConfig.js +8 -0
- package/esm/ui/AppLogo.d.ts +7 -0
- package/esm/ui/AppLogo.js +10 -0
- package/esm/ui/AssemblySelector.d.ts +13 -0
- package/esm/ui/AssemblySelector.js +39 -0
- package/esm/ui/BaseTooltip.d.ts +8 -0
- package/esm/ui/BaseTooltip.js +42 -0
- package/esm/ui/CascadingMenu.d.ts +30 -0
- package/esm/ui/CascadingMenu.js +48 -0
- package/esm/ui/CascadingMenuButton.d.ts +26 -0
- package/esm/ui/CascadingMenuButton.js +24 -0
- package/esm/ui/CascadingMenuHelpDialog.d.ts +5 -0
- package/esm/ui/CascadingMenuHelpDialog.js +10 -0
- package/esm/ui/CascadingMenuHelpIconButton.d.ts +5 -0
- package/esm/ui/CascadingMenuHelpIconButton.js +15 -0
- package/esm/ui/ColorPicker.js +62 -0
- package/esm/ui/ConfirmDialog.d.ts +10 -0
- package/esm/ui/ConfirmDialog.js +13 -0
- package/esm/ui/DataGridFlexContainer.d.ts +5 -0
- package/esm/ui/DataGridFlexContainer.js +12 -0
- package/esm/ui/Dialog.d.ts +7 -0
- package/esm/ui/Dialog.js +45 -0
- package/esm/ui/DraggableDialog.js +27 -0
- package/esm/ui/DropDownMenu.d.ts +6 -0
- package/esm/ui/DropDownMenu.js +24 -0
- package/esm/ui/EditableTypography.js +60 -0
- package/esm/ui/ErrorBoundary.d.ts +17 -0
- package/esm/ui/ErrorBoundary.js +16 -0
- package/esm/ui/ErrorMessage.js +56 -0
- package/esm/ui/ErrorMessageStackTraceContents.d.ts +4 -0
- package/esm/ui/ErrorMessageStackTraceContents.js +25 -0
- package/esm/ui/ErrorMessageStackTraceDialog.js +108 -0
- package/esm/ui/ExternalLink.js +7 -0
- package/esm/ui/FactoryResetDialog.js +18 -0
- package/esm/ui/FatalErrorDialog.js +18 -0
- package/esm/ui/FileSelector/FileSelector.d.ts +11 -0
- package/esm/ui/FileSelector/FileSelector.js +52 -0
- package/esm/ui/FileSelector/LocalFileChooser.d.ts +6 -0
- package/esm/ui/FileSelector/LocalFileChooser.js +39 -0
- package/esm/ui/FileSelector/LocationInput.d.ts +9 -0
- package/esm/ui/FileSelector/LocationInput.js +15 -0
- package/esm/ui/FileSelector/SourceTypeSelector.d.ts +9 -0
- package/esm/ui/FileSelector/SourceTypeSelector.js +38 -0
- package/esm/ui/FileSelector/UrlChooser.d.ts +8 -0
- package/esm/ui/FileSelector/UrlChooser.js +17 -0
- package/esm/ui/FileSelector/index.d.ts +1 -0
- package/esm/ui/FileSelector/index.js +1 -0
- package/esm/ui/FileSelector/useInternetAccounts.d.ts +178 -0
- package/esm/ui/FileSelector/useInternetAccounts.js +18 -0
- package/esm/ui/HoverMenu.js +15 -0
- package/esm/ui/Icons.js +14 -0
- package/esm/ui/LoadingEllipses.d.ts +7 -0
- package/esm/ui/LoadingEllipses.js +31 -0
- package/esm/ui/Logo.js +42 -0
- package/esm/ui/Menu.d.ts +2 -0
- package/esm/ui/Menu.js +1 -0
- package/esm/ui/MenuButton.d.ts +1 -0
- package/esm/ui/MenuButton.js +1 -0
- package/esm/ui/MenuItems.d.ts +15 -0
- package/esm/ui/MenuItems.js +59 -0
- package/esm/ui/MenuTypes.d.ts +39 -0
- package/esm/ui/MenuTypes.js +1 -0
- package/esm/ui/PrerenderedCanvas.d.ts +10 -0
- package/esm/ui/PrerenderedCanvas.js +33 -0
- package/esm/ui/RedErrorMessageBox.js +16 -0
- package/esm/ui/ResizeHandle.js +67 -0
- package/esm/ui/ReturnToImportFormDialog.js +13 -0
- package/esm/ui/SanitizedHTML.js +61 -0
- package/esm/ui/Snackbar.d.ts +10 -0
- package/esm/ui/Snackbar.js +14 -0
- package/esm/ui/SnackbarContents.d.ts +5 -0
- package/esm/ui/SnackbarContents.js +11 -0
- package/esm/ui/SnackbarModel.d.ts +17 -0
- package/esm/ui/SnackbarModel.js +55 -0
- package/esm/ui/colors.js +67 -0
- package/esm/ui/index.d.ts +20 -0
- package/esm/ui/index.js +20 -0
- package/esm/ui/react-colorful.d.ts +3 -0
- package/esm/ui/react-colorful.js +416 -0
- package/esm/ui/theme.d.ts +58 -0
- package/esm/ui/theme.js +392 -0
- package/esm/ui/useEvent.js +10 -0
- package/esm/util/Base1DUtils.d.ts +38 -0
- package/esm/util/Base1DUtils.js +205 -0
- package/esm/util/Base1DViewModel.d.ts +61 -0
- package/esm/util/Base1DViewModel.js +129 -0
- package/esm/util/QuickLRU/index.d.ts +1 -0
- package/esm/util/QuickLRU/index.js +1 -0
- package/esm/util/TimeTraveller.d.ts +19 -0
- package/esm/util/TimeTraveller.js +94 -0
- package/esm/util/aborting.js +42 -0
- package/esm/util/analytics.js +80 -0
- package/esm/util/blobToDataURL.js +14 -0
- package/esm/util/blockTypes.d.ts +59 -0
- package/esm/util/blockTypes.js +119 -0
- package/esm/util/calculateDynamicBlocks.d.ts +3 -0
- package/esm/util/calculateDynamicBlocks.js +104 -0
- package/esm/util/calculateStaticBlocks.d.ts +13 -0
- package/esm/util/calculateStaticBlocks.js +106 -0
- package/esm/util/coarseStripHTML.d.ts +1 -0
- package/esm/util/coarseStripHTML.js +17 -0
- package/esm/util/color/cssColorsLevel4.js +156 -0
- package/esm/util/color/index.d.ts +5 -0
- package/esm/util/color/index.js +39 -0
- package/esm/util/colord.d.ts +9 -0
- package/esm/util/colord.js +14 -0
- package/esm/util/compositeMap.d.ts +11 -0
- package/esm/util/compositeMap.js +59 -0
- package/esm/util/convertCodingSequenceToPeptides.d.ts +6 -0
- package/esm/util/convertCodingSequenceToPeptides.js +9 -0
- package/esm/util/dedupe.js +12 -0
- package/esm/util/fetchSeq.d.ts +8 -0
- package/esm/util/fetchSeq.js +23 -0
- package/esm/util/flatbush/index.d.ts +25 -0
- package/esm/util/flatbush/index.js +423 -0
- package/esm/util/flatqueue/index.d.ts +11 -0
- package/esm/util/flatqueue/index.js +61 -0
- package/esm/util/formatFastaStrings.js +8 -0
- package/esm/util/idMaker.js +21 -0
- package/esm/util/index.d.ts +271 -0
- package/esm/util/index.js +873 -0
- package/esm/util/io/RemoteFileWithRangeCache.js +71 -0
- package/esm/util/io/index.d.ts +7 -0
- package/esm/util/io/index.js +92 -0
- package/esm/util/isWebWorker.d.ts +1 -0
- package/esm/util/isWebWorker.js +4 -0
- package/esm/util/jexl.d.ts +2 -0
- package/esm/util/jexl.js +49 -0
- package/esm/util/jexlStrings.js +17 -0
- package/esm/util/layouts/BaseLayout.d.ts +30 -0
- package/esm/util/layouts/BaseLayout.js +1 -0
- package/esm/util/layouts/GranularRectLayout.d.ts +37 -0
- package/esm/util/layouts/GranularRectLayout.js +418 -0
- package/esm/util/layouts/MultiLayout.d.ts +12 -0
- package/esm/util/layouts/MultiLayout.js +40 -0
- package/esm/util/layouts/PileupLayout.d.ts +41 -0
- package/esm/util/layouts/PileupLayout.js +202 -0
- package/esm/util/layouts/PrecomputedLayout.d.ts +30 -0
- package/esm/util/layouts/PrecomputedLayout.js +71 -0
- package/esm/util/layouts/SceneGraph.js +121 -0
- package/esm/util/layouts/index.d.ts +8 -0
- package/esm/util/layouts/index.js +6 -0
- package/esm/util/layouts/intervalUtils.d.ts +3 -0
- package/esm/util/layouts/intervalUtils.js +63 -0
- package/esm/util/librpc.d.ts +2 -0
- package/esm/util/librpc.js +1 -0
- package/esm/util/linkify.d.ts +1 -0
- package/esm/util/linkify.js +5 -0
- package/esm/util/locString.d.ts +9 -0
- package/esm/util/locString.js +62 -0
- package/esm/util/makeAbortableReaction.d.ts +3 -0
- package/esm/util/makeAbortableReaction.js +47 -0
- package/esm/util/map-obj/index.d.ts +13 -0
- package/esm/util/map-obj/index.js +92 -0
- package/esm/util/mst-reflection.d.ts +11 -0
- package/esm/util/mst-reflection.js +54 -0
- package/esm/util/nanoid.d.ts +5 -0
- package/esm/util/nanoid.js +36 -0
- package/esm/util/nextTick.js +3 -0
- package/esm/util/offscreenCanvasGetSerializingSvg.d.ts +5 -0
- package/esm/util/offscreenCanvasGetSerializingSvg.js +9 -0
- package/esm/util/offscreenCanvasPonyfill.d.ts +5 -0
- package/esm/util/offscreenCanvasPonyfill.js +57 -0
- package/esm/util/offscreenCanvasUtils.d.ts +12 -0
- package/esm/util/offscreenCanvasUtils.js +19 -0
- package/esm/util/parseLineByLine.js +22 -0
- package/esm/util/range.js +21 -0
- package/esm/util/renderToAbstractCanvas.d.ts +17 -0
- package/esm/util/renderToAbstractCanvas.js +53 -0
- package/esm/util/rpc.d.ts +2 -0
- package/esm/util/rpc.js +6 -0
- package/esm/util/rxjs.d.ts +4 -0
- package/esm/util/rxjs.js +16 -0
- package/esm/util/simpleFeature.d.ts +44 -0
- package/esm/util/simpleFeature.js +81 -0
- package/esm/util/stats.d.ts +23 -0
- package/esm/util/stats.js +72 -0
- package/esm/util/stopToken.d.ts +19 -0
- package/esm/util/stopToken.js +90 -0
- package/esm/util/tracks.d.ts +72 -0
- package/esm/util/tracks.js +214 -0
- package/esm/util/transferables.d.ts +2 -0
- package/esm/util/transferables.js +35 -0
- package/esm/util/tss-react/cssAndCx.d.ts +16 -0
- package/esm/util/tss-react/cssAndCx.js +97 -0
- package/esm/util/tss-react/index.d.ts +4 -0
- package/esm/util/tss-react/index.js +7 -0
- package/esm/util/tss-react/makeStyles.d.ts +15 -0
- package/esm/util/tss-react/makeStyles.js +38 -0
- package/esm/util/tss-react/mergeClasses.d.ts +2 -0
- package/esm/util/tss-react/mergeClasses.js +24 -0
- package/esm/util/tss-react/mui/index.d.ts +1 -0
- package/esm/util/tss-react/mui/index.js +1 -0
- package/esm/util/tss-react/mui/mui.d.ts +10 -0
- package/esm/util/tss-react/mui/mui.js +5 -0
- package/esm/util/tss-react/tools/classnames.d.ts +2 -0
- package/esm/util/tss-react/tools/classnames.js +44 -0
- package/esm/util/tss-react/tools/getDependencyArrayRef.d.ts +1 -0
- package/esm/util/tss-react/tools/getDependencyArrayRef.js +19 -0
- package/esm/util/tss-react/types.d.ts +13 -0
- package/esm/util/tss-react/types.js +6 -0
- package/esm/util/types/ElementId.d.ts +1 -0
- package/esm/util/types/ElementId.js +3 -0
- package/esm/util/types/index.d.ts +273 -0
- package/esm/util/types/index.js +131 -0
- package/esm/util/types/mst.d.ts +107 -0
- package/esm/util/types/mst.js +68 -0
- package/esm/util/types/util.d.ts +6 -0
- package/esm/util/types/util.js +1 -0
- package/esm/util/useFeatureSequence.d.ts +19 -0
- package/esm/util/useFeatureSequence.js +87 -0
- package/esm/util/useMeasure.js +30 -0
- package/esm/util/when.js +1 -0
- package/package.json +487 -39
- package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +0 -38
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +0 -13
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +0 -48
- package/BaseFeatureWidget/BaseFeatureDetail/BaseAttributes.d.ts +0 -8
- package/BaseFeatureWidget/BaseFeatureDetail/BaseAttributes.js +0 -13
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +0 -2
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +0 -23
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCoreDetails.d.ts +0 -2
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCoreDetails.js +0 -13
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +0 -23
- package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +0 -2
- package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +0 -30
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +0 -63
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +0 -11
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +0 -48
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +0 -27
- package/BaseFeatureWidget/BaseFeatureDetail/Position.d.ts +0 -2
- package/BaseFeatureWidget/BaseFeatureDetail/Position.js +0 -17
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +0 -20
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +0 -28
- package/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +0 -7
- package/BaseFeatureWidget/BaseFeatureDetail/index.js +0 -34
- package/BaseFeatureWidget/BaseFeatureDetail/types.d.ts +0 -7
- package/BaseFeatureWidget/BaseFeatureDetail/types.js +0 -2
- package/BaseFeatureWidget/BaseFeatureDetail/util.js +0 -32
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.d.ts +0 -10
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +0 -48
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +0 -7
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +0 -74
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.d.ts +0 -7
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +0 -72
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.d.ts +0 -8
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.js +0 -28
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.d.ts +0 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +0 -34
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +0 -17
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +0 -8
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +0 -40
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.d.ts +0 -8
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +0 -141
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +0 -5
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js +0 -66
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.d.ts +0 -6
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +0 -50
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.d.ts +0 -10
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +0 -65
- package/BaseFeatureWidget/SequenceFeatureDetails/index.d.ts +0 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/index.js +0 -8
- package/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +0 -28
- package/BaseFeatureWidget/SequenceFeatureDetails/model.js +0 -81
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.d.ts +0 -16
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +0 -88
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.d.ts +0 -8
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +0 -20
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.d.ts +0 -10
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +0 -56
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.d.ts +0 -9
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +0 -25
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.d.ts +0 -10
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +0 -25
- package/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.d.ts +0 -80
- package/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.js +0 -585
- package/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.d.ts +0 -141
- package/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.js +0 -1118
- package/BaseFeatureWidget/SequenceFeatureDetails/types.d.ts +0 -8
- package/BaseFeatureWidget/SequenceFeatureDetails/types.js +0 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/util.d.ts +0 -17
- package/BaseFeatureWidget/SequenceFeatureDetails/util.js +0 -49
- package/BaseFeatureWidget/configSchema.d.ts +0 -2
- package/BaseFeatureWidget/configSchema.js +0 -6
- package/BaseFeatureWidget/index.d.ts +0 -2
- package/BaseFeatureWidget/index.js +0 -7
- package/BaseFeatureWidget/stateModelFactory.d.ts +0 -101
- package/BaseFeatureWidget/stateModelFactory.js +0 -99
- package/BaseFeatureWidget/types.d.ts +0 -22
- package/BaseFeatureWidget/types.js +0 -2
- package/BaseFeatureWidget/util.d.ts +0 -48
- package/BaseFeatureWidget/util.js +0 -77
- package/CorePlugin.d.ts +0 -6
- package/CorePlugin.js +0 -66
- package/PhasedScheduler.js +0 -28
- package/Plugin.d.ts +0 -13
- package/Plugin.js +0 -7
- package/PluginLoader.d.ts +0 -64
- package/PluginLoader.js +0 -174
- package/PluginManager.d.ts +0 -139
- package/PluginManager.js +0 -405
- package/ReExports/BaseFeatureDetails.js +0 -45
- package/ReExports/DataGrid.js +0 -5
- package/ReExports/MuiDataGridReExports.js +0 -167
- package/ReExports/MuiReExports.d.ts +0 -133
- package/ReExports/MuiReExports.js +0 -150
- package/ReExports/index.d.ts +0 -1
- package/ReExports/index.js +0 -8
- package/ReExports/lazify.js +0 -14
- package/ReExports/list.js +0 -273
- package/ReExports/material-ui-colors.d.ts +0 -1
- package/ReExports/material-ui-colors.js +0 -17
- package/ReExports/modules.js +0 -179
- package/TextSearch/BaseResults.d.ts +0 -46
- package/TextSearch/BaseResults.js +0 -61
- package/TextSearch/TextSearchManager.d.ts +0 -48
- package/TextSearch/TextSearchManager.js +0 -85
- package/assemblyManager/assembly.d.ts +0 -71
- package/assemblyManager/assembly.js +0 -304
- package/assemblyManager/assemblyConfigSchema.d.ts +0 -27
- package/assemblyManager/assemblyConfigSchema.js +0 -53
- package/assemblyManager/assemblyManager.d.ts +0 -499
- package/assemblyManager/assemblyManager.js +0 -134
- package/assemblyManager/index.d.ts +0 -3
- package/assemblyManager/index.js +0 -10
- package/configuration/configurationSchema.d.ts +0 -35
- package/configuration/configurationSchema.js +0 -174
- package/configuration/configurationSlot.d.ts +0 -31
- package/configuration/configurationSlot.js +0 -241
- package/configuration/index.d.ts +0 -3
- package/configuration/index.js +0 -21
- package/configuration/types.d.ts +0 -14
- package/configuration/types.js +0 -2
- package/configuration/util.d.ts +0 -10
- package/configuration/util.js +0 -123
- package/data_adapters/BaseAdapter/BaseAdapter.d.ts +0 -14
- package/data_adapters/BaseAdapter/BaseAdapter.js +0 -30
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +0 -24
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +0 -115
- package/data_adapters/BaseAdapter/BaseOptions.d.ts +0 -15
- package/data_adapters/BaseAdapter/BaseOptions.js +0 -2
- package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.d.ts +0 -10
- package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.js +0 -2
- package/data_adapters/BaseAdapter/BaseSequenceAdapter.d.ts +0 -10
- package/data_adapters/BaseAdapter/BaseSequenceAdapter.js +0 -10
- package/data_adapters/BaseAdapter/BaseTextSearchAdapter.d.ts +0 -6
- package/data_adapters/BaseAdapter/BaseTextSearchAdapter.js +0 -2
- package/data_adapters/BaseAdapter/RegionsAdapter.d.ts +0 -6
- package/data_adapters/BaseAdapter/RegionsAdapter.js +0 -2
- package/data_adapters/BaseAdapter/index.d.ts +0 -13
- package/data_adapters/BaseAdapter/index.js +0 -25
- package/data_adapters/BaseAdapter/types.d.ts +0 -21
- package/data_adapters/BaseAdapter/types.js +0 -2
- package/data_adapters/BaseAdapter/util.d.ts +0 -12
- package/data_adapters/BaseAdapter/util.js +0 -22
- package/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +0 -6
- package/data_adapters/CytobandAdapter/CytobandAdapter.js +0 -31
- package/data_adapters/CytobandAdapter/configSchema.d.ts +0 -9
- package/data_adapters/CytobandAdapter/configSchema.js +0 -26
- package/data_adapters/CytobandAdapter/index.d.ts +0 -2
- package/data_adapters/CytobandAdapter/index.js +0 -51
- package/data_adapters/dataAdapterCache.d.ts +0 -14
- package/data_adapters/dataAdapterCache.js +0 -60
- package/data_adapters/util.js +0 -10
- package/pluggableElementTypes/AdapterType.d.ts +0 -25
- package/pluggableElementTypes/AdapterType.js +0 -19
- package/pluggableElementTypes/AddTrackWorkflowType.d.ts +0 -17
- package/pluggableElementTypes/AddTrackWorkflowType.js +0 -14
- package/pluggableElementTypes/ConnectionType.d.ts +0 -20
- package/pluggableElementTypes/ConnectionType.js +0 -17
- package/pluggableElementTypes/DisplayType.d.ts +0 -28
- package/pluggableElementTypes/DisplayType.js +0 -18
- package/pluggableElementTypes/InternetAccountType.d.ts +0 -12
- package/pluggableElementTypes/InternetAccountType.js +0 -14
- package/pluggableElementTypes/PluggableElementBase.js +0 -12
- package/pluggableElementTypes/RpcMethodType.d.ts +0 -17
- package/pluggableElementTypes/RpcMethodType.js +0 -69
- package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +0 -11
- package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.js +0 -35
- package/pluggableElementTypes/TextSearchAdapterType.d.ts +0 -18
- package/pluggableElementTypes/TextSearchAdapterType.js +0 -18
- package/pluggableElementTypes/TrackType.d.ts +0 -16
- package/pluggableElementTypes/TrackType.js +0 -18
- package/pluggableElementTypes/ViewType.d.ts +0 -29
- package/pluggableElementTypes/ViewType.js +0 -21
- package/pluggableElementTypes/WidgetType.d.ts +0 -25
- package/pluggableElementTypes/WidgetType.js +0 -17
- package/pluggableElementTypes/index.d.ts +0 -26
- package/pluggableElementTypes/index.js +0 -44
- package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +0 -29
- package/pluggableElementTypes/models/BaseConnectionModelFactory.js +0 -38
- package/pluggableElementTypes/models/BaseDisplayModel.d.ts +0 -68
- package/pluggableElementTypes/models/BaseDisplayModel.js +0 -81
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +0 -53
- package/pluggableElementTypes/models/BaseTrackModel.js +0 -145
- package/pluggableElementTypes/models/BaseViewModel.d.ts +0 -42
- package/pluggableElementTypes/models/BaseViewModel.js +0 -35
- package/pluggableElementTypes/models/InternetAccountModel.d.ts +0 -86
- package/pluggableElementTypes/models/InternetAccountModel.js +0 -155
- package/pluggableElementTypes/models/baseConnectionConfig.d.ts +0 -16
- package/pluggableElementTypes/models/baseConnectionConfig.js +0 -20
- package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +0 -27
- package/pluggableElementTypes/models/baseInternetAccountConfig.js +0 -35
- package/pluggableElementTypes/models/baseTrackConfig.d.ts +0 -82
- package/pluggableElementTypes/models/baseTrackConfig.js +0 -135
- package/pluggableElementTypes/models/index.d.ts +0 -13
- package/pluggableElementTypes/models/index.js +0 -22
- package/pluggableElementTypes/renderers/BoxRendererType.d.ts +0 -60
- package/pluggableElementTypes/renderers/BoxRendererType.js +0 -102
- package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +0 -26
- package/pluggableElementTypes/renderers/CircularChordRendererType.js +0 -34
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.d.ts +0 -38
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +0 -65
- package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +0 -51
- package/pluggableElementTypes/renderers/FeatureRendererType.js +0 -85
- package/pluggableElementTypes/renderers/LayoutSession.d.ts +0 -25
- package/pluggableElementTypes/renderers/LayoutSession.js +0 -42
- package/pluggableElementTypes/renderers/RendererType.d.ts +0 -25
- package/pluggableElementTypes/renderers/RendererType.js +0 -23
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +0 -9
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +0 -9
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +0 -6
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +0 -8
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +0 -49
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +0 -81
- package/pluggableElementTypes/renderers/index.d.ts +0 -7
- package/pluggableElementTypes/renderers/index.js +0 -20
- package/pluggableElementTypes/renderers/util/serializableFilterChain.js +0 -32
- package/rpc/BaseRpcDriver.d.ts +0 -43
- package/rpc/BaseRpcDriver.js +0 -113
- package/rpc/MainThreadRpcDriver.d.ts +0 -14
- package/rpc/MainThreadRpcDriver.js +0 -32
- package/rpc/RpcManager.d.ts +0 -34
- package/rpc/RpcManager.js +0 -69
- package/rpc/WebWorkerRpcDriver.d.ts +0 -29
- package/rpc/WebWorkerRpcDriver.js +0 -65
- package/rpc/baseRpcConfig.d.ts +0 -8
- package/rpc/baseRpcConfig.js +0 -12
- package/rpc/configSchema.d.ts +0 -9
- package/rpc/configSchema.js +0 -27
- package/rpc/coreRpcMethods.d.ts +0 -9
- package/rpc/coreRpcMethods.js +0 -22
- package/rpc/mainThreadRpcConfig.d.ts +0 -8
- package/rpc/mainThreadRpcConfig.js +0 -13
- package/rpc/methods/CoreFreeResources.d.ts +0 -6
- package/rpc/methods/CoreFreeResources.js +0 -23
- package/rpc/methods/CoreGetFeatureDensityStats.d.ts +0 -17
- package/rpc/methods/CoreGetFeatureDensityStats.js +0 -36
- package/rpc/methods/CoreGetFeatureDetails.d.ts +0 -11
- package/rpc/methods/CoreGetFeatureDetails.js +0 -38
- package/rpc/methods/CoreGetFeatures.d.ts +0 -18
- package/rpc/methods/CoreGetFeatures.js +0 -40
- package/rpc/methods/CoreGetFileInfo.d.ts +0 -9
- package/rpc/methods/CoreGetFileInfo.js +0 -24
- package/rpc/methods/CoreGetMetadata.d.ts +0 -9
- package/rpc/methods/CoreGetMetadata.js +0 -24
- package/rpc/methods/CoreGetRefNames.d.ts +0 -9
- package/rpc/methods/CoreGetRefNames.js +0 -25
- package/rpc/methods/CoreRender.d.ts +0 -10
- package/rpc/methods/CoreRender.js +0 -46
- package/rpc/methods/util.d.ts +0 -15
- package/rpc/methods/util.js +0 -9
- package/rpc/webWorkerRpcConfig.d.ts +0 -8
- package/rpc/webWorkerRpcConfig.js +0 -13
- package/stories/JBrowseCore.stories.d.ts +0 -5
- package/stories/JBrowseCore.stories.js +0 -10
- package/stories/examples/WithSequencePanel.d.ts +0 -6
- package/stories/examples/WithSequencePanel.js +0 -42
- package/stories/examples/index.d.ts +0 -1
- package/stories/examples/index.js +0 -17
- package/stories/examples/util.d.ts +0 -33
- package/stories/examples/util.js +0 -235
- package/tsconfig.build.tsbuildinfo +0 -1
- package/ui/AppLogo.d.ts +0 -7
- package/ui/AppLogo.js +0 -12
- package/ui/AssemblySelector.d.ts +0 -13
- package/ui/AssemblySelector.js +0 -46
- package/ui/BaseTooltip.d.ts +0 -8
- package/ui/BaseTooltip.js +0 -46
- package/ui/CascadingMenu.d.ts +0 -9
- package/ui/CascadingMenu.js +0 -92
- package/ui/CascadingMenuButton.d.ts +0 -11
- package/ui/CascadingMenuButton.js +0 -29
- package/ui/ColorPicker.js +0 -101
- package/ui/DataGridFlexContainer.d.ts +0 -3
- package/ui/DataGridFlexContainer.js +0 -15
- package/ui/Dialog.d.ts +0 -7
- package/ui/Dialog.js +0 -50
- package/ui/DraggableDialog.js +0 -32
- package/ui/DropDownMenu.d.ts +0 -8
- package/ui/DropDownMenu.js +0 -37
- package/ui/EditableTypography.js +0 -72
- package/ui/ErrorBoundary.d.ts +0 -17
- package/ui/ErrorBoundary.js +0 -19
- package/ui/ErrorMessage.js +0 -94
- package/ui/ErrorMessageStackTraceDialog.js +0 -149
- package/ui/ExternalLink.js +0 -13
- package/ui/FactoryResetDialog.js +0 -24
- package/ui/FatalErrorDialog.js +0 -24
- package/ui/FileSelector/FileSelector.d.ts +0 -11
- package/ui/FileSelector/FileSelector.js +0 -102
- package/ui/FileSelector/LocalFileChooser.d.ts +0 -6
- package/ui/FileSelector/LocalFileChooser.js +0 -42
- package/ui/FileSelector/UrlChooser.d.ts +0 -8
- package/ui/FileSelector/UrlChooser.js +0 -19
- package/ui/FileSelector/index.d.ts +0 -1
- package/ui/FileSelector/index.js +0 -8
- package/ui/HoverMenu.js +0 -50
- package/ui/Icons.js +0 -23
- package/ui/LoadingEllipses.d.ts +0 -6
- package/ui/LoadingEllipses.js +0 -35
- package/ui/Logo.js +0 -46
- package/ui/Menu.d.ts +0 -53
- package/ui/Menu.js +0 -233
- package/ui/MenuButton.d.ts +0 -10
- package/ui/MenuButton.js +0 -28
- package/ui/PrerenderedCanvas.d.ts +0 -10
- package/ui/PrerenderedCanvas.js +0 -34
- package/ui/RedErrorMessageBox.js +0 -19
- package/ui/ResizeHandle.js +0 -72
- package/ui/ReturnToImportFormDialog.js +0 -18
- package/ui/SanitizedHTML.js +0 -64
- package/ui/Snackbar.d.ts +0 -10
- package/ui/Snackbar.js +0 -49
- package/ui/SnackbarContents.d.ts +0 -5
- package/ui/SnackbarContents.js +0 -16
- package/ui/SnackbarModel.d.ts +0 -17
- package/ui/SnackbarModel.js +0 -96
- package/ui/colors.js +0 -78
- package/ui/hooks.d.ts +0 -66
- package/ui/hooks.js +0 -185
- package/ui/index.d.ts +0 -19
- package/ui/index.js +0 -56
- package/ui/react-colorful.d.ts +0 -17
- package/ui/react-colorful.js +0 -466
- package/ui/theme.d.ts +0 -59
- package/ui/theme.js +0 -381
- package/ui/useEvent.js +0 -47
- package/util/Base1DUtils.d.ts +0 -38
- package/util/Base1DUtils.js +0 -198
- package/util/Base1DViewModel.d.ts +0 -61
- package/util/Base1DViewModel.js +0 -135
- package/util/QuickLRU.d.ts +0 -32
- package/util/QuickLRU.js +0 -237
- package/util/TimeTraveller.d.ts +0 -19
- package/util/TimeTraveller.js +0 -90
- package/util/aborting.js +0 -48
- package/util/analytics.js +0 -86
- package/util/blobToDataURL.js +0 -17
- package/util/blockTypes.d.ts +0 -58
- package/util/blockTypes.js +0 -110
- package/util/calculateDynamicBlocks.d.ts +0 -3
- package/util/calculateDynamicBlocks.js +0 -100
- package/util/calculateStaticBlocks.d.ts +0 -13
- package/util/calculateStaticBlocks.js +0 -102
- package/util/cluster.d.ts +0 -17
- package/util/cluster.js +0 -96
- package/util/color/cssColorsLevel4.js +0 -160
- package/util/color/index.d.ts +0 -4
- package/util/color/index.js +0 -40
- package/util/colord.d.ts +0 -1
- package/util/colord.js +0 -13
- package/util/compositeMap.d.ts +0 -11
- package/util/compositeMap.js +0 -61
- package/util/dedupe.js +0 -15
- package/util/formatFastaStrings.js +0 -12
- package/util/idMaker.js +0 -24
- package/util/index.d.ts +0 -274
- package/util/index.js +0 -1052
- package/util/io/RemoteFileWithRangeCache.js +0 -76
- package/util/io/index.d.ts +0 -7
- package/util/io/index.js +0 -103
- package/util/jexl.d.ts +0 -4
- package/util/jexl.js +0 -54
- package/util/jexlStrings.js +0 -23
- package/util/layouts/BaseLayout.d.ts +0 -30
- package/util/layouts/BaseLayout.js +0 -2
- package/util/layouts/GranularRectLayout.d.ts +0 -37
- package/util/layouts/GranularRectLayout.js +0 -343
- package/util/layouts/MultiLayout.d.ts +0 -12
- package/util/layouts/MultiLayout.js +0 -42
- package/util/layouts/PrecomputedLayout.d.ts +0 -28
- package/util/layouts/PrecomputedLayout.js +0 -66
- package/util/layouts/PrecomputedMultiLayout.d.ts +0 -4
- package/util/layouts/PrecomputedMultiLayout.js +0 -21
- package/util/layouts/SceneGraph.js +0 -115
- package/util/layouts/index.d.ts +0 -7
- package/util/layouts/index.js +0 -31
- package/util/makeAbortableReaction.d.ts +0 -2
- package/util/makeAbortableReaction.js +0 -50
- package/util/map-obj.d.ts +0 -3
- package/util/map-obj.js +0 -37
- package/util/mst-reflection.d.ts +0 -11
- package/util/mst-reflection.js +0 -62
- package/util/nanoid.d.ts +0 -5
- package/util/nanoid.js +0 -43
- package/util/nextTick.js +0 -6
- package/util/offscreenCanvasPonyfill.d.ts +0 -7
- package/util/offscreenCanvasPonyfill.js +0 -65
- package/util/offscreenCanvasUtils.d.ts +0 -28
- package/util/offscreenCanvasUtils.js +0 -99
- package/util/parseLineByLine.js +0 -25
- package/util/range.js +0 -26
- package/util/rxjs.d.ts +0 -3
- package/util/rxjs.js +0 -21
- package/util/simpleFeature.d.ts +0 -44
- package/util/simpleFeature.js +0 -82
- package/util/stats.d.ts +0 -21
- package/util/stats.js +0 -78
- package/util/stopToken.d.ts +0 -3
- package/util/stopToken.js +0 -29
- package/util/tracks.d.ts +0 -55
- package/util/tracks.js +0 -168
- package/util/types/index.d.ts +0 -254
- package/util/types/index.js +0 -172
- package/util/types/mst.d.ts +0 -107
- package/util/types/mst.js +0 -72
- package/util/types/util.d.ts +0 -6
- package/util/types/util.js +0 -2
- package/util/useMeasure.js +0 -33
- package/util/when.js +0 -5
- /package/{BaseFeatureWidget → esm/BaseFeatureWidget}/BaseFeatureDetail/ArrayValue.d.ts +0 -0
- /package/{BaseFeatureWidget → esm/BaseFeatureWidget}/BaseFeatureDetail/BasicValue.d.ts +0 -0
- /package/{BaseFeatureWidget → esm/BaseFeatureWidget}/BaseFeatureDetail/DataGridDetails.d.ts +0 -0
- /package/{BaseFeatureWidget → esm/BaseFeatureWidget}/BaseFeatureDetail/FieldName.d.ts +0 -0
- /package/{BaseFeatureWidget → esm/BaseFeatureWidget}/BaseFeatureDetail/SimpleField.d.ts +0 -0
- /package/{BaseFeatureWidget → esm/BaseFeatureWidget}/BaseFeatureDetail/UriField.d.ts +0 -0
- /package/{BaseFeatureWidget → esm/BaseFeatureWidget}/BaseFeatureDetail/util.d.ts +0 -0
- /package/{BaseFeatureWidget → esm/BaseFeatureWidget}/SequenceFeatureDetails/dialogs/HelpDialog.d.ts +0 -0
- /package/{PhasedScheduler.d.ts → esm/PhasedScheduler.d.ts} +0 -0
- /package/{ReExports → esm/ReExports}/BaseFeatureDetails.d.ts +0 -0
- /package/{ReExports → esm/ReExports}/DataGrid.d.ts +0 -0
- /package/{ReExports → esm/ReExports}/MuiDataGridReExports.d.ts +0 -0
- /package/{ReExports → esm/ReExports}/lazify.d.ts +0 -0
- /package/{ReExports → esm/ReExports}/list.d.ts +0 -0
- /package/{ReExports → esm/ReExports}/modules.d.ts +0 -0
- /package/{data_adapters → esm/data_adapters}/util.d.ts +0 -0
- /package/{pluggableElementTypes → esm/pluggableElementTypes}/PluggableElementBase.d.ts +0 -0
- /package/{pluggableElementTypes → esm/pluggableElementTypes}/renderers/util/serializableFilterChain.d.ts +0 -0
- /package/{ui → esm/ui}/ColorPicker.d.ts +0 -0
- /package/{ui → esm/ui}/DraggableDialog.d.ts +0 -0
- /package/{ui → esm/ui}/EditableTypography.d.ts +0 -0
- /package/{ui → esm/ui}/ErrorMessage.d.ts +0 -0
- /package/{ui → esm/ui}/ErrorMessageStackTraceDialog.d.ts +0 -0
- /package/{ui → esm/ui}/ExternalLink.d.ts +0 -0
- /package/{ui → esm/ui}/FactoryResetDialog.d.ts +0 -0
- /package/{ui → esm/ui}/FatalErrorDialog.d.ts +0 -0
- /package/{ui → esm/ui}/HoverMenu.d.ts +0 -0
- /package/{ui → esm/ui}/Icons.d.ts +0 -0
- /package/{ui → esm/ui}/Logo.d.ts +0 -0
- /package/{ui → esm/ui}/RedErrorMessageBox.d.ts +0 -0
- /package/{ui → esm/ui}/ResizeHandle.d.ts +0 -0
- /package/{ui → esm/ui}/ReturnToImportFormDialog.d.ts +0 -0
- /package/{ui → esm/ui}/SanitizedHTML.d.ts +0 -0
- /package/{ui → esm/ui}/colors.d.ts +0 -0
- /package/{ui → esm/ui}/useEvent.d.ts +0 -0
- /package/{util → esm/util}/aborting.d.ts +0 -0
- /package/{util → esm/util}/analytics.d.ts +0 -0
- /package/{util → esm/util}/blobToDataURL.d.ts +0 -0
- /package/{util → esm/util}/color/cssColorsLevel4.d.ts +0 -0
- /package/{util → esm/util}/dedupe.d.ts +0 -0
- /package/{util → esm/util}/formatFastaStrings.d.ts +0 -0
- /package/{util → esm/util}/idMaker.d.ts +0 -0
- /package/{util → esm/util}/io/RemoteFileWithRangeCache.d.ts +0 -0
- /package/{util → esm/util}/jexlStrings.d.ts +0 -0
- /package/{util → esm/util}/layouts/SceneGraph.d.ts +0 -0
- /package/{util → esm/util}/nextTick.d.ts +0 -0
- /package/{util → esm/util}/parseLineByLine.d.ts +0 -0
- /package/{util → esm/util}/range.d.ts +0 -0
- /package/{util → esm/util}/useMeasure.d.ts +0 -0
- /package/{util → esm/util}/when.d.ts +0 -0
|
@@ -0,0 +1,873 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { unzip } from '@gmod/bgzf-filehandle';
|
|
3
|
+
import useMeasure from '@jbrowse/core/util/useMeasure';
|
|
4
|
+
import { getEnv as getEnvMST, getParent, getSnapshot, hasParent, isAlive, isStateTreeNode, } from '@jbrowse/mobx-state-tree';
|
|
5
|
+
import { flushSync } from 'react-dom';
|
|
6
|
+
import { createRoot } from 'react-dom/client';
|
|
7
|
+
import { coarseStripHTML } from "./coarseStripHTML.js";
|
|
8
|
+
import { colord } from "./colord.js";
|
|
9
|
+
import { parseLocString } from "./locString.js";
|
|
10
|
+
import { checkStopToken } from "./stopToken.js";
|
|
11
|
+
import { isDisplayModel, isSessionModel, isTrackModel, isUriLocation, isViewModel, } from "./types/index.js";
|
|
12
|
+
export * from "./types/index.js";
|
|
13
|
+
export * from "./when.js";
|
|
14
|
+
export * from "./range.js";
|
|
15
|
+
export * from "./dedupe.js";
|
|
16
|
+
export * from "./coarseStripHTML.js";
|
|
17
|
+
export * from "./offscreenCanvasPonyfill.js";
|
|
18
|
+
export * from "./offscreenCanvasUtils.js";
|
|
19
|
+
export * from "./rpc.js";
|
|
20
|
+
const containingDisplayCache = new WeakMap();
|
|
21
|
+
const containingTrackCache = new WeakMap();
|
|
22
|
+
const containingViewCache = new WeakMap();
|
|
23
|
+
const sessionCache = new WeakMap();
|
|
24
|
+
export function useDebounce(value, delay) {
|
|
25
|
+
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
const handle = setTimeout(() => {
|
|
28
|
+
setDebouncedValue(value);
|
|
29
|
+
}, delay);
|
|
30
|
+
return () => {
|
|
31
|
+
clearTimeout(handle);
|
|
32
|
+
};
|
|
33
|
+
}, [value, delay]);
|
|
34
|
+
return debouncedValue;
|
|
35
|
+
}
|
|
36
|
+
export function useWidthSetter(view, padding) {
|
|
37
|
+
const [ref, { width }] = useMeasure();
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
let token;
|
|
40
|
+
if (width && isAlive(view)) {
|
|
41
|
+
token = requestAnimationFrame(() => {
|
|
42
|
+
view.setWidth(width);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return () => {
|
|
46
|
+
if (token) {
|
|
47
|
+
cancelAnimationFrame(token);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}, [padding, view, width]);
|
|
51
|
+
return ref;
|
|
52
|
+
}
|
|
53
|
+
export function useDebouncedCallback(callback, wait = 400) {
|
|
54
|
+
const argsRef = useRef(null);
|
|
55
|
+
const timeout = useRef(null);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (timeout.current) {
|
|
58
|
+
clearTimeout(timeout.current);
|
|
59
|
+
}
|
|
60
|
+
}, []);
|
|
61
|
+
return function debouncedCallback(...args) {
|
|
62
|
+
argsRef.current = args;
|
|
63
|
+
if (timeout.current) {
|
|
64
|
+
clearTimeout(timeout.current);
|
|
65
|
+
}
|
|
66
|
+
timeout.current = setTimeout(() => {
|
|
67
|
+
if (argsRef.current) {
|
|
68
|
+
callback(...argsRef.current);
|
|
69
|
+
}
|
|
70
|
+
}, wait);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export function findParentThat(node, predicate) {
|
|
74
|
+
if (!hasParent(node)) {
|
|
75
|
+
throw new Error('node does not have parent');
|
|
76
|
+
}
|
|
77
|
+
let currentNode = getParent(node);
|
|
78
|
+
while (currentNode && isAlive(currentNode)) {
|
|
79
|
+
if (predicate(currentNode)) {
|
|
80
|
+
return currentNode;
|
|
81
|
+
}
|
|
82
|
+
if (hasParent(currentNode)) {
|
|
83
|
+
currentNode = getParent(currentNode);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
throw new Error('no matching node found');
|
|
90
|
+
}
|
|
91
|
+
export function springAnimate(fromValue, toValue, setValue, onFinish = () => { }, precision = 0, tension = 400, friction = 20, clamp = true) {
|
|
92
|
+
const mass = 1;
|
|
93
|
+
if (!precision) {
|
|
94
|
+
precision = Math.abs(toValue - fromValue) / 1000;
|
|
95
|
+
}
|
|
96
|
+
let animationFrameId;
|
|
97
|
+
function update(animation) {
|
|
98
|
+
const time = performance.now();
|
|
99
|
+
let position = animation.lastPosition;
|
|
100
|
+
let lastTime = animation.lastTime || time;
|
|
101
|
+
let velocity = animation.lastVelocity || 0;
|
|
102
|
+
if (time > lastTime + 64) {
|
|
103
|
+
lastTime = time;
|
|
104
|
+
}
|
|
105
|
+
const numSteps = Math.floor(time - lastTime);
|
|
106
|
+
for (let i = 0; i < numSteps; ++i) {
|
|
107
|
+
const force = -tension * (position - toValue);
|
|
108
|
+
const damping = -friction * velocity;
|
|
109
|
+
const acceleration = (force + damping) / mass;
|
|
110
|
+
velocity += (acceleration * 1) / 1000;
|
|
111
|
+
position += (velocity * 1) / 1000;
|
|
112
|
+
}
|
|
113
|
+
const isVelocity = Math.abs(velocity) <= precision;
|
|
114
|
+
const isDisplacement = tension !== 0 ? Math.abs(toValue - position) <= precision : true;
|
|
115
|
+
const isOvershooting = clamp && tension !== 0
|
|
116
|
+
? fromValue < toValue
|
|
117
|
+
? position > toValue
|
|
118
|
+
: position < toValue
|
|
119
|
+
: false;
|
|
120
|
+
const endOfAnimation = isOvershooting || (isVelocity && isDisplacement);
|
|
121
|
+
if (endOfAnimation) {
|
|
122
|
+
setValue(toValue);
|
|
123
|
+
onFinish();
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
setValue(position);
|
|
127
|
+
animationFrameId = requestAnimationFrame(() => {
|
|
128
|
+
update({
|
|
129
|
+
lastPosition: position,
|
|
130
|
+
lastTime: time,
|
|
131
|
+
lastVelocity: velocity,
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return [
|
|
137
|
+
() => {
|
|
138
|
+
update({ lastPosition: fromValue });
|
|
139
|
+
},
|
|
140
|
+
() => {
|
|
141
|
+
cancelAnimationFrame(animationFrameId);
|
|
142
|
+
},
|
|
143
|
+
];
|
|
144
|
+
}
|
|
145
|
+
export function findParentThatIs(node, predicate) {
|
|
146
|
+
return findParentThat(node, predicate);
|
|
147
|
+
}
|
|
148
|
+
export function getSession(node) {
|
|
149
|
+
const cached = sessionCache.get(node);
|
|
150
|
+
if (cached && isAlive(cached)) {
|
|
151
|
+
return cached;
|
|
152
|
+
}
|
|
153
|
+
try {
|
|
154
|
+
const result = findParentThatIs(node, isSessionModel);
|
|
155
|
+
sessionCache.set(node, result);
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
catch (e) {
|
|
159
|
+
throw new Error('no session model found!');
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
export function getContainingView(node) {
|
|
163
|
+
const cached = containingViewCache.get(node);
|
|
164
|
+
if (cached && isAlive(cached)) {
|
|
165
|
+
return cached;
|
|
166
|
+
}
|
|
167
|
+
try {
|
|
168
|
+
const result = findParentThatIs(node, isViewModel);
|
|
169
|
+
containingViewCache.set(node, result);
|
|
170
|
+
return result;
|
|
171
|
+
}
|
|
172
|
+
catch (e) {
|
|
173
|
+
throw new Error('no containing view found');
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
export function getContainingTrack(node) {
|
|
177
|
+
const cached = containingTrackCache.get(node);
|
|
178
|
+
if (cached && isAlive(cached)) {
|
|
179
|
+
return cached;
|
|
180
|
+
}
|
|
181
|
+
try {
|
|
182
|
+
const result = findParentThatIs(node, isTrackModel);
|
|
183
|
+
containingTrackCache.set(node, result);
|
|
184
|
+
return result;
|
|
185
|
+
}
|
|
186
|
+
catch (e) {
|
|
187
|
+
throw new Error('no containing track found');
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
export function getContainingDisplay(node) {
|
|
191
|
+
const cached = containingDisplayCache.get(node);
|
|
192
|
+
if (cached && isAlive(cached)) {
|
|
193
|
+
return cached;
|
|
194
|
+
}
|
|
195
|
+
try {
|
|
196
|
+
const result = findParentThatIs(node, isDisplayModel);
|
|
197
|
+
containingDisplayCache.set(node, result);
|
|
198
|
+
return result;
|
|
199
|
+
}
|
|
200
|
+
catch (e) {
|
|
201
|
+
throw new Error('no containing display found');
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
export function assembleLocString(region) {
|
|
205
|
+
return assembleLocStringFast(region, toLocale);
|
|
206
|
+
}
|
|
207
|
+
export function assembleLocStringFast(region, cb = (n) => n) {
|
|
208
|
+
const { assemblyName, refName, start, end, reversed } = region;
|
|
209
|
+
const assemblyNameString = assemblyName ? `{${assemblyName}}` : '';
|
|
210
|
+
let startString;
|
|
211
|
+
if (start !== undefined) {
|
|
212
|
+
startString = `:${cb(start + 1)}`;
|
|
213
|
+
}
|
|
214
|
+
else if (end !== undefined) {
|
|
215
|
+
startString = ':1';
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
startString = '';
|
|
219
|
+
}
|
|
220
|
+
let endString;
|
|
221
|
+
if (end !== undefined) {
|
|
222
|
+
endString = start !== undefined && start + 1 === end ? '' : `..${cb(end)}`;
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
endString = start !== undefined ? '..' : '';
|
|
226
|
+
}
|
|
227
|
+
let rev = '';
|
|
228
|
+
if (reversed) {
|
|
229
|
+
rev = '[rev]';
|
|
230
|
+
}
|
|
231
|
+
return `${assemblyNameString}${refName}${startString}${endString}${rev}`;
|
|
232
|
+
}
|
|
233
|
+
export function compareLocs(locA, locB) {
|
|
234
|
+
const assemblyComp = locA.assemblyName || locB.assemblyName
|
|
235
|
+
? (locA.assemblyName || '').localeCompare(locB.assemblyName || '')
|
|
236
|
+
: 0;
|
|
237
|
+
if (assemblyComp) {
|
|
238
|
+
return assemblyComp;
|
|
239
|
+
}
|
|
240
|
+
const refComp = locA.refName || locB.refName
|
|
241
|
+
? (locA.refName || '').localeCompare(locB.refName || '')
|
|
242
|
+
: 0;
|
|
243
|
+
if (refComp) {
|
|
244
|
+
return refComp;
|
|
245
|
+
}
|
|
246
|
+
if (locA.start !== undefined && locB.start !== undefined) {
|
|
247
|
+
const startComp = locA.start - locB.start;
|
|
248
|
+
if (startComp) {
|
|
249
|
+
return startComp;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (locA.end !== undefined && locB.end !== undefined) {
|
|
253
|
+
const endComp = locA.end - locB.end;
|
|
254
|
+
if (endComp) {
|
|
255
|
+
return endComp;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return 0;
|
|
259
|
+
}
|
|
260
|
+
export function compareLocStrings(a, b, isValidRefName) {
|
|
261
|
+
const locA = parseLocString(a, isValidRefName);
|
|
262
|
+
const locB = parseLocString(b, isValidRefName);
|
|
263
|
+
return compareLocs(locA, locB);
|
|
264
|
+
}
|
|
265
|
+
export function clamp(num, min, max) {
|
|
266
|
+
if (num < min) {
|
|
267
|
+
return min;
|
|
268
|
+
}
|
|
269
|
+
if (num > max) {
|
|
270
|
+
return max;
|
|
271
|
+
}
|
|
272
|
+
return num;
|
|
273
|
+
}
|
|
274
|
+
function roundToNearestPointOne(num) {
|
|
275
|
+
return Math.round(num * 10) / 10;
|
|
276
|
+
}
|
|
277
|
+
export function bpToPx(bp, { reversed, end = 0, start = 0, }, bpPerPx) {
|
|
278
|
+
return roundToNearestPointOne((reversed ? end - bp : bp - start) / bpPerPx);
|
|
279
|
+
}
|
|
280
|
+
const oneEightyOverPi = 180 / Math.PI;
|
|
281
|
+
const piOverOneEighty = Math.PI / 180;
|
|
282
|
+
export function radToDeg(radians) {
|
|
283
|
+
return (radians * oneEightyOverPi) % 360;
|
|
284
|
+
}
|
|
285
|
+
export function degToRad(degrees) {
|
|
286
|
+
return (degrees * piOverOneEighty) % (2 * Math.PI);
|
|
287
|
+
}
|
|
288
|
+
export function polarToCartesian(rho, theta) {
|
|
289
|
+
return [rho * Math.cos(theta), rho * Math.sin(theta)];
|
|
290
|
+
}
|
|
291
|
+
export function cartesianToPolar(x, y) {
|
|
292
|
+
const rho = Math.sqrt(x * x + y * y);
|
|
293
|
+
const theta = Math.atan(y / x);
|
|
294
|
+
return [rho, theta];
|
|
295
|
+
}
|
|
296
|
+
export function featureSpanPx(feature, region, bpPerPx) {
|
|
297
|
+
return bpSpanPx(feature.get('start'), feature.get('end'), region, bpPerPx);
|
|
298
|
+
}
|
|
299
|
+
export function bpSpanPx(leftBp, rightBp, region, bpPerPx) {
|
|
300
|
+
const start = bpToPx(leftBp, region, bpPerPx);
|
|
301
|
+
const end = bpToPx(rightBp, region, bpPerPx);
|
|
302
|
+
return region.reversed ? [end, start] : [start, end];
|
|
303
|
+
}
|
|
304
|
+
export function calculateLayoutBounds(featureStart, featureEnd, layoutWidthBp, reversed) {
|
|
305
|
+
const featureWidthBp = featureEnd - featureStart;
|
|
306
|
+
const labelOverhangBp = Math.max(0, layoutWidthBp - featureWidthBp);
|
|
307
|
+
return reversed
|
|
308
|
+
? [featureStart - labelOverhangBp, featureEnd]
|
|
309
|
+
: [featureStart, featureStart + layoutWidthBp];
|
|
310
|
+
}
|
|
311
|
+
export function iterMap(iter, func, sizeHint) {
|
|
312
|
+
const results = Array.from({ length: sizeHint || 0 });
|
|
313
|
+
let counter = 0;
|
|
314
|
+
for (const item of iter) {
|
|
315
|
+
results[counter] = func(item);
|
|
316
|
+
counter += 1;
|
|
317
|
+
}
|
|
318
|
+
return results;
|
|
319
|
+
}
|
|
320
|
+
export function findLastIndex(array, predicate) {
|
|
321
|
+
let l = array.length;
|
|
322
|
+
while (l--) {
|
|
323
|
+
if (predicate(array[l], l, array)) {
|
|
324
|
+
return l;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return -1;
|
|
328
|
+
}
|
|
329
|
+
export function findLast(array, predicate) {
|
|
330
|
+
let l = array.length;
|
|
331
|
+
while (l--) {
|
|
332
|
+
if (predicate(array[l], l, array)) {
|
|
333
|
+
return array[l];
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return undefined;
|
|
337
|
+
}
|
|
338
|
+
export function renameRegionIfNeeded(refNameMap, region) {
|
|
339
|
+
if (isStateTreeNode(region) && !isAlive(region)) {
|
|
340
|
+
return region;
|
|
341
|
+
}
|
|
342
|
+
if (refNameMap?.[region.refName]) {
|
|
343
|
+
region = isStateTreeNode(region)
|
|
344
|
+
? { ...getSnapshot(region) }
|
|
345
|
+
: { ...region };
|
|
346
|
+
const newRef = refNameMap[region.refName];
|
|
347
|
+
if (newRef) {
|
|
348
|
+
return {
|
|
349
|
+
...region,
|
|
350
|
+
refName: newRef,
|
|
351
|
+
originalRefName: region.refName,
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
return region;
|
|
356
|
+
}
|
|
357
|
+
export async function renameRegionsIfNeeded(assemblyManager, args) {
|
|
358
|
+
const { regions = [], adapterConfig } = args;
|
|
359
|
+
if (!args.sessionId) {
|
|
360
|
+
throw new Error('sessionId is required');
|
|
361
|
+
}
|
|
362
|
+
const assemblyNames = regions.map(region => region.assemblyName);
|
|
363
|
+
const assemblyMaps = Object.fromEntries(await Promise.all([...new Set(assemblyNames)].map(async (assemblyName) => {
|
|
364
|
+
return [
|
|
365
|
+
assemblyName,
|
|
366
|
+
await assemblyManager.getRefNameMapForAdapter(adapterConfig, assemblyName, args),
|
|
367
|
+
];
|
|
368
|
+
})));
|
|
369
|
+
return {
|
|
370
|
+
...args,
|
|
371
|
+
regions: regions.map((region, i) => renameRegionIfNeeded(assemblyMaps[assemblyNames[i]], region)),
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
export function minmax(a, b) {
|
|
375
|
+
return [Math.min(a, b), Math.max(a, b)];
|
|
376
|
+
}
|
|
377
|
+
export function shorten(name, max = 70, short = 30) {
|
|
378
|
+
return name.length > max
|
|
379
|
+
? `${name.slice(0, short)}...${name.slice(-short)}`
|
|
380
|
+
: name;
|
|
381
|
+
}
|
|
382
|
+
export function shorten2(name, max = 70) {
|
|
383
|
+
return name.length > max ? `${name.slice(0, max)}...` : name;
|
|
384
|
+
}
|
|
385
|
+
export function stringify({ refName, coord, assemblyName, oob, }, useAssemblyName) {
|
|
386
|
+
return [
|
|
387
|
+
assemblyName && useAssemblyName ? `{${assemblyName}}` : '',
|
|
388
|
+
refName
|
|
389
|
+
? `${shorten(refName)}:${toLocale(coord)}${oob ? ' (out of bounds)' : ''}`
|
|
390
|
+
: '',
|
|
391
|
+
].join('');
|
|
392
|
+
}
|
|
393
|
+
export const isElectron = /electron/i.test(typeof navigator !== 'undefined' ? navigator.userAgent : '');
|
|
394
|
+
export const complementTable = {
|
|
395
|
+
S: 'S',
|
|
396
|
+
w: 'w',
|
|
397
|
+
T: 'A',
|
|
398
|
+
r: 'y',
|
|
399
|
+
a: 't',
|
|
400
|
+
N: 'N',
|
|
401
|
+
K: 'M',
|
|
402
|
+
x: 'x',
|
|
403
|
+
d: 'h',
|
|
404
|
+
Y: 'R',
|
|
405
|
+
V: 'B',
|
|
406
|
+
y: 'r',
|
|
407
|
+
M: 'K',
|
|
408
|
+
h: 'd',
|
|
409
|
+
k: 'm',
|
|
410
|
+
C: 'G',
|
|
411
|
+
g: 'c',
|
|
412
|
+
t: 'a',
|
|
413
|
+
A: 'T',
|
|
414
|
+
n: 'n',
|
|
415
|
+
W: 'W',
|
|
416
|
+
X: 'X',
|
|
417
|
+
m: 'k',
|
|
418
|
+
v: 'b',
|
|
419
|
+
B: 'V',
|
|
420
|
+
s: 's',
|
|
421
|
+
H: 'D',
|
|
422
|
+
c: 'g',
|
|
423
|
+
D: 'H',
|
|
424
|
+
b: 'v',
|
|
425
|
+
R: 'Y',
|
|
426
|
+
G: 'C',
|
|
427
|
+
};
|
|
428
|
+
export function revcom(str) {
|
|
429
|
+
const revcomped = [];
|
|
430
|
+
for (let i = str.length - 1; i >= 0; i--) {
|
|
431
|
+
revcomped.push(complementTable[str[i]] ?? str[i]);
|
|
432
|
+
}
|
|
433
|
+
return revcomped.join('');
|
|
434
|
+
}
|
|
435
|
+
export function reverse(str) {
|
|
436
|
+
const reversed = [];
|
|
437
|
+
for (let i = str.length - 1; i >= 0; i--) {
|
|
438
|
+
reversed.push(str[i]);
|
|
439
|
+
}
|
|
440
|
+
return reversed.join('');
|
|
441
|
+
}
|
|
442
|
+
export function complement(str) {
|
|
443
|
+
const comp = [];
|
|
444
|
+
for (let i = 0, l = str.length; i < l; i++) {
|
|
445
|
+
comp.push(complementTable[str[i]] ?? str[i]);
|
|
446
|
+
}
|
|
447
|
+
return comp.join('');
|
|
448
|
+
}
|
|
449
|
+
export const rIC = typeof jest === 'undefined'
|
|
450
|
+
?
|
|
451
|
+
typeof window !== 'undefined' && window.requestIdleCallback
|
|
452
|
+
? window.requestIdleCallback
|
|
453
|
+
: (cb) => setTimeout(() => {
|
|
454
|
+
cb();
|
|
455
|
+
}, 1)
|
|
456
|
+
: (cb) => {
|
|
457
|
+
cb();
|
|
458
|
+
};
|
|
459
|
+
const widths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2796875, 0.2765625, 0.3546875, 0.5546875, 0.5546875, 0.8890625, 0.665625, 0.190625, 0.3328125, 0.3328125, 0.3890625, 0.5828125, 0.2765625, 0.3328125, 0.2765625, 0.3015625, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.2765625, 0.2765625, 0.584375, 0.5828125, 0.584375, 0.5546875, 1.0140625, 0.665625, 0.665625, 0.721875, 0.721875, 0.665625, 0.609375, 0.7765625, 0.721875, 0.2765625, 0.5, 0.665625, 0.5546875, 0.8328125, 0.721875, 0.7765625, 0.665625, 0.7765625, 0.721875, 0.665625, 0.609375, 0.721875, 0.665625, 0.94375, 0.665625, 0.665625, 0.609375, 0.2765625, 0.3546875, 0.2765625, 0.4765625, 0.5546875, 0.3328125, 0.5546875, 0.5546875, 0.5, 0.5546875, 0.5546875, 0.2765625, 0.5546875, 0.5546875, 0.221875, 0.240625, 0.5, 0.221875, 0.8328125, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.3328125, 0.5, 0.2765625, 0.5546875, 0.5, 0.721875, 0.5, 0.5, 0.5, 0.3546875, 0.259375, 0.353125, 0.5890625];
|
|
460
|
+
const avgWidth = 0.5279276315789471;
|
|
461
|
+
export function measureText(str, fontSize = 10) {
|
|
462
|
+
const s = String(str);
|
|
463
|
+
let total = 0;
|
|
464
|
+
for (let i = 0, l = s.length; i < l; i++) {
|
|
465
|
+
total += widths[s.charCodeAt(i)] ?? avgWidth;
|
|
466
|
+
}
|
|
467
|
+
return total * fontSize;
|
|
468
|
+
}
|
|
469
|
+
export function getFrame(start, end, strand, phase) {
|
|
470
|
+
return strand === 1
|
|
471
|
+
? (((start + phase) % 3) + 1)
|
|
472
|
+
: (-1 * ((end - phase) % 3) - 1);
|
|
473
|
+
}
|
|
474
|
+
export const defaultStarts = ['ATG'];
|
|
475
|
+
export const defaultStops = ['TAA', 'TAG', 'TGA'];
|
|
476
|
+
export const defaultCodonTable = {
|
|
477
|
+
TCA: 'S',
|
|
478
|
+
TCC: 'S',
|
|
479
|
+
TCG: 'S',
|
|
480
|
+
TCT: 'S',
|
|
481
|
+
TTC: 'F',
|
|
482
|
+
TTT: 'F',
|
|
483
|
+
TTA: 'L',
|
|
484
|
+
TTG: 'L',
|
|
485
|
+
TAC: 'Y',
|
|
486
|
+
TAT: 'Y',
|
|
487
|
+
TAA: '*',
|
|
488
|
+
TAG: '*',
|
|
489
|
+
TGC: 'C',
|
|
490
|
+
TGT: 'C',
|
|
491
|
+
TGA: '*',
|
|
492
|
+
TGG: 'W',
|
|
493
|
+
CTA: 'L',
|
|
494
|
+
CTC: 'L',
|
|
495
|
+
CTG: 'L',
|
|
496
|
+
CTT: 'L',
|
|
497
|
+
CCA: 'P',
|
|
498
|
+
CCC: 'P',
|
|
499
|
+
CCG: 'P',
|
|
500
|
+
CCT: 'P',
|
|
501
|
+
CAC: 'H',
|
|
502
|
+
CAT: 'H',
|
|
503
|
+
CAA: 'Q',
|
|
504
|
+
CAG: 'Q',
|
|
505
|
+
CGA: 'R',
|
|
506
|
+
CGC: 'R',
|
|
507
|
+
CGG: 'R',
|
|
508
|
+
CGT: 'R',
|
|
509
|
+
ATA: 'I',
|
|
510
|
+
ATC: 'I',
|
|
511
|
+
ATT: 'I',
|
|
512
|
+
ATG: 'M',
|
|
513
|
+
ACA: 'T',
|
|
514
|
+
ACC: 'T',
|
|
515
|
+
ACG: 'T',
|
|
516
|
+
ACT: 'T',
|
|
517
|
+
AAC: 'N',
|
|
518
|
+
AAT: 'N',
|
|
519
|
+
AAA: 'K',
|
|
520
|
+
AAG: 'K',
|
|
521
|
+
AGC: 'S',
|
|
522
|
+
AGT: 'S',
|
|
523
|
+
AGA: 'R',
|
|
524
|
+
AGG: 'R',
|
|
525
|
+
GTA: 'V',
|
|
526
|
+
GTC: 'V',
|
|
527
|
+
GTG: 'V',
|
|
528
|
+
GTT: 'V',
|
|
529
|
+
GCA: 'A',
|
|
530
|
+
GCC: 'A',
|
|
531
|
+
GCG: 'A',
|
|
532
|
+
GCT: 'A',
|
|
533
|
+
GAC: 'D',
|
|
534
|
+
GAT: 'D',
|
|
535
|
+
GAA: 'E',
|
|
536
|
+
GAG: 'E',
|
|
537
|
+
GGA: 'G',
|
|
538
|
+
GGC: 'G',
|
|
539
|
+
GGG: 'G',
|
|
540
|
+
GGT: 'G',
|
|
541
|
+
};
|
|
542
|
+
export function generateCodonTable(table) {
|
|
543
|
+
const tempCodonTable = {};
|
|
544
|
+
for (const codon of Object.keys(table)) {
|
|
545
|
+
const aa = table[codon];
|
|
546
|
+
const nucs = [];
|
|
547
|
+
for (let i = 0; i < 3; i++) {
|
|
548
|
+
const nuc = codon.charAt(i);
|
|
549
|
+
nucs[i] = [];
|
|
550
|
+
nucs[i][0] = nuc.toUpperCase();
|
|
551
|
+
nucs[i][1] = nuc.toLowerCase();
|
|
552
|
+
}
|
|
553
|
+
for (let i = 0; i < 2; i++) {
|
|
554
|
+
const n0 = nucs[0][i];
|
|
555
|
+
for (let j = 0; j < 2; j++) {
|
|
556
|
+
const n1 = nucs[1][j];
|
|
557
|
+
for (let k = 0; k < 2; k++) {
|
|
558
|
+
const n2 = nucs[2][k];
|
|
559
|
+
const triplet = n0 + n1 + n2;
|
|
560
|
+
tempCodonTable[triplet] = aa;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
return tempCodonTable;
|
|
566
|
+
}
|
|
567
|
+
export async function updateStatus(msg, cb, fn) {
|
|
568
|
+
cb?.(msg);
|
|
569
|
+
const res = await fn();
|
|
570
|
+
cb?.('');
|
|
571
|
+
return res;
|
|
572
|
+
}
|
|
573
|
+
export async function updateStatus2(msg, cb, stopToken, fn) {
|
|
574
|
+
cb(msg);
|
|
575
|
+
const res = await fn();
|
|
576
|
+
checkStopToken(stopToken);
|
|
577
|
+
cb('');
|
|
578
|
+
return res;
|
|
579
|
+
}
|
|
580
|
+
export function hashCode(str) {
|
|
581
|
+
let hash = 0;
|
|
582
|
+
if (str.length === 0) {
|
|
583
|
+
return hash;
|
|
584
|
+
}
|
|
585
|
+
for (let i = 0; i < str.length; i++) {
|
|
586
|
+
const chr = str.charCodeAt(i);
|
|
587
|
+
hash = (hash << 5) - hash + chr;
|
|
588
|
+
hash |= 0;
|
|
589
|
+
}
|
|
590
|
+
return hash;
|
|
591
|
+
}
|
|
592
|
+
export function objectHash(obj) {
|
|
593
|
+
return `${hashCode(JSON.stringify(obj))}`;
|
|
594
|
+
}
|
|
595
|
+
export async function bytesForRegions(regions, index) {
|
|
596
|
+
const blockResults = await Promise.all(regions.map(r => index.blocksForRange(r.refName, r.start, r.end)));
|
|
597
|
+
return sum(blockResults
|
|
598
|
+
.flat()
|
|
599
|
+
.map(block => block.maxv.blockPosition + 65535 - block.minv.blockPosition));
|
|
600
|
+
}
|
|
601
|
+
export function isSupportedIndexingAdapter(type = '') {
|
|
602
|
+
return [
|
|
603
|
+
'Gff3TabixAdapter',
|
|
604
|
+
'VcfTabixAdapter',
|
|
605
|
+
'Gff3Adapter',
|
|
606
|
+
'VcfAdapter',
|
|
607
|
+
].includes(type);
|
|
608
|
+
}
|
|
609
|
+
export function getBpDisplayStr(total) {
|
|
610
|
+
if (Math.floor(total / 1_000_000) > 0) {
|
|
611
|
+
return `${reducePrecision(total / 1_000_000)}Mbp`;
|
|
612
|
+
}
|
|
613
|
+
else if (Math.floor(total / 1_000) > 0) {
|
|
614
|
+
return `${reducePrecision(total / 1_000)}Kbp`;
|
|
615
|
+
}
|
|
616
|
+
else {
|
|
617
|
+
return `${Math.floor(total)}bp`;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
export function reducePrecision(s, n = 3) {
|
|
621
|
+
return toLocale(Number.parseFloat(s.toPrecision(n)));
|
|
622
|
+
}
|
|
623
|
+
export function getProgressDisplayStr(current, total) {
|
|
624
|
+
if (Math.floor(total / 1_000_000) > 0) {
|
|
625
|
+
return `${reducePrecision(current / 1_000_000)}/${reducePrecision(total / 1_000_000)}Mb`;
|
|
626
|
+
}
|
|
627
|
+
else if (Math.floor(total / 1_000) > 0) {
|
|
628
|
+
return `${reducePrecision(current / 1_000)}/${reducePrecision(total / 1_000)}Kb`;
|
|
629
|
+
}
|
|
630
|
+
else {
|
|
631
|
+
return `${reducePrecision(current)}/${reducePrecision(total)} bytes`;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
export function toLocale(n) {
|
|
635
|
+
if (n < 1000) {
|
|
636
|
+
return String(n);
|
|
637
|
+
}
|
|
638
|
+
const str = String(n);
|
|
639
|
+
const len = str.length;
|
|
640
|
+
let result = '';
|
|
641
|
+
for (let i = 0; i < len; i++) {
|
|
642
|
+
if (i > 0 && (len - i) % 3 === 0) {
|
|
643
|
+
result += ',';
|
|
644
|
+
}
|
|
645
|
+
result += str[i];
|
|
646
|
+
}
|
|
647
|
+
return result;
|
|
648
|
+
}
|
|
649
|
+
export function getTickDisplayStr(totalBp, bpPerPx) {
|
|
650
|
+
return Math.floor(bpPerPx / 1_000) > 0
|
|
651
|
+
? `${toLocale(Number.parseFloat((totalBp / 1_000_000).toFixed(2)))}M`
|
|
652
|
+
: toLocale(Math.floor(totalBp));
|
|
653
|
+
}
|
|
654
|
+
export function getLayoutId({ sessionId, trackInstanceId, }) {
|
|
655
|
+
return `${sessionId}-${trackInstanceId}`;
|
|
656
|
+
}
|
|
657
|
+
export function getStatsId({ sessionId, trackInstanceId, }) {
|
|
658
|
+
return `${sessionId}-${trackInstanceId}`;
|
|
659
|
+
}
|
|
660
|
+
export function useLocalStorage(key, initialValue, enabled = true) {
|
|
661
|
+
const [storedValue, setStoredValue] = useState(() => {
|
|
662
|
+
if (typeof window === 'undefined' || !enabled) {
|
|
663
|
+
return initialValue;
|
|
664
|
+
}
|
|
665
|
+
try {
|
|
666
|
+
const item = window.localStorage.getItem(key);
|
|
667
|
+
return item ? JSON.parse(item) : initialValue;
|
|
668
|
+
}
|
|
669
|
+
catch (error) {
|
|
670
|
+
console.error(error);
|
|
671
|
+
return initialValue;
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
const setValue = (value) => {
|
|
675
|
+
try {
|
|
676
|
+
const valueToStore = value instanceof Function ? value(storedValue) : value;
|
|
677
|
+
setStoredValue(valueToStore);
|
|
678
|
+
if (typeof window !== 'undefined' && enabled) {
|
|
679
|
+
window.localStorage.setItem(key, JSON.stringify(valueToStore));
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
catch (error) {
|
|
683
|
+
console.error(error);
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
return [storedValue, setValue];
|
|
687
|
+
}
|
|
688
|
+
export function getUriLink(value) {
|
|
689
|
+
const { uri, baseUri = '' } = value;
|
|
690
|
+
let href;
|
|
691
|
+
try {
|
|
692
|
+
href = new URL(uri, baseUri).href;
|
|
693
|
+
}
|
|
694
|
+
catch (e) {
|
|
695
|
+
href = uri;
|
|
696
|
+
}
|
|
697
|
+
return href;
|
|
698
|
+
}
|
|
699
|
+
export function getStr(obj) {
|
|
700
|
+
return isObject(obj)
|
|
701
|
+
? isUriLocation(obj)
|
|
702
|
+
? getUriLink(obj)
|
|
703
|
+
: JSON.stringify(obj)
|
|
704
|
+
: String(obj);
|
|
705
|
+
}
|
|
706
|
+
export function linkify(s) {
|
|
707
|
+
const pattern = /(^|[\s\n]|<[A-Za-z]*\/?>)((?:https?|ftp):\/\/[-A-Z0-9+\u0026\u2019@#/%?=()~_|!:,.;]*[-A-Z0-9+\u0026@#/%=~()_|])/gi;
|
|
708
|
+
return s.replaceAll(pattern, '$1<a href=\'$2\' target="_blank">$2</a>');
|
|
709
|
+
}
|
|
710
|
+
export function measureGridWidth(elements, args) {
|
|
711
|
+
const { padding = 30, minWidth = 80, fontSize = 12, maxWidth = 1000, stripHTML = false, } = args || {};
|
|
712
|
+
return max(elements
|
|
713
|
+
.map(element => getStr(element))
|
|
714
|
+
.map(str => (stripHTML ? coarseStripHTML(str) : str))
|
|
715
|
+
.map(str => measureText(str, fontSize))
|
|
716
|
+
.map(n => Math.min(Math.max(n + padding, minWidth), maxWidth)));
|
|
717
|
+
}
|
|
718
|
+
export function getEnv(obj) {
|
|
719
|
+
return getEnvMST(obj);
|
|
720
|
+
}
|
|
721
|
+
export function localStorageGetItem(item) {
|
|
722
|
+
return typeof localStorage !== 'undefined'
|
|
723
|
+
? localStorage.getItem(item)
|
|
724
|
+
: undefined;
|
|
725
|
+
}
|
|
726
|
+
export function localStorageSetItem(str, item) {
|
|
727
|
+
if (typeof localStorage !== 'undefined') {
|
|
728
|
+
localStorage.setItem(str, item);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
export function max(arr, init = Number.NEGATIVE_INFINITY) {
|
|
732
|
+
let max = init;
|
|
733
|
+
for (const entry of arr) {
|
|
734
|
+
max = Math.max(entry, max);
|
|
735
|
+
}
|
|
736
|
+
return max;
|
|
737
|
+
}
|
|
738
|
+
export function min(arr, init = Number.POSITIVE_INFINITY) {
|
|
739
|
+
let min = init;
|
|
740
|
+
for (const entry of arr) {
|
|
741
|
+
min = Math.min(entry, min);
|
|
742
|
+
}
|
|
743
|
+
return min;
|
|
744
|
+
}
|
|
745
|
+
export function sum(arr) {
|
|
746
|
+
let sum = 0;
|
|
747
|
+
for (const entry of arr) {
|
|
748
|
+
sum += entry;
|
|
749
|
+
}
|
|
750
|
+
return sum;
|
|
751
|
+
}
|
|
752
|
+
export function avg(arr) {
|
|
753
|
+
return sum(arr) / arr.length;
|
|
754
|
+
}
|
|
755
|
+
export function groupBy(array, predicate) {
|
|
756
|
+
const result = {};
|
|
757
|
+
for (const value of array) {
|
|
758
|
+
const t = predicate(value);
|
|
759
|
+
if (!result[t]) {
|
|
760
|
+
result[t] = [];
|
|
761
|
+
}
|
|
762
|
+
result[t].push(value);
|
|
763
|
+
}
|
|
764
|
+
return result;
|
|
765
|
+
}
|
|
766
|
+
export function notEmpty(value) {
|
|
767
|
+
return value !== null && value !== undefined;
|
|
768
|
+
}
|
|
769
|
+
export function mergeIntervals(intervals, w = 5000) {
|
|
770
|
+
if (intervals.length <= 1) {
|
|
771
|
+
return intervals;
|
|
772
|
+
}
|
|
773
|
+
const stack = [];
|
|
774
|
+
let top = null;
|
|
775
|
+
intervals = intervals.sort((a, b) => a.start - b.start);
|
|
776
|
+
stack.push(intervals[0]);
|
|
777
|
+
for (let i = 1; i < intervals.length; i++) {
|
|
778
|
+
top = stack.at(-1);
|
|
779
|
+
if (top.end + w < intervals[i].start - w) {
|
|
780
|
+
stack.push(intervals[i]);
|
|
781
|
+
}
|
|
782
|
+
else if (top.end < intervals[i].end) {
|
|
783
|
+
top.end = Math.max(top.end, intervals[i].end);
|
|
784
|
+
stack.pop();
|
|
785
|
+
stack.push(top);
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
return stack;
|
|
789
|
+
}
|
|
790
|
+
export function gatherOverlaps(regions, w = 5000) {
|
|
791
|
+
const memo = {};
|
|
792
|
+
for (const x of regions) {
|
|
793
|
+
if (!memo[x.refName]) {
|
|
794
|
+
memo[x.refName] = [];
|
|
795
|
+
}
|
|
796
|
+
memo[x.refName].push(x);
|
|
797
|
+
}
|
|
798
|
+
return Object.values(memo).flatMap(group => mergeIntervals(group.sort((a, b) => a.start - b.start), w));
|
|
799
|
+
}
|
|
800
|
+
export function stripAlpha(str) {
|
|
801
|
+
return colord(str).alpha(1).toHex();
|
|
802
|
+
}
|
|
803
|
+
export function getStrokeProps(str) {
|
|
804
|
+
if (str) {
|
|
805
|
+
const c = colord(str);
|
|
806
|
+
return {
|
|
807
|
+
strokeOpacity: c.alpha(),
|
|
808
|
+
stroke: c.alpha(1).toHex(),
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
else {
|
|
812
|
+
return {};
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
export function getFillProps(str) {
|
|
816
|
+
if (str) {
|
|
817
|
+
const c = colord(str);
|
|
818
|
+
return {
|
|
819
|
+
fillOpacity: c.alpha(),
|
|
820
|
+
fill: c.alpha(1).toHex(),
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
else {
|
|
824
|
+
return {};
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
export function renderToStaticMarkup(node) {
|
|
828
|
+
const div = document.createElement('div');
|
|
829
|
+
flushSync(() => {
|
|
830
|
+
createRoot(div).render(node);
|
|
831
|
+
});
|
|
832
|
+
return div.innerHTML.replaceAll(/\brgba\((.+?),[^,]+?\)/g, 'rgb($1)');
|
|
833
|
+
}
|
|
834
|
+
export function isGzip(buf) {
|
|
835
|
+
return buf[0] === 31 && buf[1] === 139 && buf[2] === 8;
|
|
836
|
+
}
|
|
837
|
+
export async function fetchAndMaybeUnzip(loc, opts = {}) {
|
|
838
|
+
const { statusCallback = () => { } } = opts;
|
|
839
|
+
const buf = await updateStatus('Downloading file', statusCallback, () => loc.readFile(opts));
|
|
840
|
+
return isGzip(buf)
|
|
841
|
+
? await updateStatus('Unzipping', statusCallback, () => unzip(buf))
|
|
842
|
+
: buf;
|
|
843
|
+
}
|
|
844
|
+
export async function fetchAndMaybeUnzipText(loc, opts) {
|
|
845
|
+
const buffer = await fetchAndMaybeUnzip(loc, opts);
|
|
846
|
+
if (buffer.length > 536_870_888) {
|
|
847
|
+
throw new Error('Data exceeds maximum string length (512MB)');
|
|
848
|
+
}
|
|
849
|
+
return new TextDecoder('utf8', { fatal: true }).decode(buffer);
|
|
850
|
+
}
|
|
851
|
+
export function isObject(x) {
|
|
852
|
+
return typeof x === 'object' && x !== null;
|
|
853
|
+
}
|
|
854
|
+
export function localStorageGetNumber(key, defaultVal) {
|
|
855
|
+
return +(localStorageGetItem(key) ?? defaultVal);
|
|
856
|
+
}
|
|
857
|
+
export function localStorageGetBoolean(key, defaultVal) {
|
|
858
|
+
return Boolean(JSON.parse(localStorageGetItem(key) || JSON.stringify(defaultVal)));
|
|
859
|
+
}
|
|
860
|
+
export function localStorageSetBoolean(key, value) {
|
|
861
|
+
localStorageSetItem(key, JSON.stringify(value));
|
|
862
|
+
}
|
|
863
|
+
export function testAdapter(fileName, regex, adapterHint, expected) {
|
|
864
|
+
return (regex.test(fileName) && !adapterHint) || adapterHint === expected;
|
|
865
|
+
}
|
|
866
|
+
export { default as SimpleFeature, isFeature, } from "./simpleFeature.js";
|
|
867
|
+
export { blobToDataURL } from "./blobToDataURL.js";
|
|
868
|
+
export { makeAbortableReaction } from "./makeAbortableReaction.js";
|
|
869
|
+
export * from "./aborting.js";
|
|
870
|
+
export * from "./linkify.js";
|
|
871
|
+
export * from "./locString.js";
|
|
872
|
+
export * from "./stopToken.js";
|
|
873
|
+
export * from "./tracks.js";
|