Show ToolTip on Network Traffic graph #492

pull rebroad wants to merge 4 commits into bitcoin-core:master from rebroad:NetworkGraphTooltip changing 6 files +168 −9
  1. rebroad commented at 2:46 pm on December 1, 2021: contributor

    Enables a tooltip on the graph to make it easier to see what point in time a part of the graph corresponds to.

    This PR includes the change in #484, but also deals with the potential issues that the simplicity of 484 introduced.

    TODO:

    • make it easier to select a point on the graph by factoring in the vertical position of the mouse pointer also.
    • maybe - add ridges on the X-axis to show where an interval change or time jump occurs.
    • make the Units translateable.
  2. rebroad cross-referenced this on Dec 1, 2021 from issue Don't clear traffic graph when changing interval by rebroad
  3. rebroad force-pushed on Dec 1, 2021
  4. rebroad force-pushed on Dec 1, 2021
  5. shaavan commented at 10:41 am on December 2, 2021: contributor

    Concept ACK

    I think this PR is an improvement from a UX perspective. I shall be testing this PR when the TODO is completed.

  6. rebroad force-pushed on Dec 2, 2021
  7. rebroad force-pushed on Dec 2, 2021
  8. rebroad commented at 2:51 pm on December 2, 2021: contributor

    Concept ACK

    I think this PR is an improvement from a UX perspective. I shall be testing this PR when the TODO is completed. @shaavan TODOs now updated

  9. rebroad force-pushed on Dec 6, 2021
  10. rebroad cross-referenced this on Dec 6, 2021 from issue Enable a non-linear network traffic option (click to toggle between linear and non-linear) by rebroad
  11. rebroad force-pushed on Dec 6, 2021
  12. rebroad force-pushed on Dec 6, 2021
  13. rebroad force-pushed on Dec 6, 2021
  14. rebroad force-pushed on Dec 6, 2021
  15. rebroad force-pushed on Dec 6, 2021
  16. rebroad force-pushed on Dec 6, 2021
  17. rebroad force-pushed on Dec 6, 2021
  18. rebroad force-pushed on Dec 6, 2021
  19. rebroad commented at 10:15 pm on December 6, 2021: contributor
    Had to keep changing the strUnit function as the printf test kept failing (it makes false assumptions).
  20. rebroad marked this as ready for review on Dec 7, 2021
  21. in src/util/strencodings.cpp:394 in 2a64d4b3de outdated
    389+    if (value < 1'000) return strprintf(strprintf("%%.%df %s%%s", std::max(dp - 3, 0), letter), value, strUnit);
    390+
    391+    return strprintf(strprintf("%%.%df %s%%s", std::max(dp - 4, 0),  letter), value, strUnit);
    392+}
    393+
    394+std::string strBps(float bits) {
    


    rebroad commented at 9:42 am on December 7, 2021:
    strBps() isn’t used by this PR, but is planned to be used in #305
  22. rebroad force-pushed on Dec 7, 2021
  23. rebroad force-pushed on Dec 9, 2021
  24. katesalazar commented at 8:24 pm on December 10, 2021: contributor

    I’d fancy reviewing this, but my time is very limited. As you keep finishing PRs, I could use some meta issue (or something) helping me realize the dependency tree between PRs without me having to spend time figuring it out. Cheers,

    On Tue, Dec 7, 2021 at 10:42 AM Rebroad @.***> wrote:

    @.**** commented on this pull request.

    In src/util/strencodings.cpp https://github.com/bitcoin-core/gui/pull/492#discussion_r763811501:

    • } else if (value < 1'000'000'000) {
    •    letter = "M";
      
    •    value /= 1'000'000;
      
    • } else {
    •    letter = "G";
      
    •    value /= 1'000'000'000;
      
    • }
    • if (value < 1) return strprintf(strprintf("%%.%df %s%%s", dp, letter), value, strUnit);
    • if (value < 10) return strprintf(strprintf("%%.%df %s%%s", std::max(dp - 1, 0), letter), value, strUnit);
    • if (value < 100) return strprintf(strprintf("%%.%df %s%%s", std::max(dp - 2, 0), letter), value, strUnit);
    • if (value < 1'000) return strprintf(strprintf("%%.%df %s%%s", std::max(dp - 3, 0), letter), value, strUnit);
    • return strprintf(strprintf("%%.%df %s%%s", std::max(dp - 4, 0), letter), value, strUnit); +}

    +std::string strBps(float bits) {

    This isn’t used by this PR, but is planned to be used in #305 https://github.com/bitcoin-core/gui/pull/305

    — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bitcoin-core/gui/pull/492#pullrequestreview-825023047, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMRS4WYRUK34NOVAYWUPPBDUPXJHPANCNFSM5JEVGYYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

  25. rebroad force-pushed on Dec 10, 2021
  26. rebroad commented at 11:29 pm on December 10, 2021: contributor

    I’d fancy reviewing this, but my time is very limited. As you keep finishing PRs, I could use some meta issue (or something) helping me realize the dependency tree between PRs without me having to spend time figuring it out. Cheers,

    Hi. The latest push to this PR ought to be the last one - I had been trying to get the ToolTips to behave better, which they now do. They no longer time-out (disappear) and they also can now moved along with the graph regardless of the duration/speed selected. Also, the yellow circle will disappear more reliably now if the ToolTip also disappears (due to the mouse pointing elsewhere). It took a while to refine this functionality, which in the latest commit required an additional timer (tt_timer) to check the ToolTip status at an interval independent of the graph being updated, or the mouse moving.

  27. rebroad force-pushed on Dec 12, 2021
  28. rebroad force-pushed on Dec 12, 2021
  29. Network Graph - Create y_value function 878be64ac4
  30. Add formatBytesps function cdc5f0b2e6
  31. Show ToolTip on Network Traffic graph e5897a78a0
  32. Don't clear graph when changing interval 6c139ebf71
  33. rebroad force-pushed on Dec 12, 2021
  34. DrahtBot commented at 10:53 am on December 30, 2021: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #539 (gui: scale network graph based on time interval by RandyMcMillan)
    • #524 (Replace int with std::chrono in for the timer->setInterval() argument by shaavan)
    • #473 (Enable a non-linear network traffic option (click to toggle between linear and non-linear) by rebroad)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  35. katesalazar commented at 4:32 pm on January 4, 2022: contributor
    Why isn’t “Add formatBytesps function” (cdc5f0b) squashed in “Show ToolTip on Network Traffic graph” (e5897a7)?
  36. katesalazar commented at 4:53 pm on January 4, 2022: contributor
    Built and tested this, seems cool.
  37. in src/qt/trafficgraphwidget.cpp:183 in 6c139ebf71
    178+    if (ttpoint >= 0 && ttpoint < sampleCount) {
    179+        painter.setPen(Qt::yellow);
    180+        int w = width() - XMARGIN * 2;
    181+        int x = XMARGIN + w - w * ttpoint / DESIRED_SAMPLES;
    182+        int y = y_value(floatmax(vSamplesIn.at(ttpoint), vSamplesOut.at(ttpoint)));
    183+        painter.drawEllipse(QPointF(x, y), 3, 3);
    


    katesalazar commented at 4:57 pm on January 4, 2022:
    What about fencing these in a function? Maybe a macro? Maybe add a couple of comments?
  38. in src/qt/trafficgraphwidget.cpp:265 in 6c139ebf71
    261@@ -262,8 +262,7 @@ void TrafficGraphWidget::setGraphRangeMins(int mins)
    262     int msecsPerSample = nMins * 60 * 1000 / DESIRED_SAMPLES;
    263     timer->stop();
    264     timer->setInterval(msecsPerSample);
    265-
    266-    clear();
    267+    timer->start();
    


    katesalazar commented at 4:59 pm on January 4, 2022:
    Why did you separate this change in a rev of its own?
  39. DrahtBot cross-referenced this on Jan 13, 2022 from issue Replace int with std::chrono in for the timer->setInterval() argument by shaavan
  40. DrahtBot cross-referenced this on Jan 27, 2022 from issue Scale network graph based on time interval by RandyMcMillan
  41. DrahtBot added the label Needs rebase on Feb 4, 2022
  42. DrahtBot commented at 11:02 am on February 4, 2022: contributor

    🐙 This pull request conflicts with the target branch and needs rebase.

    Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a “draft”.

  43. rebroad cross-referenced this on Feb 24, 2022 from issue Network graph improvements by rebroad
  44. hebasto commented at 5:21 pm on May 26, 2022: member
    Closing due to a long period of inactivity here. Feel free to reopen.
  45. hebasto closed this on May 26, 2022

  46. katesalazar commented at 7:16 pm on September 18, 2022: contributor

    #473 is similarly inactive.

    On Thu, May 26, 2022 at 7:22 PM Hennadii Stepanov @.***> wrote:

    Closing due to a long period of inactivity here. Feel free to reopen.

    — Reply to this email directly, view it on GitHub https://github.com/bitcoin-core/gui/pull/492#issuecomment-1138821055, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMRS4W7L4JVJ3LULH5S767TVL6XMDANCNFSM5JEVGYYQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

  47. bitcoin-core locked this on Sep 18, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-23 00:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me