mol_plot_all 1.2.133 → 1.2.134
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 +6 -0
- package/node.deps.json +1 -1
- package/node.esm.js +65 -11
- package/node.esm.js.map +1 -1
- package/node.js +65 -11
- package/node.js.map +1 -1
- package/node.test.js +65 -11
- package/node.test.js.map +1 -1
- package/node.view.tree +5 -1
- package/package.json +1 -1
- package/web.d.ts +6 -0
- package/web.deps.json +1 -1
- package/web.esm.js +65 -11
- package/web.esm.js.map +1 -1
- package/web.js +65 -11
- package/web.js.map +1 -1
- package/web.view.tree +5 -1
package/node.test.js
CHANGED
|
@@ -3313,11 +3313,21 @@ var $;
|
|
|
3313
3313
|
return val;
|
|
3314
3314
|
return null;
|
|
3315
3315
|
}
|
|
3316
|
+
draw_start(event) {
|
|
3317
|
+
if (event !== undefined)
|
|
3318
|
+
return event;
|
|
3319
|
+
return null;
|
|
3320
|
+
}
|
|
3316
3321
|
draw(event) {
|
|
3317
3322
|
if (event !== undefined)
|
|
3318
3323
|
return event;
|
|
3319
3324
|
return null;
|
|
3320
3325
|
}
|
|
3326
|
+
draw_end(event) {
|
|
3327
|
+
if (event !== undefined)
|
|
3328
|
+
return event;
|
|
3329
|
+
return null;
|
|
3330
|
+
}
|
|
3321
3331
|
style() {
|
|
3322
3332
|
return {
|
|
3323
3333
|
...super.style(),
|
|
@@ -3331,7 +3341,7 @@ var $;
|
|
|
3331
3341
|
pointerdown: (event) => this.event_start(event),
|
|
3332
3342
|
pointermove: (event) => this.event_move(event),
|
|
3333
3343
|
pointerup: (event) => this.event_end(event),
|
|
3334
|
-
pointerleave: (event) => this.
|
|
3344
|
+
pointerleave: (event) => this.event_leave(event),
|
|
3335
3345
|
wheel: (event) => this.event_wheel(event)
|
|
3336
3346
|
};
|
|
3337
3347
|
}
|
|
@@ -3350,6 +3360,11 @@ var $;
|
|
|
3350
3360
|
return event;
|
|
3351
3361
|
return null;
|
|
3352
3362
|
}
|
|
3363
|
+
event_leave(event) {
|
|
3364
|
+
if (event !== undefined)
|
|
3365
|
+
return event;
|
|
3366
|
+
return null;
|
|
3367
|
+
}
|
|
3353
3368
|
event_wheel(event) {
|
|
3354
3369
|
if (event !== undefined)
|
|
3355
3370
|
return event;
|
|
@@ -3419,9 +3434,15 @@ var $;
|
|
|
3419
3434
|
__decorate([
|
|
3420
3435
|
$.$mol_mem
|
|
3421
3436
|
], $mol_touch.prototype, "swipe_to_top", null);
|
|
3437
|
+
__decorate([
|
|
3438
|
+
$.$mol_mem
|
|
3439
|
+
], $mol_touch.prototype, "draw_start", null);
|
|
3422
3440
|
__decorate([
|
|
3423
3441
|
$.$mol_mem
|
|
3424
3442
|
], $mol_touch.prototype, "draw", null);
|
|
3443
|
+
__decorate([
|
|
3444
|
+
$.$mol_mem
|
|
3445
|
+
], $mol_touch.prototype, "draw_end", null);
|
|
3425
3446
|
__decorate([
|
|
3426
3447
|
$.$mol_mem
|
|
3427
3448
|
], $mol_touch.prototype, "event_start", null);
|
|
@@ -3431,6 +3452,9 @@ var $;
|
|
|
3431
3452
|
__decorate([
|
|
3432
3453
|
$.$mol_mem
|
|
3433
3454
|
], $mol_touch.prototype, "event_end", null);
|
|
3455
|
+
__decorate([
|
|
3456
|
+
$.$mol_mem
|
|
3457
|
+
], $mol_touch.prototype, "event_leave", null);
|
|
3434
3458
|
__decorate([
|
|
3435
3459
|
$.$mol_mem
|
|
3436
3460
|
], $mol_touch.prototype, "event_wheel", null);
|
|
@@ -3477,10 +3501,14 @@ var $;
|
|
|
3477
3501
|
event_eat(event) {
|
|
3478
3502
|
if (event instanceof PointerEvent) {
|
|
3479
3503
|
const events = this.pointer_events().filter(e => e.pointerId !== event.pointerId);
|
|
3480
|
-
if (event.type !== 'pointerleave')
|
|
3504
|
+
if (event.type !== 'pointerup' && event.type !== 'pointerleave')
|
|
3481
3505
|
events.push(event);
|
|
3482
3506
|
this.pointer_events(events);
|
|
3483
|
-
|
|
3507
|
+
const touch_count = events.filter(e => e.pointerType === 'touch').length;
|
|
3508
|
+
if (this.allow_zoom() && touch_count === 2) {
|
|
3509
|
+
return this.action_type('zoom');
|
|
3510
|
+
}
|
|
3511
|
+
if (this.action_type() === 'zoom' && touch_count === 1) {
|
|
3484
3512
|
return this.action_type('zoom');
|
|
3485
3513
|
}
|
|
3486
3514
|
let button;
|
|
@@ -3513,10 +3541,12 @@ var $;
|
|
|
3513
3541
|
const action_type = this.event_eat(event);
|
|
3514
3542
|
if (!action_type)
|
|
3515
3543
|
return;
|
|
3516
|
-
if (action_type === 'draw')
|
|
3517
|
-
return;
|
|
3518
3544
|
const coords = this.pointer_coords();
|
|
3519
3545
|
this.start_pos(coords.center());
|
|
3546
|
+
if (action_type === 'draw') {
|
|
3547
|
+
this.draw_start(event);
|
|
3548
|
+
return;
|
|
3549
|
+
}
|
|
3520
3550
|
this.start_distance(coords.distance());
|
|
3521
3551
|
this.start_zoom(this.zoom());
|
|
3522
3552
|
}
|
|
@@ -3528,14 +3558,17 @@ var $;
|
|
|
3528
3558
|
return;
|
|
3529
3559
|
const start_pan = this.start_pan();
|
|
3530
3560
|
const action_type = this.event_eat(event);
|
|
3561
|
+
const start_pos = this.start_pos();
|
|
3531
3562
|
let pos = this.pointer_center();
|
|
3532
3563
|
if (!action_type)
|
|
3533
3564
|
return;
|
|
3534
3565
|
if (action_type === 'draw') {
|
|
3535
|
-
|
|
3566
|
+
const distance = new $.$mol_vector(start_pos, pos).distance();
|
|
3567
|
+
if (distance >= 4) {
|
|
3568
|
+
this.draw(event);
|
|
3569
|
+
}
|
|
3536
3570
|
return;
|
|
3537
3571
|
}
|
|
3538
|
-
const start_pos = this.start_pos();
|
|
3539
3572
|
if (!start_pos)
|
|
3540
3573
|
return;
|
|
3541
3574
|
if (action_type === 'pan') {
|
|
@@ -3584,12 +3617,15 @@ var $;
|
|
|
3584
3617
|
}
|
|
3585
3618
|
}
|
|
3586
3619
|
event_end(event) {
|
|
3620
|
+
const action = this.action_type();
|
|
3621
|
+
if (action === 'draw') {
|
|
3622
|
+
this.draw_end(event);
|
|
3623
|
+
}
|
|
3624
|
+
this.event_leave(event);
|
|
3625
|
+
}
|
|
3626
|
+
event_leave(event) {
|
|
3587
3627
|
this.event_eat(event);
|
|
3588
3628
|
this.dom_node().releasePointerCapture(event.pointerId);
|
|
3589
|
-
if (!this.start_pos()) {
|
|
3590
|
-
this.draw(event);
|
|
3591
|
-
return;
|
|
3592
|
-
}
|
|
3593
3629
|
this.start_pos(null);
|
|
3594
3630
|
}
|
|
3595
3631
|
swipe_left(event) {
|
|
@@ -3832,11 +3868,21 @@ var $;
|
|
|
3832
3868
|
allow_zoom() {
|
|
3833
3869
|
return true;
|
|
3834
3870
|
}
|
|
3871
|
+
draw_start(event) {
|
|
3872
|
+
if (event !== undefined)
|
|
3873
|
+
return event;
|
|
3874
|
+
return null;
|
|
3875
|
+
}
|
|
3835
3876
|
draw(event) {
|
|
3836
3877
|
if (event !== undefined)
|
|
3837
3878
|
return event;
|
|
3838
3879
|
return null;
|
|
3839
3880
|
}
|
|
3881
|
+
draw_end(event) {
|
|
3882
|
+
if (event !== undefined)
|
|
3883
|
+
return event;
|
|
3884
|
+
return null;
|
|
3885
|
+
}
|
|
3840
3886
|
cursor_position() {
|
|
3841
3887
|
return this.Touch().pointer_center();
|
|
3842
3888
|
}
|
|
@@ -3853,7 +3899,9 @@ var $;
|
|
|
3853
3899
|
obj.allow_draw = () => this.allow_draw();
|
|
3854
3900
|
obj.allow_pan = () => this.allow_pan();
|
|
3855
3901
|
obj.allow_zoom = () => this.allow_zoom();
|
|
3902
|
+
obj.draw_start = (event) => this.draw_start(event);
|
|
3856
3903
|
obj.draw = (event) => this.draw(event);
|
|
3904
|
+
obj.draw_end = (event) => this.draw_end(event);
|
|
3857
3905
|
return obj;
|
|
3858
3906
|
}
|
|
3859
3907
|
}
|
|
@@ -3935,9 +3983,15 @@ var $;
|
|
|
3935
3983
|
__decorate([
|
|
3936
3984
|
$.$mol_mem
|
|
3937
3985
|
], $mol_plot_pane.prototype, "zoom", null);
|
|
3986
|
+
__decorate([
|
|
3987
|
+
$.$mol_mem
|
|
3988
|
+
], $mol_plot_pane.prototype, "draw_start", null);
|
|
3938
3989
|
__decorate([
|
|
3939
3990
|
$.$mol_mem
|
|
3940
3991
|
], $mol_plot_pane.prototype, "draw", null);
|
|
3992
|
+
__decorate([
|
|
3993
|
+
$.$mol_mem
|
|
3994
|
+
], $mol_plot_pane.prototype, "draw_end", null);
|
|
3941
3995
|
__decorate([
|
|
3942
3996
|
$.$mol_mem
|
|
3943
3997
|
], $mol_plot_pane.prototype, "Touch", null);
|