mol_plot_all 1.2.128 → 1.2.132
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.d.ts +7 -14
- package/node.deps.json +1 -1
- package/node.esm.js +145 -104
- package/node.esm.js.map +1 -1
- package/node.js +145 -104
- package/node.js.map +1 -1
- package/node.test.js +172 -468
- package/node.test.js.map +1 -1
- package/node.view.tree +6 -1
- package/package.json +1 -1
- package/web.d.ts +7 -14
- package/web.deps.json +1 -1
- package/web.esm.js +145 -104
- package/web.esm.js.map +1 -1
- package/web.js +145 -104
- package/web.js.map +1 -1
- package/web.test.js +24 -361
- package/web.test.js.map +1 -1
- package/web.view.tree +6 -1
package/node.esm.js
CHANGED
|
@@ -961,91 +961,125 @@ var $;
|
|
|
961
961
|
"use strict";
|
|
962
962
|
var $;
|
|
963
963
|
(function ($) {
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
964
|
+
let cache = new WeakMap();
|
|
965
|
+
function $mol_compare_deep(left, right) {
|
|
966
|
+
if (Object.is(left, right))
|
|
967
|
+
return true;
|
|
968
|
+
if (left === null)
|
|
969
|
+
return false;
|
|
970
|
+
if (right === null)
|
|
971
|
+
return false;
|
|
972
|
+
if (typeof left !== 'object')
|
|
973
|
+
return false;
|
|
974
|
+
if (typeof right !== 'object')
|
|
975
|
+
return false;
|
|
976
|
+
const left_proto = Reflect.getPrototypeOf(left);
|
|
977
|
+
const right_proto = Reflect.getPrototypeOf(right);
|
|
978
|
+
if (left_proto !== right_proto)
|
|
979
|
+
return false;
|
|
980
|
+
if (left instanceof Boolean)
|
|
981
|
+
return Object.is(left.valueOf(), right['valueOf']());
|
|
982
|
+
if (left instanceof Number)
|
|
983
|
+
return Object.is(left.valueOf(), right['valueOf']());
|
|
984
|
+
if (left instanceof String)
|
|
985
|
+
return Object.is(left.valueOf(), right['valueOf']());
|
|
986
|
+
if (left instanceof Date)
|
|
987
|
+
return Object.is(left.valueOf(), right['valueOf']());
|
|
988
|
+
if (left instanceof RegExp)
|
|
989
|
+
return left.source === right['source'] && left.flags === right['flags'];
|
|
990
|
+
let left_cache = cache.get(left);
|
|
991
|
+
if (left_cache) {
|
|
992
|
+
const right_cache = left_cache.get(right);
|
|
993
|
+
if (typeof right_cache === 'boolean')
|
|
994
|
+
return right_cache;
|
|
995
|
+
}
|
|
996
|
+
else {
|
|
997
|
+
left_cache = new WeakMap([[right, true]]);
|
|
998
|
+
cache.set(left, left_cache);
|
|
999
|
+
}
|
|
1000
|
+
let result;
|
|
988
1001
|
try {
|
|
989
|
-
|
|
1002
|
+
if (left_proto && !Reflect.getPrototypeOf(left_proto))
|
|
1003
|
+
result = compare_pojo(left, right);
|
|
1004
|
+
else if (Array.isArray(left))
|
|
1005
|
+
result = compare_array(left, right);
|
|
1006
|
+
else if (left instanceof Set)
|
|
1007
|
+
result = compare_set(left, right);
|
|
1008
|
+
else if (left instanceof Map)
|
|
1009
|
+
result = compare_map(left, right);
|
|
1010
|
+
else if (ArrayBuffer.isView(left))
|
|
1011
|
+
result = compare_buffer(left, right);
|
|
1012
|
+
else if (Symbol.toPrimitive in left)
|
|
1013
|
+
result = compare_primitive(left, right);
|
|
1014
|
+
else
|
|
1015
|
+
result = false;
|
|
990
1016
|
}
|
|
991
1017
|
finally {
|
|
992
|
-
|
|
1018
|
+
left_cache.set(right, result);
|
|
993
1019
|
}
|
|
1020
|
+
return result;
|
|
994
1021
|
}
|
|
995
|
-
$.$
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
if (!Object.is(source[i], target[i]))
|
|
1006
|
-
return target;
|
|
1007
|
-
}
|
|
1008
|
-
return source;
|
|
1022
|
+
$.$mol_compare_deep = $mol_compare_deep;
|
|
1023
|
+
function compare_array(left, right) {
|
|
1024
|
+
const len = left.length;
|
|
1025
|
+
if (len !== right.length)
|
|
1026
|
+
return false;
|
|
1027
|
+
for (let i = 0; i < len; ++i) {
|
|
1028
|
+
if (!$mol_compare_deep(left[i], right[i]))
|
|
1029
|
+
return false;
|
|
1030
|
+
}
|
|
1031
|
+
return true;
|
|
1009
1032
|
}
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
let equal = true;
|
|
1018
|
-
for (let key in target) {
|
|
1019
|
-
const conformed = $mol_conform(target[key], source[key]);
|
|
1020
|
-
if (conformed !== target[key]) {
|
|
1021
|
-
try {
|
|
1022
|
-
target[key] = conformed;
|
|
1023
|
-
}
|
|
1024
|
-
catch (error) { }
|
|
1025
|
-
if (!Object.is(conformed, target[key]))
|
|
1026
|
-
equal = false;
|
|
1027
|
-
}
|
|
1028
|
-
if (!Object.is(conformed, source[key]))
|
|
1029
|
-
equal = false;
|
|
1030
|
-
++count;
|
|
1033
|
+
function compare_buffer(left, right) {
|
|
1034
|
+
const len = left.byteLength;
|
|
1035
|
+
if (len !== right.byteLength)
|
|
1036
|
+
return false;
|
|
1037
|
+
for (let i = 0; i < len; ++i) {
|
|
1038
|
+
if (left[i] !== right[i])
|
|
1039
|
+
return false;
|
|
1031
1040
|
}
|
|
1032
|
-
|
|
1033
|
-
|
|
1041
|
+
return true;
|
|
1042
|
+
}
|
|
1043
|
+
function compare_iterator(left, right, compare) {
|
|
1044
|
+
while (true) {
|
|
1045
|
+
const left_next = left.next();
|
|
1046
|
+
const right_next = right.next();
|
|
1047
|
+
if (left_next.done !== right_next.done)
|
|
1048
|
+
return false;
|
|
1049
|
+
if (left_next.done)
|
|
1034
1050
|
break;
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1051
|
+
if (!compare(left_next.value, right_next.value))
|
|
1052
|
+
return false;
|
|
1053
|
+
}
|
|
1054
|
+
return true;
|
|
1055
|
+
}
|
|
1056
|
+
function compare_set(left, right) {
|
|
1057
|
+
if (left.size !== right.size)
|
|
1058
|
+
return false;
|
|
1059
|
+
return compare_iterator(left.values(), right.values(), $mol_compare_deep);
|
|
1060
|
+
}
|
|
1061
|
+
function compare_map(left, right) {
|
|
1062
|
+
if (left.size !== right.size)
|
|
1063
|
+
return false;
|
|
1064
|
+
return compare_iterator(left.keys(), right.keys(), Object.is)
|
|
1065
|
+
&& compare_iterator(left.values(), right.values(), $mol_compare_deep);
|
|
1066
|
+
}
|
|
1067
|
+
function compare_pojo(left, right) {
|
|
1068
|
+
const left_keys = Object.getOwnPropertyNames(left);
|
|
1069
|
+
const right_keys = Object.getOwnPropertyNames(right);
|
|
1070
|
+
if (left_keys.length !== right_keys.length)
|
|
1071
|
+
return false;
|
|
1072
|
+
for (let key of left_keys) {
|
|
1073
|
+
if (!$mol_compare_deep(left[key], Reflect.get(right, key)))
|
|
1074
|
+
return false;
|
|
1075
|
+
}
|
|
1076
|
+
return true;
|
|
1077
|
+
}
|
|
1078
|
+
function compare_primitive(left, right) {
|
|
1079
|
+
return Object.is(left[Symbol.toPrimitive]('default'), right[Symbol.toPrimitive]('default'));
|
|
1080
|
+
}
|
|
1047
1081
|
})($ || ($ = {}));
|
|
1048
|
-
//
|
|
1082
|
+
//deep.js.map
|
|
1049
1083
|
;
|
|
1050
1084
|
"use strict";
|
|
1051
1085
|
var $;
|
|
@@ -1372,8 +1406,7 @@ var $;
|
|
|
1372
1406
|
}
|
|
1373
1407
|
}
|
|
1374
1408
|
push(value) {
|
|
1375
|
-
|
|
1376
|
-
if (this.error !== null || !Object.is(this.value, value)) {
|
|
1409
|
+
if (this.error !== null || !$.$mol_compare_deep(this.value, value)) {
|
|
1377
1410
|
if ($mol_fiber.logs)
|
|
1378
1411
|
this.$.$mol_log3_done({
|
|
1379
1412
|
place: this,
|
|
@@ -3182,6 +3215,15 @@ var $;
|
|
|
3182
3215
|
return val;
|
|
3183
3216
|
return 1;
|
|
3184
3217
|
}
|
|
3218
|
+
allow_draw() {
|
|
3219
|
+
return true;
|
|
3220
|
+
}
|
|
3221
|
+
allow_pan() {
|
|
3222
|
+
return true;
|
|
3223
|
+
}
|
|
3224
|
+
allow_zoom() {
|
|
3225
|
+
return true;
|
|
3226
|
+
}
|
|
3185
3227
|
action_type(val) {
|
|
3186
3228
|
if (val !== undefined)
|
|
3187
3229
|
return val;
|
|
@@ -3298,8 +3340,7 @@ var $;
|
|
|
3298
3340
|
pointermove: (event) => this.event_move(event),
|
|
3299
3341
|
pointerup: (event) => this.event_end(event),
|
|
3300
3342
|
pointerleave: (event) => this.event_end(event),
|
|
3301
|
-
wheel: (event) => this.event_wheel(event)
|
|
3302
|
-
contextmenu: (event) => this.event_menu(event)
|
|
3343
|
+
wheel: (event) => this.event_wheel(event)
|
|
3303
3344
|
};
|
|
3304
3345
|
}
|
|
3305
3346
|
event_start(event) {
|
|
@@ -3322,11 +3363,6 @@ var $;
|
|
|
3322
3363
|
return event;
|
|
3323
3364
|
return null;
|
|
3324
3365
|
}
|
|
3325
|
-
event_menu(event) {
|
|
3326
|
-
if (event !== undefined)
|
|
3327
|
-
return event;
|
|
3328
|
-
return null;
|
|
3329
|
-
}
|
|
3330
3366
|
}
|
|
3331
3367
|
__decorate([
|
|
3332
3368
|
$.$mol_mem
|
|
@@ -3406,9 +3442,6 @@ var $;
|
|
|
3406
3442
|
__decorate([
|
|
3407
3443
|
$.$mol_mem
|
|
3408
3444
|
], $mol_touch.prototype, "event_wheel", null);
|
|
3409
|
-
__decorate([
|
|
3410
|
-
$.$mol_mem
|
|
3411
|
-
], $mol_touch.prototype, "event_menu", null);
|
|
3412
3445
|
$.$mol_touch = $mol_touch;
|
|
3413
3446
|
})($ || ($ = {}));
|
|
3414
3447
|
//touch.view.tree.js.map
|
|
@@ -3455,16 +3488,22 @@ var $;
|
|
|
3455
3488
|
if (event.type !== 'pointerleave')
|
|
3456
3489
|
events.push(event);
|
|
3457
3490
|
this.pointer_events(events);
|
|
3458
|
-
if (events.filter(e => e.pointerType === 'touch').length === 2) {
|
|
3491
|
+
if (this.allow_zoom() && events.filter(e => e.pointerType === 'touch').length === 2) {
|
|
3459
3492
|
return this.action_type('zoom');
|
|
3460
3493
|
}
|
|
3494
|
+
let button;
|
|
3495
|
+
(function (button) {
|
|
3496
|
+
button[button["left"] = 1] = "left";
|
|
3497
|
+
button[button["right"] = 2] = "right";
|
|
3498
|
+
button[button["middle"] = 4] = "middle";
|
|
3499
|
+
})(button || (button = {}));
|
|
3461
3500
|
if (events.length > 0) {
|
|
3462
|
-
if (event.ctrlKey)
|
|
3501
|
+
if (event.ctrlKey && this.allow_zoom())
|
|
3463
3502
|
return this.action_type('zoom');
|
|
3464
|
-
if (event.buttons ===
|
|
3465
|
-
return this.action_type('pan');
|
|
3466
|
-
if (event.buttons === 1)
|
|
3503
|
+
if (event.buttons === button.left && this.allow_draw())
|
|
3467
3504
|
return this.action_type('draw');
|
|
3505
|
+
if (event.buttons && this.allow_pan())
|
|
3506
|
+
return this.action_type('pan');
|
|
3468
3507
|
}
|
|
3469
3508
|
return this.action_type('');
|
|
3470
3509
|
}
|
|
@@ -3508,11 +3547,7 @@ var $;
|
|
|
3508
3547
|
if (!start_pos)
|
|
3509
3548
|
return;
|
|
3510
3549
|
if (action_type === 'pan') {
|
|
3511
|
-
|
|
3512
|
-
if (distance >= 4) {
|
|
3513
|
-
this._menu_mute = true;
|
|
3514
|
-
this.dom_node().setPointerCapture(event.pointerId);
|
|
3515
|
-
}
|
|
3550
|
+
this.dom_node().setPointerCapture(event.pointerId);
|
|
3516
3551
|
this.pan(new $.$mol_vector_2d(start_pan[0] + pos[0] - start_pos[0], start_pan[1] + pos[1] - start_pos[1]));
|
|
3517
3552
|
}
|
|
3518
3553
|
const precision = this.swipe_precision();
|
|
@@ -3564,7 +3599,6 @@ var $;
|
|
|
3564
3599
|
return;
|
|
3565
3600
|
}
|
|
3566
3601
|
this.start_pos(null);
|
|
3567
|
-
new $.$mol_after_timeout(0, () => this._menu_mute = false);
|
|
3568
3602
|
}
|
|
3569
3603
|
swipe_left(event) {
|
|
3570
3604
|
if (this.view_rect().right - this.start_pos()[0] < this.swipe_precision() * 2)
|
|
@@ -3594,11 +3628,6 @@ var $;
|
|
|
3594
3628
|
this.swipe_to_bottom(event);
|
|
3595
3629
|
this.event_end(event);
|
|
3596
3630
|
}
|
|
3597
|
-
_menu_mute = false;
|
|
3598
|
-
event_menu(event) {
|
|
3599
|
-
if (this._menu_mute)
|
|
3600
|
-
event.preventDefault();
|
|
3601
|
-
}
|
|
3602
3631
|
event_wheel(event) {
|
|
3603
3632
|
if (this.pan === $mol_touch.prototype.pan && this.zoom === $mol_touch.prototype.zoom)
|
|
3604
3633
|
return;
|
|
@@ -3802,6 +3831,15 @@ var $;
|
|
|
3802
3831
|
return val;
|
|
3803
3832
|
return 1;
|
|
3804
3833
|
}
|
|
3834
|
+
allow_draw() {
|
|
3835
|
+
return true;
|
|
3836
|
+
}
|
|
3837
|
+
allow_pan() {
|
|
3838
|
+
return true;
|
|
3839
|
+
}
|
|
3840
|
+
allow_zoom() {
|
|
3841
|
+
return true;
|
|
3842
|
+
}
|
|
3805
3843
|
draw(event) {
|
|
3806
3844
|
if (event !== undefined)
|
|
3807
3845
|
return event;
|
|
@@ -3820,6 +3858,9 @@ var $;
|
|
|
3820
3858
|
const obj = new this.$.$mol_touch();
|
|
3821
3859
|
obj.zoom = (val) => this.zoom(val);
|
|
3822
3860
|
obj.pan = (val) => this.shift(val);
|
|
3861
|
+
obj.allow_draw = () => this.allow_draw();
|
|
3862
|
+
obj.allow_pan = () => this.allow_pan();
|
|
3863
|
+
obj.allow_zoom = () => this.allow_zoom();
|
|
3823
3864
|
obj.draw = (event) => this.draw(event);
|
|
3824
3865
|
return obj;
|
|
3825
3866
|
}
|