From 37a47cc43e2c74dded0572c31debd23bfe45a301 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 1 Jun 2018 18:51:49 +0200 Subject: [PATCH] Asthetics works, comma on thoursands --- ChartGrid.js | 5 +++-- Dashboard.js | 6 ++++-- Files/FileCursor.js | 2 +- FloatingSpace/Note.js | 6 +++--- FloatingSpace/ProfileBall.js | 8 ++++---- ProductCard.js | 12 ++++++------ TimelineChart.js | 8 ++++---- 7 files changed, 25 insertions(+), 22 deletions(-) diff --git a/ChartGrid.js b/ChartGrid.js index 589acedd6..d949592cc 100644 --- a/ChartGrid.js +++ b/ChartGrid.js @@ -501,9 +501,10 @@ let fontSize = 10; let label = ' ' + Math.round(j * 1000000) / 1000000; + label = Number(label).toLocaleString(); let labelPoint = { - x: viewPort.visibleArea.bottomRight.x + 1, + x: viewPort.visibleArea.bottomRight.x + 5, y: point1.y + fontSize / 2 * FONT_ASPECT_RATIO }; @@ -540,7 +541,7 @@ let label = ' ' + pad(labelValue, 3) + '%'; let labelPoint = { - x: -2, + x: 0, y: point1.y + fontSize / 2 * FONT_ASPECT_RATIO }; diff --git a/Dashboard.js b/Dashboard.js index 81b0c2e59..549d6f985 100644 --- a/Dashboard.js +++ b/Dashboard.js @@ -13,9 +13,11 @@ UI_COLOR = { UI_FONT = { PRIMARY: "Saira", - SECONDARY: "Courier New" + SECONDARY: "Source Code Pro" }; +FONT_ASPECT_RATIO = 0.50; + /* User Interface Panels */ UI_PANEL = { @@ -157,7 +159,7 @@ const _2_MINUTES_IN_MILISECONDS = 2 * 60 * 1000; const _1_MINUTE_IN_MILISECONDS = 1 * 60 * 1000; const EARLIEST_DATE = new Date(2014, 0, 18, 4, 26, 8); -const FONT_ASPECT_RATIO = 0.60; + const CHART_ASPECT_RATIO = 1 / 10; let INITIAL_ZOOM_LEVEL = -26; // This is the zoom level at the view port in which the APP starts. diff --git a/Files/FileCursor.js b/Files/FileCursor.js index f996cff5d..335533075 100644 --- a/Files/FileCursor.js +++ b/Files/FileCursor.js @@ -2,7 +2,7 @@ function newFileCursor() { const MODULE_NAME = "File Cursor"; - const INFO_LOG = false; + const INFO_LOG = true; const ERROR_LOG = true; const logger = newWebDebugLog(); logger.fileName = MODULE_NAME; diff --git a/FloatingSpace/Note.js b/FloatingSpace/Note.js index a30904ea8..40081e88b 100644 --- a/FloatingSpace/Note.js +++ b/FloatingSpace/Note.js @@ -295,12 +295,12 @@ function newNote() { let startingPosition = { x: pFloatingObject.currentPosition.x, - y: pFloatingObject.currentPosition.y - labelRows.length / 2 * (fontSize * 0.60 + 10) + y: pFloatingObject.currentPosition.y - labelRows.length / 2 * (fontSize * FONT_ASPECT_RATIO + 10) }; labelPoint = { - x: startingPosition.x - labelRow.length / 2 * fontSize * 0.60, - y: startingPosition.y + (i + 1) * (fontSize * 0.60 + 10) + x: startingPosition.x - labelRow.length / 2 * fontSize * FONT_ASPECT_RATIO, + y: startingPosition.y + (i + 1) * (fontSize * FONT_ASPECT_RATIO + 10) }; browserCanvasContext.font = fontSize + 'px ' + UI_FONT.SECONDARY; diff --git a/FloatingSpace/ProfileBall.js b/FloatingSpace/ProfileBall.js index 77ca50940..c0e44ebd8 100644 --- a/FloatingSpace/ProfileBall.js +++ b/FloatingSpace/ProfileBall.js @@ -126,8 +126,8 @@ function newProfileBall() { if (label !== undefined) { labelPoint = { - x: pFloatingObject.currentPosition.x - label.length / 2 * fontSize * 0.60, - y: pFloatingObject.currentPosition.y - pFloatingObject.currentImageSize / 2 - fontSize * 0.60 - 5 + x: pFloatingObject.currentPosition.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO, + y: pFloatingObject.currentPosition.y - pFloatingObject.currentImageSize / 2 - fontSize * FONT_ASPECT_RATIO - 5 }; browserCanvasContext.font = fontSize + 'px ' + UI_FONT.SECONDARY; @@ -141,8 +141,8 @@ function newProfileBall() { if (label !== undefined) { labelPoint = { - x: pFloatingObject.currentPosition.x - label.length / 2 * fontSize * 0.60, - y: pFloatingObject.currentPosition.y + pFloatingObject.currentImageSize / 2 + fontSize * 0.60 + 10 + x: pFloatingObject.currentPosition.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO, + y: pFloatingObject.currentPosition.y + pFloatingObject.currentImageSize / 2 + fontSize * FONT_ASPECT_RATIO + 10 }; browserCanvasContext.font = fontSize + 'px ' + UI_FONT.SECONDARY; diff --git a/ProductCard.js b/ProductCard.js index a215afff1..20340fbeb 100644 --- a/ProductCard.js +++ b/ProductCard.js @@ -447,8 +447,8 @@ label = thisObject.devTeam.displayName; labelPoint = { - x: 10 + devTeamImageSize / 2 - label.length / 2 * fontSize * 0.60, - y: thisObject.container.frame.height / 2 + devTeamImageSize / 2 + fontSize * 0.60 + 5 + x: 10 + devTeamImageSize / 2 - label.length / 2 * fontSize * FONT_ASPECT_RATIO, + y: thisObject.container.frame.height / 2 + devTeamImageSize / 2 + fontSize * FONT_ASPECT_RATIO + 5 }; labelPoint = thisObject.container.frame.frameThisPoint(labelPoint); @@ -462,8 +462,8 @@ label = thisObject.bot.displayName; labelPoint = { - x: thisObject.container.frame.width - 10 - botImageSize - 5 + botImageSize / 2 - label.length / 2 * fontSize * 0.60, - y: thisObject.container.frame.height / 2 + devTeamImageSize / 2 + fontSize * 0.60 + 5 + x: thisObject.container.frame.width - 10 - botImageSize - 5 + botImageSize / 2 - label.length / 2 * fontSize * FONT_ASPECT_RATIO, + y: thisObject.container.frame.height / 2 + devTeamImageSize / 2 + fontSize * FONT_ASPECT_RATIO + 5 }; labelPoint = thisObject.container.frame.frameThisPoint(labelPoint); @@ -484,8 +484,8 @@ }; labelPoint = { - x: thisObject.container.frame.width / 2 - label.length / 2 * fontSize * 0.60, - y: thisObject.container.frame.height / 2 - devTeamImageSize / 2 - fontSize * 0.60 - 5 + x: thisObject.container.frame.width / 2 - label.length / 2 * fontSize * FONT_ASPECT_RATIO, + y: thisObject.container.frame.height / 2 - devTeamImageSize / 2 - fontSize * FONT_ASPECT_RATIO - 5 }; labelPoint = thisObject.container.frame.frameThisPoint(labelPoint); diff --git a/TimelineChart.js b/TimelineChart.js index 518c01820..a4eeadc14 100644 --- a/TimelineChart.js +++ b/TimelineChart.js @@ -968,8 +968,8 @@ point = transformThisPoint(point, thisObject.container); point = { - x: (viewPort.visibleArea.bottomRight.x - viewPort.visibleArea.bottomLeft.x) / 2 - label.length / 2 * currentFontSize * 0.60, - y: point.y + currentFontSize * 0.60 / 2 + x: (viewPort.visibleArea.bottomRight.x - viewPort.visibleArea.bottomLeft.x) / 2 - label.length / 2 * currentFontSize * FONT_ASPECT_RATIO, + y: point.y + currentFontSize * FONT_ASPECT_RATIO / 2 }; } else { @@ -977,8 +977,8 @@ targetLabelFontSize = 150; point = { - x: (viewPort.visibleArea.bottomRight.x - viewPort.visibleArea.bottomLeft.x) / 2 - label.length / 2 * currentFontSize * 0.60, - y: (viewPort.visibleArea.bottomLeft.y - viewPort.visibleArea.topLeft.y) / 2 + currentFontSize * 0.60 / 2 + x: (viewPort.visibleArea.bottomRight.x - viewPort.visibleArea.bottomLeft.x) / 2 - label.length / 2 * currentFontSize * FONT_ASPECT_RATIO, + y: (viewPort.visibleArea.bottomLeft.y - viewPort.visibleArea.topLeft.y) / 2 + currentFontSize * FONT_ASPECT_RATIO / 2 }; }