@jbrowse/core 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +2 -1
- package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +4 -4
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +10 -9
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +3 -13
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +2 -1
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +2 -2
- package/PluginManager.d.ts +1 -1
- package/ReExports/modules.d.ts +1 -1
- package/ReExports/modules.js +1 -22
- package/assemblyManager/assemblyManager.js +1 -1
- package/data_adapters/BaseAdapter/BaseAdapter.d.ts +2 -2
- package/data_adapters/BaseAdapter/BaseAdapter.js +1 -0
- package/package.json +5 -5
- package/pluggableElementTypes/renderers/CircularChordRendererType.js +8 -9
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +2 -4
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +2 -30
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +1 -1
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +2 -30
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +6 -7
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/DataGridFlexContainer.d.ts +3 -0
- package/ui/DataGridFlexContainer.js +15 -0
- package/ui/theme.js +5 -5
- package/util/cluster.d.ts +17 -0
- package/util/cluster.js +96 -0
- package/util/index.d.ts +2 -1
- package/util/index.js +6 -1
- package/util/offscreenCanvasUtils.d.ts +11 -11
- package/util/offscreenCanvasUtils.js +4 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export default function ArrayValue({ name, value, description, prefix, }: {
|
|
1
|
+
export default function ArrayValue({ name, value, description, formatter, prefix, }: {
|
|
2
2
|
description?: React.ReactNode;
|
|
3
3
|
name: string;
|
|
4
4
|
value: unknown[];
|
|
5
|
+
formatter?: (value: unknown, key: string) => React.ReactNode;
|
|
5
6
|
prefix?: string[];
|
|
6
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -24,15 +24,15 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
24
24
|
overflow: 'auto',
|
|
25
25
|
},
|
|
26
26
|
}));
|
|
27
|
-
function ArrayValue({ name, value, description, prefix = [], }) {
|
|
27
|
+
function ArrayValue({ name, value, description, formatter, prefix = [], }) {
|
|
28
28
|
const { classes } = useStyles();
|
|
29
29
|
if (value.length === 1) {
|
|
30
|
-
return (0, util_1.isObject)(value[0]) ? ((0, jsx_runtime_1.jsx)(Attributes_1.default, { attributes: value[0], prefix: [...prefix, name] })) : ((0, jsx_runtime_1.jsxs)("div", { className: classes.field, children: [(0, jsx_runtime_1.jsx)(FieldName_1.default, { prefix: prefix, description: description, name: name }), (0, jsx_runtime_1.jsx)(BasicValue_1.default, { value: value[0] })] }));
|
|
30
|
+
return (0, util_1.isObject)(value[0]) ? ((0, jsx_runtime_1.jsx)(Attributes_1.default, { formatter: formatter, attributes: value[0], prefix: [...prefix, name] })) : ((0, jsx_runtime_1.jsxs)("div", { className: classes.field, children: [(0, jsx_runtime_1.jsx)(FieldName_1.default, { prefix: prefix, description: description, name: name }), (0, jsx_runtime_1.jsx)(BasicValue_1.default, { value: formatter ? formatter(value[0], name) : value[0] })] }));
|
|
31
31
|
}
|
|
32
32
|
else if (value.every(val => (0, util_1.isObject)(val))) {
|
|
33
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: value.map((val, i) => ((0, jsx_runtime_1.jsx)(Attributes_1.default, { attributes: val, prefix: [...prefix, `${name}-${i}`] }, `${JSON.stringify(val)}-${i}`))) }));
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: value.map((val, i) => ((0, jsx_runtime_1.jsx)(Attributes_1.default, { formatter: formatter, attributes: val, prefix: [...prefix, `${name}-${i}`] }, `${JSON.stringify(val)}-${i}`))) }));
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: classes.field, children: [(0, jsx_runtime_1.jsx)(FieldName_1.default, { prefix: prefix, description: description, name: name }), value.map((val, i) => ((0, jsx_runtime_1.jsx)("div", { className: classes.fieldSubvalue, children: (0, jsx_runtime_1.jsx)(BasicValue_1.default, { value: val }) }, `${JSON.stringify(val)}-${i}`)))] }));
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: classes.field, children: [(0, jsx_runtime_1.jsx)(FieldName_1.default, { prefix: prefix, description: description, name: name }), value.map((val, i) => ((0, jsx_runtime_1.jsx)("div", { className: classes.fieldSubvalue, children: (0, jsx_runtime_1.jsx)(BasicValue_1.default, { value: formatter ? formatter(val, name) : val }) }, `${JSON.stringify(val)}-${i}`)))] }));
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -24,24 +24,25 @@ const globalOmit = [
|
|
|
24
24
|
'thickEnd',
|
|
25
25
|
];
|
|
26
26
|
function Attributes(props) {
|
|
27
|
-
const { attributes, omit = [], omitSingleLevel = [], descriptions, formatter
|
|
27
|
+
const { attributes, omit = [], omitSingleLevel = [], descriptions, formatter, hideUris, prefix = [], } = props;
|
|
28
28
|
const omits = new Set([...omit, ...globalOmit, ...omitSingleLevel]);
|
|
29
29
|
const { __jbrowsefmt, ...rest } = attributes;
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
const filteredFormattedAttributes = Object.entries({
|
|
31
|
+
...rest,
|
|
32
|
+
...__jbrowsefmt,
|
|
33
|
+
}).filter(([k, v]) => v != null && !omits.has(k));
|
|
34
|
+
const maxLabelWidth = (0, util_1.generateMaxWidth)(filteredFormattedAttributes, prefix);
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: filteredFormattedAttributes.map(([key, value]) => {
|
|
35
36
|
const description = (0, util_1.accessNested)([...prefix, key], descriptions);
|
|
36
37
|
if (Array.isArray(value)) {
|
|
37
|
-
return value.length > 1 && value.every(val => (0, util_2.isObject)(val)) ? ((0, jsx_runtime_1.jsx)(DataGridDetails_1.default, { name: key, prefix: prefix, value: value }, key)) : ((0, jsx_runtime_1.jsx)(ArrayValue_1.default, { name: key, value: value, description: description, prefix: prefix }, key));
|
|
38
|
+
return value.length > 1 && value.every(val => (0, util_2.isObject)(val)) ? ((0, jsx_runtime_1.jsx)(DataGridDetails_1.default, { name: key, prefix: prefix, value: value }, key)) : ((0, jsx_runtime_1.jsx)(ArrayValue_1.default, { name: key, value: value, formatter: formatter, description: description, prefix: prefix }, key));
|
|
38
39
|
}
|
|
39
40
|
else if ((0, util_2.isObject)(value)) {
|
|
40
41
|
const { omitSingleLevel, ...rest } = props;
|
|
41
|
-
return (0, util_2.isUriLocation)(value) ? (hideUris ? null : ((0, jsx_runtime_1.jsx)(UriField_1.default, { name: key, prefix: prefix, value: value }, key))) : ((0, jsx_runtime_1.jsx)(Attributes, { ...rest, attributes: value, descriptions: descriptions, prefix: [...prefix, key] }, key));
|
|
42
|
+
return (0, util_2.isUriLocation)(value) ? (hideUris ? null : ((0, jsx_runtime_1.jsx)(UriField_1.default, { name: key, prefix: prefix, value: value }, key))) : ((0, jsx_runtime_1.jsx)(Attributes, { ...rest, formatter: formatter, attributes: value, descriptions: descriptions, prefix: [...prefix, key] }, key));
|
|
42
43
|
}
|
|
43
44
|
else {
|
|
44
|
-
return ((0, jsx_runtime_1.jsx)(SimpleField_1.default, { name: key,
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)(SimpleField_1.default, { name: key, formatter: formatter, value: value, description: description, prefix: prefix, width: Math.min(maxLabelWidth, MAX_FIELD_NAME_WIDTH) }, key));
|
|
45
46
|
}
|
|
46
47
|
}) }));
|
|
47
48
|
}
|
|
@@ -11,6 +11,7 @@ const x_data_grid_1 = require("@mui/x-data-grid");
|
|
|
11
11
|
const mui_1 = require("tss-react/mui");
|
|
12
12
|
const FieldName_1 = __importDefault(require("./FieldName"));
|
|
13
13
|
const ui_1 = require("../../ui");
|
|
14
|
+
const DataGridFlexContainer_1 = __importDefault(require("../../ui/DataGridFlexContainer"));
|
|
14
15
|
const util_1 = require("../../util");
|
|
15
16
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
16
17
|
margin: {
|
|
@@ -52,21 +53,10 @@ function DataGridDetails({ value, prefix, name, }) {
|
|
|
52
53
|
if (unionKeys.size < keys.length + 5) {
|
|
53
54
|
return ((0, jsx_runtime_1.jsxs)("div", { className: classes.margin, children: [(0, jsx_runtime_1.jsx)(FieldName_1.default, { prefix: prefix, name: name }), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: checked, onChange: event => {
|
|
54
55
|
setChecked(event.target.checked);
|
|
55
|
-
} }), label: (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", children: "Show options" }) }), (0, jsx_runtime_1.jsx)(
|
|
56
|
-
toolbar: checked ? x_data_grid_1.GridToolbar : null,
|
|
57
|
-
}, slotProps: {
|
|
58
|
-
toolbar: {
|
|
59
|
-
printOptions: {
|
|
60
|
-
disableToolbarButton: true,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
}, columns: colNames.map((val, index) => ({
|
|
56
|
+
} }), label: (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", children: "Show options" }) }), (0, jsx_runtime_1.jsx)(DataGridFlexContainer_1.default, { children: (0, jsx_runtime_1.jsx)(x_data_grid_1.DataGrid, { rows: rows, rowHeight: 20, columnHeaderHeight: 35, hideFooter: rows.length < 25, showToolbar: checked, columns: colNames.map((val, index) => ({
|
|
64
57
|
field: val,
|
|
65
|
-
renderCell: params => {
|
|
66
|
-
const value = params.value;
|
|
67
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: classes.cell, children: (0, jsx_runtime_1.jsx)(ui_1.SanitizedHTML, { html: (0, util_1.getStr)(value || '') }) }));
|
|
68
|
-
},
|
|
69
58
|
width: widths[index],
|
|
59
|
+
renderCell: ({ value }) => ((0, jsx_runtime_1.jsx)("div", { className: classes.cell, children: (0, jsx_runtime_1.jsx)(ui_1.SanitizedHTML, { html: (0, util_1.getStr)(value || '') }) })),
|
|
70
60
|
})) }) })] }));
|
|
71
61
|
}
|
|
72
62
|
return null;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export default function SimpleField({ name, value, description, prefix, width, }: {
|
|
1
|
+
export default function SimpleField({ name, value, description, prefix, width, formatter, }: {
|
|
2
2
|
description?: React.ReactNode;
|
|
3
3
|
name: string;
|
|
4
4
|
value: unknown;
|
|
5
5
|
prefix?: string[];
|
|
6
6
|
width?: number;
|
|
7
|
+
formatter?: (value: unknown, key: string) => React.ReactNode;
|
|
7
8
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -14,7 +14,7 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
14
14
|
flexWrap: 'wrap',
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
|
-
function SimpleField({ name, value, description, prefix, width, }) {
|
|
17
|
+
function SimpleField({ name, value, description, prefix, width, formatter, }) {
|
|
18
18
|
const { classes } = useStyles();
|
|
19
|
-
return value
|
|
19
|
+
return value != null ? ((0, jsx_runtime_1.jsxs)("div", { className: classes.field, children: [(0, jsx_runtime_1.jsx)(FieldName_1.default, { prefix: prefix, description: description, name: name, width: width }), (0, jsx_runtime_1.jsx)(BasicValue_1.default, { value: formatter ? formatter(value, name) : value })] })) : null;
|
|
20
20
|
}
|
package/PluginManager.d.ts
CHANGED
|
@@ -213,7 +213,7 @@ export default class PluginManager {
|
|
|
213
213
|
'mobx-react': typeof import("mobx-react");
|
|
214
214
|
'@mui/x-data-grid': {
|
|
215
215
|
useGridApiContext: typeof import("@mui/x-data-grid").useGridApiContext;
|
|
216
|
-
useGridApiRef: <Api extends import("@mui/x-data-grid").GridApiCommon = import("@mui/x-data-grid/internals").GridApiCommunity>() => import("@mui/x-internals/types").RefObject<Api>;
|
|
216
|
+
useGridApiRef: <Api extends import("@mui/x-data-grid").GridApiCommon = import("@mui/x-data-grid/internals").GridApiCommunity>() => import("@mui/x-internals/types").RefObject<Api | null>;
|
|
217
217
|
useGridRootProps: () => import("@mui/x-data-grid/internals").DataGridProcessedProps;
|
|
218
218
|
};
|
|
219
219
|
'@mui/material/utils': typeof import("@mui/material/utils");
|
package/ReExports/modules.d.ts
CHANGED
|
@@ -133,7 +133,7 @@ declare const libs: {
|
|
|
133
133
|
'mobx-react': typeof mxreact;
|
|
134
134
|
'@mui/x-data-grid': {
|
|
135
135
|
useGridApiContext: typeof useGridApiContext;
|
|
136
|
-
useGridApiRef: <Api extends import("@mui/x-data-grid").GridApiCommon = import("@mui/x-data-grid/internals").GridApiCommunity>() => import("@mui/x-internals/types").RefObject<Api>;
|
|
136
|
+
useGridApiRef: <Api extends import("@mui/x-data-grid").GridApiCommon = import("@mui/x-data-grid/internals").GridApiCommunity>() => import("@mui/x-internals/types").RefObject<Api | null>;
|
|
137
137
|
useGridRootProps: () => import("@mui/x-data-grid/internals").DataGridProcessedProps;
|
|
138
138
|
};
|
|
139
139
|
'@mui/material/utils': typeof MUIUtils;
|
package/ReExports/modules.js
CHANGED
|
@@ -120,7 +120,7 @@ const Entries = {
|
|
|
120
120
|
FormHelperText: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/material/FormHelperText')))),
|
|
121
121
|
FormGroup: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/material/FormGroup')))),
|
|
122
122
|
Grid: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/material/Grid')))),
|
|
123
|
-
Grid2: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/material/
|
|
123
|
+
Grid2: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/material/Grid')))),
|
|
124
124
|
Grow: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/material/Grow')))),
|
|
125
125
|
Icon: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/material/Icon')))),
|
|
126
126
|
IconButton: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/material/IconButton')))),
|
|
@@ -312,9 +312,6 @@ const DataGridEntries = {
|
|
|
312
312
|
GridRowCount: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/x-data-grid'))).then(module => ({
|
|
313
313
|
default: module.GridRowCount,
|
|
314
314
|
}))),
|
|
315
|
-
GridSaveAltIcon: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/x-data-grid'))).then(module => ({
|
|
316
|
-
default: module.GridSaveAltIcon,
|
|
317
|
-
}))),
|
|
318
315
|
GridSearchIcon: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/x-data-grid'))).then(module => ({
|
|
319
316
|
default: module.GridSearchIcon,
|
|
320
317
|
}))),
|
|
@@ -327,27 +324,9 @@ const DataGridEntries = {
|
|
|
327
324
|
GridTableRowsIcon: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/x-data-grid'))).then(module => ({
|
|
328
325
|
default: module.GridTableRowsIcon,
|
|
329
326
|
}))),
|
|
330
|
-
GridToolbar: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/x-data-grid'))).then(module => ({
|
|
331
|
-
default: module.GridToolbar,
|
|
332
|
-
}))),
|
|
333
|
-
GridToolbarColumnsButton: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/x-data-grid'))).then(module => ({
|
|
334
|
-
default: module.GridToolbarColumnsButton,
|
|
335
|
-
}))),
|
|
336
|
-
GridToolbarContainer: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/x-data-grid'))).then(module => ({
|
|
337
|
-
default: module.GridToolbarContainer,
|
|
338
|
-
}))),
|
|
339
|
-
GridToolbarDensitySelector: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/x-data-grid'))).then(module => ({
|
|
340
|
-
default: module.GridToolbarDensitySelector,
|
|
341
|
-
}))),
|
|
342
|
-
GridToolbarExport: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/x-data-grid'))).then(module => ({
|
|
343
|
-
default: module.GridToolbarExport,
|
|
344
|
-
}))),
|
|
345
327
|
GridToolbarExportContainer: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/x-data-grid'))).then(module => ({
|
|
346
328
|
default: module.GridToolbarExportContainer,
|
|
347
329
|
}))),
|
|
348
|
-
GridToolbarFilterButton: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/x-data-grid'))).then(module => ({
|
|
349
|
-
default: module.GridToolbarFilterButton,
|
|
350
|
-
}))),
|
|
351
330
|
GridTripleDotsVerticalIcon: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/x-data-grid'))).then(module => ({
|
|
352
331
|
default: module.GridTripleDotsVerticalIcon,
|
|
353
332
|
}))),
|
|
@@ -86,7 +86,7 @@ function assemblyManagerFactory(conf, pm) {
|
|
|
86
86
|
if (assembly) {
|
|
87
87
|
return assembly.isValidRefName(refName);
|
|
88
88
|
}
|
|
89
|
-
throw new Error(`Failed to look up refName
|
|
89
|
+
throw new Error(`Failed to look up refName:${refName} on assemblyName:${assemblyName} (assembly does not exist)`);
|
|
90
90
|
},
|
|
91
91
|
}))
|
|
92
92
|
.actions(self => ({
|
|
@@ -2,7 +2,7 @@ import type PluginManager from '../../PluginManager';
|
|
|
2
2
|
import type { AnyConfigurationModel } from '../../configuration';
|
|
3
3
|
import type { AugmentedRegion as Region } from '../../util/types';
|
|
4
4
|
import type { getSubAdapterType } from '../dataAdapterCache';
|
|
5
|
-
export declare
|
|
5
|
+
export declare class BaseAdapter {
|
|
6
6
|
config: AnyConfigurationModel;
|
|
7
7
|
getSubAdapter?: getSubAdapterType | undefined;
|
|
8
8
|
pluginManager?: PluginManager | undefined;
|
|
@@ -10,5 +10,5 @@ export declare abstract class BaseAdapter {
|
|
|
10
10
|
static capabilities: string[];
|
|
11
11
|
constructor(config?: AnyConfigurationModel, getSubAdapter?: getSubAdapterType | undefined, pluginManager?: PluginManager | undefined);
|
|
12
12
|
getConf(arg: string | string[]): any;
|
|
13
|
-
|
|
13
|
+
freeResources(_region: Region): void;
|
|
14
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "JBrowse 2 core libraries used by plugins",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"@gmod/abortable-promise-cache": "^2.0.0",
|
|
35
35
|
"@gmod/bgzf-filehandle": "^2.0.1",
|
|
36
36
|
"@gmod/http-range-fetcher": "^4.0.0",
|
|
37
|
-
"@mui/icons-material": "^
|
|
38
|
-
"@mui/material": "^
|
|
39
|
-
"@mui/x-data-grid": "^
|
|
37
|
+
"@mui/icons-material": "^7.0.0",
|
|
38
|
+
"@mui/material": "^7.0.0",
|
|
39
|
+
"@mui/x-data-grid": "^8.0.0",
|
|
40
40
|
"canvas-sequencer": "^3.1.0",
|
|
41
41
|
"canvas2svg": "^1.0.16",
|
|
42
42
|
"colord": "^2.9.3",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"access": "public",
|
|
70
70
|
"directory": "dist"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "0bb64d8cc7ecdd167515308b31eec3d9acbc59e4"
|
|
73
73
|
}
|
|
@@ -14,22 +14,21 @@ class CircularChordRendererType extends FeatureRendererType_1.default {
|
|
|
14
14
|
}
|
|
15
15
|
deserializeResultsInClient(res, args) {
|
|
16
16
|
const deserializedFeatures = new Map(res.features.map(f => util_1.SimpleFeature.fromJSON(f)).map(f => [f.id(), f]));
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
return args.exportSVG
|
|
18
|
+
? {
|
|
19
19
|
...res,
|
|
20
20
|
features: deserializedFeatures,
|
|
21
21
|
blockKey: 'circularChord',
|
|
22
22
|
html: this.supportsSVG
|
|
23
23
|
? res.html
|
|
24
24
|
: '<text y="12" fill="black">SVG export not supported for this track</text>',
|
|
25
|
+
}
|
|
26
|
+
: {
|
|
27
|
+
...res,
|
|
28
|
+
features: deserializedFeatures,
|
|
29
|
+
blockKey: 'circularChord',
|
|
30
|
+
reactElement: ((0, jsx_runtime_1.jsx)(RpcRenderedSvgGroup_1.default, { ...args, ...res, features: deserializedFeatures, RenderingComponent: this.ReactComponent })),
|
|
25
31
|
};
|
|
26
|
-
}
|
|
27
|
-
return {
|
|
28
|
-
...res,
|
|
29
|
-
features: deserializedFeatures,
|
|
30
|
-
blockKey: 'circularChord',
|
|
31
|
-
reactElement: ((0, jsx_runtime_1.jsx)(RpcRenderedSvgGroup_1.default, { ...args, ...res, features: deserializedFeatures, RenderingComponent: this.ReactComponent })),
|
|
32
|
-
};
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
exports.default = CircularChordRendererType;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { AnyReactComponentType, Feature } from '../../util';
|
|
2
2
|
import type { ThemeOptions } from '@mui/material';
|
|
3
|
-
|
|
3
|
+
declare const RpcRenderedSvgGroup: (props: {
|
|
4
4
|
html: string;
|
|
5
5
|
features: Map<string, Feature>;
|
|
6
6
|
theme: ThemeOptions;
|
|
7
|
-
displayModel?: any;
|
|
8
7
|
RenderingComponent: AnyReactComponentType;
|
|
9
|
-
}
|
|
10
|
-
declare const RpcRenderedSvgGroup: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
9
|
export default RpcRenderedSvgGroup;
|
|
@@ -1,37 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const material_1 = require("@mui/material");
|
|
6
4
|
const mobx_react_1 = require("mobx-react");
|
|
7
|
-
const client_1 = require("react-dom/client");
|
|
8
|
-
const ui_1 = require("../../ui");
|
|
9
|
-
const util_1 = require("../../util");
|
|
10
5
|
const RpcRenderedSvgGroup = (0, mobx_react_1.observer)(function RpcRenderedSvgGroup(props) {
|
|
11
|
-
const { html,
|
|
12
|
-
|
|
13
|
-
const rootRef = (0, react_1.useRef)(null);
|
|
14
|
-
(0, react_1.useEffect)(() => {
|
|
15
|
-
const renderTimeout = (0, util_1.rIC)(() => {
|
|
16
|
-
var _a;
|
|
17
|
-
if (!ref.current) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const jbrowseTheme = (0, ui_1.createJBrowseTheme)(theme);
|
|
21
|
-
rootRef.current =
|
|
22
|
-
(_a = rootRef.current) !== null && _a !== void 0 ? _a : (0, client_1.hydrateRoot)(ref.current, (0, jsx_runtime_1.jsx)(material_1.ThemeProvider, { theme: jbrowseTheme, children: (0, jsx_runtime_1.jsx)(RenderingComponent, { ...rest }) }));
|
|
23
|
-
});
|
|
24
|
-
return () => {
|
|
25
|
-
if (renderTimeout !== undefined) {
|
|
26
|
-
clearTimeout(renderTimeout);
|
|
27
|
-
}
|
|
28
|
-
const root = rootRef.current;
|
|
29
|
-
rootRef.current = null;
|
|
30
|
-
setTimeout(() => {
|
|
31
|
-
root === null || root === void 0 ? void 0 : root.unmount();
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
}, [RenderingComponent, theme, rest]);
|
|
35
|
-
return (0, jsx_runtime_1.jsx)("g", { ref: ref, dangerouslySetInnerHTML: { __html: html } });
|
|
6
|
+
const { html, RenderingComponent, ...rest } = props;
|
|
7
|
+
return (0, jsx_runtime_1.jsx)(RenderingComponent, { ...rest });
|
|
36
8
|
});
|
|
37
9
|
exports.default = RpcRenderedSvgGroup;
|
|
@@ -2,5 +2,5 @@ import type { RenderArgs, ResultsSerialized } from './ServerSideRendererType';
|
|
|
2
2
|
interface Props extends ResultsSerialized, RenderArgs {
|
|
3
3
|
RenderingComponent: React.ComponentType<any>;
|
|
4
4
|
}
|
|
5
|
-
declare const ServerSideRenderedContent: ({
|
|
5
|
+
declare const ServerSideRenderedContent: ({ html, RenderingComponent, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default ServerSideRenderedContent;
|
|
@@ -1,36 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const styles_1 = require("@mui/material/styles");
|
|
6
4
|
const mobx_react_1 = require("mobx-react");
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const util_1 = require("../../util");
|
|
10
|
-
const ServerSideRenderedContent = (0, mobx_react_1.observer)(function ServerSideRenderedContent({ theme, html, RenderingComponent, ...rest }) {
|
|
11
|
-
const ref = (0, react_1.useRef)(null);
|
|
12
|
-
const rootRef = (0, react_1.useRef)(null);
|
|
13
|
-
(0, react_1.useEffect)(() => {
|
|
14
|
-
const renderTimeout = (0, util_1.rIC)(() => {
|
|
15
|
-
var _a;
|
|
16
|
-
if (!ref.current) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const jbrowseTheme = (0, ui_1.createJBrowseTheme)(theme);
|
|
20
|
-
rootRef.current =
|
|
21
|
-
(_a = rootRef.current) !== null && _a !== void 0 ? _a : (0, client_1.hydrateRoot)(ref.current, (0, jsx_runtime_1.jsx)(styles_1.ThemeProvider, { theme: jbrowseTheme, children: (0, jsx_runtime_1.jsx)(RenderingComponent, { ...rest }) }));
|
|
22
|
-
});
|
|
23
|
-
return () => {
|
|
24
|
-
if (renderTimeout !== undefined) {
|
|
25
|
-
clearTimeout(renderTimeout);
|
|
26
|
-
}
|
|
27
|
-
const root = rootRef.current;
|
|
28
|
-
rootRef.current = null;
|
|
29
|
-
setTimeout(() => {
|
|
30
|
-
root === null || root === void 0 ? void 0 : root.unmount();
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
}, [theme, rest, RenderingComponent]);
|
|
34
|
-
return (0, jsx_runtime_1.jsx)("div", { ref: ref, dangerouslySetInnerHTML: { __html: html } });
|
|
5
|
+
const ServerSideRenderedContent = (0, mobx_react_1.observer)(function ServerSideRenderedContent({ html, RenderingComponent, ...props }) {
|
|
6
|
+
return (0, jsx_runtime_1.jsx)(RenderingComponent, { ...props });
|
|
35
7
|
});
|
|
36
8
|
exports.default = ServerSideRenderedContent;
|
|
@@ -28,18 +28,17 @@ class ServerSideRenderer extends RendererType_1.default {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
deserializeResultsInClient(res, args) {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
return args.exportSVG
|
|
32
|
+
? {
|
|
33
33
|
...res,
|
|
34
34
|
html: this.supportsSVG
|
|
35
35
|
? res.html
|
|
36
36
|
: '<text y="12" fill="black">SVG export not supported for this track</text>',
|
|
37
|
+
}
|
|
38
|
+
: {
|
|
39
|
+
...res,
|
|
40
|
+
reactElement: ((0, jsx_runtime_1.jsx)(ServerSideRenderedContent_1.default, { ...args, ...res, RenderingComponent: this.ReactComponent })),
|
|
37
41
|
};
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
...res,
|
|
41
|
-
reactElement: ((0, jsx_runtime_1.jsx)(ServerSideRenderedContent_1.default, { ...args, ...res, RenderingComponent: this.ReactComponent })),
|
|
42
|
-
};
|
|
43
42
|
}
|
|
44
43
|
deserializeArgsInWorker(args) {
|
|
45
44
|
const deserialized = { ...args };
|