@jbrowse/img 3.0.5 → 3.2.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.
package/dist/parseArgv.js CHANGED
@@ -21,13 +21,13 @@ function parseArgv(argv) {
21
21
  }
22
22
  function standardizeArgv(args, trackTypes) {
23
23
  const result = { trackList: [] };
24
- args.forEach(arg => {
24
+ for (const arg of args) {
25
25
  if (trackTypes.includes(arg[0])) {
26
26
  result.trackList.push(arg);
27
27
  }
28
28
  else {
29
29
  result[arg[0]] = arg[1][0] || true;
30
30
  }
31
- });
31
+ }
32
32
  return result;
33
33
  }
@@ -8,7 +8,7 @@ exports.renderRegion = renderRegion;
8
8
  const fs_1 = __importDefault(require("fs"));
9
9
  const path_1 = __importDefault(require("path"));
10
10
  const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
11
- const react_linear_genome_view_1 = require("@jbrowse/react-linear-genome-view");
11
+ const react_linear_genome_view2_1 = require("@jbrowse/react-linear-genome-view2");
12
12
  const util_1 = require("./util");
13
13
  function read(file) {
14
14
  let res;
@@ -36,7 +36,7 @@ function addRelativePaths(config, configPath) {
36
36
  }
37
37
  }
38
38
  function readData({ assembly: asm, config, session, fasta, aliases, cytobands, defaultSession, tracks, trackList = [], }) {
39
- var _a;
39
+ var _a, _b;
40
40
  const assemblyData = asm && fs_1.default.existsSync(asm) ? read(asm) : undefined;
41
41
  const tracksData = tracks ? read(tracks) : undefined;
42
42
  const configData = config ? read(config) : {};
@@ -109,11 +109,10 @@ function readData({ assembly: asm, config, session, fasta, aliases, cytobands, d
109
109
  else if (!configData.tracks) {
110
110
  configData.tracks = [];
111
111
  }
112
- trackList.forEach(track => {
113
- var _a;
112
+ for (const track of trackList) {
114
113
  const [type, opts] = track;
115
114
  const [file, ...rest] = opts;
116
- const index = (_a = rest.find(r => r.startsWith('index:'))) === null || _a === void 0 ? void 0 : _a.replace('index:', '');
115
+ const index = (_b = rest.find(r => r.startsWith('index:'))) === null || _b === void 0 ? void 0 : _b.replace('index:', '');
117
116
  if (!file) {
118
117
  throw new Error('no file specified');
119
118
  }
@@ -276,7 +275,7 @@ function readData({ assembly: asm, config, session, fasta, aliases, cytobands, d
276
275
  },
277
276
  ];
278
277
  }
279
- });
278
+ }
280
279
  if (!defaultSession) {
281
280
  configData.defaultSession = undefined;
282
281
  }
@@ -292,7 +291,7 @@ function process(trackEntry, view, extra = c => c) {
292
291
  }
293
292
  const currentTrack = view.showTrack(extra(track));
294
293
  const display = currentTrack.displays[0];
295
- opts.forEach(opt => {
294
+ for (const opt of opts) {
296
295
  if (opt.startsWith('height:')) {
297
296
  const [, height] = opt.split(':');
298
297
  if (height) {
@@ -353,10 +352,10 @@ function process(trackEntry, view, extra = c => c) {
353
352
  }
354
353
  display.setResolution(+val);
355
354
  }
356
- });
355
+ }
357
356
  }
358
357
  async function renderRegion(opts) {
359
- const model = (0, react_linear_genome_view_1.createViewState)({
358
+ const model = (0, react_linear_genome_view2_1.createViewState)({
360
359
  ...readData(opts),
361
360
  });
362
361
  const { loc, width = 1500, trackList = [], session: sessionParam, defaultSession, } = opts;
@@ -376,9 +375,9 @@ async function renderRegion(opts) {
376
375
  else if (!sessionParam && !defaultSession) {
377
376
  console.warn('No loc specified');
378
377
  }
379
- trackList.forEach(track => {
378
+ for (const track of trackList) {
380
379
  process(track, view, extra => path_1.default.basename(extra));
381
- });
380
+ }
382
381
  return (0, plugin_linear_genome_view_1.renderToSvg)(view, {
383
382
  rasterizeLayers: !opts.noRasterize,
384
383
  ...opts,
package/esm/parseArgv.js CHANGED
@@ -17,13 +17,13 @@ export function parseArgv(argv) {
17
17
  }
18
18
  export function standardizeArgv(args, trackTypes) {
19
19
  const result = { trackList: [] };
20
- args.forEach(arg => {
20
+ for (const arg of args) {
21
21
  if (trackTypes.includes(arg[0])) {
22
22
  result.trackList.push(arg);
23
23
  }
24
24
  else {
25
25
  result[arg[0]] = arg[1][0] || true;
26
26
  }
27
- });
27
+ }
28
28
  return result;
29
29
  }
@@ -1,7 +1,7 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
3
  import { renderToSvg } from '@jbrowse/plugin-linear-genome-view';
4
- import { createViewState } from '@jbrowse/react-linear-genome-view';
4
+ import { createViewState } from '@jbrowse/react-linear-genome-view2';
5
5
  import { booleanize } from './util';
6
6
  function read(file) {
7
7
  let res;
@@ -29,7 +29,7 @@ function addRelativePaths(config, configPath) {
29
29
  }
30
30
  }
31
31
  export function readData({ assembly: asm, config, session, fasta, aliases, cytobands, defaultSession, tracks, trackList = [], }) {
32
- var _a;
32
+ var _a, _b;
33
33
  const assemblyData = asm && fs.existsSync(asm) ? read(asm) : undefined;
34
34
  const tracksData = tracks ? read(tracks) : undefined;
35
35
  const configData = config ? read(config) : {};
@@ -102,11 +102,10 @@ export function readData({ assembly: asm, config, session, fasta, aliases, cytob
102
102
  else if (!configData.tracks) {
103
103
  configData.tracks = [];
104
104
  }
105
- trackList.forEach(track => {
106
- var _a;
105
+ for (const track of trackList) {
107
106
  const [type, opts] = track;
108
107
  const [file, ...rest] = opts;
109
- const index = (_a = rest.find(r => r.startsWith('index:'))) === null || _a === void 0 ? void 0 : _a.replace('index:', '');
108
+ const index = (_b = rest.find(r => r.startsWith('index:'))) === null || _b === void 0 ? void 0 : _b.replace('index:', '');
110
109
  if (!file) {
111
110
  throw new Error('no file specified');
112
111
  }
@@ -269,7 +268,7 @@ export function readData({ assembly: asm, config, session, fasta, aliases, cytob
269
268
  },
270
269
  ];
271
270
  }
272
- });
271
+ }
273
272
  if (!defaultSession) {
274
273
  configData.defaultSession = undefined;
275
274
  }
@@ -285,7 +284,7 @@ function process(trackEntry, view, extra = c => c) {
285
284
  }
286
285
  const currentTrack = view.showTrack(extra(track));
287
286
  const display = currentTrack.displays[0];
288
- opts.forEach(opt => {
287
+ for (const opt of opts) {
289
288
  if (opt.startsWith('height:')) {
290
289
  const [, height] = opt.split(':');
291
290
  if (height) {
@@ -346,7 +345,7 @@ function process(trackEntry, view, extra = c => c) {
346
345
  }
347
346
  display.setResolution(+val);
348
347
  }
349
- });
348
+ }
350
349
  }
351
350
  export async function renderRegion(opts) {
352
351
  const model = createViewState({
@@ -369,9 +368,9 @@ export async function renderRegion(opts) {
369
368
  else if (!sessionParam && !defaultSession) {
370
369
  console.warn('No loc specified');
371
370
  }
372
- trackList.forEach(track => {
371
+ for (const track of trackList) {
373
372
  process(track, view, extra => path.basename(extra));
374
- });
373
+ }
375
374
  return renderToSvg(view, {
376
375
  rasterizeLayers: !opts.noRasterize,
377
376
  ...opts,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/img",
3
- "version": "3.0.5",
3
+ "version": "3.2.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "esm/index.js",
6
6
  "author": "JBrowse Team",
@@ -27,8 +27,7 @@
27
27
  "@babel/runtime": "^7.17.9",
28
28
  "@emotion/cache": "^11.7.1",
29
29
  "@emotion/react": "^11.9.0",
30
- "@jbrowse/plugin-linear-genome-view": "^3.0.5",
31
- "@jbrowse/react-linear-genome-view": "^3.0.5",
30
+ "@jbrowse/react-linear-genome-view2": "^3.2.0",
32
31
  "canvas": "^3.0.0",
33
32
  "jsdom": "^26.0.0",
34
33
  "mobx": "^6.6.0",
@@ -41,5 +40,5 @@
41
40
  "publishConfig": {
42
41
  "access": "public"
43
42
  },
44
- "gitHead": "a03749efe19e51609922272b845a331897346789"
43
+ "gitHead": "c750e3f56706a490c19ba75abd807fec5e38aebf"
45
44
  }