Opened 9 years ago

Closed 8 years ago

#12392 closed enhancement (fixed)

[patch][ccla] Provides a interaction framework for charting with mouse & touch zoom and pan interactions

Reported by: cjolif Owned by: Eugene Lazutkin
Priority: high Milestone: 1.7
Component: Charting Version: 1.6.0rc1
Keywords: 1.7-mobile Cc:
Blocked By: Blocking:

Description

This patch is providing an interaction framework for charting. Current action2d package is interacting with data item in the chart plots. Here we talk about interacting with the chart itself (zoom etc..).

The patch provides:

  • The framework itself (mimic on action2d but called interaction2d an targeting the chart itself). This includes the ability for the chart widget to instantiate the interactions from div.
  • Predefined zoom & pan interaction for mouse (including mouse wheel) + touch interaction (including double tap)
  • Some coordinate management utilities in plot2d/Base.js that are useful for interactions.
  • A getPlot method on Chart.js
  • A small "fix" in Tooltip.js to use chart getCoords() method instead of redoing the same thing.
  • new tests/tests modifications

More interactions can be added later on.

See also mobile charting enhancement document: https://docs.google.com/document/d/1WM1UeXGZKgUSzL94TzRbr3dNEHiMzSJvy7pZep8yyAw/edit?hl=fr&authkey=CL7IjbIM

Attachments (4)

interaction01.patch (70.1 KB) - added by cjolif 9 years ago.
interaction01.2.patch (72.8 KB) - added by cjolif 8 years ago.
Version with new options on mouse interaction (keyboard+ double click zoom)
interaction01.3.patch (84.3 KB) - added by cjolif 8 years ago.
New patch with previous enhancement + refactoring to action2d + IE fixes + some missing shift->pop changes in enableCache implementation
interaction01.4.patch (85.5 KB) - added by cjolif 8 years ago.
fix the patch format

Download all attachments as: .zip

Change History (12)

comment:1 Changed 9 years ago by cjolif

The patch does not display correctly in trac! I'll try to find what's going on, but if someone knows what went wrong please let me know.

comment:2 Changed 9 years ago by cjolif

Ok, that was caused by a "\ No newline at end of file" line output in the patch by eclipse. Removing that line makes it work.

comment:3 Changed 9 years ago by Chris Mitchell

Type: defectenhancement

comment:4 Changed 9 years ago by Chris Mitchell

Milestone: tbd1.7

comment:5 Changed 9 years ago by cjolif

The new attachment (interaction01.patch) is superseding the previous patch (to be attached later). It contains a few improvements on previous interactions (ability to get some part of the interaction under option) plus two new interactions:

  • a mouse based data indicator
  • a touch based data indicator

They display a vertical (for horizontal chart) bar at the nearest data under the point with a tip describing the data. The touch based version support double touch interaction displaying the data change between the two touch points.

Examples/tests are included.

comment:6 Changed 9 years ago by cjolif

Note: this patch is causing issues on iOS/SVG when zooming or panning over a "filled" chart (area chart, column chart) because iOS seems to have an issue with touch events being "lost" if the target (here the area for example) is removed from the DOM while touching the screen. I'm currently implementing a workaround based on a glass view in charge of being the target.

comment:7 in reply to:  6 Changed 9 years ago by cjolif

Replying to cjolif:

Note: this patch is causing issues on iOS/SVG when zooming or panning over a "filled" chart (area chart, column chart) because iOS seems to have an issue with touch events being "lost" if the target (here the area for example) is removed from the DOM while touching the screen. I'm currently implementing a workaround based on a glass view in charge of being the target.

These issues are now fixed in latest version.

Changed 9 years ago by cjolif

Attachment: interaction01.patch added

Changed 8 years ago by cjolif

Attachment: interaction01.2.patch added

Version with new options on mouse interaction (keyboard+ double click zoom)

Changed 8 years ago by cjolif

Attachment: interaction01.3.patch added

New patch with previous enhancement + refactoring to action2d + IE fixes + some missing shift->pop changes in enableCache implementation

Changed 8 years ago by cjolif

Attachment: interaction01.4.patch added

fix the patch format

comment:8 Changed 8 years ago by Chris Mitchell

Resolution: fixed
Status: newclosed

fixed in [24566] and [24567]

Note: See TracTickets for help on using tickets.