mol_plot_all 1.2.238 → 1.2.241

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.test.js CHANGED
@@ -1730,17 +1730,27 @@ var $;
1730
1730
  };
1731
1731
  }
1732
1732
  }
1733
- recall(...args) {
1734
- if (this.cursor > $mol_wire_cursor.fresh) {
1735
- try {
1736
- this.once();
1737
- }
1738
- catch (error) {
1739
- if (error instanceof Promise)
1740
- $mol_fail_hidden(error);
1741
- }
1733
+ resync(...args) {
1734
+ let res;
1735
+ try {
1736
+ res = this.recall(...args);
1742
1737
  }
1743
- return this.put(this.task.call(this.host, ...args));
1738
+ catch (error) {
1739
+ if (error instanceof Promise)
1740
+ $mol_fail_hidden(error);
1741
+ res = error;
1742
+ }
1743
+ try {
1744
+ this.once();
1745
+ }
1746
+ catch (error) {
1747
+ if (error instanceof Promise)
1748
+ $mol_fail_hidden(error);
1749
+ }
1750
+ return this.put(res);
1751
+ }
1752
+ recall(...args) {
1753
+ return this.task.call(this.host, ...args);
1744
1754
  }
1745
1755
  once() {
1746
1756
  return this.sync();
@@ -1786,6 +1796,9 @@ var $;
1786
1796
  return next;
1787
1797
  }
1788
1798
  }
1799
+ __decorate([
1800
+ $mol_wire_method
1801
+ ], $mol_wire_atom.prototype, "resync", null);
1789
1802
  __decorate([
1790
1803
  $mol_wire_method
1791
1804
  ], $mol_wire_atom.prototype, "recall", null);
@@ -1833,7 +1846,7 @@ var $;
1833
1846
  return atom.sync();
1834
1847
  }
1835
1848
  }
1836
- return atom.recall(...args);
1849
+ return atom.resync(...args);
1837
1850
  };
1838
1851
  Object.defineProperty(wrapper, 'name', { value: func.name + ' ' });
1839
1852
  Object.assign(wrapper, { orig: func });
@@ -2744,8 +2757,11 @@ var $;
2744
2757
  return this[0].map((_, i) => this.map(row => row[i]));
2745
2758
  }
2746
2759
  get x() { return this[0]; }
2760
+ set x(next) { this[0] = next; }
2747
2761
  get y() { return this[1]; }
2762
+ set y(next) { this[1] = next; }
2748
2763
  get z() { return this[2]; }
2764
+ set z(next) { this[2] = next; }
2749
2765
  }
2750
2766
  $.$mol_vector = $mol_vector;
2751
2767
  class $mol_vector_1d extends $mol_vector {
@@ -2758,10 +2774,17 @@ var $;
2758
2774
  }
2759
2775
  $.$mol_vector_3d = $mol_vector_3d;
2760
2776
  class $mol_vector_range extends $mol_vector {
2761
- get [0]() { return super[0]; }
2762
- get [1]() { return super[1]; }
2777
+ 0;
2778
+ 1;
2779
+ constructor(min, max) {
2780
+ super(min, max);
2781
+ this[0] = min;
2782
+ this[1] = max;
2783
+ }
2763
2784
  get min() { return this[0]; }
2785
+ set min(next) { this[0] = next; }
2764
2786
  get max() { return this[1]; }
2787
+ set max(next) { this[1] = next; }
2765
2788
  get inversed() {
2766
2789
  return new this.constructor(this.max, this.min);
2767
2790
  }
@@ -3067,7 +3090,14 @@ var $;
3067
3090
  const series_x = this.series_x();
3068
3091
  const series_y = this.series_y();
3069
3092
  for (let i = 0; i < series_x.length; i++) {
3070
- next = next.expanded1([this.repos_x(series_x[i]), this.repos_y(series_y[i])]);
3093
+ if (series_x[i] > next.x.max)
3094
+ next.x.max = series_x[i];
3095
+ if (series_x[i] < next.x.min)
3096
+ next.x.min = series_x[i];
3097
+ if (series_y[i] > next.y.max)
3098
+ next.y.max = series_y[i];
3099
+ if (series_y[i] < next.y.min)
3100
+ next.y.min = series_y[i];
3071
3101
  }
3072
3102
  return next;
3073
3103
  }
