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/web.esm.js
CHANGED
|
@@ -3028,11 +3028,21 @@ var $;
|
|
|
3028
3028
|
return val;
|
|
3029
3029
|
return null;
|
|
3030
3030
|
}
|
|
3031
|
+
draw_start(event) {
|
|
3032
|
+
if (event !== undefined)
|
|
3033
|
+
return event;
|
|
3034
|
+
return null;
|
|
3035
|
+
}
|
|
3031
3036
|
draw(event) {
|
|
3032
3037
|
if (event !== undefined)
|
|
3033
3038
|
return event;
|
|
3034
3039
|
return null;
|
|
3035
3040
|
}
|
|
3041
|
+
draw_end(event) {
|
|
3042
|
+
if (event !== undefined)
|
|
3043
|
+
return event;
|
|
3044
|
+
return null;
|
|
3045
|
+
}
|
|
3036
3046
|
style() {
|
|
3037
3047
|
return {
|
|
3038
3048
|
...super.style(),
|
|
@@ -3046,7 +3056,7 @@ var $;
|
|
|
3046
3056
|
pointerdown: (event) => this.event_start(event),
|
|
3047
3057
|
pointermove: (event) => this.event_move(event),
|
|
3048
3058
|
pointerup: (event) => this.event_end(event),
|
|
3049
|
-
pointerleave: (event) => this.
|
|
3059
|
+
pointerleave: (event) => this.event_leave(event),
|
|
3050
3060
|
wheel: (event) => this.event_wheel(event)
|
|
3051
3061
|
};
|
|
3052
3062
|
}
|
|
@@ -3065,6 +3075,11 @@ var $;
|
|
|
3065
3075
|
return event;
|
|
3066
3076
|
return null;
|
|
3067
3077
|
}
|
|
3078
|
+
event_leave(event) {
|
|
3079
|
+
if (event !== undefined)
|
|
3080
|
+
return event;
|
|
3081
|
+
return null;
|
|
3082
|
+
}
|
|
3068
3083
|
event_wheel(event) {
|
|
3069
3084
|
if (event !== undefined)
|
|
3070
3085
|
return event;
|
|
@@ -3134,9 +3149,15 @@ var $;
|
|
|
3134
3149
|
__decorate([
|
|
3135
3150
|
$.$mol_mem
|
|
3136
3151
|
], $mol_touch.prototype, "swipe_to_top", null);
|
|
3152
|
+
__decorate([
|
|
3153
|
+
$.$mol_mem
|
|
3154
|
+
], $mol_touch.prototype, "draw_start", null);
|
|
3137
3155
|
__decorate([
|
|
3138
3156
|
$.$mol_mem
|
|
3139
3157
|
], $mol_touch.prototype, "draw", null);
|
|
3158
|
+
__decorate([
|
|
3159
|
+
$.$mol_mem
|
|
3160
|
+
], $mol_touch.prototype, "draw_end", null);
|
|
3140
3161
|
__decorate([
|
|
3141
3162
|
$.$mol_mem
|
|
3142
3163
|
], $mol_touch.prototype, "event_start", null);
|
|
@@ -3146,6 +3167,9 @@ var $;
|
|
|
3146
3167
|
__decorate([
|
|
3147
3168
|
$.$mol_mem
|
|
3148
3169
|
], $mol_touch.prototype, "event_end", null);
|
|
3170
|
+
__decorate([
|
|
3171
|
+
$.$mol_mem
|
|
3172
|
+
], $mol_touch.prototype, "event_leave", null);
|
|
3149
3173
|
__decorate([
|
|
3150
3174
|
$.$mol_mem
|
|
3151
3175
|
], $mol_touch.prototype, "event_wheel", null);
|
|
@@ -3192,10 +3216,14 @@ var $;
|
|
|
3192
3216
|
event_eat(event) {
|
|
3193
3217
|
if (event instanceof PointerEvent) {
|
|
3194
3218
|
const events = this.pointer_events().filter(e => e.pointerId !== event.pointerId);
|
|
3195
|
-
if (event.type !== 'pointerleave')
|
|
3219
|
+
if (event.type !== 'pointerup' && event.type !== 'pointerleave')
|
|
3196
3220
|
events.push(event);
|
|
3197
3221
|
this.pointer_events(events);
|
|
3198
|
-
|
|
3222
|
+
const touch_count = events.filter(e => e.pointerType === 'touch').length;
|
|
3223
|
+
if (this.allow_zoom() && touch_count === 2) {
|
|
3224
|
+
return this.action_type('zoom');
|
|
3225
|
+
}
|
|
3226
|
+
if (this.action_type() === 'zoom' && touch_count === 1) {
|
|
3199
3227
|
return this.action_type('zoom');
|
|
3200
3228
|
}
|
|
3201
3229
|
let button;
|
|
@@ -3228,10 +3256,12 @@ var $;
|
|
|
3228
3256
|
const action_type = this.event_eat(event);
|
|
3229
3257
|
if (!action_type)
|
|
3230
3258
|
return;
|
|
3231
|
-
if (action_type === 'draw')
|
|
3232
|
-
return;
|
|
3233
3259
|
const coords = this.pointer_coords();
|
|
3234
3260
|
this.start_pos(coords.center());
|
|
3261
|
+
if (action_type === 'draw') {
|
|
3262
|
+
this.draw_start(event);
|
|
3263
|
+
return;
|
|
3264
|
+
}
|
|
3235
3265
|
this.start_distance(coords.distance());
|
|
3236
3266
|
this.start_zoom(this.zoom());
|
|
3237
3267
|
}
|
|
@@ -3243,14 +3273,17 @@ var $;
|
|
|
3243
3273
|
return;
|
|
3244
3274
|
const start_pan = this.start_pan();
|
|
3245
3275
|
const action_type = this.event_eat(event);
|
|
3276
|
+
const start_pos = this.start_pos();
|
|
3246
3277
|
let pos = this.pointer_center();
|
|
3247
3278
|
if (!action_type)
|
|
3248
3279
|
return;
|
|
3249
3280
|
if (action_type === 'draw') {
|
|
3250
|
-
|
|
3281
|
+
const distance = new $.$mol_vector(start_pos, pos).distance();
|
|
3282
|
+
if (distance >= 4) {
|
|
3283
|
+
this.draw(event);
|
|
3284
|
+
}
|
|
3251
3285
|
return;
|
|
3252
3286
|
}
|
|
3253
|
-
const start_pos = this.start_pos();
|
|
3254
3287
|
if (!start_pos)
|
|
3255
3288
|
return;
|
|
3256
3289
|
if (action_type === 'pan') {
|
|
@@ -3299,12 +3332,15 @@ var $;
|
|
|
3299
3332
|
}
|
|
3300
3333
|
}
|
|
3301
3334
|
event_end(event) {
|
|
3335
|
+
const action = this.action_type();
|
|
3336
|
+
if (action === 'draw') {
|
|
3337
|
+
this.draw_end(event);
|
|
3338
|
+
}
|
|
3339
|
+
this.event_leave(event);
|
|
3340
|
+
}
|
|
3341
|
+
event_leave(event) {
|
|
3302
3342
|
this.event_eat(event);
|
|
3303
3343
|
this.dom_node().releasePointerCapture(event.pointerId);
|
|
3304
|
-
if (!this.start_pos()) {
|
|
3305
|
-
this.draw(event);
|
|
3306
|
-
return;
|
|
3307
|
-
}
|
|
3308
3344
|
this.start_pos(null);
|
|
3309
3345
|
}
|
|
3310
3346
|
swipe_left(event) {
|
|
@@ -3547,11 +3583,21 @@ var $;
|
|
|
3547
3583
|
allow_zoom() {
|
|
3548
3584
|
return true;
|
|
3549
3585
|
}
|
|
3586
|
+
draw_start(event) {
|
|
3587
|
+
if (event !== undefined)
|
|
3588
|
+
return event;
|
|
3589
|
+
return null;
|
|
3590
|
+
}
|
|
3550
3591
|
draw(event) {
|
|
3551
3592
|
if (event !== undefined)
|
|
3552
3593
|
return event;
|
|
3553
3594
|
return null;
|
|
3554
3595
|
}
|
|
3596
|
+
draw_end(event) {
|
|
3597
|
+
if (event !== undefined)
|
|
3598
|
+
return event;
|
|
3599
|
+
return null;
|
|
3600
|
+
}
|
|
3555
3601
|
cursor_position() {
|
|
3556
3602
|
return this.Touch().pointer_center();
|
|
3557
3603
|
}
|
|
@@ -3568,7 +3614,9 @@ var $;
|
|
|
3568
3614
|
obj.allow_draw = () => this.allow_draw();
|
|
3569
3615
|
obj.allow_pan = () => this.allow_pan();
|
|
3570
3616
|
obj.allow_zoom = () => this.allow_zoom();
|
|
3617
|
+
obj.draw_start = (event) => this.draw_start(event);
|
|
3571
3618
|
obj.draw = (event) => this.draw(event);
|
|
3619
|
+
obj.draw_end = (event) => this.draw_end(event);
|
|
3572
3620
|
return obj;
|
|
3573
3621
|
}
|
|
3574
3622
|
}
|
|
@@ -3650,9 +3698,15 @@ var $;
|
|
|
3650
3698
|
__decorate([
|
|
3651
3699
|
$.$mol_mem
|
|
3652
3700
|
], $mol_plot_pane.prototype, "zoom", null);
|
|
3701
|
+
__decorate([
|
|
3702
|
+
$.$mol_mem
|
|
3703
|
+
], $mol_plot_pane.prototype, "draw_start", null);
|
|
3653
3704
|
__decorate([
|
|
3654
3705
|
$.$mol_mem
|
|
3655
3706
|
], $mol_plot_pane.prototype, "draw", null);
|
|
3707
|
+
__decorate([
|
|
3708
|
+
$.$mol_mem
|
|
3709
|
+
], $mol_plot_pane.prototype, "draw_end", null);
|
|
3656
3710
|
__decorate([
|
|
3657
3711
|
$.$mol_mem
|
|
3658
3712
|
], $mol_plot_pane.prototype, "Touch", null);
|