From a026cfb3bbd7e8179d0c63c72a653a666f246544 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 17 Dec 2019 09:57:35 +0100 Subject: [PATCH] Panels overlapping or too short --- Dashboard.js | 2 +- Panels/PlotterPanel.js | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Dashboard.js b/Dashboard.js index ff9e3d493..230c680bb 100644 --- a/Dashboard.js +++ b/Dashboard.js @@ -45,7 +45,7 @@ function newDashboard () { } APP_SCHEMA_MAP.set(key, nodeDefinition) } - console.log(APP_SCHEMA_MAP) + startCanvas() } diff --git a/Panels/PlotterPanel.js b/Panels/PlotterPanel.js index 7677a0934..b2d33194b 100644 --- a/Panels/PlotterPanel.js +++ b/Panels/PlotterPanel.js @@ -21,6 +21,7 @@ function newPlotterPanel () { container.frame.containerName = 'Plotter Panel' + let heightFactor = 1 let currentRecord let panelTabButton let panelNode @@ -34,8 +35,8 @@ function newPlotterPanel () { thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL - thisObject.container.frame.position.x = viewPort.visibleArea.topRight.x - thisObject.container.frame.width * 5 - thisObject.container.frame.position.y = viewPort.visibleArea.bottomLeft.y - thisObject.container.frame.height + thisObject.container.frame.position.x = viewPort.visibleArea.topRight.x - thisObject.container.frame.width - thisObject.container.frame.width * Math.random() * 8 + thisObject.container.frame.position.y = viewPort.visibleArea.bottomLeft.y - thisObject.container.frame.height - thisObject.container.frame.height * Math.random() * 1.5 panelTabButton = newPanelTabButton() panelTabButton.parentContainer = thisObject.container @@ -109,6 +110,11 @@ function newPlotterPanel () { let valuePosition = i * 10 + 15 let value = 'No value defined.' + if (valuePosition > 100) { + heightFactor = 2 + thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * heightFactor + } + if (panelData.dataFormula !== undefined) { try { value = eval(panelData.dataFormula.code) @@ -134,8 +140,8 @@ function newPlotterPanel () { valuePosition = panelData.code.valuePosition } - printLabel(labelText, X_AXIS, PANEL_HEIGHT * labelPosition / 100, '1') - printLabel(value, X_AXIS, PANEL_HEIGHT * valuePosition / 100, '0.50') + printLabel(labelText, X_AXIS, PANEL_HEIGHT * labelPosition / 100 / heightFactor, '1') + printLabel(value, X_AXIS, PANEL_HEIGHT * valuePosition / 100 / heightFactor, '0.50') } function printLabel (labelToPrint, x, y, opacity) {