dateRateTransformations

This commit is contained in:
Luis Fernando Molina committed 2020-10-19 19:21:49 +02:00
1 parent f62cf4e257
commit e7a2bab773
5 files changed
+24 -24

No files matched your search

@@ -326,8 +326,8 @@ function newEdgeEditor() {
y: (-dragVectorWhenDragStarted.y)
}
let newMinDate = getDateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystemWhenDragStarted)
let newMaxRate = getRateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystemWhenDragStarted)
let newMinDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystemWhenDragStarted)
let newMaxRate = UI.projects.superalgos.utilities.dateRateTransformations.getRateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystemWhenDragStarted)
let xDifferenceMaxMin = coordinateSystemWhenDragStarted.max.x - coordinateSystemWhenDragStarted.min.x
let yDifferenceMaxMin = coordinateSystemWhenDragStarted.max.y - coordinateSystemWhenDragStarted.min.y
@@ -348,7 +348,7 @@ function newEdgeEditor() {
y: 0
}
let newMinDate = getDateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystem)
let newMinDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystem)
let xDifferenceMaxMin = coordinateSystem.max.x - coordinateSystem.min.x
coordinateSystem.min.x = newMinDate.valueOf()
coordinateSystem.max.x = newMinDate.valueOf() + xDifferenceMaxMin
@@ -365,7 +365,7 @@ function newEdgeEditor() {
y: -dragVector.y + thisObject.container.frame.height * coordinateSystem.VERTICAL_MARGIN_INVERSE_FACTOR / 2
}
let newMaxRate = getRateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystem)
let newMaxRate = UI.projects.superalgos.utilities.dateRateTransformations.getRateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystem)
let yDifferenceMaxMin = coordinateSystem.max.y - coordinateSystem.min.y
coordinateSystem.min.y = newMaxRate - yDifferenceMaxMin
coordinateSystem.max.y = newMaxRate
@@ -397,7 +397,7 @@ function newEdgeEditor() {
y: (thisObject.container.parentContainer.frame.position.y - parentFrameWhenDragStarted.position.y)
}
/* This is equivalent to getRateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */
/* This is equivalent to UI.projects.superalgos.utilities.dateRateTransformations.getRateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */
point = coordinateSystemWhenDragStarted.unInverseTransform(point, parentFrameWhenDragStarted.height)
let newMaxRate = point.y
@@ -438,7 +438,7 @@ function newEdgeEditor() {
thisObject.container.parentContainer.frame.height = point.y
/* This is equivalent to getRateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */
/* This is equivalent to UI.projects.superalgos.utilities.dateRateTransformations.getRateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */
point = coordinateSystemWhenDragStarted.unInverseTransform(point, parentFrameWhenDragStarted.height)
let newMinRate = point.y
@@ -479,7 +479,7 @@ function newEdgeEditor() {
y: 0
}
/* This is equivalent to getDateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */
/* This is equivalent to UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */
point = coordinateSystemWhenDragStarted.unInverseTransform(point, parentFrameWhenDragStarted.width)
let newMinDate = point.x
@@ -516,7 +516,7 @@ function newEdgeEditor() {
thisObject.container.parentContainer.frame.width = point.x
/* This is equivalent to getRateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */
/* This is equivalent to UI.projects.superalgos.utilities.dateRateTransformations.getRateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */
point = coordinateSystemWhenDragStarted.unInverseTransform(point, parentFrameWhenDragStarted.width)
let newMaxDate = point.x
@@ -148,20 +148,20 @@ function newPlotter() {
}
function onMouseOver(event) {
let userPosition = getDateFromPointAtBrowserCanvas(event, thisObject.container, coordinateSystem)
let userPosition = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(event, thisObject.container, coordinateSystem)
userPositionDate = userPosition.valueOf()
let minPositionPoint = {
x: event.x,
y: event.y + 4
}
minUserPositionRate = getRateFromPointAtBrowserCanvas(minPositionPoint, thisObject.container, coordinateSystem)
minUserPositionRate = UI.projects.superalgos.utilities.dateRateTransformations.getRateFromPointAtBrowserCanvas(minPositionPoint, thisObject.container, coordinateSystem)
let maxPositionPoint = {
x: event.x,
y: event.y - 4
}
maxUserPositionRate = getRateFromPointAtBrowserCanvas(maxPositionPoint, thisObject.container, coordinateSystem)
maxUserPositionRate = UI.projects.superalgos.utilities.dateRateTransformations.getRateFromPointAtBrowserCanvas(maxPositionPoint, thisObject.container, coordinateSystem)
}
function onMarketFilesUpdated() {
@@ -393,8 +393,8 @@ function newPlotter() {
let daysOnSides = getSideDays(timeFrame)
let leftDate = getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem)
let rightDate = getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem)
let leftDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem)
let rightDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem)
let dateDiff = rightDate.valueOf() - leftDate.valueOf()
@@ -440,8 +440,8 @@ function newPlotter() {
let daysOnSides = getSideDays(timeFrame)
let leftDate = getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem)
let rightDate = getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem)
let leftDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem)
let rightDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem)
let dateDiff = rightDate.valueOf() - leftDate.valueOf()
@@ -338,7 +338,7 @@ function newRateScale() {
y: (-dragVectorWhenDragStarted.y)
}
let newMaxRate = getRateFromPointAtContainer(point, limitingContainer, coordinateSystemWhenDragStarted)
let newMaxRate = UI.projects.superalgos.utilities.dateRateTransformations.getRateFromPointAtContainer(point, limitingContainer, coordinateSystemWhenDragStarted)
let yDifferenceMaxMin = coordinateSystemWhenDragStarted.max.y - coordinateSystemWhenDragStarted.min.y
coordinateSystem.min.y = newMaxRate - yDifferenceMaxMin
@@ -358,7 +358,7 @@ function newRateScale() {
x: event.dragVector.x,
y: -event.dragVector.y
}
let newMaxRate = getRateFromPointAtContainer(point, rateCalculationsContainer, coordinateSystem)
let newMaxRate = UI.projects.superalgos.utilities.dateRateTransformations.getRateFromPointAtContainer(point, rateCalculationsContainer, coordinateSystem)
let yDifferenceMaxMin = coordinateSystem.max.y - coordinateSystem.min.y
coordinateSystem.min.y = newMaxRate - yDifferenceMaxMin
coordinateSystem.max.y = newMaxRate
@@ -370,7 +370,7 @@ function newRateScale() {
x: event.dragVector.x,
y: event.dragVector.y
}
let newMaxRate = getRateFromPointAtContainer(point, rateCalculationsContainer, coordinateSystem)
let newMaxRate = UI.projects.superalgos.utilities.dateRateTransformations.getRateFromPointAtContainer(point, rateCalculationsContainer, coordinateSystem)
coordinateSystem.max.y = newMaxRate
coordinateSystem.maxHeight = rateCalculationsContainer.frame.height
@@ -381,7 +381,7 @@ function newRateScale() {
x: event.dragVector.x,
y: event.dragVector.y + rateCalculationsContainer.frame.height
}
let newMinRate = getRateFromPointAtContainer(point, rateCalculationsContainer, coordinateSystem)
let newMinRate = UI.projects.superalgos.utilities.dateRateTransformations.getRateFromPointAtContainer(point, rateCalculationsContainer, coordinateSystem)
coordinateSystem.min.y = newMinRate
coordinateSystem.maxHeight = rateCalculationsContainer.frame.height
@@ -440,7 +440,7 @@ function newRateScale() {
y: canvas.mouse.position.y
}
thisObject.rate = getRateFromPointAtBrowserCanvas(ratePoint, rateCalculationsContainer, coordinateSystem)
thisObject.rate = UI.projects.superalgos.utilities.dateRateTransformations.getRateFromPointAtBrowserCanvas(ratePoint, rateCalculationsContainer, coordinateSystem)
/* rateScale Positioning */
ratePoint = {
@@ -513,7 +513,7 @@ function newRateScale() {
y: TOP_SPACE_HEIGHT + SEPARATION * (i + 0)
}
let rate = getRateFromPointAtBrowserCanvas(ratePoint1, rateCalculationsContainer, coordinateSystem)
let rate = UI.projects.superalgos.utilities.dateRateTransformations.getRateFromPointAtBrowserCanvas(ratePoint1, rateCalculationsContainer, coordinateSystem)
let labels = scaleLabels(rate)
let decimalsDisplace = labels[1].length * FONT_SIZE * FONT_ASPECT_RATIO
@@ -248,7 +248,7 @@ function newTimeScale() {
y: 0
}
let mouseDate = getDateFromPointAtBrowserCanvas(timePoint, limitingContainer, coordinateSystem)
let mouseDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(timePoint, limitingContainer, coordinateSystem)
thisObject.date = new Date(mouseDate)
@@ -297,7 +297,7 @@ function newTimeScale() {
y: 0
}
let time = getDateFromPointAtBrowserCanvas(timePoint, limitingContainer, coordinateSystem)
let time = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(timePoint, limitingContainer, coordinateSystem)
let labels = scaleLabels(time, true)
let labelDisplace = labels[1].length * FONT_SIZE * FONT_ASPECT_RATIO
@@ -335,7 +335,7 @@ function newTimeMachine() {
y: thisObject.container.frame.height / 2
}
datetime = new Date(getDateFromPointAtContainer(center, thisObject.container, timeMachineCoordinateSystem))
datetime = new Date(UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtContainer(center, thisObject.container, timeMachineCoordinateSystem))
for (let i = 0; i < thisObject.timelineCharts.length; i++) {
let timelineChart = thisObject.timelineCharts[i]