MCPcopy Index your code
hub / github.com/apache/echarts / _dragHandle

Method _dragHandle

src/component/visualMap/ContinuousView.ts:388–428  ·  view source on GitHub ↗
(
        handleIndex: 0 | 1 | 'all',
        isEnd?: boolean,
        // dx is event from ondragend if isEnd is true. It's not used
        dx?: number | ElementEvent,
        dy?: number
    )

Source from the content-addressed store, hash-verified

386 }
387
388 private _dragHandle(
389 handleIndex: 0 | 1 | 'all',
390 isEnd?: boolean,
391 // dx is event from ondragend if isEnd is true. It's not used
392 dx?: number | ElementEvent,
393 dy?: number
394 ) {
395 if (!this._useHandle) {
396 return;
397 }
398
399 this._dragging = !isEnd;
400
401 if (!isEnd) {
402 // Transform dx, dy to bar coordination.
403 const vertex = this._applyTransform([dx as number, dy], this._shapes.mainGroup, true) as number[];
404 this._updateInterval(handleIndex, vertex[1]);
405
406 this._hideIndicator();
407 // Considering realtime, update view should be executed
408 // before dispatch action.
409 this._updateView();
410 }
411
412 // dragEnd do not dispatch action when realtime.
413 if (isEnd === !this.visualMapModel.get('realtime')) { // jshint ignore:line
414 this.api.dispatchAction({
415 type: 'selectDataRange',
416 from: this.uid,
417 visualMapId: this.visualMapModel.id,
418 selected: this._dataInterval.slice()
419 });
420 }
421
422 if (isEnd) {
423 !this._hovering && this._clearHoverLinkToSeries();
424 }
425 else if (useHoverLinkOnHandle(this.visualMapModel)) {
426 this._doHoverLinkToSeries(this._handleEnds[handleIndex as 0 | 1], false);
427 }
428 }
429
430 private _resetInterval() {
431 const visualMapModel = this.visualMapModel;

Callers

nothing calls this directly

Calls 9

_applyTransformMethod · 0.95
_updateIntervalMethod · 0.95
_hideIndicatorMethod · 0.95
_updateViewMethod · 0.95
_doHoverLinkToSeriesMethod · 0.95
useHoverLinkOnHandleFunction · 0.85
dispatchActionMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected