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
Enhancement: ability to add a target value, thresholds #3
Comments
Hi Ian, and thanks :) Regarding real time, it's just a matter of triggering refresh function in specific time interval. Not sure if it's optimal solution, though. We could make it par of plugin, but I would rather have your business logic utilize justGage, than justGage utilizing your API for data :) Threshold values would be another interval inside of min - max. Hitting or leaving that interval could be checked upon value update in refresh function (and constructor function, too). I'd say a "you're over" and "you're under" types of messages would be sufficient enough to tell user what's going on...unless you need to remind him on each percentage closing on critical value that disaster is about to happen :D |
I've done some initial work on this, to a state where the code would work for our use case I think. Happy to refactor it into more generic code though if you think it needs expanding on. The code isn't finished anyway and I'll tidy it up - worth taking a look and see if you think it fits though. The user can pass in three optional parameters: targetValue, thresholdLower, thresholdUpper. These are then used to dictate the colour of the gauge dependant on how far the actual value is away from the target and where it sits in the spectrum. This approach just uses the colour instead of notifications or messages. Let me know what you think, I've added an example file: https://github.com/Ianfeather/justgage |
Hey Ian, just checked the demo. Sweet :) And you're right - less is more, no notifications, definitely. Because for the person who's job is looking at these gauges, color representation of the state is just fine. I would be happy to include your work in next version. I am thinking about it as a "mode" you can select, similar to the way you currently use "levelColorsGradient" boolean to turn on sector-based color representation. Haven't looked at the code yet. I'd like to keep logic for different modes as a separate chunks - functions, or whatever, so we can have clean "core", and then just add features on top of that. |
Yeah a mode sounds good. When I tidy up the code I'll look to do this and then make a pull request. One thing I think would be really good is if you could have some visual representation of the target - like a line that could go across the guage. This would only be shown if the mode was triggered. I haven't done too much work with SVG, how hard do you see this being? |
I like the idea of a line crossing the gauge! |
Guys, sorry for the late reply, I was busy as hell :) I'll try to code something over weekend regarding the target-line. Shouldn't be too hard... |
A threshold line would be a great addition, it could also be programmatically used as a peak value indicator for live meters. |
This is yet another feature I am looking for, happy to ear it is in the future plans for Justgage. Thanks. |
Guys, I've just added new option to define custom ranges for thresholds and similar stuff. I think it's pretty universal, as you can cover single range (say, 40 - 50), or the whole min to max area. Here's a demo - http://justgage.com/demos/custom-sectors/. Whaddaya say? :) Works? |
Really a cool tool, but where can i download the source code ? the demo http://bit.ly/15RBkKe is showing 404 error |
Updated, try that one :) |
Hi toorshia ,custom ranges for threshold is a cool feature but if there is a line crossing the gauge for threshold line, it would look great. |
Hi, I'll put this request under enhancements ;) |
Can you put this on github so we can see it, and pull it ? |
Yeah, sure thing :) |
Hello, |
Great job with this, really nice. I'm interested in using this to display real time (or near real time) metrics. For us, I think being able to set and visualise a target value that we want to hit, or a threshold that we need to stay inside would be really cool. Plus as an aside, being able to alert on leaving that threshold so that we can act on it.
I've forked the repo but if you have any ideas on this it'd be great to hear them. Will let you know I get on.
The text was updated successfully, but these errors were encountered: