@jbrowse/core 2.16.1 → 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 +3 -4
- package/BaseFeatureWidget/BaseFeatureDetail/index.js +5 -9
- 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 -35
- package/BaseFeatureWidget/SequenceFeatureDetails/model.js +19 -44
- 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 +3 -94
- 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 +10 -114
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +13 -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 +2 -1
- package/data_adapters/CytobandAdapter/CytobandAdapter.js +11 -12
- 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 +4 -5
- 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 +5 -5
- 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 +6 -2
- 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 +2 -19
- 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 +24 -84
- 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 +25 -173
- package/util/index.js +87 -326
- 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 -58
- package/util/simpleFeature.js +0 -35
- package/util/stats.d.ts +4 -34
- package/util/stats.js +0 -60
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { SimpleFeatureSerialized } from '../../util';
|
|
2
|
+
import type { ErrorState, SeqState } from '../util';
|
|
3
3
|
export declare function useFeatureSequence(model: {
|
|
4
4
|
view?: {
|
|
5
5
|
assemblyNames?: string[];
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useFeatureSequence = useFeatureSequence;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const util_1 = require("../../util");
|
|
6
5
|
const configuration_1 = require("../../configuration");
|
|
6
|
+
const util_1 = require("../../util");
|
|
7
7
|
const BPLIMIT = 500000;
|
|
8
8
|
function useFeatureSequence(model, feature, upDownBp, forceLoad) {
|
|
9
9
|
const [sequence, setSequence] = (0, react_1.useState)();
|
|
@@ -36,7 +36,6 @@ function useFeatureSequence(model, feature, upDownBp, forceLoad) {
|
|
|
36
36
|
const [feat] = feats;
|
|
37
37
|
return (feat === null || feat === void 0 ? void 0 : feat.get('seq')) || '';
|
|
38
38
|
}
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
40
39
|
;
|
|
41
40
|
(async () => {
|
|
42
41
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { SimpleFeatureSerialized } from '../../util';
|
|
2
|
+
import type { Instance } from 'mobx-state-tree';
|
|
3
3
|
export declare function SequenceFeatureDetailsF(): import("mobx-state-tree").IModelType<{}, {
|
|
4
4
|
showCoordinatesSetting: string;
|
|
5
5
|
intronBp: number;
|
|
@@ -9,50 +9,17 @@ export declare function SequenceFeatureDetailsF(): import("mobx-state-tree").IMo
|
|
|
9
9
|
feature: SimpleFeatureSerialized | undefined;
|
|
10
10
|
mode: string;
|
|
11
11
|
} & {
|
|
12
|
-
/**
|
|
13
|
-
* #action
|
|
14
|
-
*/
|
|
15
12
|
setFeature(f: SimpleFeatureSerialized): void;
|
|
16
|
-
/**
|
|
17
|
-
* #action
|
|
18
|
-
*/
|
|
19
13
|
setUpDownBp(f: number): void;
|
|
20
|
-
/**
|
|
21
|
-
* #action
|
|
22
|
-
*/
|
|
23
14
|
setIntronBp(f: number): void;
|
|
24
|
-
/**
|
|
25
|
-
* #action
|
|
26
|
-
*/
|
|
27
15
|
setUpperCaseCDS(f: boolean): void;
|
|
28
|
-
/**
|
|
29
|
-
* #action
|
|
30
|
-
*/
|
|
31
16
|
setShowCoordinates(f: "none" | "relative" | "genomic"): void;
|
|
32
|
-
/**
|
|
33
|
-
* #action
|
|
34
|
-
*/
|
|
35
17
|
setMode(mode: string): void;
|
|
36
18
|
} & {
|
|
37
|
-
/**
|
|
38
|
-
* #getter
|
|
39
|
-
*/
|
|
40
19
|
readonly showCoordinates: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* #getter
|
|
43
|
-
*/
|
|
44
20
|
readonly showGenomicCoordsOption: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* #getter
|
|
47
|
-
*/
|
|
48
21
|
readonly hasCDS: boolean | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* #getter
|
|
51
|
-
*/
|
|
52
22
|
readonly hasExon: boolean | undefined;
|
|
53
|
-
/**
|
|
54
|
-
* #getter
|
|
55
|
-
*/
|
|
56
23
|
readonly hasExonOrCDS: boolean | undefined;
|
|
57
24
|
} & {
|
|
58
25
|
afterAttach(): void;
|
|
@@ -1,98 +1,73 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SequenceFeatureDetailsF = SequenceFeatureDetailsF;
|
|
4
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
5
4
|
const mobx_1 = require("mobx");
|
|
6
|
-
|
|
5
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
7
6
|
const util_1 = require("../../util");
|
|
8
7
|
function localStorageGetNumber(key, defaultVal) {
|
|
9
8
|
var _a;
|
|
10
9
|
return +((_a = (0, util_1.localStorageGetItem)(key)) !== null && _a !== void 0 ? _a : defaultVal);
|
|
11
10
|
}
|
|
11
|
+
function localStorageGetBoolean(key, defaultVal) {
|
|
12
|
+
return Boolean(JSON.parse((0, util_1.localStorageGetItem)(key) || JSON.stringify(defaultVal)));
|
|
13
|
+
}
|
|
14
|
+
function localStorageSetNumber(key, value) {
|
|
15
|
+
(0, util_1.localStorageSetItem)(key, JSON.stringify(value));
|
|
16
|
+
}
|
|
17
|
+
function localStorageSetBoolean(key, value) {
|
|
18
|
+
(0, util_1.localStorageSetItem)(key, JSON.stringify(value));
|
|
19
|
+
}
|
|
20
|
+
const p = 'sequenceFeatureDetails';
|
|
12
21
|
function SequenceFeatureDetailsF() {
|
|
13
22
|
return mobx_state_tree_1.types
|
|
14
23
|
.model('SequenceFeatureDetails')
|
|
15
24
|
.volatile(() => ({
|
|
16
|
-
showCoordinatesSetting: (0, util_1.localStorageGetItem)(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
upperCaseCDS: Boolean(JSON.parse((0, util_1.localStorageGetItem)('sequenceFeatureDetails-upperCaseCDS') || 'true')),
|
|
25
|
+
showCoordinatesSetting: (0, util_1.localStorageGetItem)(`${p}-showCoordinatesSetting`) || 'none',
|
|
26
|
+
intronBp: localStorageGetNumber(`${p}-intronBp`, 10),
|
|
27
|
+
upDownBp: localStorageGetNumber(`${p}-upDownBp`, 100),
|
|
28
|
+
upperCaseCDS: localStorageGetBoolean(`${p}-upperCaseCDS`, true),
|
|
21
29
|
charactersPerRow: 100,
|
|
22
30
|
feature: undefined,
|
|
23
31
|
mode: '',
|
|
24
32
|
}))
|
|
25
33
|
.actions(self => ({
|
|
26
|
-
/**
|
|
27
|
-
* #action
|
|
28
|
-
*/
|
|
29
34
|
setFeature(f) {
|
|
30
35
|
self.feature = f;
|
|
31
36
|
},
|
|
32
|
-
/**
|
|
33
|
-
* #action
|
|
34
|
-
*/
|
|
35
37
|
setUpDownBp(f) {
|
|
36
38
|
self.upDownBp = f;
|
|
37
39
|
},
|
|
38
|
-
/**
|
|
39
|
-
* #action
|
|
40
|
-
*/
|
|
41
40
|
setIntronBp(f) {
|
|
42
41
|
self.intronBp = f;
|
|
43
42
|
},
|
|
44
|
-
/**
|
|
45
|
-
* #action
|
|
46
|
-
*/
|
|
47
43
|
setUpperCaseCDS(f) {
|
|
48
44
|
self.upperCaseCDS = f;
|
|
49
45
|
},
|
|
50
|
-
/**
|
|
51
|
-
* #action
|
|
52
|
-
*/
|
|
53
46
|
setShowCoordinates(f) {
|
|
54
47
|
self.showCoordinatesSetting = f;
|
|
55
48
|
},
|
|
56
|
-
/**
|
|
57
|
-
* #action
|
|
58
|
-
*/
|
|
59
49
|
setMode(mode) {
|
|
60
50
|
self.mode = mode;
|
|
61
51
|
},
|
|
62
52
|
}))
|
|
63
53
|
.views(self => ({
|
|
64
|
-
/**
|
|
65
|
-
* #getter
|
|
66
|
-
*/
|
|
67
54
|
get showCoordinates() {
|
|
68
55
|
return self.showCoordinatesSetting !== 'none';
|
|
69
56
|
},
|
|
70
|
-
/**
|
|
71
|
-
* #getter
|
|
72
|
-
*/
|
|
73
57
|
get showGenomicCoordsOption() {
|
|
74
58
|
return (self.mode === 'gene' ||
|
|
75
59
|
self.mode === 'gene_updownstream' ||
|
|
76
60
|
self.mode === 'genomic' ||
|
|
77
61
|
self.mode === 'genomic_sequence_updownstream');
|
|
78
62
|
},
|
|
79
|
-
/**
|
|
80
|
-
* #getter
|
|
81
|
-
*/
|
|
82
63
|
get hasCDS() {
|
|
83
64
|
var _a, _b;
|
|
84
65
|
return (_b = (_a = self.feature) === null || _a === void 0 ? void 0 : _a.subfeatures) === null || _b === void 0 ? void 0 : _b.some(sub => sub.type === 'CDS');
|
|
85
66
|
},
|
|
86
|
-
/**
|
|
87
|
-
* #getter
|
|
88
|
-
*/
|
|
89
67
|
get hasExon() {
|
|
90
68
|
var _a, _b;
|
|
91
69
|
return (_b = (_a = self.feature) === null || _a === void 0 ? void 0 : _a.subfeatures) === null || _b === void 0 ? void 0 : _b.some(sub => sub.type === 'exon');
|
|
92
70
|
},
|
|
93
|
-
/**
|
|
94
|
-
* #getter
|
|
95
|
-
*/
|
|
96
71
|
get hasExonOrCDS() {
|
|
97
72
|
return this.hasExon || this.hasCDS;
|
|
98
73
|
},
|
|
@@ -100,10 +75,10 @@ function SequenceFeatureDetailsF() {
|
|
|
100
75
|
.actions(self => ({
|
|
101
76
|
afterAttach() {
|
|
102
77
|
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
|
|
103
|
-
(
|
|
104
|
-
(
|
|
105
|
-
(
|
|
106
|
-
(0, util_1.localStorageSetItem)(
|
|
78
|
+
localStorageSetNumber(`${p}-upDownBp`, self.upDownBp);
|
|
79
|
+
localStorageSetNumber(`${p}-intronBp`, self.intronBp);
|
|
80
|
+
localStorageSetBoolean(`${p}-upperCaseCDS`, self.upperCaseCDS);
|
|
81
|
+
(0, util_1.localStorageSetItem)(`${p}-showCoordinatesSetting`, self.showCoordinatesSetting);
|
|
107
82
|
}));
|
|
108
83
|
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
|
|
109
84
|
self.setMode(self.hasCDS ? 'cds' : self.hasExon ? 'cdna' : 'genomic');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import type { SimpleFeatureSerialized } from '../../../util';
|
|
3
|
+
import type { Feat } from '../../util';
|
|
4
|
+
import type { SequenceFeatureDetailsModel } from '../model';
|
|
5
5
|
declare const CDNASequence: ({ utr, cds, exons, sequence, upstream, downstream, feature, includeIntrons, collapseIntron, model, }: {
|
|
6
6
|
utr: Feat[];
|
|
7
7
|
cds: Feat[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Feat } from '../../util';
|
|
3
|
-
import { SequenceFeatureDetailsModel } from '../model';
|
|
2
|
+
import type { Feat } from '../../util';
|
|
3
|
+
import type { SequenceFeatureDetailsModel } from '../model';
|
|
4
4
|
declare const CDSSequence: ({ cds, sequence, model, }: {
|
|
5
5
|
cds: Feat[];
|
|
6
6
|
sequence: string;
|
|
@@ -5,17 +5,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const mobx_react_1 = require("mobx-react");
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const util_2 = require("../../util");
|
|
8
|
+
const util_1 = require("../../util");
|
|
9
|
+
const util_2 = require("../util");
|
|
11
10
|
const SequenceDisplay_1 = __importDefault(require("./SequenceDisplay"));
|
|
12
11
|
const CDSSequence = (0, mobx_react_1.observer)(function ({ cds, sequence, model, }) {
|
|
13
12
|
const { charactersPerRow, showCoordinates } = model;
|
|
14
|
-
const { segments } = (0,
|
|
15
|
-
str: (0,
|
|
13
|
+
const { segments } = (0, util_2.splitString)({
|
|
14
|
+
str: (0, util_1.stitch)(cds, sequence),
|
|
16
15
|
charactersPerRow,
|
|
17
16
|
showCoordinates,
|
|
18
17
|
});
|
|
19
|
-
return (react_1.default.createElement(SequenceDisplay_1.default, { model: model, color:
|
|
18
|
+
return (react_1.default.createElement(SequenceDisplay_1.default, { model: model, color: util_2.cdsColor, chunks: segments, start: 0 }));
|
|
20
19
|
});
|
|
21
20
|
exports.default = CDSSequence;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { SimpleFeatureSerialized } from '../../../util';
|
|
3
|
+
import type { SequenceFeatureDetailsModel } from '../model';
|
|
4
4
|
declare const GenomicSequence: ({ sequence, upstream, feature, downstream, model, }: {
|
|
5
5
|
sequence: string;
|
|
6
6
|
feature: SimpleFeatureSerialized;
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const mobx_react_1 = require("mobx-react");
|
|
8
|
-
// locals
|
|
9
8
|
const util_1 = require("../util");
|
|
10
9
|
const SequenceDisplay_1 = __importDefault(require("./SequenceDisplay"));
|
|
11
10
|
const GenomicSequence = (0, mobx_react_1.observer)(function ({ sequence, upstream, feature, downstream, model, }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Feat } from '../../util';
|
|
3
|
-
import { SequenceFeatureDetailsModel } from '../model';
|
|
2
|
+
import type { Feat } from '../../util';
|
|
3
|
+
import type { SequenceFeatureDetailsModel } from '../model';
|
|
4
4
|
declare const ProteinSequence: ({ cds, sequence, codonTable, model, }: {
|
|
5
5
|
cds: Feat[];
|
|
6
6
|
sequence: string;
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const mobx_react_1 = require("mobx-react");
|
|
8
|
-
// locals
|
|
9
8
|
const util_1 = require("../../util");
|
|
10
9
|
const util_2 = require("../util");
|
|
11
10
|
const SequenceDisplay_1 = __importDefault(require("./SequenceDisplay"));
|
|
@@ -14,7 +13,6 @@ const ProteinSequence = (0, mobx_react_1.observer)(function ({ cds, sequence, co
|
|
|
14
13
|
const str = (0, util_1.stitch)(cds, sequence);
|
|
15
14
|
let protein = '';
|
|
16
15
|
for (let i = 0; i < str.length; i += 3) {
|
|
17
|
-
// use & symbol for undefined codon, or partial slice
|
|
18
16
|
protein += codonTable[str.slice(i, i + 3)] || '&';
|
|
19
17
|
}
|
|
20
18
|
const { segments } = (0, util_2.splitString)({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SequenceFeatureDetailsModel } from '../model';
|
|
2
|
+
import type { SequenceFeatureDetailsModel } from '../model';
|
|
3
3
|
declare const SequenceDisplay: ({ chunks, start, color, strand, coordStart, model, }: {
|
|
4
4
|
chunks: string[];
|
|
5
5
|
start: number;
|
|
@@ -21,9 +21,7 @@ const SequenceDisplay = (0, mobx_react_1.observer)(function ({ chunks, start, co
|
|
|
21
21
|
: showCoordinates
|
|
22
22
|
? ' \n'
|
|
23
23
|
: '';
|
|
24
|
-
return (
|
|
25
|
-
/* biome-ignore lint/suspicious/noArrayIndexKey: */
|
|
26
|
-
react_1.default.createElement(react_1.default.Fragment, { key: `${chunk}-${idx}` },
|
|
24
|
+
return (react_1.default.createElement(react_1.default.Fragment, { key: `${chunk}-${idx}` },
|
|
27
25
|
showCoordinates ? prefix : null,
|
|
28
26
|
react_1.default.createElement("span", { style: { background: color } }, chunk),
|
|
29
27
|
postfix));
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.genomeColor = exports.updownstreamColor = exports.cdsColor = exports.proteinColor = exports.utrColor = exports.intronColor = void 0;
|
|
4
4
|
exports.splitString = splitString;
|
|
5
|
-
// note that these are currently put into the style section instead of being
|
|
6
|
-
// defined in classes to aid copy and paste to an external document e.g. word
|
|
7
5
|
exports.intronColor = undefined;
|
|
8
6
|
exports.utrColor = 'rgb(200,240,240)';
|
|
9
7
|
exports.proteinColor = 'rgb(220,160,220)';
|
|
@@ -26,8 +24,6 @@ function splitString({ str, charactersPerRow, showCoordinates, currRemainder = 0
|
|
|
26
24
|
if (showCoordinates) {
|
|
27
25
|
let res = '';
|
|
28
26
|
for (let i = 0, j = splitStart; i < r.length; i++, j++) {
|
|
29
|
-
// note: this adds a space at the start but it causes trouble to try to
|
|
30
|
-
// say e.g. j%splitSize==0 && j to try to only add non-zero spaces
|
|
31
27
|
if (j % splitSize === 0) {
|
|
32
28
|
res += ' ';
|
|
33
29
|
j = 0;
|
|
@@ -41,7 +37,7 @@ function splitString({ str, charactersPerRow, showCoordinates, currRemainder = 0
|
|
|
41
37
|
else {
|
|
42
38
|
chunks[iter] = r;
|
|
43
39
|
}
|
|
44
|
-
splitStart = 0;
|
|
40
|
+
splitStart = 0;
|
|
45
41
|
offset += inc;
|
|
46
42
|
}
|
|
47
43
|
return {
|
|
@@ -1,56 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
/**
|
|
4
|
-
* #stateModel BaseFeatureWidget
|
|
5
|
-
* displays data about features, allowing configuration callbacks to modify the
|
|
6
|
-
* contents of what is displayed
|
|
7
|
-
*
|
|
8
|
-
* see: formatDetails-\>feature,formatDetails-\>subfeatures
|
|
9
|
-
*/
|
|
1
|
+
import type PluginManager from '../PluginManager';
|
|
2
|
+
import type { Instance } from 'mobx-state-tree';
|
|
10
3
|
export declare function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
11
|
-
/**
|
|
12
|
-
* #property
|
|
13
|
-
*/
|
|
14
4
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
15
|
-
/**
|
|
16
|
-
* #property
|
|
17
|
-
*/
|
|
18
5
|
type: import("mobx-state-tree").ISimpleType<"BaseFeatureWidget">;
|
|
19
|
-
/**
|
|
20
|
-
* #property
|
|
21
|
-
*/
|
|
22
6
|
featureData: import("mobx-state-tree").IType<any, any, any>;
|
|
23
|
-
/**
|
|
24
|
-
* #property
|
|
25
|
-
*/
|
|
26
7
|
formattedFields: import("mobx-state-tree").IType<any, any, any>;
|
|
27
|
-
/**
|
|
28
|
-
* #property
|
|
29
|
-
*/
|
|
30
8
|
unformattedFeatureData: import("mobx-state-tree").IType<any, any, any>;
|
|
31
|
-
/**
|
|
32
|
-
* #property
|
|
33
|
-
*/
|
|
34
9
|
view: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
|
|
35
|
-
/**
|
|
36
|
-
* #property
|
|
37
|
-
*/
|
|
38
10
|
track: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
|
|
39
|
-
/**
|
|
40
|
-
* #property
|
|
41
|
-
*/
|
|
42
11
|
trackId: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
43
|
-
/**
|
|
44
|
-
* #property
|
|
45
|
-
*/
|
|
46
12
|
trackType: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
47
|
-
/**
|
|
48
|
-
* #property
|
|
49
|
-
*/
|
|
50
13
|
maxDepth: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
51
|
-
/**
|
|
52
|
-
* #property
|
|
53
|
-
*/
|
|
54
14
|
sequenceFeatureDetails: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{}, {
|
|
55
15
|
showCoordinatesSetting: string;
|
|
56
16
|
intronBp: number;
|
|
@@ -76,77 +36,26 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
76
36
|
afterAttach(): void;
|
|
77
37
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
78
38
|
}, {
|
|
79
|
-
/**
|
|
80
|
-
* #volatile
|
|
81
|
-
*/
|
|
82
39
|
error: unknown;
|
|
83
40
|
} & {
|
|
84
|
-
/**
|
|
85
|
-
* #action
|
|
86
|
-
*/
|
|
87
41
|
setFeatureData(featureData: Record<string, unknown>): void;
|
|
88
|
-
/**
|
|
89
|
-
* #action
|
|
90
|
-
*/
|
|
91
42
|
clearFeatureData(): void;
|
|
92
|
-
/**
|
|
93
|
-
* #action
|
|
94
|
-
*/
|
|
95
43
|
setFormattedData(feat: Record<string, unknown>): void;
|
|
96
|
-
/**
|
|
97
|
-
* #action
|
|
98
|
-
*/
|
|
99
44
|
setExtra(type?: string, trackId?: string, maxDepth?: number): void;
|
|
100
|
-
/**
|
|
101
|
-
* #action
|
|
102
|
-
*/
|
|
103
45
|
setError(e: unknown): void;
|
|
104
46
|
} & {
|
|
105
47
|
afterCreate(): void;
|
|
106
48
|
}, import("mobx-state-tree").ModelCreationType<import("mobx-state-tree/dist/internal").ExtractCFromProps<{
|
|
107
|
-
/**
|
|
108
|
-
* #property
|
|
109
|
-
*/
|
|
110
49
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
111
|
-
/**
|
|
112
|
-
* #property
|
|
113
|
-
*/
|
|
114
50
|
type: import("mobx-state-tree").ISimpleType<"BaseFeatureWidget">;
|
|
115
|
-
/**
|
|
116
|
-
* #property
|
|
117
|
-
*/
|
|
118
51
|
featureData: import("mobx-state-tree").IType<any, any, any>;
|
|
119
|
-
/**
|
|
120
|
-
* #property
|
|
121
|
-
*/
|
|
122
52
|
formattedFields: import("mobx-state-tree").IType<any, any, any>;
|
|
123
|
-
/**
|
|
124
|
-
* #property
|
|
125
|
-
*/
|
|
126
53
|
unformattedFeatureData: import("mobx-state-tree").IType<any, any, any>;
|
|
127
|
-
/**
|
|
128
|
-
* #property
|
|
129
|
-
*/
|
|
130
54
|
view: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
|
|
131
|
-
/**
|
|
132
|
-
* #property
|
|
133
|
-
*/
|
|
134
55
|
track: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
|
|
135
|
-
/**
|
|
136
|
-
* #property
|
|
137
|
-
*/
|
|
138
56
|
trackId: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
139
|
-
/**
|
|
140
|
-
* #property
|
|
141
|
-
*/
|
|
142
57
|
trackType: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
143
|
-
/**
|
|
144
|
-
* #property
|
|
145
|
-
*/
|
|
146
58
|
maxDepth: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
147
|
-
/**
|
|
148
|
-
* #property
|
|
149
|
-
*/
|
|
150
59
|
sequenceFeatureDetails: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{}, {
|
|
151
60
|
showCoordinatesSetting: string;
|
|
152
61
|
intronBp: number;
|
|
@@ -179,8 +88,8 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
179
88
|
trackId: string | undefined;
|
|
180
89
|
trackType: string | undefined;
|
|
181
90
|
maxDepth: number | undefined;
|
|
182
|
-
formattedFields: any;
|
|
183
91
|
sequenceFeatureDetails: import("mobx-state-tree").ModelSnapshotType<{}>;
|
|
92
|
+
formattedFields: any;
|
|
184
93
|
finalizedFeatureData: any;
|
|
185
94
|
}>;
|
|
186
95
|
export type BaseFeatureWidgetStateModel = ReturnType<typeof stateModelFactory>;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.stateModelFactory = stateModelFactory;
|
|
7
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
8
4
|
const mobx_1 = require("mobx");
|
|
9
|
-
const
|
|
5
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
10
6
|
const configuration_1 = require("../configuration");
|
|
11
7
|
const util_1 = require("../util");
|
|
12
|
-
const mst_1 = require("../util/types/mst");
|
|
13
8
|
const model_1 = require("./SequenceFeatureDetails/model");
|
|
14
9
|
const util_2 = require("./util");
|
|
10
|
+
const mst_1 = require("../util/types/mst");
|
|
15
11
|
function formatSubfeatures(obj, depth, parse, currentDepth = 0, returnObj = {}) {
|
|
16
12
|
var _a;
|
|
17
13
|
if (depth <= currentDepth) {
|
|
@@ -22,97 +18,39 @@ function formatSubfeatures(obj, depth, parse, currentDepth = 0, returnObj = {})
|
|
|
22
18
|
parse(sub);
|
|
23
19
|
});
|
|
24
20
|
}
|
|
25
|
-
/**
|
|
26
|
-
* #stateModel BaseFeatureWidget
|
|
27
|
-
* displays data about features, allowing configuration callbacks to modify the
|
|
28
|
-
* contents of what is displayed
|
|
29
|
-
*
|
|
30
|
-
* see: formatDetails-\>feature,formatDetails-\>subfeatures
|
|
31
|
-
*/
|
|
32
21
|
function stateModelFactory(pluginManager) {
|
|
33
22
|
return mobx_state_tree_1.types
|
|
34
23
|
.model('BaseFeatureWidget', {
|
|
35
|
-
/**
|
|
36
|
-
* #property
|
|
37
|
-
*/
|
|
38
24
|
id: mst_1.ElementId,
|
|
39
|
-
/**
|
|
40
|
-
* #property
|
|
41
|
-
*/
|
|
42
25
|
type: mobx_state_tree_1.types.literal('BaseFeatureWidget'),
|
|
43
|
-
/**
|
|
44
|
-
* #property
|
|
45
|
-
*/
|
|
46
26
|
featureData: mobx_state_tree_1.types.frozen(),
|
|
47
|
-
/**
|
|
48
|
-
* #property
|
|
49
|
-
*/
|
|
50
27
|
formattedFields: mobx_state_tree_1.types.frozen(),
|
|
51
|
-
/**
|
|
52
|
-
* #property
|
|
53
|
-
*/
|
|
54
28
|
unformattedFeatureData: mobx_state_tree_1.types.frozen(),
|
|
55
|
-
/**
|
|
56
|
-
* #property
|
|
57
|
-
*/
|
|
58
29
|
view: mobx_state_tree_1.types.safeReference(pluginManager.pluggableMstType('view', 'stateModel')),
|
|
59
|
-
/**
|
|
60
|
-
* #property
|
|
61
|
-
*/
|
|
62
30
|
track: mobx_state_tree_1.types.safeReference(pluginManager.pluggableMstType('track', 'stateModel')),
|
|
63
|
-
/**
|
|
64
|
-
* #property
|
|
65
|
-
*/
|
|
66
31
|
trackId: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.string),
|
|
67
|
-
/**
|
|
68
|
-
* #property
|
|
69
|
-
*/
|
|
70
32
|
trackType: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.string),
|
|
71
|
-
/**
|
|
72
|
-
* #property
|
|
73
|
-
*/
|
|
74
33
|
maxDepth: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.number),
|
|
75
|
-
/**
|
|
76
|
-
* #property
|
|
77
|
-
*/
|
|
78
34
|
sequenceFeatureDetails: mobx_state_tree_1.types.optional((0, model_1.SequenceFeatureDetailsF)(), {}),
|
|
79
35
|
})
|
|
80
36
|
.volatile(() => ({
|
|
81
|
-
/**
|
|
82
|
-
* #volatile
|
|
83
|
-
*/
|
|
84
37
|
error: undefined,
|
|
85
38
|
}))
|
|
86
39
|
.actions(self => ({
|
|
87
|
-
/**
|
|
88
|
-
* #action
|
|
89
|
-
*/
|
|
90
40
|
setFeatureData(featureData) {
|
|
91
41
|
self.unformattedFeatureData = featureData;
|
|
92
42
|
},
|
|
93
|
-
/**
|
|
94
|
-
* #action
|
|
95
|
-
*/
|
|
96
43
|
clearFeatureData() {
|
|
97
44
|
self.featureData = undefined;
|
|
98
45
|
},
|
|
99
|
-
/**
|
|
100
|
-
* #action
|
|
101
|
-
*/
|
|
102
46
|
setFormattedData(feat) {
|
|
103
47
|
self.featureData = feat;
|
|
104
48
|
},
|
|
105
|
-
/**
|
|
106
|
-
* #action
|
|
107
|
-
*/
|
|
108
49
|
setExtra(type, trackId, maxDepth) {
|
|
109
50
|
self.trackId = trackId;
|
|
110
51
|
self.trackType = type;
|
|
111
52
|
self.maxDepth = maxDepth;
|
|
112
53
|
},
|
|
113
|
-
/**
|
|
114
|
-
* #action
|
|
115
|
-
*/
|
|
116
54
|
setError(e) {
|
|
117
55
|
self.error = e;
|
|
118
56
|
},
|
|
@@ -127,7 +65,7 @@ function stateModelFactory(pluginManager) {
|
|
|
127
65
|
self.setExtra(track.type, track.configuration.trackId, (0, configuration_1.getConf)(track, ['formatDetails', 'maxDepth']));
|
|
128
66
|
}
|
|
129
67
|
if (unformattedFeatureData) {
|
|
130
|
-
const feature = (
|
|
68
|
+
const feature = structuredClone(unformattedFeatureData);
|
|
131
69
|
const combine = (arg2, feature) => ({
|
|
132
70
|
...(0, configuration_1.getConf)(session, ['formatDetails', arg2], { feature }),
|
|
133
71
|
...(0, configuration_1.getConf)(track, ['formatDetails', arg2], { feature }),
|
|
@@ -149,7 +87,6 @@ function stateModelFactory(pluginManager) {
|
|
|
149
87
|
},
|
|
150
88
|
}))
|
|
151
89
|
.preProcessSnapshot(snap => {
|
|
152
|
-
// @ts-expect-error
|
|
153
90
|
const { featureData, finalizedFeatureData, ...rest } = snap;
|
|
154
91
|
return {
|
|
155
92
|
unformattedFeatureData: featureData,
|
|
@@ -158,15 +95,8 @@ function stateModelFactory(pluginManager) {
|
|
|
158
95
|
};
|
|
159
96
|
})
|
|
160
97
|
.postProcessSnapshot(snap => {
|
|
161
|
-
// xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
|
|
162
98
|
const { unformattedFeatureData, featureData, ...rest } = snap;
|
|
163
|
-
// finalizedFeatureData avoids running formatter twice if loading from
|
|
164
|
-
// snapshot
|
|
165
99
|
return {
|
|
166
|
-
// replacing undefined with null helps with allowing fields to be
|
|
167
|
-
// hidden, setting null is not allowed by jexl so we set it to
|
|
168
|
-
// undefined to hide. see config guide. this replacement happens both
|
|
169
|
-
// here and when displaying the featureData in base feature widget
|
|
170
100
|
finalizedFeatureData: (0, util_2.replaceUndefinedWithNull)(featureData),
|
|
171
101
|
...rest,
|
|
172
102
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { BaseFeatureWidgetModel } from './stateModelFactory';
|
|
3
|
+
import type { SimpleFeatureSerialized } from '../util/simpleFeature';
|
|
4
4
|
export interface BaseProps extends BaseCardProps {
|
|
5
5
|
feature: SimpleFeatureSerialized;
|
|
6
6
|
formatter?: (val: unknown, key: string) => React.ReactNode;
|