@apollo-annotation/jbrowse-plugin-apollo 0.1.20 → 0.1.21
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/dist/index.esm.js +122 -73
- package/dist/index.esm.js.map +1 -1
- package/dist/jbrowse-plugin-apollo.cjs.development.js +122 -73
- package/dist/jbrowse-plugin-apollo.cjs.development.js.map +1 -1
- package/dist/jbrowse-plugin-apollo.cjs.production.min.js +1 -1
- package/dist/jbrowse-plugin-apollo.cjs.production.min.js.map +1 -1
- package/dist/jbrowse-plugin-apollo.umd.development.js +241 -152
- package/dist/jbrowse-plugin-apollo.umd.development.js.map +1 -1
- package/dist/jbrowse-plugin-apollo.umd.production.min.js +1 -1
- package/dist/jbrowse-plugin-apollo.umd.production.min.js.map +1 -1
- package/package.json +4 -4
- package/src/LinearApolloDisplay/components/LinearApolloDisplay.tsx +0 -4
- package/src/LinearApolloDisplay/configSchema.ts +5 -14
- package/src/LinearApolloDisplay/index.ts +1 -1
- package/src/LinearApolloDisplay/stateModel/base.ts +99 -14
- package/src/index.ts +2 -2
- package/src/makeDisplayComponent.tsx +49 -25
- package/src/LinearApolloDisplay/stateModel/trackHeightMixin.ts +0 -43
package/dist/index.esm.js
CHANGED
|
@@ -49,7 +49,7 @@ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
|
49
49
|
import ErrorIcon from '@mui/icons-material/Error';
|
|
50
50
|
import SaveIcon from '@mui/icons-material/Save';
|
|
51
51
|
|
|
52
|
-
var version = "0.1.
|
|
52
|
+
var version = "0.1.21";
|
|
53
53
|
|
|
54
54
|
const ApolloConfigSchema = ConfigurationSchema('ApolloInternetAccount', {
|
|
55
55
|
baseURL: {
|
|
@@ -4056,7 +4056,7 @@ class ApolloSequenceAdapter extends BaseSequenceAdapter {
|
|
|
4056
4056
|
freeResources( /* { region } */) { }
|
|
4057
4057
|
}
|
|
4058
4058
|
|
|
4059
|
-
var configSchema$
|
|
4059
|
+
var configSchema$3 = ConfigurationSchema('ApolloSequenceAdapter', {
|
|
4060
4060
|
assemblyId: {
|
|
4061
4061
|
type: 'string',
|
|
4062
4062
|
defaultValue: '',
|
|
@@ -4066,7 +4066,7 @@ var configSchema$2 = ConfigurationSchema('ApolloSequenceAdapter', {
|
|
|
4066
4066
|
function installApolloSequenceAdapter(pluginManager) {
|
|
4067
4067
|
pluginManager.addAdapterType(() => new AdapterType({
|
|
4068
4068
|
name: 'ApolloSequenceAdapter',
|
|
4069
|
-
configSchema: configSchema$
|
|
4069
|
+
configSchema: configSchema$3,
|
|
4070
4070
|
adapterMetadata: {
|
|
4071
4071
|
category: undefined,
|
|
4072
4072
|
hiddenFromGUI: true,
|
|
@@ -4660,7 +4660,7 @@ class ApolloTextSearchAdapter extends BaseAdapter {
|
|
|
4660
4660
|
freeResources() { }
|
|
4661
4661
|
}
|
|
4662
4662
|
|
|
4663
|
-
var configSchema$
|
|
4663
|
+
var configSchema$2 = ConfigurationSchema('ApolloTextSearchAdapter', {
|
|
4664
4664
|
assemblyNames: {
|
|
4665
4665
|
type: 'stringArray',
|
|
4666
4666
|
defaultValue: [],
|
|
@@ -4683,7 +4683,7 @@ function installApolloTextSearchAdapter(pluginManager) {
|
|
|
4683
4683
|
pluginManager.addTextSearchAdapterType(() => new TextSearchAdapterType({
|
|
4684
4684
|
name: 'ApolloTextSearchAdapter',
|
|
4685
4685
|
displayName: 'Apollo text search adapter',
|
|
4686
|
-
configSchema: configSchema$
|
|
4686
|
+
configSchema: configSchema$2,
|
|
4687
4687
|
AdapterClass: ApolloTextSearchAdapter,
|
|
4688
4688
|
description: 'Apollo Text Search adapter',
|
|
4689
4689
|
}));
|
|
@@ -5986,11 +5986,7 @@ const ApolloTranscriptDetailsWidget = observer(function ApolloTranscriptDetails(
|
|
|
5986
5986
|
React__default.createElement(TranscriptSequence, { feature: feature, session: apolloSession, assembly: currentAssembly._id || '', refName: refName })));
|
|
5987
5987
|
});
|
|
5988
5988
|
|
|
5989
|
-
|
|
5990
|
-
const LGVPlugin = pluginManager.getPlugin('LinearGenomeViewPlugin');
|
|
5991
|
-
const { baseLinearDisplayConfigSchema } = LGVPlugin.exports;
|
|
5992
|
-
return ConfigurationSchema('LinearApolloDisplay', { height: { type: 'number', defaultValue: 500 } }, { baseConfiguration: baseLinearDisplayConfigSchema, explicitlyTyped: true });
|
|
5993
|
-
}
|
|
5989
|
+
const configSchema$1 = ConfigurationSchema('LinearApolloDisplay', {}, { explicitIdentifier: 'displayId', explicitlyTyped: true });
|
|
5994
5990
|
|
|
5995
5991
|
function handleFeatureTypeChange(changeManager, feature, oldType, newType) {
|
|
5996
5992
|
const featureId = feature._id;
|
|
@@ -6234,56 +6230,16 @@ const NumberCell = observer(function NumberCell({ initialValue, notifyError, onC
|
|
|
6234
6230
|
} })));
|
|
6235
6231
|
});
|
|
6236
6232
|
|
|
6237
|
-
// TODO: get this added to LGV runtime exports so we don't have to duplicate it
|
|
6238
6233
|
const minDisplayHeight = 20;
|
|
6239
|
-
/**
|
|
6240
|
-
* #stateModel TrackHeightMixin
|
|
6241
|
-
* #category display
|
|
6242
|
-
*/
|
|
6243
|
-
const TrackHeightMixin = types
|
|
6244
|
-
.model({
|
|
6245
|
-
heightPreConfig: types.maybe(types.refinement('displayHeight', types.number, (n) => n >= minDisplayHeight)),
|
|
6246
|
-
})
|
|
6247
|
-
.volatile(() => ({
|
|
6248
|
-
scrollTop: 0,
|
|
6249
|
-
}))
|
|
6250
|
-
.views((self) => ({
|
|
6251
|
-
get height() {
|
|
6252
|
-
// @ts-expect-error getConf needs self.configuration
|
|
6253
|
-
return self.heightPreConfig ?? getConf(self, 'height');
|
|
6254
|
-
},
|
|
6255
|
-
}))
|
|
6256
|
-
.actions((self) => ({
|
|
6257
|
-
setScrollTop(scrollTop) {
|
|
6258
|
-
self.scrollTop = scrollTop;
|
|
6259
|
-
},
|
|
6260
|
-
setHeight(displayHeight) {
|
|
6261
|
-
self.heightPreConfig = Math.max(displayHeight, minDisplayHeight);
|
|
6262
|
-
return self.height;
|
|
6263
|
-
},
|
|
6264
|
-
resizeHeight(distance) {
|
|
6265
|
-
const oldHeight = self.height;
|
|
6266
|
-
const newHeight = this.setHeight(self.height + distance);
|
|
6267
|
-
return newHeight - oldHeight;
|
|
6268
|
-
},
|
|
6269
|
-
}));
|
|
6270
|
-
|
|
6271
6234
|
function baseModelFactory(_pluginManager, configSchema) {
|
|
6272
|
-
|
|
6273
|
-
// const LGVPlugin = pluginManager.getPlugin(
|
|
6274
|
-
// 'LinearGenomeViewPlugin',
|
|
6275
|
-
// ) as LinearGenomeViewPlugin
|
|
6276
|
-
// const { TrackHeightMixin } = LGVPlugin.exports
|
|
6277
|
-
return types
|
|
6278
|
-
.compose(BaseDisplay, TrackHeightMixin)
|
|
6279
|
-
.named('BaseLinearApolloDisplay')
|
|
6235
|
+
return BaseDisplay.named('BaseLinearApolloDisplay')
|
|
6280
6236
|
.props({
|
|
6281
6237
|
type: types.literal('LinearApolloDisplay'),
|
|
6282
6238
|
configuration: ConfigurationReference(configSchema),
|
|
6239
|
+
graphical: true,
|
|
6240
|
+
table: false,
|
|
6241
|
+
heightPreConfig: types.maybe(types.refinement('displayHeight', types.number, (n) => n >= minDisplayHeight)),
|
|
6283
6242
|
})
|
|
6284
|
-
.volatile((self) => ({
|
|
6285
|
-
lgv: getContainingView(self),
|
|
6286
|
-
}))
|
|
6287
6243
|
.views((self) => {
|
|
6288
6244
|
const { configuration, renderProps: superRenderProps } = self;
|
|
6289
6245
|
return {
|
|
@@ -6296,6 +6252,26 @@ function baseModelFactory(_pluginManager, configSchema) {
|
|
|
6296
6252
|
},
|
|
6297
6253
|
};
|
|
6298
6254
|
})
|
|
6255
|
+
.volatile(() => ({
|
|
6256
|
+
scrollTop: 0,
|
|
6257
|
+
}))
|
|
6258
|
+
.views((self) => ({
|
|
6259
|
+
get lgv() {
|
|
6260
|
+
return getContainingView(self);
|
|
6261
|
+
},
|
|
6262
|
+
get height() {
|
|
6263
|
+
if (self.heightPreConfig) {
|
|
6264
|
+
return self.heightPreConfig;
|
|
6265
|
+
}
|
|
6266
|
+
if (self.graphical && self.table) {
|
|
6267
|
+
return 500;
|
|
6268
|
+
}
|
|
6269
|
+
if (self.graphical) {
|
|
6270
|
+
return 200;
|
|
6271
|
+
}
|
|
6272
|
+
return 300;
|
|
6273
|
+
},
|
|
6274
|
+
}))
|
|
6299
6275
|
.views((self) => ({
|
|
6300
6276
|
get rendererTypeName() {
|
|
6301
6277
|
return self.configuration.renderer.type;
|
|
@@ -6352,6 +6328,73 @@ function baseModelFactory(_pluginManager, configSchema) {
|
|
|
6352
6328
|
.apolloSelectedFeature;
|
|
6353
6329
|
},
|
|
6354
6330
|
}))
|
|
6331
|
+
.actions((self) => ({
|
|
6332
|
+
setScrollTop(scrollTop) {
|
|
6333
|
+
self.scrollTop = scrollTop;
|
|
6334
|
+
},
|
|
6335
|
+
setHeight(displayHeight) {
|
|
6336
|
+
self.heightPreConfig = Math.max(displayHeight, minDisplayHeight);
|
|
6337
|
+
return self.height;
|
|
6338
|
+
},
|
|
6339
|
+
resizeHeight(distance) {
|
|
6340
|
+
const oldHeight = self.height;
|
|
6341
|
+
const newHeight = this.setHeight(self.height + distance);
|
|
6342
|
+
return newHeight - oldHeight;
|
|
6343
|
+
},
|
|
6344
|
+
showGraphicalOnly() {
|
|
6345
|
+
self.graphical = true;
|
|
6346
|
+
self.table = false;
|
|
6347
|
+
},
|
|
6348
|
+
showTableOnly() {
|
|
6349
|
+
self.graphical = false;
|
|
6350
|
+
self.table = true;
|
|
6351
|
+
},
|
|
6352
|
+
showGraphicalAndTable() {
|
|
6353
|
+
self.graphical = true;
|
|
6354
|
+
self.table = true;
|
|
6355
|
+
},
|
|
6356
|
+
}))
|
|
6357
|
+
.views((self) => {
|
|
6358
|
+
const { trackMenuItems: superTrackMenuItems } = self;
|
|
6359
|
+
return {
|
|
6360
|
+
trackMenuItems() {
|
|
6361
|
+
const { graphical, table } = self;
|
|
6362
|
+
return [
|
|
6363
|
+
...superTrackMenuItems(),
|
|
6364
|
+
{
|
|
6365
|
+
type: 'subMenu',
|
|
6366
|
+
label: 'Appearance',
|
|
6367
|
+
subMenu: [
|
|
6368
|
+
{
|
|
6369
|
+
label: 'Show graphical display',
|
|
6370
|
+
type: 'radio',
|
|
6371
|
+
checked: graphical && !table,
|
|
6372
|
+
onClick: () => {
|
|
6373
|
+
self.showGraphicalOnly();
|
|
6374
|
+
},
|
|
6375
|
+
},
|
|
6376
|
+
{
|
|
6377
|
+
label: 'Show table display',
|
|
6378
|
+
type: 'radio',
|
|
6379
|
+
checked: table && !graphical,
|
|
6380
|
+
onClick: () => {
|
|
6381
|
+
self.showTableOnly();
|
|
6382
|
+
},
|
|
6383
|
+
},
|
|
6384
|
+
{
|
|
6385
|
+
label: 'Show both graphical and table display',
|
|
6386
|
+
type: 'radio',
|
|
6387
|
+
checked: table && graphical,
|
|
6388
|
+
onClick: () => {
|
|
6389
|
+
self.showGraphicalAndTable();
|
|
6390
|
+
},
|
|
6391
|
+
},
|
|
6392
|
+
],
|
|
6393
|
+
},
|
|
6394
|
+
];
|
|
6395
|
+
},
|
|
6396
|
+
};
|
|
6397
|
+
})
|
|
6355
6398
|
.actions((self) => ({
|
|
6356
6399
|
setSelectedFeature(feature) {
|
|
6357
6400
|
self.session.apolloSetSelectedFeature(feature);
|
|
@@ -8365,7 +8408,7 @@ const useStyles$1 = makeStyles()((theme) => ({
|
|
|
8365
8408
|
const LinearApolloDisplay = observer(function LinearApolloDisplay(props) {
|
|
8366
8409
|
const theme = useTheme();
|
|
8367
8410
|
const { model } = props;
|
|
8368
|
-
const { apolloRowHeight, contextMenuItems: getContextMenuItems, cursor, featuresHeight, isShown, onMouseDown, onMouseLeave, onMouseMove, onMouseUp, regionCannotBeRendered, session, setCanvas, setCollaboratorCanvas, setOverlayCanvas, setSeqTrackCanvas, setSeqTrackOverlayCanvas, setTheme,
|
|
8411
|
+
const { apolloRowHeight, contextMenuItems: getContextMenuItems, cursor, featuresHeight, isShown, onMouseDown, onMouseLeave, onMouseMove, onMouseUp, regionCannotBeRendered, session, setCanvas, setCollaboratorCanvas, setOverlayCanvas, setSeqTrackCanvas, setSeqTrackOverlayCanvas, setTheme, } = model;
|
|
8369
8412
|
const { classes } = useStyles$1();
|
|
8370
8413
|
const lgv = getContainingView(model);
|
|
8371
8414
|
useEffect(() => {
|
|
@@ -8422,9 +8465,7 @@ const LinearApolloDisplay = observer(function LinearApolloDisplay(props) {
|
|
|
8422
8465
|
React__default.createElement("canvas", { ref: async (node) => {
|
|
8423
8466
|
await Promise.resolve();
|
|
8424
8467
|
setOverlayCanvas(node);
|
|
8425
|
-
}, width: lgv.dynamicBlocks.totalWidthPx, height: featuresHeight, onMouseMove: onMouseMove, onMouseLeave: onMouseLeave, onMouseDown: onMouseDown, onMouseUp: onMouseUp,
|
|
8426
|
-
tabularEditor.showPane();
|
|
8427
|
-
}, className: classes.canvas, style: { cursor: cursor ?? 'default' }, "data-testid": "overlayCanvas" }),
|
|
8468
|
+
}, width: lgv.dynamicBlocks.totalWidthPx, height: featuresHeight, onMouseMove: onMouseMove, onMouseLeave: onMouseLeave, onMouseDown: onMouseDown, onMouseUp: onMouseUp, className: classes.canvas, style: { cursor: cursor ?? 'default' }, "data-testid": "overlayCanvas" }),
|
|
8428
8469
|
lgv.displayedRegions.flatMap((region, idx) => {
|
|
8429
8470
|
const assembly = assemblyManager.get(region.assemblyName);
|
|
8430
8471
|
return [...session.apolloDataStore.checkResults.values()]
|
|
@@ -8560,25 +8601,33 @@ const AccordionControl = observer(function AccordionControl({ onClick, onResize,
|
|
|
8560
8601
|
});
|
|
8561
8602
|
const DisplayComponent = observer(function DisplayComponent({ model, ...other }) {
|
|
8562
8603
|
const { classes } = useStyles();
|
|
8563
|
-
const { height: overallHeight, isShown, selectedFeature, tabularEditor, toggleShown, } = model;
|
|
8564
|
-
const detailsHeight = tabularEditor.isShown ? model.detailsHeight : 0;
|
|
8565
|
-
const featureAreaHeight = isShown
|
|
8566
|
-
? overallHeight - detailsHeight - accordionControlHeight * 2
|
|
8567
|
-
: 0;
|
|
8568
|
-
const onDetailsResize = (delta) => {
|
|
8569
|
-
model.setDetailsHeight(model.detailsHeight - delta);
|
|
8570
|
-
};
|
|
8604
|
+
const { detailsHeight, graphical, height: overallHeight, isShown, selectedFeature, table, tabularEditor, toggleShown, } = model;
|
|
8571
8605
|
const canvasScrollContainerRef = useRef(null);
|
|
8572
8606
|
useEffect(() => {
|
|
8573
8607
|
scrollSelectedFeatureIntoView(model, canvasScrollContainerRef);
|
|
8574
8608
|
}, [model, selectedFeature]);
|
|
8609
|
+
const onDetailsResize = (delta) => {
|
|
8610
|
+
model.setDetailsHeight(detailsHeight - delta);
|
|
8611
|
+
};
|
|
8612
|
+
if (graphical && table) {
|
|
8613
|
+
const tabularHeight = tabularEditor.isShown ? detailsHeight : 0;
|
|
8614
|
+
const featureAreaHeight = isShown
|
|
8615
|
+
? overallHeight - detailsHeight - accordionControlHeight * 2
|
|
8616
|
+
: 0;
|
|
8617
|
+
return (React__default.createElement("div", { style: { height: overallHeight } },
|
|
8618
|
+
React__default.createElement(AccordionControl, { open: isShown, title: "Graphical", onClick: toggleShown }),
|
|
8619
|
+
React__default.createElement("div", { className: classes.shading, ref: canvasScrollContainerRef, style: { height: featureAreaHeight } },
|
|
8620
|
+
React__default.createElement(LinearApolloDisplay, { model: model, ...other })),
|
|
8621
|
+
React__default.createElement(AccordionControl, { title: "Table", open: tabularEditor.isShown, onClick: tabularEditor.togglePane, onResize: onDetailsResize }),
|
|
8622
|
+
React__default.createElement("div", { className: classes.details, style: { height: tabularHeight } },
|
|
8623
|
+
React__default.createElement(TabularEditorPane, { model: model }))));
|
|
8624
|
+
}
|
|
8625
|
+
if (graphical) {
|
|
8626
|
+
return (React__default.createElement("div", { className: classes.shading, ref: canvasScrollContainerRef, style: { height: overallHeight } },
|
|
8627
|
+
React__default.createElement(LinearApolloDisplay, { model: model, ...other })));
|
|
8628
|
+
}
|
|
8575
8629
|
return (React__default.createElement("div", { className: classes.details, style: { height: overallHeight } },
|
|
8576
|
-
React__default.createElement(
|
|
8577
|
-
React__default.createElement("div", { className: classes.shading, ref: canvasScrollContainerRef, style: { height: featureAreaHeight } },
|
|
8578
|
-
React__default.createElement(LinearApolloDisplay, { model: model, ...other })),
|
|
8579
|
-
React__default.createElement(AccordionControl, { title: "Table", open: tabularEditor.isShown, onClick: tabularEditor.togglePane, onResize: onDetailsResize }),
|
|
8580
|
-
React__default.createElement("div", { style: { height: detailsHeight } },
|
|
8581
|
-
React__default.createElement(TabularEditorPane, { model: model }))));
|
|
8630
|
+
React__default.createElement(TabularEditorPane, { model: model })));
|
|
8582
8631
|
});
|
|
8583
8632
|
function makeSixFrameDisplayComponent(pluginManager) {
|
|
8584
8633
|
const LGVPlugin = pluginManager.getPlugin('LinearGenomeViewPlugin');
|
|
@@ -10298,7 +10347,7 @@ class ApolloPlugin extends Plugin {
|
|
|
10298
10347
|
});
|
|
10299
10348
|
});
|
|
10300
10349
|
pluginManager.addDisplayType(() => {
|
|
10301
|
-
const configSchema =
|
|
10350
|
+
const configSchema = configSchema$1;
|
|
10302
10351
|
return new DisplayType({
|
|
10303
10352
|
name: 'LinearApolloDisplay',
|
|
10304
10353
|
configSchema,
|