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/web.js CHANGED
@@ -2375,8 +2375,11 @@ var $;
2375
2375
  return this[0].map((_, i) => this.map(row => row[i]));
2376
2376
  }
2377
2377
  get x() { return this[0]; }
2378
+ set x(next) { this[0] = next; }
2378
2379
  get y() { return this[1]; }
2380
+ set y(next) { this[1] = next; }
2379
2381
  get z() { return this[2]; }
2382
+ set z(next) { this[2] = next; }
2380
2383
  }
2381
2384
  $.$mol_vector = $mol_vector;
2382
2385
  class $mol_vector_1d extends $mol_vector {
@@ -2389,10 +2392,17 @@ var $;
2389
2392
  }
2390
2393
  $.$mol_vector_3d = $mol_vector_3d;
2391
2394
  class $mol_vector_range extends $mol_vector {
2392
- get [0]() { return super[0]; }
2393
- get [1]() { return super[1]; }
2395
+ 0;
2396
+ 1;
2397
+ constructor(min, max) {
2398
+ super(min, max);
2399
+ this[0] = min;
2400
+ this[1] = max;
2401
+ }
2394
2402
  get min() { return this[0]; }
2403
+ set min(next) { this[0] = next; }
2395
2404
  get max() { return this[1]; }
2405
+ set max(next) { this[1] = next; }
2396
2406
  get inversed() {
2397
2407
  return new this.constructor(this.max, this.min);
2398
2408
  }
@@ -2698,7 +2708,14 @@ var $;
2698
2708
  const series_x = this.series_x();
2699
2709
  const series_y = this.series_y();
2700
2710
  for (let i = 0; i < series_x.length; i++) {
2701
- next = next.expanded1([this.repos_x(series_x[i]), this.repos_y(series_y[i])]);
2711
+ if (series_x[i] > next.x.max)
2712
+ next.x.max = series_x[i];
2713
+ if (series_x[i] < next.x.min)
2714
+ next.x.min = series_x[i];
2715
+ if (series_y[i] > next.y.max)
2716
+ next.y.max = series_y[i];
2717
+ if (series_y[i] < next.y.min)
2718
+ next.y.min = series_y[i];
2702
2719
  }
2703
2720
  return next;
2704
2721
  }
@@ -4052,16 +4069,17 @@ var $;
4052
4069
  "use strict";
4053
4070
  var $;
4054
4071
  (function ($) {
4055
- function $mol_coord_pack(a, b) {
4056
- return a << 16 | b & 0xFFFF;
4072
+ const mask = 0b11111_11111_11111;
4073
+ function $mol_coord_pack(high, low) {
4074
+ return (high << 17 >>> 2) | (low & mask);
4057
4075
  }
4058
4076
  $.$mol_coord_pack = $mol_coord_pack;
4059
- function $mol_coord_high(key) {
4060
- return key >> 16;
4077
+ function $mol_coord_high(pack) {
4078
+ return pack << 2 >> 17;
4061
4079
  }
4062
4080
  $.$mol_coord_high = $mol_coord_high;
4063
- function $mol_coord_low(key) {
4064
- return (key & 0xFFFF) << 16 >> 16;
4081
+ function $mol_coord_low(pack) {
4082
+ return (pack << 17) >> 17;
4065
4083
  }
4066
4084
  $.$mol_coord_low = $mol_coord_low;
4067
4085
  })($ || ($ = {}));
@@ -4147,6 +4165,12 @@ var $;
4147
4165
  const size_x = Math.max(0, Math.ceil((1 / aspect - 1) * diameter));
4148
4166
  return points.map(point => `M ${point[0] - shift_x} ${point[1] - shift_y} l ${size_x} ${size_y}`).join(' ');
4149
4167
  }
4168
+ dimensions() {
4169
+ const scale = this.scale();
4170
+ const radius = this.diameter() / Math.min(...scale) / 2;
4171
+ const dims = super.dimensions();
4172
+ 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));
4173
+ }
4150
4174
  }
4151
4175
  __decorate([
4152
4176
  $mol_mem
@@ -4154,6 +4178,9 @@ var $;
4154
4178
  __decorate([
4155
4179
  $mol_mem
4156
4180
  ], $mol_plot_dot.prototype, "indexes", null);
4181
+ __decorate([
4182
+ $mol_mem
4183
+ ], $mol_plot_dot.prototype, "dimensions", null);
4157
4184
  $$.$mol_plot_dot = $mol_plot_dot;
4158
4185
  })($$ = $.$$ || ($.$$ = {}));
4159
4186
  })($ || ($ = {}));