mol_plot_all 1.2.239 → 1.2.240

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
@@ -2757,8 +2757,11 @@ var $;
2757
2757
  return this[0].map((_, i) => this.map(row => row[i]));
2758
2758
  }
2759
2759
  get x() { return this[0]; }
2760
+ set x(next) { this[0] = next; }
2760
2761
  get y() { return this[1]; }
2762
+ set y(next) { this[1] = next; }
2761
2763
  get z() { return this[2]; }
2764
+ set z(next) { this[2] = next; }
2762
2765
  }
2763
2766
  $.$mol_vector = $mol_vector;
2764
2767
  class $mol_vector_1d extends $mol_vector {
@@ -2771,10 +2774,17 @@ var $;
2771
2774
  }
2772
2775
  $.$mol_vector_3d = $mol_vector_3d;
2773
2776
  class $mol_vector_range extends $mol_vector {
2774
- get [0]() { return super[0]; }
2775
- 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
+ }
2776
2784
  get min() { return this[0]; }
2785
+ set min(next) { this[0] = next; }
2777
2786
  get max() { return this[1]; }
2787
+ set max(next) { this[1] = next; }
2778
2788
  get inversed() {
2779
2789
  return new this.constructor(this.max, this.min);
2780
2790
  }
@@ -3080,7 +3090,14 @@ var $;
3080
3090
  const series_x = this.series_x();
3081
3091
  const series_y = this.series_y();
3082
3092
  for (let i = 0; i < series_x.length; i++) {
3083
- 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];
3084
3101
  }
3085
3102
  return next;
3086
3103
  }
@@ -4434,16 +4451,17 @@ var $;
4434
4451
  "use strict";
4435
4452
  var $;
4436
4453
  (function ($) {
4437
- function $mol_coord_pack(a, b) {
4438
- 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);
4439
4457
  }
4440
4458
  $.$mol_coord_pack = $mol_coord_pack;
4441
- function $mol_coord_high(key) {
4442
- return key >> 16;
4459
+ function $mol_coord_high(pack) {
4460
+ return pack << 2 >> 17;
4443
4461
  }
4444
4462
  $.$mol_coord_high = $mol_coord_high;
4445
- function $mol_coord_low(key) {
4446
- return (key & 0xFFFF) << 16 >> 16;
4463
+ function $mol_coord_low(pack) {
4464
+ return (pack << 17) >> 17;
4447
4465
  }
4448
4466
  $.$mol_coord_low = $mol_coord_low;
4449
4467
  })($ || ($ = {}));
@@ -4529,6 +4547,12 @@ var $;
4529
4547
  const size_x = Math.max(0, Math.ceil((1 / aspect - 1) * diameter));
4530
4548
  return points.map(point => `M ${point[0] - shift_x} ${point[1] - shift_y} l ${size_x} ${size_y}`).join(' ');
4531
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
+ }
4532
4556
  }
4533
4557
  __decorate([
4534
4558
  $mol_mem
@@ -4536,6 +4560,9 @@ var $;
4536
4560
  __decorate([
4537
4561
  $mol_mem
4538
4562
  ], $mol_plot_dot.prototype, "indexes", null);
4563
+ __decorate([
4564
+ $mol_mem
4565
+ ], $mol_plot_dot.prototype, "dimensions", null);
4539
4566
  $$.$mol_plot_dot = $mol_plot_dot;
4540
4567
  })($$ = $.$$ || ($.$$ = {}));
4541
4568
  })($ || ($ = {}));