Refactoring

This commit is contained in:
Luis Fernando Molina committed 2020-01-11 18:38:23 +01:00
1 parent 5cfd77cffb
commit 2e98b587f6
5 files changed
+63 -63

No files matched your search

+17 -17
View File
@@ -34,7 +34,7 @@
container.initialize();
thisObject.container = container;
let timeLineCoordinateSystem = newTimeLineCoordinateSystem(); // Needed to be able to plot on the timeline, otherwise not.
let coordinateSystem = newCoordinateSystem(); // Needed to be able to plot on the timeline, otherwise not.
let timeFrame; // This will hold the current Time Frame the user is at.
let datetime; // This will hold the current Datetime the user is at.
@@ -298,8 +298,8 @@
let daysOnSides = getSideDays(timeFrame);
let leftDate = getDateFromPoint(viewPort.visibleArea.topLeft, thisObject.container, timeLineCoordinateSystem);
let rightDate = getDateFromPoint(viewPort.visibleArea.topRight, thisObject.container, timeLineCoordinateSystem);
let leftDate = getDateFromPoint(viewPort.visibleArea.topLeft, thisObject.container, coordinateSystem);
let rightDate = getDateFromPoint(viewPort.visibleArea.topRight, thisObject.container, coordinateSystem);
let dateDiff = rightDate.valueOf() - leftDate.valueOf();
@@ -396,8 +396,8 @@
let daysOnSides = getSideDays(timeFrame);
let leftDate = getDateFromPoint(viewPort.visibleArea.topLeft, thisObject.container, timeLineCoordinateSystem);
let rightDate = getDateFromPoint(viewPort.visibleArea.topRight, thisObject.container, timeLineCoordinateSystem);
let leftDate = getDateFromPoint(viewPort.visibleArea.topLeft, thisObject.container, coordinateSystem);
let rightDate = getDateFromPoint(viewPort.visibleArea.topRight, thisObject.container, coordinateSystem);
let dateDiff = rightDate.valueOf() - leftDate.valueOf();
@@ -471,7 +471,7 @@
try {
if (timeLineCoordinateSystem.maxValue > 0) { return; } // Already calculated.
if (coordinateSystem.maxValue > 0) { return; } // Already calculated.
let minValue = {
x: MIN_PLOTABLE_DATE.valueOf(),
@@ -483,7 +483,7 @@
y: nextPorwerOf10(USDT_BTC_HTH) / 4 // TODO: This 4 is temporary
};
timeLineCoordinateSystem.initialize(
coordinateSystem.initialize(
minValue,
maxValue,
thisObject.container.frame.width,
@@ -602,16 +602,16 @@
recordPoint10.x = 0;
}
recordPoint1 = timeLineCoordinateSystem.transformThisPoint(recordPoint1);
recordPoint2 = timeLineCoordinateSystem.transformThisPoint(recordPoint2);
recordPoint3 = timeLineCoordinateSystem.transformThisPoint(recordPoint3);
recordPoint4 = timeLineCoordinateSystem.transformThisPoint(recordPoint4);
recordPoint5 = timeLineCoordinateSystem.transformThisPoint(recordPoint5);
recordPoint6 = timeLineCoordinateSystem.transformThisPoint(recordPoint6);
recordPoint7 = timeLineCoordinateSystem.transformThisPoint(recordPoint7);
recordPoint8 = timeLineCoordinateSystem.transformThisPoint(recordPoint8);
recordPoint9 = timeLineCoordinateSystem.transformThisPoint(recordPoint9);
recordPoint10 = timeLineCoordinateSystem.transformThisPoint(recordPoint10);
recordPoint1 = coordinateSystem.transformThisPoint(recordPoint1);
recordPoint2 = coordinateSystem.transformThisPoint(recordPoint2);
recordPoint3 = coordinateSystem.transformThisPoint(recordPoint3);
recordPoint4 = coordinateSystem.transformThisPoint(recordPoint4);
recordPoint5 = coordinateSystem.transformThisPoint(recordPoint5);
recordPoint6 = coordinateSystem.transformThisPoint(recordPoint6);
recordPoint7 = coordinateSystem.transformThisPoint(recordPoint7);
recordPoint8 = coordinateSystem.transformThisPoint(recordPoint8);
recordPoint9 = coordinateSystem.transformThisPoint(recordPoint9);
recordPoint10 = coordinateSystem.transformThisPoint(recordPoint10);
recordPoint1 = transformThisPoint(recordPoint1, thisObject.container);
recordPoint2 = transformThisPoint(recordPoint2, thisObject.container);