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/web.esm.js
CHANGED
|
@@ -549,91 +549,125 @@ var $;
|
|
|
549
549
|
"use strict";
|
|
550
550
|
var $;
|
|
551
551
|
(function ($) {
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
552
|
+
let cache = new WeakMap();
|
|
553
|
+
function $mol_compare_deep(left, right) {
|
|
554
|
+
if (Object.is(left, right))
|
|
555
|
+
return true;
|
|
556
|
+
if (left === null)
|
|
557
|
+
return false;
|
|
558
|
+
if (right === null)
|
|
559
|
+
return false;
|
|
560
|
+
if (typeof left !== 'object')
|
|
561
|
+
return false;
|
|
562
|
+
if (typeof right !== 'object')
|
|
563
|
+
return false;
|
|
564
|
+
const left_proto = Reflect.getPrototypeOf(left);
|
|
565
|
+
const right_proto = Reflect.getPrototypeOf(right);
|
|
566
|
+
if (left_proto !== right_proto)
|
|
567
|
+
return false;
|
|
568
|
+
if (left instanceof Boolean)
|
|
569
|
+
return Object.is(left.valueOf(), right['valueOf']());
|
|
570
|
+
if (left instanceof Number)
|
|
571
|
+
return Object.is(left.valueOf(), right['valueOf']());
|
|
572
|
+
if (left instanceof String)
|
|
573
|
+
return Object.is(left.valueOf(), right['valueOf']());
|
|
574
|
+
if (left instanceof Date)
|
|
575
|
+
return Object.is(left.valueOf(), right['valueOf']());
|
|
576
|
+
if (left instanceof RegExp)
|
|
577
|
+
return left.source === right['source'] && left.flags === right['flags'];
|
|
578
|
+
let left_cache = cache.get(left);
|
|
579
|
+
if (left_cache) {
|
|
580
|
+
const right_cache = left_cache.get(right);
|
|
581
|
+
if (typeof right_cache === 'boolean')
|
|
582
|
+
return right_cache;
|
|
583
|
+
}
|
|
584
|
+
else {
|
|
585
|
+
left_cache = new WeakMap([[right, true]]);
|
|
586
|
+
cache.set(left, left_cache);
|
|
587
|
+
}
|
|
588
|
+
let result;
|
|
576
589
|
try {
|
|
577
|
-
|
|
590
|
+
if (left_proto && !Reflect.getPrototypeOf(left_proto))
|
|
591
|
+
result = compare_pojo(left, right);
|
|
592
|
+
else if (Array.isArray(left))
|
|
593
|
+
result = compare_array(left, right);
|
|
594
|
+
else if (left instanceof Set)
|
|
595
|
+
result = compare_set(left, right);
|
|
596
|
+
else if (left instanceof Map)
|
|
597
|
+
result = compare_map(left, right);
|
|
598
|
+
else if (ArrayBuffer.isView(left))
|
|
599
|
+
result = compare_buffer(left, right);
|
|
600
|
+
else if (Symbol.toPrimitive in left)
|
|
601
|
+
result = compare_primitive(left, right);
|
|
602
|
+
else
|
|
603
|
+
result = false;
|
|
578
604
|
}
|
|
579
605
|
finally {
|
|
580
|
-
|
|
606
|
+
left_cache.set(right, result);
|
|
581
607
|
}
|
|
608
|
+
return result;
|
|
582
609
|
}
|
|
583
|
-
$.$
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
if (!Object.is(source[i], target[i]))
|
|
594
|
-
return target;
|
|
595
|
-
}
|
|
596
|
-
return source;
|
|
610
|
+
$.$mol_compare_deep = $mol_compare_deep;
|
|
611
|
+
function compare_array(left, right) {
|
|
612
|
+
const len = left.length;
|
|
613
|
+
if (len !== right.length)
|
|
614
|
+
return false;
|
|
615
|
+
for (let i = 0; i < len; ++i) {
|
|
616
|
+
if (!$mol_compare_deep(left[i], right[i]))
|
|
617
|
+
return false;
|
|
618
|
+
}
|
|
619
|
+
return true;
|
|
597
620
|
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
let equal = true;
|
|
606
|
-
for (let key in target) {
|
|
607
|
-
const conformed = $mol_conform(target[key], source[key]);
|
|
608
|
-
if (conformed !== target[key]) {
|
|
609
|
-
try {
|
|
610
|
-
target[key] = conformed;
|
|
611
|
-
}
|
|
612
|
-
catch (error) { }
|
|
613
|
-
if (!Object.is(conformed, target[key]))
|
|
614
|
-
equal = false;
|
|
615
|
-
}
|
|
616
|
-
if (!Object.is(conformed, source[key]))
|
|
617
|
-
equal = false;
|
|
618
|
-
++count;
|
|
621
|
+
function compare_buffer(left, right) {
|
|
622
|
+
const len = left.byteLength;
|
|
623
|
+
if (len !== right.byteLength)
|
|
624
|
+
return false;
|
|
625
|
+
for (let i = 0; i < len; ++i) {
|
|
626
|
+
if (left[i] !== right[i])
|
|
627
|
+
return false;
|
|
619
628
|
}
|
|
620
|
-
|
|
621
|
-
|
|
629
|
+
return true;
|
|
630
|
+
}
|
|
631
|
+
function compare_iterator(left, right, compare) {
|
|
632
|
+
while (true) {
|
|
633
|
+
const left_next = left.next();
|
|
634
|
+
const right_next = right.next();
|
|
635
|
+
if (left_next.done !== right_next.done)
|
|
636
|
+
return false;
|
|
637
|
+
if (left_next.done)
|
|
622
638
|
break;
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
639
|
+
if (!compare(left_next.value, right_next.value))
|
|
640
|
+
return false;
|
|
641
|
+
}
|
|
642
|
+
return true;
|
|
643
|
+
}
|
|
644
|
+
function compare_set(left, right) {
|
|
645
|
+
if (left.size !== right.size)
|
|
646
|
+
return false;
|
|
647
|
+
return compare_iterator(left.values(), right.values(), $mol_compare_deep);
|
|
648
|
+
}
|
|
649
|
+
function compare_map(left, right) {
|
|
650
|
+
if (left.size !== right.size)
|
|
651
|
+
return false;
|
|
652
|
+
return compare_iterator(left.keys(), right.keys(), Object.is)
|
|
653
|
+
&& compare_iterator(left.values(), right.values(), $mol_compare_deep);
|
|
654
|
+
}
|
|
655
|
+
function compare_pojo(left, right) {
|
|
656
|
+
const left_keys = Object.getOwnPropertyNames(left);
|
|
657
|
+
const right_keys = Object.getOwnPropertyNames(right);
|
|
658
|
+
if (left_keys.length !== right_keys.length)
|
|
659
|
+
return false;
|
|
660
|
+
for (let key of left_keys) {
|
|
661
|
+
if (!$mol_compare_deep(left[key], Reflect.get(right, key)))
|
|
662
|
+
return false;
|
|
663
|
+
}
|
|
664
|
+
return true;
|
|
665
|
+
}
|
|
666
|
+
function compare_primitive(left, right) {
|
|
667
|
+
return Object.is(left[Symbol.toPrimitive]('default'), right[Symbol.toPrimitive]('default'));
|
|
668
|
+
}
|
|
635
669
|
})($ || ($ = {}));
|
|
636
|
-
//
|
|
670
|
+
//deep.js.map
|
|
637
671
|
;
|
|
638
672
|
"use strict";
|
|
639
673
|
var $;
|
|
@@ -960,8 +994,7 @@ var $;
|
|
|
960
994
|
}
|
|
961
995
|
}
|
|
962
996
|
push(value) {
|
|
963
|
-
|
|
964
|
-
if (this.error !== null || !Object.is(this.value, value)) {
|
|
997
|
+
if (this.error !== null || !$.$mol_compare_deep(this.value, value)) {
|
|
965
998
|
if ($mol_fiber.logs)
|
|
966
999
|
this.$.$mol_log3_done({
|
|
967
1000
|
place: this,
|
|
@@ -2889,6 +2922,15 @@ var $;
|
|
|
2889
2922
|
return val;
|
|
2890
2923
|
return 1;
|
|
2891
2924
|
}
|
|
2925
|
+
allow_draw() {
|
|
2926
|
+
return true;
|
|
2927
|
+
}
|
|
2928
|
+
allow_pan() {
|
|
2929
|
+
return true;
|
|
2930
|
+
}
|
|
2931
|
+
allow_zoom() {
|
|
2932
|
+
return true;
|
|
2933
|
+
}
|
|
2892
2934
|
action_type(val) {
|
|
2893
2935
|
if (val !== undefined)
|
|
2894
2936
|
return val;
|
|
@@ -3005,8 +3047,7 @@ var $;
|
|
|
3005
3047
|
pointermove: (event) => this.event_move(event),
|
|
3006
3048
|
pointerup: (event) => this.event_end(event),
|
|
3007
3049
|
pointerleave: (event) => this.event_end(event),
|
|
3008
|
-
wheel: (event) => this.event_wheel(event)
|
|
3009
|
-
contextmenu: (event) => this.event_menu(event)
|
|
3050
|
+
wheel: (event) => this.event_wheel(event)
|
|
3010
3051
|
};
|
|
3011
3052
|
}
|
|
3012
3053
|
event_start(event) {
|
|
@@ -3029,11 +3070,6 @@ var $;
|
|
|
3029
3070
|
return event;
|
|
3030
3071
|
return null;
|
|
3031
3072
|
}
|
|
3032
|
-
event_menu(event) {
|
|
3033
|
-
if (event !== undefined)
|
|
3034
|
-
return event;
|
|
3035
|
-
return null;
|
|
3036
|
-
}
|
|
3037
3073
|
}
|
|
3038
3074
|
__decorate([
|
|
3039
3075
|
$.$mol_mem
|
|
@@ -3113,9 +3149,6 @@ var $;
|
|
|
3113
3149
|
__decorate([
|
|
3114
3150
|
$.$mol_mem
|
|
3115
3151
|
], $mol_touch.prototype, "event_wheel", null);
|
|
3116
|
-
__decorate([
|
|
3117
|
-
$.$mol_mem
|
|
3118
|
-
], $mol_touch.prototype, "event_menu", null);
|
|
3119
3152
|
$.$mol_touch = $mol_touch;
|
|
3120
3153
|
})($ || ($ = {}));
|
|
3121
3154
|
//touch.view.tree.js.map
|
|
@@ -3162,16 +3195,22 @@ var $;
|
|
|
3162
3195
|
if (event.type !== 'pointerleave')
|
|
3163
3196
|
events.push(event);
|
|
3164
3197
|
this.pointer_events(events);
|
|
3165
|
-
if (events.filter(e => e.pointerType === 'touch').length === 2) {
|
|
3198
|
+
if (this.allow_zoom() && events.filter(e => e.pointerType === 'touch').length === 2) {
|
|
3166
3199
|
return this.action_type('zoom');
|
|
3167
3200
|
}
|
|
3201
|
+
let button;
|
|
3202
|
+
(function (button) {
|
|
3203
|
+
button[button["left"] = 1] = "left";
|
|
3204
|
+
button[button["right"] = 2] = "right";
|
|
3205
|
+
button[button["middle"] = 4] = "middle";
|
|
3206
|
+
})(button || (button = {}));
|
|
3168
3207
|
if (events.length > 0) {
|
|
3169
|
-
if (event.ctrlKey)
|
|
3208
|
+
if (event.ctrlKey && this.allow_zoom())
|
|
3170
3209
|
return this.action_type('zoom');
|
|
3171
|
-
if (event.buttons ===
|
|
3172
|
-
return this.action_type('pan');
|
|
3173
|
-
if (event.buttons === 1)
|
|
3210
|
+
if (event.buttons === button.left && this.allow_draw())
|
|
3174
3211
|
return this.action_type('draw');
|
|
3212
|
+
if (event.buttons && this.allow_pan())
|
|
3213
|
+
return this.action_type('pan');
|
|
3175
3214
|
}
|
|
3176
3215
|
return this.action_type('');
|
|
3177
3216
|
}
|
|
@@ -3215,11 +3254,7 @@ var $;
|
|
|
3215
3254
|
if (!start_pos)
|
|
3216
3255
|
return;
|
|
3217
3256
|
if (action_type === 'pan') {
|
|
3218
|
-
|
|
3219
|
-
if (distance >= 4) {
|
|
3220
|
-
this._menu_mute = true;
|
|
3221
|
-
this.dom_node().setPointerCapture(event.pointerId);
|
|
3222
|
-
}
|
|
3257
|
+
this.dom_node().setPointerCapture(event.pointerId);
|
|
3223
3258
|
this.pan(new $.$mol_vector_2d(start_pan[0] + pos[0] - start_pos[0], start_pan[1] + pos[1] - start_pos[1]));
|
|
3224
3259
|
}
|
|
3225
3260
|
const precision = this.swipe_precision();
|
|
@@ -3271,7 +3306,6 @@ var $;
|
|
|
3271
3306
|
return;
|
|
3272
3307
|
}
|
|
3273
3308
|
this.start_pos(null);
|
|
3274
|
-
new $.$mol_after_timeout(0, () => this._menu_mute = false);
|
|
3275
3309
|
}
|
|
3276
3310
|
swipe_left(event) {
|
|
3277
3311
|
if (this.view_rect().right - this.start_pos()[0] < this.swipe_precision() * 2)
|
|
@@ -3301,11 +3335,6 @@ var $;
|
|
|
3301
3335
|
this.swipe_to_bottom(event);
|
|
3302
3336
|
this.event_end(event);
|
|
3303
3337
|
}
|
|
3304
|
-
_menu_mute = false;
|
|
3305
|
-
event_menu(event) {
|
|
3306
|
-
if (this._menu_mute)
|
|
3307
|
-
event.preventDefault();
|
|
3308
|
-
}
|
|
3309
3338
|
event_wheel(event) {
|
|
3310
3339
|
if (this.pan === $mol_touch.prototype.pan && this.zoom === $mol_touch.prototype.zoom)
|
|
3311
3340
|
return;
|
|
@@ -3509,6 +3538,15 @@ var $;
|
|
|
3509
3538
|
return val;
|
|
3510
3539
|
return 1;
|
|
3511
3540
|
}
|
|
3541
|
+
allow_draw() {
|
|
3542
|
+
return true;
|
|
3543
|
+
}
|
|
3544
|
+
allow_pan() {
|
|
3545
|
+
return true;
|
|
3546
|
+
}
|
|
3547
|
+
allow_zoom() {
|
|
3548
|
+
return true;
|
|
3549
|
+
}
|
|
3512
3550
|
draw(event) {
|
|
3513
3551
|
if (event !== undefined)
|
|
3514
3552
|
return event;
|
|
@@ -3527,6 +3565,9 @@ var $;
|
|
|
3527
3565
|
const obj = new this.$.$mol_touch();
|
|
3528
3566
|
obj.zoom = (val) => this.zoom(val);
|
|
3529
3567
|
obj.pan = (val) => this.shift(val);
|
|
3568
|
+
obj.allow_draw = () => this.allow_draw();
|
|
3569
|
+
obj.allow_pan = () => this.allow_pan();
|
|
3570
|
+
obj.allow_zoom = () => this.allow_zoom();
|
|
3530
3571
|
obj.draw = (event) => this.draw(event);
|
|
3531
3572
|
return obj;
|
|
3532
3573
|
}
|