mol_plot_all 1.2.239 → 1.2.242

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/node.esm.js CHANGED
@@ -1739,26 +1739,7 @@ var $;
1739
1739
  }
1740
1740
  }
1741
1741
  resync(...args) {
1742
- let res;
1743
- try {
1744
- res = this.recall(...args);
1745
- }
1746
- catch (error) {
1747
- if (error instanceof Promise)
1748
- $mol_fail_hidden(error);
1749
- res = error;
1750
- }
1751
- try {
1752
- this.once();
1753
- }
1754
- catch (error) {
1755
- if (error instanceof Promise)
1756
- $mol_fail_hidden(error);
1757
- }
1758
- return this.put(res);
1759
- }
1760
- recall(...args) {
1761
- return this.task.call(this.host, ...args);
1742
+ return this.put(this.task.call(this.host, ...args));
1762
1743
  }
1763
1744
  once() {
1764
1745
  return this.sync();
@@ -1807,9 +1788,6 @@ var $;
1807
1788
  __decorate([
1808
1789
  $mol_wire_method
1809
1790
  ], $mol_wire_atom.prototype, "resync", null);
1810
- __decorate([
1811
- $mol_wire_method
1812
- ], $mol_wire_atom.prototype, "recall", null);
1813
1791
  __decorate([
1814
1792
  $mol_wire_method
1815
1793
  ], $mol_wire_atom.prototype, "once", null);
@@ -2765,8 +2743,11 @@ var $;
2765
2743
  return this[0].map((_, i) => this.map(row => row[i]));
2766
2744
  }
2767
2745
  get x() { return this[0]; }
2746
+ set x(next) { this[0] = next; }
2768
2747
  get y() { return this[1]; }
2748
+ set y(next) { this[1] = next; }
2769
2749
  get z() { return this[2]; }
2750
+ set z(next) { this[2] = next; }
2770
2751
  }
2771
2752
  $.$mol_vector = $mol_vector;
2772
2753
  class $mol_vector_1d extends $mol_vector {
@@ -2779,10 +2760,17 @@ var $;
2779
2760
  }
2780
2761
  $.$mol_vector_3d = $mol_vector_3d;
2781
2762
  class $mol_vector_range extends $mol_vector {
2782
- get [0]() { return super[0]; }
2783
- get [1]() { return super[1]; }
2763
+ 0;
2764
+ 1;
2765
+ constructor(min, max) {
2766
+ super(min, max);
2767
+ this[0] = min;
2768
+ this[1] = max;
2769
+ }
2784
2770
  get min() { return this[0]; }
2771
+ set min(next) { this[0] = next; }
2785
2772
  get max() { return this[1]; }
2773
+ set max(next) { this[1] = next; }
2786
2774
  get inversed() {
2787
2775
  return new this.constructor(this.max, this.min);
2788
2776
  }
@@ -3088,7 +3076,14 @@ var $;
3088
3076
  const series_x = this.series_x();
3089
3077
  const series_y = this.series_y();
3090
3078
  for (let i = 0; i < series_x.length; i++) {
3091
- next = next.expanded1([this.repos_x(series_x[i]), this.repos_y(series_y[i])]);
3079
+ if (series_x[i] > next.x.max)
3080
+ next.x.max = series_x[i];
3081
+ if (series_x[i] < next.x.min)
3082
+ next.x.min = series_x[i];
3083
+ if (series_y[i] > next.y.max)
3084
+ next.y.max = series_y[i];
3085
+ if (series_y[i] < next.y.min)
3086
+ next.y.min = series_y[i];
3092
3087
  }
3093
3088
  return next;
3094
3089
  }
@@ -4442,16 +4437,17 @@ var $;
4442
4437
  "use strict";
4443
4438
  var $;
4444
4439
  (function ($) {
4445
- function $mol_coord_pack(a, b) {
4446
- return a << 16 | b & 0xFFFF;
4440
+ const mask = 0b11111_11111_11111;
4441
+ function $mol_coord_pack(high, low) {
4442
+ return (high << 17 >>> 2) | (low & mask);
4447
4443
  }
4448
4444
  $.$mol_coord_pack = $mol_coord_pack;
4449
- function $mol_coord_high(key) {
4450
- return key >> 16;
4445
+ function $mol_coord_high(pack) {
4446
+ return pack << 2 >> 17;
4451
4447
  }
4452
4448
  $.$mol_coord_high = $mol_coord_high;
4453
- function $mol_coord_low(key) {
4454
- return (key & 0xFFFF) << 16 >> 16;
4449
+ function $mol_coord_low(pack) {
4450
+ return (pack << 17) >> 17;
4455
4451
  }
4456
4452
  $.$mol_coord_low = $mol_coord_low;
4457
4453
  })($ || ($ = {}));
@@ -4537,6 +4533,12 @@ var $;
4537
4533
  const size_x = Math.max(0, Math.ceil((1 / aspect - 1) * diameter));
4538
4534
  return points.map(point => `M ${point[0] - shift_x} ${point[1] - shift_y} l ${size_x} ${size_y}`).join(' ');
4539
4535
  }
4536
+ dimensions() {
4537
+ const scale = this.scale();
4538
+ const radius = this.diameter() / Math.min(...scale) / 2;
4539
+ const dims = super.dimensions();
4540
+ return new this.$.$mol_vector_2d(new $mol_vector_range(dims.x.min - radius, dims.x.max + radius), new $mol_vector_range(dims.y.min - radius, dims.y.max + radius));
4541
+ }
4540
4542
  }
4541
4543
  __decorate([
4542
4544
  $mol_mem
@@ -4544,6 +4546,9 @@ var $;
4544
4546
  __decorate([
4545
4547
  $mol_mem
4546
4548
  ], $mol_plot_dot.prototype, "indexes", null);
4549
+ __decorate([
4550
+ $mol_mem
4551
+ ], $mol_plot_dot.prototype, "dimensions", null);
4547
4552
  $$.$mol_plot_dot = $mol_plot_dot;
4548
4553
  })($$ = $.$$ || ($.$$ = {}));
4549
4554
  })($ || ($ = {}));