@jbrowse/plugin-linear-comparative-view 3.4.0 → 3.5.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.
@@ -201,7 +201,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
201
201
  } & {
202
202
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
203
203
  deleteBlock(key: string): void;
204
- selectFeature(feature: Feature): Promise<void>;
204
+ selectFeature(feature: Feature): void;
205
205
  navToFeature(feature: Feature): void;
206
206
  clearFeatureSelection(): void;
207
207
  setFeatureIdUnderMouse(feature?: string): void;
@@ -19,6 +19,6 @@ const useStyles = (0, mui_1.makeStyles)()(() => ({
19
19
  const HeaderSearchBoxes = (0, mobx_react_1.observer)(function ({ view, }) {
20
20
  const { classes } = useStyles();
21
21
  const { assemblyNames, coarseTotalBp } = view;
22
- return ((0, jsx_runtime_1.jsxs)("span", { className: classes.searchBox, children: [(0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.SearchBox, { model: view, showHelp: false }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "body2", color: "textSecondary", className: classes.bp, children: [assemblyNames.join(','), " ", (0, util_1.toLocale)(Math.round(coarseTotalBp)), " bp"] })] }));
22
+ return ((0, jsx_runtime_1.jsxs)("span", { className: classes.searchBox, children: [(0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.SearchBox, { model: view, showHelp: false }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "body2", color: "textSecondary", className: classes.bp, children: [assemblyNames.join(','), " ", (0, util_1.getBpDisplayStr)(coarseTotalBp)] })] }));
23
23
  });
24
24
  exports.default = HeaderSearchBoxes;
@@ -77,7 +77,8 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
77
77
  readonly width: number;
78
78
  readonly interRegionPaddingWidth: number;
79
79
  readonly assemblyNames: string[];
80
- readonly stickyViewHeaders: boolean;
80
+ readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
81
+ readonly stickyViewHeaders: boolean | undefined;
81
82
  readonly rubberbandTop: number;
82
83
  readonly pinnedTracksTop: number;
83
84
  } & {
@@ -392,7 +393,8 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
392
393
  readonly width: number;
393
394
  readonly interRegionPaddingWidth: number;
394
395
  readonly assemblyNames: string[];
395
- readonly stickyViewHeaders: boolean;
396
+ readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
397
+ readonly stickyViewHeaders: boolean | undefined;
396
398
  readonly rubberbandTop: number;
397
399
  readonly pinnedTracksTop: number;
398
400
  } & {
@@ -31,6 +31,7 @@ function drawRef(model, ctx1, ctx3) {
31
31
  const view = (0, util_1.getContainingView)(model);
32
32
  const drawCurves = view.drawCurves;
33
33
  const drawCIGAR = view.drawCIGAR;
34
+ const drawCIGARMatchesOnly = view.drawCIGARMatchesOnly;
34
35
  const { level, height, featPositions } = model;
35
36
  const width = view.width;
36
37
  const bpPerPxs = view.views.map(v => v.bpPerPx);
@@ -123,11 +124,19 @@ function drawRef(model, ctx1, ctx3) {
123
124
  continuingFlag = true;
124
125
  }
125
126
  else {
126
- ctx1.fillStyle =
127
- colorMap[(continuingFlag && d1 > 1) || d2 > 1 ? op : 'M'];
127
+ const letter = (continuingFlag && d1 > 1) || d2 > 1 ? op : 'M';
128
+ ctx1.fillStyle = colorMap[letter];
128
129
  continuingFlag = false;
129
- (0, util_2.draw)(ctx1, px1, cx1, y1, cx2, px2, y2, mid, drawCurves);
130
- ctx1.fill();
130
+ if (drawCIGARMatchesOnly) {
131
+ if (letter === 'M') {
132
+ (0, util_2.draw)(ctx1, px1, cx1, y1, cx2, px2, y2, mid, drawCurves);
133
+ ctx1.fill();
134
+ }
135
+ }
136
+ else {
137
+ (0, util_2.draw)(ctx1, px1, cx1, y1, cx2, px2, y2, mid, drawCurves);
138
+ ctx1.fill();
139
+ }
131
140
  if (ctx3) {
132
141
  ctx3.fillStyle = makeColor(idx);
133
142
  (0, util_2.draw)(ctx3, px1, cx1, y1, cx2, px2, y2, mid, drawCurves);
@@ -1,4 +1,4 @@
1
- import type { ExportSvgOptions } from '../model';
1
+ import type { ExportSvgOptions } from '../types';
2
2
  export default function ExportSvgDialog({ model, handleClose, }: {
3
3
  model: {
4
4
  exportSvg(opts: ExportSvgOptions): Promise<void>;
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.default = ExportSvgDialog;
4
7
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -6,15 +9,13 @@ const react_1 = require("react");
6
9
  const ui_1 = require("@jbrowse/core/ui");
7
10
  const util_1 = require("@jbrowse/core/util");
8
11
  const material_1 = require("@mui/material");
12
+ const TextField2_1 = __importDefault(require("./TextField2"));
9
13
  function LoadingMessage() {
10
14
  return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 20, style: { marginRight: 20 } }), (0, jsx_runtime_1.jsx)(material_1.Typography, { display: "inline", children: "Creating SVG" })] }));
11
15
  }
12
16
  function useSvgLocal(key, val) {
13
17
  return (0, util_1.useLocalStorage)(`svg-${key}`, val);
14
18
  }
15
- function TextField2({ children, ...rest }) {
16
- return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { ...rest, children: children }) }));
17
- }
18
19
  function ExportSvgDialog({ model, handleClose, }) {
19
20
  const session = (0, util_1.getSession)(model);
20
21
  const offscreenCanvas = typeof OffscreenCanvas !== 'undefined';
@@ -24,11 +25,11 @@ function ExportSvgDialog({ model, handleClose, }) {
24
25
  const [trackLabels, setTrackLabels] = useSvgLocal('tracklabels', 'offset');
25
26
  const [themeName, setThemeName] = useSvgLocal('theme', session.themeName || 'default');
26
27
  const [error, setError] = (0, react_1.useState)();
27
- return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: handleClose, title: "Export SVG", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [error ? ((0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error })) : loading ? ((0, jsx_runtime_1.jsx)(LoadingMessage, {})) : null, (0, jsx_runtime_1.jsx)(TextField2, { helperText: "filename", value: filename, onChange: event => {
28
+ return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: handleClose, title: "Export SVG", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [error ? ((0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error })) : loading ? ((0, jsx_runtime_1.jsx)(LoadingMessage, {})) : null, (0, jsx_runtime_1.jsx)(TextField2_1.default, { helperText: "filename", value: filename, onChange: event => {
28
29
  setFilename(event.target.value);
29
- } }), (0, jsx_runtime_1.jsxs)(TextField2, { select: true, label: "Track label positioning", variant: "outlined", value: trackLabels, style: { width: 150 }, onChange: event => {
30
+ } }), (0, jsx_runtime_1.jsxs)(TextField2_1.default, { select: true, label: "Track label positioning", variant: "outlined", value: trackLabels, style: { width: 150 }, onChange: event => {
30
31
  setTrackLabels(event.target.value);
31
- }, children: [(0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "offset", children: "Offset" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "overlay", children: "Overlay" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "left", children: "Left" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "none", children: "None" })] }), (0, jsx_runtime_1.jsx)("br", {}), session.allThemes ? ((0, jsx_runtime_1.jsx)(TextField2, { select: true, label: "Theme", variant: "outlined", value: themeName, onChange: event => {
32
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "offset", children: "Offset" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "overlay", children: "Overlay" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "left", children: "Left" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "none", children: "None" })] }), (0, jsx_runtime_1.jsx)("br", {}), session.allThemes ? ((0, jsx_runtime_1.jsx)(TextField2_1.default, { select: true, label: "Theme", variant: "outlined", value: themeName, onChange: event => {
32
33
  setThemeName(event.target.value);
33
34
  }, children: Object.entries(session.allThemes()).map(([key, val]) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: key, children: val.name || '(Unknown name)' }, key))) })) : null, offscreenCanvas ? ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: rasterizeLayers, onChange: () => {
34
35
  setRasterizeLayers(val => !val);
@@ -0,0 +1,2 @@
1
+ import type { TextFieldProps } from '@mui/material';
2
+ export default function TextField2({ children, ...rest }: TextFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = TextField2;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const material_1 = require("@mui/material");
6
+ function TextField2({ children, ...rest }) {
7
+ return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { ...rest, children: children }) }));
8
+ }
@@ -1,24 +1,7 @@
1
- import type React from 'react';
2
1
  import { Curves } from './components/Icons';
