@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.
@@ -100,7 +100,7 @@ var ExpandMoreIcon__default = /*#__PURE__*/_interopDefaultLegacy(ExpandMoreIcon)
100
100
  var ErrorIcon__default = /*#__PURE__*/_interopDefaultLegacy(ErrorIcon);
101
101
  var SaveIcon__default = /*#__PURE__*/_interopDefaultLegacy(SaveIcon);
102
102
 
103
- var version = "0.1.20";
103
+ var version = "0.1.21";
104
104
 
105
105
  const ApolloConfigSchema = configuration.ConfigurationSchema('ApolloInternetAccount', {
106
106
  baseURL: {
@@ -4107,7 +4107,7 @@ class ApolloSequenceAdapter extends BaseAdapter.BaseSequenceAdapter {
4107
4107
  freeResources( /* { region } */) { }
4108
4108
  }
4109
4109
 
4110
- var configSchema$2 = configuration.ConfigurationSchema('ApolloSequenceAdapter', {
4110
+ var configSchema$3 = configuration.ConfigurationSchema('ApolloSequenceAdapter', {
4111
4111
  assemblyId: {
4112
4112
  type: 'string',
4113
4113
  defaultValue: '',
@@ -4117,7 +4117,7 @@ var configSchema$2 = configuration.ConfigurationSchema('ApolloSequenceAdapter',
4117
4117
  function installApolloSequenceAdapter(pluginManager) {
4118
4118
  pluginManager.addAdapterType(() => new AdapterType__default["default"]({
4119
4119
  name: 'ApolloSequenceAdapter',
4120
- configSchema: configSchema$2,
4120
+ configSchema: configSchema$3,
4121
4121
  adapterMetadata: {
4122
4122
  category: undefined,
4123
4123
  hiddenFromGUI: true,
@@ -4711,7 +4711,7 @@ class ApolloTextSearchAdapter extends BaseAdapter.BaseAdapter {
4711
4711
  freeResources() { }
4712
4712
  }
4713
4713
 
4714
- var configSchema$1 = configuration.ConfigurationSchema('ApolloTextSearchAdapter', {
4714
+ var configSchema$2 = configuration.ConfigurationSchema('ApolloTextSearchAdapter', {
4715
4715
  assemblyNames: {
4716
4716
  type: 'stringArray',
4717
4717
  defaultValue: [],
@@ -4734,7 +4734,7 @@ function installApolloTextSearchAdapter(pluginManager) {
4734
4734
  pluginManager.addTextSearchAdapterType(() => new pluggableElementTypes.TextSearchAdapterType({
4735
4735
  name: 'ApolloTextSearchAdapter',
4736
4736
  displayName: 'Apollo text search adapter',
4737
- configSchema: configSchema$1,
4737
+ configSchema: configSchema$2,
4738
4738
  AdapterClass: ApolloTextSearchAdapter,
4739
4739
  description: 'Apollo Text Search adapter',
4740
4740
  }));
@@ -6037,11 +6037,7 @@ const ApolloTranscriptDetailsWidget = mobxReact.observer(function ApolloTranscri
6037
6037
  React__default["default"].createElement(TranscriptSequence, { feature: feature, session: apolloSession, assembly: currentAssembly._id || '', refName: refName })));
6038
6038
  });
6039
6039
 
6040
- function configSchemaFactory$1(pluginManager) {
6041
- const LGVPlugin = pluginManager.getPlugin('LinearGenomeViewPlugin');
6042
- const { baseLinearDisplayConfigSchema } = LGVPlugin.exports;
6043
- return configuration.ConfigurationSchema('LinearApolloDisplay', { height: { type: 'number', defaultValue: 500 } }, { baseConfiguration: baseLinearDisplayConfigSchema, explicitlyTyped: true });
6044
- }
6040
+ const configSchema$1 = configuration.ConfigurationSchema('LinearApolloDisplay', {}, { explicitIdentifier: 'displayId', explicitlyTyped: true });
6045
6041
 
6046
6042
  function handleFeatureTypeChange(changeManager, feature, oldType, newType) {
6047
6043
  const featureId = feature._id;
@@ -6285,56 +6281,16 @@ const NumberCell = mobxReact.observer(function NumberCell({ initialValue, notify
6285
6281
  } })));
6286
6282
  });
6287
6283
 
6288
- // TODO: get this added to LGV runtime exports so we don't have to duplicate it
6289
6284
  const minDisplayHeight = 20;
6290
- /**
6291
- * #stateModel TrackHeightMixin
6292
- * #category display
6293
- */
6294
- const TrackHeightMixin = mobxStateTree.types
6295
- .model({
6296
- heightPreConfig: mobxStateTree.types.maybe(mobxStateTree.types.refinement('displayHeight', mobxStateTree.types.number, (n) => n >= minDisplayHeight)),
6297
- })
6298
- .volatile(() => ({
6299
- scrollTop: 0,
6300
- }))
6301
- .views((self) => ({
6302
- get height() {
6303
- // @ts-expect-error getConf needs self.configuration
6304
- return self.heightPreConfig ?? configuration.getConf(self, 'height');
6305
- },
6306
- }))
6307
- .actions((self) => ({
6308
- setScrollTop(scrollTop) {
6309
- self.scrollTop = scrollTop;
6310
- },
6311
- setHeight(displayHeight) {
6312
- self.heightPreConfig = Math.max(displayHeight, minDisplayHeight);
6313
- return self.height;
6314
- },
6315
- resizeHeight(distance) {
6316
- const oldHeight = self.height;
6317
- const newHeight = this.setHeight(self.height + distance);
6318
- return newHeight - oldHeight;
6319
- },
6320
- }));
6321
-
6322
6285
  function baseModelFactory(_pluginManager, configSchema) {
6323
- // TODO: Restore this when TRackHeightMixin is in LGV runtime exports
6324
- // const LGVPlugin = pluginManager.getPlugin(
6325
- // 'LinearGenomeViewPlugin',
6326
- // ) as LinearGenomeViewPlugin
6327
- // const { TrackHeightMixin } = LGVPlugin.exports
6328
- return mobxStateTree.types
6329
- .compose(pluggableElementTypes.BaseDisplay, TrackHeightMixin)
6330
- .named('BaseLinearApolloDisplay')
6286
+ return pluggableElementTypes.BaseDisplay.named('BaseLinearApolloDisplay')
6331
6287
  .props({
6332
6288
  type: mobxStateTree.types.literal('LinearApolloDisplay'),
6333
6289
  configuration: configuration.ConfigurationReference(configSchema),
6290
+ graphical: true,
6291
+ table: false,
6292
+ heightPreConfig: mobxStateTree.types.maybe(mobxStateTree.types.refinement('displayHeight', mobxStateTree.types.number, (n) => n >= minDisplayHeight)),
6334
6293
  })
6335
- .volatile((self) => ({
6336
- lgv: util.getContainingView(self),
6337
- }))
6338
6294
  .views((self) => {
6339
6295
  const { configuration, renderProps: superRenderProps } = self;
6340
6296
  return {
@@ -6347,6 +6303,26 @@ function baseModelFactory(_pluginManager, configSchema) {
6347
6303
  },
6348
6304
  };
6349
6305
  })
6306
+ .volatile(() => ({
6307
+ scrollTop: 0,
6308
+ }))
6309
+ .views((self) => ({
6310
+ get lgv() {
6311
+ return util.getContainingView(self);
6312
+ },
6313
+ get height() {
6314
+ if (self.heightPreConfig) {
6315
+ return self.heightPreConfig;
6316
+ }
6317
+ if (self.graphical && self.table) {
6318
+ return 500;
6319
+ }
6320
+ if (self.graphical) {
6321
+ return 200;
6322
+ }
6323
+ return 300;
6324
+ },
6325
+ }))
6350
6326
  .views((self) => ({
6351
6327
  get rendererTypeName() {
6352
6328
  return self.configuration.renderer.type;
@@ -6403,6 +6379,73 @@ function baseModelFactory(_pluginManager, configSchema) {
6403
6379
  .apolloSelectedFeature;
6404
6380
  },
6405
6381
  }))
6382
+ .actions((self) => ({
6383
+ setScrollTop(scrollTop) {
6384
+ self.scrollTop = scrollTop;
6385
+ },
6386
+ setHeight(displayHeight) {
6387
+ self.heightPreConfig = Math.max(displayHeight, minDisplayHeight);
6388
+ return self.height;
6389
+ },
6390
+ resizeHeight(distance) {
6391
+ const oldHeight = self.height;
6392
+ const newHeight = this.setHeight(self.height + distance);
6393
+ return newHeight - oldHeight;
6394
+ },
6395
+ showGraphicalOnly() {
6396
+ self.graphical = true;
6397
+ self.table = false;
6398
+ },
6399
+ showTableOnly() {
6400
+ self.graphical = false;
6401
+ self.table = true;
6402
+ },
6403
+ showGraphicalAndTable() {
6404
+ self.graphical = true;
6405
+ self.table = true;
6406
+ },
6407
+ }))
6408
+ .views((self) => {
6409
+ const { trackMenuItems: superTrackMenuItems } = self;
6410
+ return {
6411
+ trackMenuItems() {
6412
+ const { graphical, table } = self;
6413
+ return [
6414
+ ...superTrackMenuItems(),
6415
+ {
6416
+ type: 'subMenu',
6417
+ label: 'Appearance',
6418
+ subMenu: [
6419
+ {
6420
+ label: 'Show graphical display',
6421
+ type: 'radio',
6422
+ checked: graphical && !table,
6423
+ onClick: () => {
6424
+ self.showGraphicalOnly();
6425
+ },
6426
+ },
6427
+ {
6428
+ label: 'Show table display',
6429
+ type: 'radio',
6430
+ checked: table && !graphical,
6431
+ onClick: () => {
6432
+ self.showTableOnly();
6433
+ },
6434
+ },
6435
+ {
6436
+ label: 'Show both graphical and table display',
6437
+ type: 'radio',
6438
+ checked: table && graphical,
6439
+ onClick: () => {
6440
+ self.showGraphicalAndTable();
6441
+ },
6442
+ },
6443
+ ],
6444
+ },
6445
+ ];
6446
+ },
6447
+ };
6448
+ })
6406
6449
  .actions((self) => ({
6407
6450
  setSelectedFeature(feature) {
6408
6451
  self.session.apolloSetSelectedFeature(feature);
@@ -8416,7 +8459,7 @@ const useStyles$1 = mui.makeStyles()((theme) => ({
8416
8459
  const LinearApolloDisplay = mobxReact.observer(function LinearApolloDisplay(props) {
8417
8460
  const theme = material.useTheme();
8418
8461
  const { model } = props;
8419
- const { apolloRowHeight, contextMenuItems: getContextMenuItems, cursor, featuresHeight, isShown, onMouseDown, onMouseLeave, onMouseMove, onMouseUp, regionCannotBeRendered, session, setCanvas, setCollaboratorCanvas, setOverlayCanvas, setSeqTrackCanvas, setSeqTrackOverlayCanvas, setTheme, tabularEditor, } = model;
8462
+ const { apolloRowHeight, contextMenuItems: getContextMenuItems, cursor, featuresHeight, isShown, onMouseDown, onMouseLeave, onMouseMove, onMouseUp, regionCannotBeRendered, session, setCanvas, setCollaboratorCanvas, setOverlayCanvas, setSeqTrackCanvas, setSeqTrackOverlayCanvas, setTheme, } = model;
8420
8463
  const { classes } = useStyles$1();
8421
8464
  const lgv = util.getContainingView(model);
8422
8465
  React.useEffect(() => {
@@ -8473,9 +8516,7 @@ const LinearApolloDisplay = mobxReact.observer(function LinearApolloDisplay(prop
8473
8516
  React__default["default"].createElement("canvas", { ref: async (node) => {
8474
8517
  await Promise.resolve();
8475
8518
  setOverlayCanvas(node);
8476
- }, width: lgv.dynamicBlocks.totalWidthPx, height: featuresHeight, onMouseMove: onMouseMove, onMouseLeave: onMouseLeave, onMouseDown: onMouseDown, onMouseUp: onMouseUp, onClick: () => {
8477
- tabularEditor.showPane();
8478
- }, className: classes.canvas, style: { cursor: cursor ?? 'default' }, "data-testid": "overlayCanvas" }),
8519
+ }, width: lgv.dynamicBlocks.totalWidthPx, height: featuresHeight, onMouseMove: onMouseMove, onMouseLeave: onMouseLeave, onMouseDown: onMouseDown, onMouseUp: onMouseUp, className: classes.canvas, style: { cursor: cursor ?? 'default' }, "data-testid": "overlayCanvas" }),
8479
8520
  lgv.displayedRegions.flatMap((region, idx) => {
8480
8521
  const assembly = assemblyManager.get(region.assemblyName);
8481
8522
  return [...session.apolloDataStore.checkResults.values()]
@@ -8611,25 +8652,33 @@ const AccordionControl = mobxReact.observer(function AccordionControl({ onClick,
8611
8652
  });
8612
8653
  const DisplayComponent = mobxReact.observer(function DisplayComponent({ model, ...other }) {
8613
8654
  const { classes } = useStyles();
8614
- const { height: overallHeight, isShown, selectedFeature, tabularEditor, toggleShown, } = model;
8615
- const detailsHeight = tabularEditor.isShown ? model.detailsHeight : 0;
8616
- const featureAreaHeight = isShown
8617
- ? overallHeight - detailsHeight - accordionControlHeight * 2
8618
- : 0;
8619
- const onDetailsResize = (delta) => {
8620
- model.setDetailsHeight(model.detailsHeight - delta);
8621
- };
8655
+ const { detailsHeight, graphical, height: overallHeight, isShown, selectedFeature, table, tabularEditor, toggleShown, } = model;
8622
8656
  const canvasScrollContainerRef = React.useRef(null);
8623
8657
  React.useEffect(() => {
8624
8658
  scrollSelectedFeatureIntoView(model, canvasScrollContainerRef);
8625
8659
  }, [model, selectedFeature]);
8660
+ const onDetailsResize = (delta) => {
8661
+ model.setDetailsHeight(detailsHeight - delta);
8662
+ };
8663
+ if (graphical && table) {
8664
+ const tabularHeight = tabularEditor.isShown ? detailsHeight : 0;
8665
+ const featureAreaHeight = isShown
8666
+ ? overallHeight - detailsHeight - accordionControlHeight * 2
8667
+ : 0;
8668
+ return (React__default["default"].createElement("div", { style: { height: overallHeight } },
8669
+ React__default["default"].createElement(AccordionControl, { open: isShown, title: "Graphical", onClick: toggleShown }),
8670
+ React__default["default"].createElement("div", { className: classes.shading, ref: canvasScrollContainerRef, style: { height: featureAreaHeight } },
8671
+ React__default["default"].createElement(LinearApolloDisplay, { model: model, ...other })),
8672
+ React__default["default"].createElement(AccordionControl, { title: "Table", open: tabularEditor.isShown, onClick: tabularEditor.togglePane, onResize: onDetailsResize }),
8673
+ React__default["default"].createElement("div", { className: classes.details, style: { height: tabularHeight } },
8674
+ React__default["default"].createElement(TabularEditorPane, { model: model }))));
8675
+ }
8676
+ if (graphical) {
8677
+ return (React__default["default"].createElement("div", { className: classes.shading, ref: canvasScrollContainerRef, style: { height: overallHeight } },
8678
+ React__default["default"].createElement(LinearApolloDisplay, { model: model, ...other })));
8679
+ }
8626
8680
  return (React__default["default"].createElement("div", { className: classes.details, style: { height: overallHeight } },
8627
- React__default["default"].createElement(AccordionControl, { open: isShown, title: "Graphical", onClick: toggleShown }),
8628
- React__default["default"].createElement("div", { className: classes.shading, ref: canvasScrollContainerRef, style: { height: featureAreaHeight } },
8629
- React__default["default"].createElement(LinearApolloDisplay, { model: model, ...other })),
8630
- React__default["default"].createElement(AccordionControl, { title: "Table", open: tabularEditor.isShown, onClick: tabularEditor.togglePane, onResize: onDetailsResize }),
8631
- React__default["default"].createElement("div", { style: { height: detailsHeight } },
8632
- React__default["default"].createElement(TabularEditorPane, { model: model }))));
8681
+ React__default["default"].createElement(TabularEditorPane, { model: model })));
8633
8682
  });
8634
8683
  function makeSixFrameDisplayComponent(pluginManager) {
8635
8684
  const LGVPlugin = pluginManager.getPlugin('LinearGenomeViewPlugin');
@@ -10349,7 +10398,7 @@ class ApolloPlugin extends Plugin__default["default"] {
10349
10398
  });
10350
10399
  });
10351
10400
  pluginManager.addDisplayType(() => {
10352
- const configSchema = configSchemaFactory$1(pluginManager);
10401
+ const configSchema = configSchema$1;
10353
10402
  return new pluggableElementTypes.DisplayType({
10354
10403
  name: 'LinearApolloDisplay',
10355
10404
  configSchema,