From afc95ec9f7277bc2361a494c9c834c7530eeb4da Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 5 May 2018 13:07:45 +0200 Subject: [PATCH] Visibility Improved --- .vs/Plotters-Trading/v15/.suo | Bin 27136 -> 29184 bytes History.js | 96 +++++++++++++++++++++++++++------- 2 files changed, 77 insertions(+), 19 deletions(-) diff --git a/.vs/Plotters-Trading/v15/.suo b/.vs/Plotters-Trading/v15/.suo index 66b6f607e074b466776bb22996f226aa8dd33e3b..f7a2443e1ff908f97355adaec05d51fd7c4ad529 100644 GIT binary patch delta 519 zcmZp;!r1VHae{#?69W_oFfgzHnT$aE@Bjb*AW`PYjG4k46L^@|8kG3|Bs|$%#B_*J zR1hd51jHOb%mc(gjSO6yJz12Q*aTE>gO#x@Vq{bUX`YzCGFgX1!&L>S259JiRVb|h zq}72~1IpKg(jYY;+mV43P)-tvxi`<`SjEH12r>&~_hf-gjm;&ZS6Em;rb2j97Z_PU zZkx=Lsk6C6<~-x%!%T*gOXLDLxPYQs5Oq46f5>@5WfU%OC;>(JAu>Soy!~0gdcOFd z-+WlbmT^%K%O)LXMs#a+*Dy_1kkUZ1+N6hZa$tJ&=4hj(jFSRRuz-vOJL-$dc_vOq zkPks_012^zycDwer#U;=)h?pyKeJqcTuKEGA`J>;}pVz#VcL` iEYctgKwkgi#lyTQ=$0@xb5liG7I`o&iep-o#sUCkO_t~Y delta 535 zcmZ9JO-lk{5XYVMSy^pKEjGwZHuE*CwhqxX6nYl}>EfkJgxAm&KqO^VuR%nOOCPONt3RXBb4pxQwrq7CG|KlALk(|hUAf()r zJNSu1M)89tEqdFUWa-&)@O*&{&}iv?UUfHONDTB= 0 && newHistoryRecord.messageRelevance <= 10) { - if (timePeriod <= dailyFilePeriods[newHistoryRecord.messageRelevance][0]) { + let relevanceTimePeriod = (dailyFilePeriods[10 - newHistoryRecord.messageRelevance][0]); + + if (timePeriod <= relevanceTimePeriod) { let bubble = { title: newHistoryRecord.messageTitle, - body: newHistoryRecord.messageBody, + body: newHistoryRecord.messageRelevance + ". " + newHistoryRecord.messageBody, date: newHistoryRecord.date, rate: newHistoryRecord.marketRate, position: { x: 0, y: 0 - } + }, + visible: false }; bubbles.push(bubble); } } } - */ } plotElements.push(history); plotLines.push(lines); + + bubblesChangedEventRaised = false; } thisObject.container.eventHandler.raiseEvent("History Changed", history); @@ -599,7 +644,7 @@ /* Since there is at least some point plotted, then the profile should be visible. */ - thisObject.profile.visible = true; + thisObject.payload.profile.visible = true; } /* Draw the lines connecting plot elements. */ @@ -653,7 +698,7 @@ /* Now we calculate the anchor position of bubbles. */ - /* + for (let i = 0; i < bubbles.length; i++) { let bubble = bubbles[i]; @@ -667,12 +712,25 @@ bubble.position = timeLineCoordinateSystem.transformThisPoint(bubble.position); bubble.position = transformThisPoint(bubble.position, thisObject.container); + + if (bubble.position.x < (viewPort.visibleArea.bottomRight.x) * (-1) || bubble.position.x > (viewPort.visibleArea.bottomRight.x) * (2)) { + bubble.visible = false; + } else { + bubble.visible = true; + } + bubble.position = viewPort.fitIntoVisibleArea(bubble.position); } - thisObject.bubbles = bubbles; - */ + if (bubblesChangedEventRaised === false) { + + thisObject.container.eventHandler.raiseEvent("Bubbles Changed", bubbles); + thisObject.payload.bubbles = bubbles; + + bubblesChangedEventRaised = true; + } + } /* @@ -682,8 +740,8 @@ */ - thisObject.profile.position.x = point.x; - thisObject.profile.position.y = point.y; + thisObject.payload.profile.position.x = point.x; + thisObject.payload.profile.position.y = point.y; } }