@jbrowse/plugin-wiggle 2.12.3 → 2.13.1

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.
@@ -24,9 +24,7 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
24
24
  refName: import("mobx-state-tree").ISimpleType<string>;
25
25
  start: import("mobx-state-tree").ISimpleType<number>;
26
26
  end: import("mobx-state-tree").ISimpleType<number>;
27
- reversed: import("mobx-state-tree" /**
28
- * #getter
29
- */).IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
27
+ reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
30
28
  } & {
31
29
  assemblyName: import("mobx-state-tree").ISimpleType<string>;
32
30
  }, {
@@ -9,11 +9,9 @@ const drawDensity_1 = require("../drawDensity");
9
9
  class MultiXYPlotRenderer extends WiggleBaseRenderer_1.default {
10
10
  // @ts-expect-error
11
11
  async draw(ctx, props) {
12
- const { bpPerPx, sources, regions, features } = props;
13
- const [region] = regions;
12
+ const { sources, features } = props;
14
13
  const groups = (0, util_1.groupBy)(features.values(), f => f.get('source'));
15
14
  const height = props.height / sources.length;
16
- const width = (region.end - region.start) / bpPerPx;
17
15
  let feats = [];
18
16
  ctx.save();
19
17
  sources.forEach(source => {
@@ -23,11 +21,6 @@ class MultiXYPlotRenderer extends WiggleBaseRenderer_1.default {
23
21
  features,
24
22
  height,
25
23
  });
26
- ctx.strokeStyle = 'rgba(200,200,200,0.8)';
27
- ctx.beginPath();
28
- ctx.moveTo(0, height);
29
- ctx.lineTo(width, height);
30
- ctx.stroke();
31
24
  ctx.translate(0, height);
32
25
  feats = feats.concat(reducedFeatures);
33
26
  });
@@ -7,7 +7,7 @@ const react_1 = __importDefault(require("react"));
7
7
  const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
8
8
  const mobx_react_1 = require("mobx-react");
9
9
  const YScaleBars_1 = __importDefault(require("./YScaleBars"));
10
- const MultiLinearWiggleDisplayComponent = (0, mobx_react_1.observer)((props) => {
10
+ const MultiLinearWiggleDisplayComponent = (0, mobx_react_1.observer)(function (props) {
11
11
  const { model } = props;
12
12
  return (react_1.default.createElement("div", null,
13
13
  react_1.default.createElement(plugin_linear_genome_view_1.BaseLinearDisplayComponent, { ...props }),
@@ -21,9 +21,7 @@ export default function SharedWiggleMixin(configSchema: AnyConfigurationSchemaTy
21
21
  end: import("mobx-state-tree").ISimpleType<number>;
22
22
  reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
23
23
  } & {
24
- assemblyName: import("mobx-state-tree" /**
25
- * #property
26
- */).ISimpleType<string>;
24
+ assemblyName: import("mobx-state-tree").ISimpleType<string>;
27
25
  }, {
28
26
  setRefName(newRefName: string): void;
29
27
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
package/dist/util.js CHANGED
@@ -101,11 +101,10 @@ function getNiceDomain({ scaleType, domain, bounds, }) {
101
101
  }
102
102
  }
103
103
  if (scaleType === 'log') {
104
- // if the min is 0, assume that it's just something
105
- // with no read coverage and that we should ignore it in calculations
106
- // if it's greater than 1 pin to 1 for the full range also
107
- // otherwise, we may see bigwigs with fractional values
108
- if (min === 0 || min > 1) {
104
+ // for min>0 and max>1, set log min to 1, which works for most coverage
105
+ // types tracks. if max is not >1, might be like raw p-values so then it'll
106
+ // display negative values
107
+ if (min >= 0 && max > 1) {
109
108
  min = 1;
110
109
  }
111
110
  }
@@ -24,9 +24,7 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
24
24
  refName: import("mobx-state-tree").ISimpleType<string>;
25
25
  start: import("mobx-state-tree").ISimpleType<number>;
26
26
  end: import("mobx-state-tree").ISimpleType<number>;
27
- reversed: import("mobx-state-tree" /**
28
- * #getter
29
- */).IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
27
+ reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
30
28
  } & {
31
29
  assemblyName: import("mobx-state-tree").ISimpleType<string>;
32
30
  }, {
@@ -4,11 +4,9 @@ import { drawDensity } from '../drawDensity';
4
4
  export default class MultiXYPlotRenderer extends WiggleBaseRenderer {
5
5
  // @ts-expect-error
6
6
  async draw(ctx, props) {
7
- const { bpPerPx, sources, regions, features } = props;
8
- const [region] = regions;
7
+ const { sources, features } = props;
9
8
  const groups = groupBy(features.values(), f => f.get('source'));
10
9
  const height = props.height / sources.length;
11
- const width = (region.end - region.start) / bpPerPx;
12
10
  let feats = [];
13
11
  ctx.save();
14
12
  sources.forEach(source => {
@@ -18,11 +16,6 @@ export default class MultiXYPlotRenderer extends WiggleBaseRenderer {
18
16
  features,
19
17
  height,
20
18
  });
21
- ctx.strokeStyle = 'rgba(200,200,200,0.8)';
22
- ctx.beginPath();
23
- ctx.moveTo(0, height);
24
- ctx.lineTo(width, height);
25
- ctx.stroke();
26
19
  ctx.translate(0, height);
27
20
  feats = feats.concat(reducedFeatures);
28
21
  });
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view';
3
3
  import { observer } from 'mobx-react';
4
4
  import YScaleBars from './YScaleBars';
5
- const MultiLinearWiggleDisplayComponent = observer((props) => {
5
+ const MultiLinearWiggleDisplayComponent = observer(function (props) {
6
6
  const { model } = props;
7
7
  return (React.createElement("div", null,
8
8
  React.createElement(BaseLinearDisplayComponent, { ...props }),
@@ -21,9 +21,7 @@ export default function SharedWiggleMixin(configSchema: AnyConfigurationSchemaTy
21
21
  end: import("mobx-state-tree").ISimpleType<number>;
22
22
  reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
23
23
  } & {
24
- assemblyName: import("mobx-state-tree" /**
25
- * #property
26
- */).ISimpleType<string>;
24
+ assemblyName: import("mobx-state-tree").ISimpleType<string>;
27
25
  }, {
28
26
  setRefName(newRefName: string): void;
29
27
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
package/esm/util.js CHANGED
@@ -90,11 +90,10 @@ export function getNiceDomain({ scaleType, domain, bounds, }) {
90
90
  }
91
91
  }
92
92
  if (scaleType === 'log') {
93
- // if the min is 0, assume that it's just something
94
- // with no read coverage and that we should ignore it in calculations
95
- // if it's greater than 1 pin to 1 for the full range also
96
- // otherwise, we may see bigwigs with fractional values
97
- if (min === 0 || min > 1) {
93
+ // for min>0 and max>1, set log min to 1, which works for most coverage
94
+ // types tracks. if max is not >1, might be like raw p-values so then it'll
95
+ // display negative values
96
+ if (min >= 0 && max > 1) {
98
97
  min = 1;
99
98
  }
100
99
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-wiggle",
3
- "version": "2.12.3",
3
+ "version": "2.13.1",
4
4
  "description": "JBrowse 2 wiggle adapters, tracks, etc.",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -66,5 +66,5 @@
66
66
  "distModule": "esm/index.js",
67
67
  "srcModule": "src/index.ts",
68
68
  "module": "esm/index.js",
69
- "gitHead": "2775490221cde56af344acebb0afa7e14531cd81"
69
+ "gitHead": "fcebca71cc1d066654603e1a9accfa6c6d4f764d"
70
70
  }