working but with BOTTOM_SPACE_HEIGHT

This commit is contained in:
Luis Fernando Molina committed 2019-05-10 10:39:43 +02:00
1 parent 028f97c1f3
commit c367bb4985
6 files changed
+49 -10

No files matched your search

+2 -2
View File
@@ -167,6 +167,8 @@ function newCanvas () {
/* Here we add all the functions that will be called during the animation cycle. */
animation.addCallBackFunction('Floating Space Draw', thisObject.floatingSpace.draw, onFunctionAdded)
animation.addCallBackFunction('Floating Space Physics', thisObject.floatingSpace.physics, onFunctionAdded)
animation.addCallBackFunction('ViewPort Draw', viewPort.draw, onFunctionAdded)
animation.addCallBackFunction('Chart Space Background', thisObject.chartSpace.drawBackground, onFunctionAdded)
animation.addCallBackFunction('Chart Space', thisObject.chartSpace.draw, onFunctionAdded)
@@ -176,8 +178,6 @@ function newCanvas () {
animation.addCallBackFunction('Bottom Space Physics', thisObject.bottomSpace.physics, onFunctionAdded)
animation.addCallBackFunction('Top Space', thisObject.topSpace.draw, onFunctionAdded)
animation.addCallBackFunction('Strategy Space', thisObject.strategySpace.draw, onFunctionAdded)
animation.addCallBackFunction('Floating Space Draw', thisObject.floatingSpace.draw, onFunctionAdded)
animation.addCallBackFunction('Floating Space Physics', thisObject.floatingSpace.physics, onFunctionAdded)
animation.addCallBackFunction('Splash Screen', splashScreen.draw, onFunctionAdded)
animation.start(onStart)
+2
View File
@@ -159,6 +159,8 @@ maxDate.setDate(maxDate.getDate() + 365 * 1); // We might have charts that proj
const MIN_PLOTABLE_DATE = new Date(2015, 0, 1, 0, 0, 0);
const MAX_PLOTABLE_DATE = maxDate;
const BOTTOM_SPACE_MIN_HEIGHT = 35;
const BOTTOM_SPACE_MAX_HEIGHT = browserCanvas.height;
let TOP_SPACE_HEIGHT = 5;
let BOTTOM_SPACE_HEIGHT = 35;
let BREAKPOINT_HEIGHT = 15;
+26 -1
View File
@@ -48,7 +48,7 @@
function resize () {
thisObject.container.frame.position.x = 0
thisObject.container.frame.position.y = viewPort.visibleArea.bottomLeft.y
thisObject.container.frame.position.y = browserCanvas.height - BOTTOM_SPACE_HEIGHT
thisObject.container.frame.width = browserCanvas.width
thisObject.container.frame.height = BOTTOM_SPACE_HEIGHT
@@ -56,6 +56,30 @@
function physics () {
BOTTOM_SPACE_HEIGHT = browserCanvas.height - thisObject.container.frame.position.y
/* Check the limits */
if (BOTTOM_SPACE_HEIGHT < BOTTOM_SPACE_MIN_HEIGHT) {
BOTTOM_SPACE_HEIGHT = BOTTOM_SPACE_MIN_HEIGHT
thisObject.container.frame.position.y = browserCanvas.height - BOTTOM_SPACE_HEIGHT
canvas.strategySpace.makeInvisible()
}
if (BOTTOM_SPACE_HEIGHT > BOTTOM_SPACE_MAX_HEIGHT) {
BOTTOM_SPACE_HEIGHT = BOTTOM_SPACE_MAX_HEIGHT
thisObject.container.frame.position.y = browserCanvas.height - BOTTOM_SPACE_HEIGHT
canvas.chartSpace.visible = false
canvas.panelsSpace.visible = false
}
if (BOTTOM_SPACE_HEIGHT > browserCanvas.height * 25 / 100) {
canvas.strategySpace.makeVisible()
}
if (BOTTOM_SPACE_HEIGHT < browserCanvas.height * 95 / 100) {
canvas.chartSpace.visible = true
canvas.panelsSpace.visible = true
}
viewPort.resize()
thisObject.container.frame.height = BOTTOM_SPACE_HEIGHT
}
@@ -180,3 +204,4 @@
browserCanvasContext.fill()
}
}
-4
View File
@@ -66,14 +66,10 @@ function newFloatingSpace () {
}
function makeVisible () {
canvas.chartSpace.visible = false
canvas.panelsSpace.visible = false
visible = true
}
function makeInvisible () {
canvas.chartSpace.visible = true
canvas.panelsSpace.visible = true
visible = false
}
+14
View File
@@ -7,6 +7,8 @@ function newStrategySpace () {
container: undefined,
draw: draw,
getContainer: getContainer,
makeVisible: makeVisible,
makeInvisible: makeInvisible,
initialize: initialize
}
@@ -29,6 +31,18 @@ function newStrategySpace () {
thisObject.sidePanel.areas.push(thisObject.investmentPlanWorkspace)
}
function makeVisible () {
if (thisObject.investmentPlanWorkspace.isDeployed !== true) {
thisObject.investmentPlanWorkspace.deploydInvestmentPlan()
}
canvas.floatingSpace.makeVisible()
visible = true
}
function makeInvisible () {
visible = false
}
function getContainer (point) {
let container
+5 -3
View File
@@ -6,8 +6,10 @@ function newInvestmentPlanWorkspace () {
logger.fileName = MODULE_NAME
let thisObject = {
isDeployed: false,
strategies: undefined,
container: undefined,
deploydInvestmentPlan: deploydInvestmentPlan,
draw: draw,
getContainer: getContainer,
initialize: initialize
@@ -94,7 +96,7 @@ function newInvestmentPlanWorkspace () {
.then(response => {
window.localStorage.setItem('userStrategies', JSON.stringify(response.data.strategizer_StrategyByFb.subStrategies))
thisObject.strategies = JSON.parse(JSON.stringify(response.data.strategizer_StrategyByFb.subStrategies))
deploydInvestmentPlan()
resolve({ strategies: response.data.strategizer_StrategyByFb.subStrategies})
})
.catch(error => {
@@ -121,9 +123,9 @@ function newInvestmentPlanWorkspace () {
}
function deploydInvestmentPlan () {
canvas.floatingSpace.makeVisible()
thisObject.strategy = newInvestmentPlan()
thisObject.strategy.initialize(thisObject.strategySource)
thisObject.strategy.initialize(thisObject.strategies)
thisObject.isDeployed = true
}
function getContainer (point) {