-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add overlay chart if selecting two saved results #235
Conversation
ui/static/js/fortio_chart.js
Outdated
@@ -189,6 +189,7 @@ function fortioResultToJsChartData (res) { | |||
|
|||
function showChart (data) { | |||
toggleVisibility() | |||
deleteSingleChart() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line unfortunately removes the cute transition animation when switching between single results. To keep them, there needs to be some better management of the 2 "overlayed" datasets in the global chart variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for pointing this out ! let's try to keep the "using up/down arrow" to move from result to result working nicely:
add an if ? there is already logic to switch from multi to single - we just now have 3 modes and as long as we stay in either one of the mode the only change is the data ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line resolves the bug that happens when moving from an overlay chart back to a single chart. Without this line, the data isn't reset and the single chart shows 4 datasets.
It only needs to be called when going from an overlay chart back to a single chart, however, so I added an if check. It has those nice animations when switching between single charts again.
Codecov Report
@@ Coverage Diff @@
## master #235 +/- ##
======================================
Coverage 90.2% 90.2%
======================================
Files 10 10
Lines 1906 1906
======================================
Hits 1720 1720
Misses 119 119
Partials 67 67 Continue to review full report at Codecov.
|
I checked out the branch and it's super cool - thanks for this ! What can we do about the title though ? for the 2 can you change the title to show what is A and what is B - then we can merge this |
found a small bug (that I had to fix when I first added multi chart) : resize doesn't work correctly, it looses the 2-chart or switches to multi-chart when you resize the window |
Both the original weird bug and the resizing bug are solved by separating an overlayChart and destroying the other charts as you switch 'modes'. The title is pretty long but does label and show data for A and B. It can be adjusted / removed later like you said. |
This is sweet ! thanks! 2 issues though, 1 for title space, let's apply:
(I tried to put that in your fork but don't know how, for fortio feel free to make branches in this repo directly (unlike istio where it's not recommended)) 2, I get errors when typing a max (like 400) and hitting return (it used to set the max to 400 right away)
|
for title I tried
which works but takes too much space |
Done. I applied your title change and fixed the update form bug. browse.html's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesomesauce! thanks!
ps: when we have time I want to explore the histogram with 4 slots where only 2 are used in single mode
Resolves #180.
When two items are selected from the saved results, the chart displays 4 datasets, with one saved result's 2 datasets overlayed on top of the other result's 2 datasets.
This introduces a weird bug in which the chart sometimes temporarily stops displaying one of the two saved results. It is rather inconsistent to reproduce, but clicking to hide and show datasets often triggers the bug. I'm not sure if this bug lies in my code or in Chart.js