Plot adjusted so that when snapping to the right
the left domain value also moves same amount that
the right domain did. Also Interval between left
and right domains on screen are dyanmically set to
amount zoomed in/out, instead of being defaulted
to 2 minutes. Made small edit to display if the chart
has been manipulated (panned or zoomed) or is updating
live.
Redraw rate adjusted to redraw on
mobile every 15ms instead of 1000ms
(like on desktop). Also added agentservice
to PlotController and MCTChart (bundles and
file.
Reorganizaed MCTPlot touch
functions to be in suitable order. Also
made code DRYer by removing unnecessary functions
and combining statements that are used once. Also
renamed variables to differentiate similar ones
from one another. Added marks to show where
comments are needed (will be edited in next
commit).
Refactored calculateViewport
to use ratio to cacluate the sign of
required zoom in or zoom out, and then
apply that to the ZOOM_AMT. Makes function
DRYer.
Now check done for pan/pinch using
variables set during start of gesture.
Also added functions to touch amount
checks to make MCTPinch DRYer. Comments
regarding touch functions and added
variables/functions.
Ratio used to check if
zoom should be in or out now
divides lastDistance/distance
instead of firstDistance/distance.
Therefore by comparing last distance,
user is able to zoom in and out on
same pinch without removing fingers.
Set the range of difference allowed between
the last distance and current distance to
differenciate panning and zooming. If
lastDistance - 2 <= currentDistance <= lastDistance + 2
than panning occurs, otherwise user is zooming.
BUG: The auto snap to right side of chart causes the
chart to resize narrower overtime and as user BOTH
zooms and pans more.
Adjusted Pinch to check if
distance between 2 fingers
(rounded to whole number) is equal to
last distance or first distance, if this
is true, than will pan otherwise do
pinch zoom.
Split the pinch gesture into start,
change, and end/cancel. Each of those
are read in and then they emit through
the scope to functions in the controller.
Moved MCTPinch directive into
plot-reborn. Now emits on pinch action
the event to the controller. Edited plot.html
to clean up and edited mct-plot.html to
include mct-pinch. DrawLoader adjusted to
allow and prevent error.