@@ -4421,16 +4451,17 @@ var $;
4421
4451
  "use strict";
4422
4452
  var $;
4423
4453
  (function ($) {
4424
- function $mol_coord_pack(a, b) {
4425
- return a << 16 | b & 0xFFFF;
4454
+ const mask = 0b11111_11111_11111;
4455
+ function $mol_coord_pack(high, low) {
4456
+ return (high << 17 >>> 2) | (low & mask);
4426
4457
  }
4427
4458
  $.$mol_coord_pack = $mol_coord_pack;
4428
- function $mol_coord_high(key) {
4429
- return key >> 16;
4459
+ function $mol_coord_high(pack) {
4460
+ return pack << 2 >> 17;
4430
4461
  }
4431
4462
  $.$mol_coord_high = $mol_coord_high;
4432
- function $mol_coord_low(key) {
4433
- return (key & 0xFFFF) << 16 >> 16;
4463
+ function $mol_coord_low(pack) {
4464
+ return (pack << 17) >> 17;
4434
4465
  }
4435
4466
  $.$mol_coord_low = $mol_coord_low;
4436
4467
  })($ || ($ = {}));
@@ -4516,6 +4547,12 @@ var $;
4516
4547
  const size_x = Math.max(0, Math.ceil((1 / aspect - 1) * diameter));
4517
4548
  return points.map(point => `M ${point[0] - shift_x} ${point[1] - shift_y} l ${size_x} ${size_y}`).join(' ');
4518
4549
  }
4550
+ dimensions() {
4551
+ const scale = this.scale();
4552
+ const radius = this.diameter() / Math.min(...scale) / 2;
4553
+ const dims = super.dimensions();
4554
+ 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));
4555
+ }
4519
4556
  }
4520
4557
  __decorate([
4521
4558
  $mol_mem
@@ -4523,6 +4560,9 @@ var $;
4523
4560
  __decorate([
4524
4561
  $mol_mem
4525
4562
  ], $mol_plot_dot.prototype, "indexes", null);
4563
+ __decorate([
4564
+ $mol_mem
4565
+ ], $mol_plot_dot.prototype, "dimensions", null);
4526
4566
  $$.$mol_plot_dot = $mol_plot_dot;
4527
4567
  })($$ = $.$$ || ($.$$ = {}));
4528
4568
  })($ || ($ = {}));
@@ -6757,6 +6797,19 @@ var $;
6757
6797
  App.value(2);
6758
6798
  $mol_assert_equal(App.value(), 3);
6759
6799
  },
6800
+ 'Read Pushed'($) {
6801
+ class App extends $mol_object2 {
6802
+ static $ = $;
6803
+ static value(next = 0) {
6804
+ return next;
6805
+ }
6806
+ }
6807
+ __decorate([
6808
+ $mol_wire_mem(0)
6809
+ ], App, "value", null);
6810
+ $mol_assert_equal(App.value(1), 1);
6811
+ $mol_assert_equal(App.value(), 1);
6812
+ },
6760
6813
  'Mem overrides mem'($) {
6761
6814
  class Base extends $mol_object2 {
6762
6815
  static $ = $;
@@ -6927,6 +6980,33 @@ var $;
6927
6980
  ], App, "test", null);
6928
6981
  App.test();
6929
6982
  },
6983
+ 'Update deps on push'($) {
6984
+ class App extends $mol_object2 {
6985
+ static $ = $;
6986
+ static left(next = false) {
6987
+ return next;
6988
+ }
6989
+ static right(next = false) {
6990
+ return next;
6991
+ }
6992
+ static res(next) {
6993
+ return this.left(next) && this.right();
6994
+ }
6995
+ }
6996
+ __decorate([
6997
+ $mol_wire_mem(0)
6998
+ ], App, "left", null);
6999
+ __decorate([
7000
+ $mol_wire_mem(0)
7001
+ ], App, "right", null);
7002
+ __decorate([
7003
+ $mol_wire_mem(0)
7004
+ ], App, "res", null);
7005
+ $mol_assert_equal(App.res(), false);
7006
+ $mol_assert_equal(App.res(true), false);
7007
+ $mol_assert_equal(App.right(true), true);
7008
+ $mol_assert_equal(App.res(), true);
7009
+ },
6930
7010
  'Different order of pull and push'($) {
6931
7011
  class App extends $mol_object2 {
6932
7012
  static $ = $;