@jbrowse/plugin-alignments 1.7.8 → 1.7.9

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.
@@ -142,7 +142,8 @@ function SupplementaryAlignments(props) {
142
142
  return /*#__PURE__*/_react.default.createElement("li", {
143
143
  key: "".concat(locString, "-").concat(index)
144
144
  }, /*#__PURE__*/_react.default.createElement(_core.Link, {
145
- onClick: function onClick() {
145
+ onClick: function onClick(event) {
146
+ event.preventDefault();
146
147
  var view = model.view;
147
148
 
148
149
  try {
@@ -24,6 +24,7 @@ var _util = require("@jbrowse/core/util");
24
24
  var _marked = /*#__PURE__*/_regenerator.default.mark(getNextRefPos);
25
25
 
26
26
  var mdRegex = new RegExp(/(\d+|\^[a-z]+|[a-z])/gi);
27
+ var modificationRegex = new RegExp(/([A-Z])([-+])([^,.?]+)([.?])?/);
27
28
 
28
29
  function parseCigar(cigar) {
29
30
  return (cigar || '').split(/([MIDNSHPX=])/);
@@ -351,7 +352,7 @@ function getModificationPositions(mm, fseq, fstrand) {
351
352
  skips = _mod$split2.slice(1); // regexes based on parse_mm.pl from hts-specs
352
353
 
353
354
 
354
- var matches = basemod.match(/([A-Z])([-+])([^,.?]+)([.?])?/);
355
+ var matches = basemod.match(modificationRegex);
355
356
 
356
357
  if (!matches) {
357
358
  throw new Error('bad format for MM tag');
@@ -426,7 +427,7 @@ function getModificationTypes(mm) {
426
427
  _mod$split4 = (0, _slicedToArray2.default)(_mod$split3, 1),
427
428
  basemod = _mod$split4[0];
428
429
 
429
- var matches = basemod.match(/([A-Z])([-+])([^,]+)/);
430
+ var matches = basemod.match(modificationRegex);
430
431
 
431
432
  if (!matches) {
432
433
  throw new Error('bad format for MM tag');
@@ -233,7 +233,7 @@ declare const stateModelFactory: (configSchema: LinearPileupDisplayConfigModel)
233
233
  toggleSoftClipping(): void;
234
234
  toggleMismatchAlpha(): void;
235
235
  setConfig(configuration: AnyConfigurationModel): void;
236
- setSortedBy(type: string, tag?: string | undefined): void;
236
+ setSortedBy(type: string, tag?: string): void;
237
237
  setFilterBy(filter: {
238
238
  flagInclude: number;
239
239
  flagExclude: number;
@@ -305,8 +305,8 @@ declare const stateModelFactory: (pluginManager: PluginManager, configSchema: An
305
305
  }): void;
306
306
  setColorBy(colorBy?: {
307
307
  type: string;
308
- tag?: string | undefined;
309
- } | undefined): void;
308
+ tag?: string;
309
+ }): void;
310
310
  updateModificationColorMap(uniqueModifications: string[]): void;
311
311
  } & {
312
312
  readonly rendererConfig: any;
@@ -102,12 +102,23 @@ export default class PileupRenderer extends BoxRendererType {
102
102
  layoutFeats(props: RenderArgsDeserializedWithFeaturesAndLayout): (LayoutRecord | null)[];
103
103
  fetchSequence(renderProps: RenderArgsDeserialized): Promise<any>;
104
104
  render(renderProps: RenderArgsDeserialized): Promise<{
105
+ features: Map<any, any>;
106
+ layout: import("@jbrowse/core/util/layouts").GranularRectLayout<unknown>;
107
+ height: number;
108
+ width: number;
109
+ maxHeightReached: boolean;
110
+ canvasRecordedData: any;
111
+ reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
112
+ imageData?: undefined;
113
+ html?: string | undefined;
114
+ } | {
105
115
  features: Map<any, any>;
106
116
  layout: import("@jbrowse/core/util/layouts").GranularRectLayout<unknown>;
107
117
  height: number;
108
118
  width: number;
109
119
  maxHeightReached: boolean;
110
120
  reactElement: JSX.Element;
121
+ canvasRecordedData?: undefined;
111
122
  imageData?: undefined;
112
123
  html?: string | undefined;
113
124
  } | {
@@ -116,7 +127,8 @@ export default class PileupRenderer extends BoxRendererType {
116
127
  height: number;
117
128
  width: number;
118
129
  maxHeightReached: boolean;
119
- imageData: import("@jbrowse/core/util/offscreenCanvas/types").AbstractImageBitmap;
130
+ imageData: any;
131
+ canvasRecordedData?: undefined;
120
132
  reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
121
133
  html?: string | undefined;
122
134
  }>;
@@ -137,8 +137,8 @@ var PileupRenderer = /*#__PURE__*/function (_BoxRendererType) {
137
137
  value: // get width and height of chars the height is an approximation: width
138
138
  // letter M is approximately the height
139
139
  function getCharWidthHeight(ctx) {
140
- var charWidth = ctx.measureText('A').width;
141
- var charHeight = ctx.measureText('M').width;
140
+ var charWidth = (0, _util.measureText)('A');
141
+ var charHeight = (0, _util.measureText)('M');
142
142
  return {
143
143
  charWidth: charWidth,
144
144
  charHeight: charHeight
@@ -1,2 +1,2 @@
1
- declare var _default: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
1
+ declare const _default: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
2
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-alignments",
3
- "version": "1.7.8",
3
+ "version": "1.7.9",
4
4
  "description": "JBrowse 2 alignments adapters, tracks, etc.",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -57,5 +57,5 @@
57
57
  "publishConfig": {
58
58
  "access": "public"
59
59
  },
60
- "gitHead": "b429fa2bb5734fc8a5380988f6dfdd3f7a41a39f"
60
+ "gitHead": "a6504c385d703ce6e755d05652ef659ffe28c864"
61
61
  }
@@ -134,7 +134,8 @@ function SupplementaryAlignments(props: { tag: string; model: any }) {
134
134
  return (
135
135
  <li key={`${locString}-${index}`}>
136
136
  <Link
137
- onClick={() => {
137
+ onClick={event => {
138
+ event.preventDefault()
138
139
  const { view } = model
139
140
  try {
140
141
  if (view) {
@@ -10,6 +10,7 @@ export interface Mismatch {
10
10
  cliplen?: number
11
11
  }
12
12
  const mdRegex = new RegExp(/(\d+|\^[a-z]+|[a-z])/gi)
13
+ const modificationRegex = new RegExp(/([A-Z])([-+])([^,.?]+)([.?])?/)
13
14
  export function parseCigar(cigar: string) {
14
15
  return (cigar || '').split(/([MIDNSHPX=])/)
15
16
  }
@@ -273,7 +274,7 @@ export function getModificationPositions(
273
274
  const [basemod, ...skips] = mod.split(',')
274
275
 
275
276
  // regexes based on parse_mm.pl from hts-specs
276
- const matches = basemod.match(/([A-Z])([-+])([^,.?]+)([.?])?/)
277
+ const matches = basemod.match(modificationRegex)
277
278
  if (!matches) {
278
279
  throw new Error('bad format for MM tag')
279
280
  }
@@ -328,7 +329,7 @@ export function getModificationTypes(mm: string) {
328
329
  .map(mod => {
329
330
  const [basemod] = mod.split(',')
330
331
 
331
- const matches = basemod.match(/([A-Z])([-+])([^,]+)/)
332
+ const matches = basemod.match(modificationRegex)
332
333
  if (!matches) {
333
334
  throw new Error('bad format for MM tag')
334
335
  }
@@ -132,8 +132,8 @@ export default class PileupRenderer extends BoxRendererType {
132
132
  // get width and height of chars the height is an approximation: width
133
133
  // letter M is approximately the height
134
134
  getCharWidthHeight(ctx: CanvasRenderingContext2D) {
135
- const charWidth = ctx.measureText('A').width
136
- const charHeight = ctx.measureText('M').width
135
+ const charWidth = measureText('A')
136
+ const charHeight = measureText('M')
137
137
  return { charWidth, charHeight }
138
138
  }
139
139
 
@@ -1097,7 +1097,6 @@ export default class PileupRenderer extends BoxRendererType {
1097
1097
 
1098
1098
  const width = (end - start) / bpPerPx
1099
1099
  const height = Math.max(layout.getTotalHeight(), 1)
1100
-
1101
1100
  const res = await renderToAbstractCanvas(
1102
1101
  width,
1103
1102
  height,