geneviewer-js 0.3.0 → 0.3.2

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/README.md CHANGED
@@ -192,7 +192,7 @@ Set `PORT` to use a port other than 4849.
192
192
 
193
193
  1. Bump `version` in `package.json` and `src/lib/chart.js` (`npm run check`
194
194
  compares them).
195
- 2. Commit, then tag and push: `git tag v0.3.1 && git push origin main v0.3.1`.
195
+ 2. Commit, then tag and push: `git tag v0.3.2 && git push origin main v0.3.2`.
196
196
 
197
197
  The publish workflow tests and builds, publishes to npm with provenance,
198
198
  and attaches `dist/` to a GitHub release.
@@ -201,15 +201,16 @@ and attaches `dist/` to a GitHub release.
201
201
 
202
202
  The R package vendors a release: its copies of the files are stored in the R
203
203
  repo and shipped inside the package, so users never download JavaScript
204
- separately. A maintainer pulls a new release with:
204
+ separately. From the R repo, a maintainer pulls a release with:
205
205
 
206
206
  ```sh
207
- curl -sSLO https://github.com/nvelden/geneviewer-js/releases/download/v0.3.0/{geneviewer.core.js,geneviewer.css,themes.json,geneviewerwidget.js,SHA256SUMS}
208
- shasum -a 256 -c SHA256SUMS --ignore-missing
207
+ Rscript dev/update_js.R 0.3.2
209
208
  ```
210
209
 
211
- They then copy the files into `inst/htmlwidgets/`. Do not edit those copies in
212
- the R repo; make changes here and cut a new release.
210
+ It downloads `geneviewer.core.js`, `geneviewer.css`, `themes.json`, the
211
+ binding and `SHA256SUMS` from the GitHub release, checks the checksums and
212
+ writes them to `inst/htmlwidgets/`. Do not edit those copies in the R repo;
213
+ make changes here and cut a new release.
213
214
 
214
215
  ## Roadmap
215
216
 
package/dist/SHA256SUMS CHANGED
@@ -1,11 +1,11 @@
1
- e78728da421c9b7bf3002d853fecd4497e27d8be4331fb391caab93722b4b724 geneviewer.core.js
1
+ a2189b6979396309b4338d0c080667d3dc327874b7b1bc724519093ff5c0b992 geneviewer.core.js
2
2
  d96c80adea1ce9ebe5323e153e4f1e014816ef37d502c849741d68f7b3fa6575 geneviewer.css
3
- 3a363a3b443504da4589aaf3102b00d8f488df77b6f358721f640f7befbf6c28 geneviewer.d.ts
4
- 45815b9a041648042911b03214c71412e02c2a79192ec581100ceea08d3572bd geneviewer.min.js
5
- f8541286b4ed988290501a507a70633a714cf243181569526c219fa7c868d331 geneviewer.min.js.map
6
- 039077a86bff0ba3dbbec37578f468ee4f71c54c44a2f9126ae691e83d5b7f91 geneviewer.mjs
7
- cf000dfc911a3e3302f2007f3e1fee132da4dfafd2f94dcc9c884fa772a23975 geneviewer.standalone.mjs
8
- 1025a3defe0032717b7fdd571dfc0f90df9696846066818f8a94079e103a8b23 geneviewer.standalone.mjs.map
9
- 0bc331bce739358f3150af8b1ad3851a4c4cbbf6763cc122fe3b41008b230020 geneviewerwidget.js
3
+ 78b8e7230f617d026d719dd2a737235cff0dfd2eccea9a45c6a2f3dc8c79012b geneviewer.d.ts
4
+ 3dc423bcc69d96ebf3b90d76514ad77fd933d4d32aecec7603831e7d7be37078 geneviewer.min.js
5
+ 3d8ab4ba117d4e8d0dbaa81e3821eb89a43f2061b32d4bab1a9b472f48f60148 geneviewer.min.js.map
6
+ 94fd03a9d11a866e5c2334bf78b5f8024d39e70075ec31387e3544ea4d858f91 geneviewer.mjs
7
+ 99332f7fd0f9feae88ca01432a3747ab9fe24da4c7e80c1ac36dc607c1060518 geneviewer.standalone.mjs
8
+ 47ddd606b7a6fdc1567f239e80e7c3ef6d885c64786fde1f8c42cf9aae625a21 geneviewer.standalone.mjs.map
9
+ 6c10d97166d6ae208888b3c0ba2a9fa1301888e759a49f1761ee5c00843fddff geneviewerwidget.js
10
10
  3d9a1611127c02a515da15b88c46f9da30e0f8ade676919e7502244aef4dd000 spec.d.ts
11
11
  65ebaa72b864ba74fabc06aa02d858a0a621e5579dadc0c5d9d7add1ba48f246 themes.json
@@ -6075,7 +6075,8 @@ var geneviewer = (() => {
6075
6075
  }
6076
6076
  if (options.position !== null && options.position !== void 0) {
6077
6077
  if (options.type === "rectangle") {
6078
- options.position = [options.position].flat(0).map((corners) => {
6078
+ const rectangles = Array.isArray(options.position) ? options.position : [options.position];
6079
+ options.position = rectangles.map((corners) => {
6079
6080
  if (!Array.isArray(corners)) return [move(corners)];
6080
6081
  return corners.map((point) => Array.isArray(point) ? [move(point[0]), ...point.slice(1)] : move(point));
6081
6082
  });
@@ -7325,7 +7326,7 @@ var geneviewer = (() => {
7325
7326
  }
7326
7327
 
7327
7328
  // src/lib/chart.js
7328
- var version = "0.3.0";
7329
+ var version = "0.3.2";
7329
7330
  var renderSequence = 0;
7330
7331
  var chartCount = 0;
7331
7332
  var activeShortcuts = null;
@@ -7565,9 +7566,15 @@ var geneviewer = (() => {
7565
7566
  return keyOf(item) === key;
7566
7567
  });
7567
7568
  };
7569
+ var copyItem = function(item) {
7570
+ return item === null ? null : structuredClone(item);
7571
+ };
7572
+ var copySelection = function() {
7573
+ return selection.map(copyItem);
7574
+ };
7568
7575
  var reportSelection = function() {
7569
- report("select", selected);
7570
- report("selection", selection);
7576
+ report("select", copyItem(selected));
7577
+ report("selection", copySelection());
7571
7578
  };
7572
7579
  var applySelection = function(refresh) {
7573
7580
  var previous = JSON.stringify(selection.map(function(item) {
@@ -8938,7 +8945,7 @@ var geneviewer = (() => {
8938
8945
  changeSelection(matchItems(items == null ? [] : Array.isArray(items) ? items : [items]), "replace");
8939
8946
  },
8940
8947
  getSelection: function() {
8941
- return selection.slice();
8948
+ return copySelection();
8942
8949
  },
8943
8950
  undo: function() {
8944
8951
  if (!destroyed) step(true);
@@ -91,6 +91,7 @@ export type Chart = {
91
91
  /**
92
92
  * The selected elements,
93
93
  * as the selection event reports them; the last is the one select reports.
94
+ * The items are copies: changing them does not change the selection.
94
95
  */
95
96
  getSelection: () => Array<SelectionItem>;
96
97
  /**