chartjs-plugin-zoom icon indicating copy to clipboard operation
chartjs-plugin-zoom copied to clipboard

Drag immediately after pan keeps panning

Open aeqz opened this issue 2 years ago • 1 comments

With every zoom configuration combining drag and pan that I tried, if it does not pass a certain amount of time after having performed a pan action and before starting to draw a drag region, pan keeps active during draw even if its modifier key has been released:

demo

It can be experienced in the basic sample with the following zoom configuration:

const zoomOptions = {
  limits: {
    x: {min: -200, max: 200, minRange: 50},
    y: {min: -200, max: 200, minRange: 50}
  },
  pan: {
    modifierKey: 'shift',
    enabled: true,
    mode: 'xy',
  },
  zoom: {
    wheel: {
      enabled: true,
    },
    pinch: {
      enabled: true
    },
    drag: {
      enabled: true
    },
    mode: 'xy',
    onZoomComplete({chart}) {
      // This update is needed to display up to date zoom level in the title.
      // Without this, previous zoom level is displayed.
      // The reason is: title uses the same beforeUpdate hook, and is evaluated before zoom.
      chart.update('none');
    }
  }
};

aeqz avatar Mar 30 '23 12:03 aeqz

This still exists if you zoom at least once. How can i enable just one level of zoom?

lowzyyy avatar May 31 '23 17:05 lowzyyy