3
- import type { ImportFormSyntenyTrack } from './types';
2
+ import type { ExportSvgOptions, ImportFormSyntenyTrack } from './types';
4
3
  import type PluginManager from '@jbrowse/core/PluginManager';
5
4
  import type { Instance } from 'mobx-state-tree';
6
- export interface ExportSvgOptions {
7
- rasterizeLayers?: boolean;
8
- scale?: number;
9
- filename?: string;
10
- Wrapper?: React.FC<{
11
- children: React.ReactNode;
12
- }>;
13
- fontSize?: number;
14
- rulerHeight?: number;
15
- textHeight?: number;
16
- paddingHeight?: number;
17
- headerHeight?: number;
18
- cytobandHeight?: number;
19
- themeName?: string;
20
- trackLabels?: string;
21
- }
22
5
  export default function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
23
6
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
24
7
  displayName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
@@ -94,7 +77,8 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
94
77
  readonly width: number;
95
78
  readonly interRegionPaddingWidth: number;
96
79
  readonly assemblyNames: string[];
97
- readonly stickyViewHeaders: boolean;
80
+ readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
81
+ readonly stickyViewHeaders: boolean | undefined;
98
82
  readonly rubberbandTop: number;
99
83
  readonly pinnedTracksTop: number;
100
84
  } & {
@@ -298,6 +282,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
298
282
  } & {
299
283
  type: import("mobx-state-tree").ISimpleType<"LinearSyntenyView">;
300
284
  drawCIGAR: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
285
+ drawCIGARMatchesOnly: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
301
286
  drawCurves: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
302
287
  }, {
303
288
  width: number;
@@ -346,6 +331,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
346
331
  setImportFormSyntenyTrack(arg: number, val: ImportFormSyntenyTrack): void;
347
332
  setDrawCurves(arg: boolean): void;
348
333
  setDrawCIGAR(arg: boolean): void;
334
+ setDrawCIGARMatchesOnly(arg: boolean): void;
349
335
  showAllRegions(): void;
350
336
  } & {
351
337
  exportSvg(opts: ExportSvgOptions): Promise<void>;
@@ -476,7 +462,8 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
476
462
  readonly width: number;
477
463
  readonly interRegionPaddingWidth: number;
478
464
  readonly assemblyNames: string[];
479
- readonly stickyViewHeaders: boolean;
465
+ readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
466
+ readonly stickyViewHeaders: boolean | undefined;
480
467
  readonly rubberbandTop: number;
481
468
  readonly pinnedTracksTop: number;
482
469
  } & {
@@ -54,6 +54,7 @@ function stateModelFactory(pluginManager) {
54
54
  .compose('LinearSyntenyView', (0, model_1.default)(pluginManager), mobx_state_tree_1.types.model({
55
55
  type: mobx_state_tree_1.types.literal('LinearSyntenyView'),
56
56
  drawCIGAR: true,
57
+ drawCIGARMatchesOnly: false,
57
58
  drawCurves: false,
58
59
  }))
59
60
  .volatile(() => ({
@@ -75,6 +76,9 @@ function stateModelFactory(pluginManager) {
75
76
  setDrawCIGAR(arg) {
76
77
  self.drawCIGAR = arg;
77
78
  },
79
+ setDrawCIGARMatchesOnly(arg) {
80
+ self.drawCIGARMatchesOnly = arg;
81
+ },
78
82
  showAllRegions() {
79
83
  (0, mobx_1.transaction)(() => {
80
84
  for (const view of self.views) {
@@ -114,11 +118,20 @@ function stateModelFactory(pluginManager) {
114
118
  label: 'Draw CIGAR',
115
119
  checked: self.drawCIGAR,
116
120
  type: 'checkbox',
117
- description: 'Draws per-base CIGAR level alignments',
121
+ description: 'If disabled, only draws the broad scale CIGAR match',
118
122
  onClick: () => {
119
123
  self.setDrawCIGAR(!self.drawCIGAR);
120
124
  },
121
125
  },
126
+ {
127
+ label: 'Draw only CIGAR matches',
128
+ checked: self.drawCIGARMatchesOnly,
129
+ type: 'checkbox',
130
+ description: 'If enabled, it hides the insertions and deletions in the CIGAR strings, helps with divergent',
131
+ onClick: () => {
132
+ self.setDrawCIGARMatchesOnly(!self.drawCIGARMatchesOnly);
133
+ },
134
+ },
122
135
  {
123
136
  label: 'Link views',
124
137
  type: 'checkbox',
@@ -1,2 +1,3 @@
1
- import type { ExportSvgOptions, LinearSyntenyViewModel } from '../model';
1
+ import type { LinearSyntenyViewModel } from '../model';
2
+ import type { ExportSvgOptions } from '../types';
2
3
  export declare function renderToSvg(model: LinearSyntenyViewModel, opts: ExportSvgOptions): Promise<string>;
@@ -1,3 +1,4 @@
1
+ import type React from 'react';
1
2
  import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
2
3
  import type { SnapshotIn } from 'mobx-state-tree';
3
4
  export type Conf = SnapshotIn<AnyConfigurationModel>;
@@ -10,3 +11,19 @@ export type ImportFormSyntenyTrack = {
10
11
  } | {
11
12
  type: 'none';
12
13
  };
14
+ export interface ExportSvgOptions {
15
+ rasterizeLayers?: boolean;
16
+ scale?: number;
17
+ filename?: string;
18
+ Wrapper?: React.FC<{
19
+ children: React.ReactNode;
20
+ }>;
21
+ fontSize?: number;
22
+ rulerHeight?: number;
23
+ textHeight?: number;
24
+ paddingHeight?: number;
25
+ headerHeight?: number;
26
+ cytobandHeight?: number;
27
+ themeName?: string;
28
+ trackLabels?: string;
29
+ }
@@ -201,7 +201,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
201
201
  } & {
202
202
  addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
203
203
  deleteBlock(key: string): void;
204
- selectFeature(feature: Feature): Promise<void>;
204
+ selectFeature(feature: Feature): void;
205
205
  navToFeature(feature: Feature): void;
206
206
  clearFeatureSelection(): void;
207
207
  setFeatureIdUnderMouse(feature?: string): void;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { toLocale } from '@jbrowse/core/util';
2
+ import { getBpDisplayStr } from '@jbrowse/core/util';
3
3
  import { SearchBox } from '@jbrowse/plugin-linear-genome-view';
4
4
  import { Typography } from '@mui/material';
5
5
  import { observer } from 'mobx-react';
@@ -17,6 +17,6 @@ const useStyles = makeStyles()(() => ({
17
17
  const HeaderSearchBoxes = observer(function ({ view, }) {
18
18
  const { classes } = useStyles();
19
19
  const { assemblyNames, coarseTotalBp } = view;
20
- return (_jsxs("span", { className: classes.searchBox, children: [_jsx(SearchBox, { model: view, showHelp: false }), _jsxs(Typography, { variant: "body2", color: "textSecondary", className: classes.bp, children: [assemblyNames.join(','), " ", toLocale(Math.round(coarseTotalBp)), " bp"] })] }));
20
+ return (_jsxs("span", { className: classes.searchBox, children: [_jsx(SearchBox, { model: view, showHelp: false }), _jsxs(Typography, { variant: "body2", color: "textSecondary", className: classes.bp, children: [assemblyNames.join(','), " ", getBpDisplayStr(coarseTotalBp)] })] }));
21
21
  });
22
22
  export default HeaderSearchBoxes;
@@ -77,7 +77,8 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
77
77
  readonly width: number;
78
78
  readonly interRegionPaddingWidth: number;
79
79
  readonly assemblyNames: string[];
80
- readonly stickyViewHeaders: boolean;
80
+ readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
81
+ readonly stickyViewHeaders: boolean | undefined;
81
82
  readonly rubberbandTop: number;
82
83
  readonly pinnedTracksTop: number;
83
84
  } & {
@@ -392,7 +393,8 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
392
393
  readonly width: number;
393
394
  readonly interRegionPaddingWidth: number;
394
395
  readonly assemblyNames: string[];
395
- readonly stickyViewHeaders: boolean;
396
+ readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
397
+ readonly stickyViewHeaders: boolean | undefined;
396
398
  readonly rubberbandTop: number;
397
399
  readonly pinnedTracksTop: number;
398
400
  } & {
@@ -25,6 +25,7 @@ export function drawRef(model, ctx1, ctx3) {
25
25
  const view = getContainingView(model);
26
26
  const drawCurves = view.drawCurves;
27
27
  const drawCIGAR = view.drawCIGAR;
28
+ const drawCIGARMatchesOnly = view.drawCIGARMatchesOnly;
28
29
  const { level, height, featPositions } = model;
29
30
  const width = view.width;
30
31
  const bpPerPxs = view.views.map(v => v.bpPerPx);
@@ -117,11 +118,19 @@ export function drawRef(model, ctx1, ctx3) {
117
118
  continuingFlag = true;
118
119
  }
119
120
  else {
120
- ctx1.fillStyle =
121
- colorMap[(continuingFlag && d1 > 1) || d2 > 1 ? op : 'M'];
121
+ const letter = (continuingFlag && d1 > 1) || d2 > 1 ? op : 'M';
122
+ ctx1.fillStyle = colorMap[letter];
122
123
  continuingFlag = false;
123
- draw(ctx1, px1, cx1, y1, cx2, px2, y2, mid, drawCurves);
124
- ctx1.fill();
124
+ if (drawCIGARMatchesOnly) {
125
+ if (letter === 'M') {
126
+ draw(ctx1, px1, cx1, y1, cx2, px2, y2, mid, drawCurves);
127
+ ctx1.fill();
128
+ }
129
+ }
130
+ else {
131
+ draw(ctx1, px1, cx1, y1, cx2, px2, y2, mid, drawCurves);
132
+ ctx1.fill();
133
+ }
125
134
  if (ctx3) {
126
135
  ctx3.fillStyle = makeColor(idx);
127
136
  draw(ctx3, px1, cx1, y1, cx2, px2, y2, mid, drawCurves);
@@ -1,4 +1,4 @@
1
- import type { ExportSvgOptions } from '../model';
1
+ import type { ExportSvgOptions } from '../types';
2
2
  export default function ExportSvgDialog({ model, handleClose, }: {
3
3
  model: {
4
4
  exportSvg(opts: ExportSvgOptions): Promise<void>;
@@ -2,16 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
3
  import { Dialog, ErrorMessage } from '@jbrowse/core/ui';
4
4
  import { getSession, useLocalStorage } from '@jbrowse/core/util';
5
- import { Button, Checkbox, CircularProgress, DialogActions, DialogContent, FormControlLabel, MenuItem, TextField, Typography, } from '@mui/material';
5
+ import { Button, Checkbox, CircularProgress, DialogActions, DialogContent, FormControlLabel, MenuItem, Typography, } from '@mui/material';
6
+ import TextField2 from './TextField2';
6
7
  function LoadingMessage() {
7
8
  return (_jsxs("div", { children: [_jsx(CircularProgress, { size: 20, style: { marginRight: 20 } }), _jsx(Typography, { display: "inline", children: "Creating SVG" })] }));
8
9
  }
9
10
  function useSvgLocal(key, val) {
10
11
  return useLocalStorage(`svg-${key}`, val);
11
12
  }
12
- function TextField2({ children, ...rest }) {
13
- return (_jsx("div", { children: _jsx(TextField, { ...rest, children: children }) }));
14
- }
15
13
  export default function ExportSvgDialog({ model, handleClose, }) {
16
14
  const session = getSession(model);
17
15
  const offscreenCanvas = typeof OffscreenCanvas !== 'undefined';
@@ -0,0 +1,2 @@
1
+ import type { TextFieldProps } from '@mui/material';
2
+ export default function TextField2({ children, ...rest }: TextFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { TextField } from '@mui/material';
3
+ export default function TextField2({ children, ...rest }) {
4
+ return (_jsx("div", { children: _jsx(TextField, { ...rest, children: children }) }));
5
+ }
@@ -1,24 +1,7 @@
1
- import type React from 'react';
2
1
  import { Curves } from './components/Icons';
3
- import type { ImportFormSyntenyTrack } from './types';
2
+ import type { ExportSvgOptions, ImportFormSyntenyTrack } from './types';
4
3
  import type PluginManager from '@jbrowse/core/PluginManager';
5
4
  import type { Instance } from 'mobx-state-tree';
6
- export interface ExportSvgOptions {
7
- rasterizeLayers?: boolean;
8
- scale?: number;
9
- filename?: string;
10
- Wrapper?: React.FC<{
11
- children: React.ReactNode;
12
- }>;
13
- fontSize?: number;
14
- rulerHeight?: number;
15
- textHeight?: number;
16
- paddingHeight?: number;
17
- headerHeight?: number;
18
- cytobandHeight?: number;
19
- themeName?: string;
20
- trackLabels?: string;
21
- }
22
5
  export default function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
23
6
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
24
7
  displayName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
@@ -94,7 +77,8 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
94
77
  readonly width: number;
95
78
  readonly interRegionPaddingWidth: number;
96
79
  readonly assemblyNames: string[];
97
- readonly stickyViewHeaders: boolean;
80
+ readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
81
+ readonly stickyViewHeaders: boolean | undefined;
98
82
  readonly rubberbandTop: number;
99
83
  readonly pinnedTracksTop: number;
100
84
  } & {
@@ -298,6 +282,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
298
282
  } & {
299
283
  type: import("mobx-state-tree").ISimpleType<"LinearSyntenyView">;
300
284
  drawCIGAR: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
285
+ drawCIGARMatchesOnly: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
301
286
  drawCurves: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
302
287
  }, {
303
288
  width: number;
@@ -346,6 +331,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
346
331
  setImportFormSyntenyTrack(arg: number, val: ImportFormSyntenyTrack): void;
347
332
  setDrawCurves(arg: boolean): void;
348
333
  setDrawCIGAR(arg: boolean): void;
334
+ setDrawCIGARMatchesOnly(arg: boolean): void;
349
335
  showAllRegions(): void;
350
336
  } & {
351
337
  exportSvg(opts: ExportSvgOptions): Promise<void>;
@@ -476,7 +462,8 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
476
462
  readonly width: number;
477
463
  readonly interRegionPaddingWidth: number;
478
464
  readonly assemblyNames: string[];
479
- readonly stickyViewHeaders: boolean;
465
+ readonly isTopLevelView: import("@jbrowse/core/util").AbstractViewModel | undefined;
466
+ readonly stickyViewHeaders: boolean | undefined;
480
467
  readonly rubberbandTop: number;
481
468
  readonly pinnedTracksTop: number;
482
469
  } & {
@@ -15,6 +15,7 @@ export default function stateModelFactory(pluginManager) {
15
15
  .compose('LinearSyntenyView', baseModel(pluginManager), types.model({
16
16
  type: types.literal('LinearSyntenyView'),
17
17
  drawCIGAR: true,
18
+ drawCIGARMatchesOnly: false,
18
19
  drawCurves: false,
19
20
  }))
20
21
  .volatile(() => ({
@@ -36,6 +37,9 @@ export default function stateModelFactory(pluginManager) {
36
37
  setDrawCIGAR(arg) {
37
38
  self.drawCIGAR = arg;
38
39
  },
40
+ setDrawCIGARMatchesOnly(arg) {
41
+ self.drawCIGARMatchesOnly = arg;
42
+ },
39
43
  showAllRegions() {
40
44
  transaction(() => {
41
45
  for (const view of self.views) {
@@ -75,11 +79,20 @@ export default function stateModelFactory(pluginManager) {
75
79
  label: 'Draw CIGAR',
76
80
  checked: self.drawCIGAR,
77
81
  type: 'checkbox',
78
- description: 'Draws per-base CIGAR level alignments',
82
+ description: 'If disabled, only draws the broad scale CIGAR match',
79
83
  onClick: () => {
80
84
  self.setDrawCIGAR(!self.drawCIGAR);
81
85
  },
82
86
  },
87
+ {
88
+ label: 'Draw only CIGAR matches',
89
+ checked: self.drawCIGARMatchesOnly,
90
+ type: 'checkbox',
91
+ description: 'If enabled, it hides the insertions and deletions in the CIGAR strings, helps with divergent',
92
+ onClick: () => {
93
+ self.setDrawCIGARMatchesOnly(!self.drawCIGARMatchesOnly);
94
+ },
95
+ },
83
96
  {
84
97
  label: 'Link views',
85
98
  type: 'checkbox',
@@ -1,2 +1,3 @@
1
- import type { ExportSvgOptions, LinearSyntenyViewModel } from '../model';
1
+ import type { LinearSyntenyViewModel } from '../model';
2
+ import type { ExportSvgOptions } from '../types';
2
3
  export declare function renderToSvg(model: LinearSyntenyViewModel, opts: ExportSvgOptions): Promise<string>;
@@ -1,3 +1,4 @@
1
+ import type React from 'react';
1
2
  import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
2
3
  import type { SnapshotIn } from 'mobx-state-tree';
3
4
  export type Conf = SnapshotIn<AnyConfigurationModel>;
@@ -10,3 +11,19 @@ export type ImportFormSyntenyTrack = {
10
11
  } | {
11
12
  type: 'none';
12
13
  };
14
+ export interface ExportSvgOptions {
15
+ rasterizeLayers?: boolean;
16
+ scale?: number;
17
+ filename?: string;
18
+ Wrapper?: React.FC<{
19
+ children: React.ReactNode;
20
+ }>;
21
+ fontSize?: number;
22
+ rulerHeight?: number;
23
+ textHeight?: number;
24
+ paddingHeight?: number;
25
+ headerHeight?: number;
26
+ cytobandHeight?: number;
27
+ themeName?: string;
28
+ trackLabels?: string;
29
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-comparative-view",
3
- "version": "3.4.0",
3
+ "version": "3.5.0",
4
4
  "description": "JBrowse 2 linear comparative view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -36,9 +36,9 @@
36
36
  "clean": "rimraf dist esm *.tsbuildinfo"
37
37
  },
38
38
  "dependencies": {
39
- "@jbrowse/core": "^3.4.0",
40
- "@jbrowse/plugin-alignments": "^3.4.0",
41
- "@jbrowse/plugin-linear-genome-view": "^3.4.0",
39
+ "@jbrowse/core": "^3.5.0",
40
+ "@jbrowse/plugin-alignments": "^3.5.0",
41
+ "@jbrowse/plugin-linear-genome-view": "^3.5.0",
42
42
  "@mui/icons-material": "^7.0.0",
43
43
  "@mui/material": "^7.0.0",
44
44
  "copy-to-clipboard": "^3.3.1",
@@ -59,5 +59,5 @@
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  },
62
- "gitHead": "a9f1ac35fc2dd810bae92cdaf1fc19995bee4413"
62
+ "gitHead": "8a8aa0aab2229dece106a5715a767e649e2fe92b"
63
63
  }