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.esm.js
CHANGED
|
@@ -3321,11 +3321,21 @@ var $;
|
|
|
3321
3321
|
return val;
|
|
3322
3322
|
return null;
|
|
3323
3323
|
}
|
|
3324
|
+
draw_start(event) {
|
|
3325
|
+
if (event !== undefined)
|
|
3326
|
+
return event;
|
|
3327
|
+
return null;
|
|
3328
|
+
}
|
|
3324
3329
|
draw(event) {
|
|
3325
3330
|
if (event !== undefined)
|
|
3326
3331
|
return event;
|
|
3327
3332
|
return null;
|
|
3328
3333
|
}
|
|
3334
|
+
draw_end(event) {
|
|
3335
|
+
if (event !== undefined)
|
|
3336
|
+
return event;
|
|
3337
|
+
return null;
|
|
3338
|
+
}
|
|
3329
3339
|
style() {
|
|
3330
3340
|
return {
|
|
3331
3341
|
...super.style(),
|
|
@@ -3339,7 +3349,7 @@ var $;
|
|
|
3339
3349
|
pointerdown: (event) => this.event_start(event),
|
|
3340
3350
|
pointermove: (event) => this.event_move(event),
|
|
3341
3351
|
pointerup: (event) => this.event_end(event),
|
|
3342
|
-
pointerleave: (event) => this.
|
|
3352
|
+
pointerleave: (event) => this.event_leave(event),
|
|
3343
3353
|
wheel: (event) => this.event_wheel(event)
|
|
3344
3354
|
};
|
|
3345
3355
|
}
|
|
@@ -3358,6 +3368,11 @@ var $;
|
|
|
3358
3368
|
return event;
|
|
3359
3369
|
return null;
|
|
3360
3370
|
}
|
|
3371
|
+
event_leave(event) {
|
|
3372
|
+
if (event !== undefined)
|
|
3373
|
+
return event;
|
|
3374
|
+
return null;
|
|
3375
|
+
}
|
|
3361
3376
|
event_wheel(event) {
|
|
3362
3377
|
if (event !== undefined)
|
|
3363
3378
|
return event;
|
|
@@ -3427,9 +3442,15 @@ var $;
|
|
|
3427
3442
|
__decorate([
|
|
3428
3443
|
$.$mol_mem
|
|
3429
3444
|
], $mol_touch.prototype, "swipe_to_top", null);
|
|
3445
|
+
__decorate([
|
|
3446
|
+
$.$mol_mem
|
|
3447
|
+
], $mol_touch.prototype, "draw_start", null);
|
|
3430
3448
|
__decorate([
|
|
3431
3449
|
$.$mol_mem
|
|
3432
3450
|
], $mol_touch.prototype, "draw", null);
|
|
3451
|
+
__decorate([
|
|
3452
|
+
$.$mol_mem
|
|
3453
|
+
], $mol_touch.prototype, "draw_end", null);
|
|
3433
3454
|
__decorate([
|
|
3434
3455
|
$.$mol_mem
|
|
3435
3456
|
], $mol_touch.prototype, "event_start", null);
|
|
@@ -3439,6 +3460,9 @@ var $;
|
|
|
3439
3460
|
__decorate([
|
|
3440
3461
|
$.$mol_mem
|
|
3441
3462
|
], $mol_touch.prototype, "event_end", null);
|
|
3463
|
+
__decorate([
|
|
3464
|
+
$.$mol_mem
|
|
3465
|
+
], $mol_touch.prototype, "event_leave", null);
|
|
3442
3466
|
__decorate([
|
|
3443
3467
|
$.$mol_mem
|
|
3444
3468
|
], $mol_touch.prototype, "event_wheel", null);
|
|
@@ -3485,10 +3509,14 @@ var $;
|
|
|
3485
3509
|
event_eat(event) {
|
|
3486
3510
|
if (event instanceof PointerEvent) {
|
|
3487
3511
|
const events = this.pointer_events().filter(e => e.pointerId !== event.pointerId);
|
|
3488
|
-
if (event.type !== 'pointerleave')
|
|
3512
|
+
if (event.type !== 'pointerup' && event.type !== 'pointerleave')
|
|
3489
3513
|
events.push(event);
|
|
3490
3514
|
this.pointer_events(events);
|
|
3491
|
-
|
|
3515
|
+
const touch_count = events.filter(e => e.pointerType === 'touch').length;
|
|
3516
|
+
if (this.allow_zoom() && touch_count === 2) {
|
|
3517
|
+
return this.action_type('zoom');
|
|
3518
|
+
}
|
|
3519
|
+
if (this.action_type() === 'zoom' && touch_count === 1) {
|
|
3492
3520
|
return this.action_type('zoom');
|
|
3493
3521
|
}
|
|
3494
3522
|
let button;
|
|
@@ -3521,10 +3549,12 @@ var $;
|
|
|
3521
3549
|
const action_type = this.event_eat(event);
|
|
3522
3550
|
if (!action_type)
|
|
3523
3551
|
return;
|
|
3524
|
-
if (action_type === 'draw')
|
|
3525
|
-
return;
|
|
3526
3552
|
const coords = this.pointer_coords();
|
|
3527
3553
|
this.start_pos(coords.center());
|
|
3554
|
+
if (action_type === 'draw') {
|
|
3555
|
+
this.draw_start(event);
|
|
3556
|
+
return;
|
|
3557
|
+
}
|
|
3528
3558
|
this.start_distance(coords.distance());
|
|
3529
3559
|
this.start_zoom(this.zoom());
|
|
3530
3560
|
}
|
|
@@ -3536,14 +3566,17 @@ var $;
|
|
|
3536
3566
|
return;
|
|
3537
3567
|
const start_pan = this.start_pan();
|
|
3538
3568
|
const action_type = this.event_eat(event);
|
|
3569
|
+
const start_pos = this.start_pos();
|
|
3539
3570
|
let pos = this.pointer_center();
|
|
3540
3571
|
if (!action_type)
|
|
3541
3572
|
return;
|
|
3542
3573
|
if (action_type === 'draw') {
|
|
3543
|
-
|
|
3574
|
+
const distance = new $.$mol_vector(start_pos, pos).distance();
|
|
3575
|
+
if (distance >= 4) {
|
|
3576
|
+
this.draw(event);
|
|
3577
|
+
}
|
|
3544
3578
|
return;
|
|
3545
3579
|
}
|
|
3546
|
-
const start_pos = this.start_pos();
|
|
3547
3580
|
if (!start_pos)
|
|
3548
3581
|
return;
|
|
3549
3582
|
if (action_type === 'pan') {
|
|
@@ -3592,12 +3625,15 @@ var $;
|
|
|
3592
3625
|
}
|
|
3593
3626
|
}
|
|
3594
3627
|
event_end(event) {
|
|
3628
|
+
const action = this.action_type();
|
|
3629
|
+
if (action === 'draw') {
|
|
3630
|
+
this.draw_end(event);
|
|
3631
|
+
}
|
|
3632
|
+
this.event_leave(event);
|
|
3633
|
+
}
|
|
3634
|
+
event_leave(event) {
|
|
3595
3635
|
this.event_eat(event);
|
|
3596
3636
|
this.dom_node().releasePointerCapture(event.pointerId);
|
|
3597
|
-
if (!this.start_pos()) {
|
|
3598
|
-
this.draw(event);
|
|
3599
|
-
return;
|
|
3600
|
-
}
|
|
3601
3637
|
this.start_pos(null);
|
|
3602
3638
|
}
|
|
3603
3639
|
swipe_left(event) {
|
|
@@ -3840,11 +3876,21 @@ var $;
|
|
|
3840
3876
|
allow_zoom() {
|
|
3841
3877
|
return true;
|
|
3842
3878
|
}
|
|
3879
|
+
draw_start(event) {
|
|
3880
|
+
if (event !== undefined)
|
|
3881
|
+
return event;
|
|
3882
|
+
return null;
|
|
3883
|
+
}
|
|
3843
3884
|
draw(event) {
|
|
3844
3885
|
if (event !== undefined)
|
|
3845
3886
|
return event;
|
|
3846
3887
|
return null;
|
|
3847
3888
|
}
|
|
3889
|
+
draw_end(event) {
|
|
3890
|
+
if (event !== undefined)
|
|
3891
|
+
return event;
|
|
3892
|
+
return null;
|
|
3893
|
+
}
|
|
3848
3894
|
cursor_position() {
|
|
3849
3895
|
return this.Touch().pointer_center();
|
|
3850
3896
|
}
|
|
@@ -3861,7 +3907,9 @@ var $;
|
|
|
3861
3907
|
obj.allow_draw = () => this.allow_draw();
|
|
3862
3908
|
obj.allow_pan = () => this.allow_pan();
|
|
3863
3909
|
obj.allow_zoom = () => this.allow_zoom();
|
|
3910
|
+
obj.draw_start = (event) => this.draw_start(event);
|
|
3864
3911
|
obj.draw = (event) => this.draw(event);
|
|
3912
|
+
obj.draw_end = (event) => this.draw_end(event);
|
|
3865
3913
|
return obj;
|
|
3866
3914
|
}
|
|
3867
3915
|
}
|
|
@@ -3943,9 +3991,15 @@ var $;
|
|
|
3943
3991
|
__decorate([
|
|
3944
3992
|
$.$mol_mem
|
|
3945
3993
|
], $mol_plot_pane.prototype, "zoom", null);
|
|
3994
|
+
__decorate([
|
|
3995
|
+
$.$mol_mem
|
|
3996
|
+
], $mol_plot_pane.prototype, "draw_start", null);
|
|
3946
3997
|
__decorate([
|
|
3947
3998
|
$.$mol_mem
|
|
3948
3999
|
], $mol_plot_pane.prototype, "draw", null);
|
|
4000
|
+
__decorate([
|
|
4001
|
+
$.$mol_mem
|
|
4002
|
+
], $mol_plot_pane.prototype, "draw_end", null);
|
|
3949
4003
|
__decorate([
|
|
3950
4004
|
$.$mol_mem
|
|
3951
4005
|
], $mol_plot_pane.prototype, "Touch", null);
|