diff --git a/.vs/AAWebPlatform/v15/.suo b/.vs/AAWebPlatform/v15/.suo index 60c996b15..752d890c9 100644 Binary files a/.vs/AAWebPlatform/v15/.suo and b/.vs/AAWebPlatform/v15/.suo differ diff --git a/ChartUtilities.js b/ChartUtilities.js index 48496e01e..27bb78841 100644 --- a/ChartUtilities.js +++ b/ChartUtilities.js @@ -9,21 +9,37 @@ function getSideDays(timePeriod) { } if (timePeriod === _1_HOUR_IN_MILISECONDS) { - daysOnSides = 2; + daysOnSides = 9; } - if (timePeriod === _3_HOURS_IN_MILISECONDS) { - daysOnSides = 6; - } - - if (timePeriod === _6_HOURS_IN_MILISECONDS) { + if (timePeriod === _2_HOURS_IN_MILISECONDS) { daysOnSides = 10; } - if (timePeriod === _12_HOURS_IN_MILISECONDS) { + if (timePeriod === _3_HOURS_IN_MILISECONDS) { daysOnSides = 12; } + if (timePeriod === _4_HOURS_IN_MILISECONDS) { + daysOnSides = 20; + } + + if (timePeriod === _6_HOURS_IN_MILISECONDS) { + daysOnSides = 35; + } + + if (timePeriod === _8_HOURS_IN_MILISECONDS) { + daysOnSides = 44; + } + + if (timePeriod === _12_HOURS_IN_MILISECONDS) { + daysOnSides = 56; + } + + if (timePeriod === ONE_DAY_IN_MILISECONDS) { + daysOnSides = 154; + } + return daysOnSides; } @@ -54,20 +70,22 @@ function getTransparenceFactor(timePeriod) { function recalculatePeriod(zoomLevel) { - if (zoomLevel > 600) { - return _1_MINUTE_IN_MILISECONDS; - } + console.log(" recalculatePeriod > " + zoomLevel); - if (zoomLevel > 300) { + if (zoomLevel > 200) { return _1_MINUTE_IN_MILISECONDS; } if (zoomLevel > 120) { - return _1_MINUTE_IN_MILISECONDS; + return _2_MINUTES_IN_MILISECONDS; + } + + if (zoomLevel > 80) { + return _3_MINUTES_IN_MILISECONDS; } if (zoomLevel > 60) { - return _5_MINUTES_IN_MILISECONDS; + return _4_MINUTES_IN_MILISECONDS; } if (zoomLevel > 15) { @@ -78,27 +96,55 @@ function recalculatePeriod(zoomLevel) { return _10_MINUTES_IN_MILISECONDS; } + if (zoomLevel > - 10) { + return _15_MINUTES_IN_MILISECONDS; + } + if (zoomLevel > - 13) { + return _20_MINUTES_IN_MILISECONDS; + } + + if (zoomLevel > - 15) { return _30_MINUTES_IN_MILISECONDS; } - if (zoomLevel > - 24) { + if (zoomLevel > - 16) { + return _40_MINUTES_IN_MILISECONDS; + } + + if (zoomLevel > - 17) { + return _45_MINUTES_IN_MILISECONDS; + } + + if (zoomLevel > - 18) { return _1_HOUR_IN_MILISECONDS; } + if (zoomLevel > - 24) { + return _2_HOURS_IN_MILISECONDS; + } + if (zoomLevel > - 25) { return _3_HOURS_IN_MILISECONDS; } - if (zoomLevel > - 26) { + if (zoomLevel > - 27) { + return _4_HOURS_IN_MILISECONDS; + } + + if (zoomLevel > - 27.5) { return _6_HOURS_IN_MILISECONDS; } - if (zoomLevel > - 27) { + if (zoomLevel > - 27.75) { + return _8_HOURS_IN_MILISECONDS; + } + + if (zoomLevel > - 28) { return _12_HOURS_IN_MILISECONDS; } - if (zoomLevel <= - 27) { + if (zoomLevel <= - 28) { return ONE_DAY_IN_MILISECONDS; } } diff --git a/Dashboard.js b/Dashboard.js index 0c62151ed..5c2f4766d 100644 --- a/Dashboard.js +++ b/Dashboard.js @@ -50,18 +50,29 @@ const LESS_WIDHTER_VOLUME_BAR_TOP_FACTOR = 1 / 4; const ONE_DAY_IN_MILISECONDS = 24 * 60 * 60 * 1000; const _12_HOURS_IN_MILISECONDS = 12 * 60 * 60 * 1000; +const _8_HOURS_IN_MILISECONDS = 8 * 60 * 60 * 1000; const _6_HOURS_IN_MILISECONDS = 6 * 60 * 60 * 1000; +const _4_HOURS_IN_MILISECONDS = 4 * 60 * 60 * 1000; const _3_HOURS_IN_MILISECONDS = 3 * 60 * 60 * 1000; +const _2_HOURS_IN_MILISECONDS = 2 * 60 * 60 * 1000; const _1_HOUR_IN_MILISECONDS = 1 * 60 * 60 * 1000; + +const _45_MINUTES_IN_MILISECONDS = 45 * 60 * 1000; +const _40_MINUTES_IN_MILISECONDS = 40 * 60 * 1000; const _30_MINUTES_IN_MILISECONDS = 30 * 60 * 1000; +const _20_MINUTES_IN_MILISECONDS = 20 * 60 * 1000; +const _15_MINUTES_IN_MILISECONDS = 15 * 60 * 1000; const _10_MINUTES_IN_MILISECONDS = 10 * 60 * 1000; const _5_MINUTES_IN_MILISECONDS = 5 * 60 * 1000; +const _4_MINUTES_IN_MILISECONDS = 4 * 60 * 1000; +const _3_MINUTES_IN_MILISECONDS = 3 * 60 * 1000; +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; -const INITIAL_TIME_PERIOD = ONE_DAY_IN_MILISECONDS; +const INITIAL_TIME_PERIOD = _10_MINUTES_IN_MILISECONDS; /* Here we list the valid Time Periods: */ diff --git a/Ecosystem.js b/Ecosystem.js index 5f7fccc0a..73f3eab1a 100644 --- a/Ecosystem.js +++ b/Ecosystem.js @@ -70,7 +70,7 @@ function newEcosystem() { codeName: "Market Candlesticks", displayName: "Candlesticks", exchangeList: ["Poloniex"], - validPeriods: ["24-hs", "12-hs", "06-hs", "03-hs", "01-hs"], + validPeriods: ["24-hs", "12-hs", "08-hs", "06-hs", "04-hs", "03-hs", "02-hs", "01-hs"], plotter: { devTeam: "AAMasters", repo: "AAOlivia-Plotter", @@ -107,7 +107,7 @@ function newEcosystem() { codeName: "Market Volumes", displayName: "Volumes", exchangeList: ["Poloniex"], - validPeriods: ["24-hs", "12-hs", "06-hs", "03-hs", "01-hs"], + validPeriods: ["24-hs", "12-hs", "08-hs", "06-hs", "04-hs", "03-hs", "02-hs", "01-hs"], plotter: { devTeam: "AAMasters", repo: "AAOlivia-Plotter", @@ -144,7 +144,7 @@ function newEcosystem() { codeName: "Daily Candlesticks", displayName: "Candlesticks", exchangeList: ["Poloniex"], - validPeriods: ["30-min", "15-min", "10-min", "05-min", "01-min"], + validPeriods: ["45-min", "40-min", "30-min", "20-min", "15-min", "10-min", "05-min", "04-min", "03-min", "02-min", "01-min"], plotter: { devTeam: "AAMasters", repo: "AAOlivia-Plotter", @@ -181,7 +181,7 @@ function newEcosystem() { codeName: "Daily Volumes", displayName: "Volumes", exchangeList: ["Poloniex"], - validPeriods: ["30-min", "15-min", "10-min", "05-min", "01-min"], + validPeriods: ["45-min", "40-min", "30-min", "20-min", "15-min", "10-min", "05-min", "04-min", "03-min", "02-min", "01-min"], plotter: { devTeam: "AAMasters", repo: "AAOlivia-Plotter", diff --git a/FileCloud.js b/FileCloud.js index a8c4a324e..9fd9fb913 100644 --- a/FileCloud.js +++ b/FileCloud.js @@ -33,12 +33,14 @@ function newFileCloud() { filePath = filePath.replace("@Year", pDatetime.getUTCFullYear()); filePath = filePath.replace("@Month", pad(pDatetime.getUTCMonth() + 1, 2)); - filePath = filePath.replace("@Month", pad(pDatetime.getUTCDate(), 2)); + filePath = filePath.replace("@Day", pad(pDatetime.getUTCDate(), 2)); } fileService.getFileToText('data', filePath, fileName, undefined, onFileReceived); + console.log("File Requested > " + filePath); + function onFileReceived(err, text, response) { let data; diff --git a/FileCursor.js b/FileCursor.js index a0814a035..b16b759a3 100644 --- a/FileCursor.js +++ b/FileCursor.js @@ -12,7 +12,8 @@ function newFileCursor() { fileCursor.files = files; - let cursorSize = 3; + let minCursorSize = 10; + let maxCursorSize = 30; let market; let exchange; @@ -115,7 +116,7 @@ function newFileCursor() { i++; - if (i < cursorSize) { + if (i < minCursorSize) { getNextFile(); @@ -128,8 +129,8 @@ function newFileCursor() { date = removeTime(cursorDate); - let minDate = date.valueOf() - cursorSize / 2 * 24 * 60 * 60 * 1000; - let maxDate = date.valueOf() + cursorSize / 2 * 24 * 60 * 60 * 1000; + let minDate = date.valueOf() - maxCursorSize * ONE_DAY_IN_MILISECONDS / 2; + let maxDate = date.valueOf() + maxCursorSize * ONE_DAY_IN_MILISECONDS / 2; for (let key of fileCursor.files.keys()) { diff --git a/FileCursorCache.js b/FileCursorCache.js index 84745c6eb..eaa283df4 100644 --- a/FileCursorCache.js +++ b/FileCursorCache.js @@ -54,7 +54,7 @@ function newFileCursorCache() { if (layer.validPeriods.includes(periodName) === true) { - let fileCursor = newFileCursos(); + let fileCursor = newFileCursor(); fileCursor.initialize(fileCloud, product, exchange, pMarket, periodName, pDatetime, onFileReceived); fileCursors.set(periodTime, fileCursor); @@ -78,7 +78,7 @@ function newFileCursorCache() { datetime = newDatetime; - fileCursors.forEach(setDatetime) + fileCursors.forEach(setDatetimeToEach) function setDatetimeToEach(value, key, map) { diff --git a/Utilities.js b/Utilities.js index 592beef72..438ab31c6 100644 --- a/Utilities.js +++ b/Utilities.js @@ -52,8 +52,6 @@ function getDateFromPoint(point, container, plotArea) { let date = new Date(point.x); - date = removeTime(date); - return date; } diff --git a/ViewPort.js b/ViewPort.js index c3298aa8f..d0e6d3702 100644 --- a/ViewPort.js +++ b/ViewPort.js @@ -199,7 +199,9 @@ function newViewPort() { } else { event.type = "Zoom Out"; } - + + console.log("Zoom Changed > " + event.newLevel); + viewPort.eventHandler.raiseEvent("Zoom Changed", event); return true; } diff --git a/index.html b/index.html index 5cf79f66f..41eefd8bd 100644 --- a/index.html +++ b/index.html @@ -7,6 +7,7 @@ +