Skip to content
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

Closed
Ianfeather opened this issue Aug 16, 2012 · 16 comments
Closed

Enhancement: ability to add a target value, thresholds #3

Ianfeather opened this issue Aug 16, 2012 · 16 comments
Assignees

Comments

@Ianfeather
Copy link

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.

@toorshia
Copy link
Owner

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
Now, the looks & feels of the actual alert - let's say I'd have to open up my sketchbook and visualize some kind of alert that could be practical and work nice for a user. I'll mock up something while you're busy updating JS ;) Happy forking!

@Ianfeather
Copy link
Author

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

@toorshia
Copy link
Owner

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.
What's your opinion on this?

@Ianfeather
Copy link
Author

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?

@DiogoDoreto
Copy link

I like the idea of a line crossing the gauge!

@toorshia
Copy link
Owner

toorshia commented Sep 7, 2012

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...

@tablatronix
Copy link

A threshold line would be a great addition, it could also be programmatically used as a peak value indicator for live meters.

@lmartins
Copy link

lmartins commented Jan 7, 2013

This is yet another feature I am looking for, happy to ear it is in the future plans for Justgage.
I'll try to adopt Ianfeather's work for now.

Thanks.

@toorshia
Copy link
Owner

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?

@kesy1984
Copy link

Really a cool tool, but where can i download the source code ? the demo http://bit.ly/15RBkKe is showing 404 error

@toorshia
Copy link
Owner

Updated, try that one :)

@kesy1984
Copy link

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.

@toorshia
Copy link
Owner

Hi,

I'll put this request under enhancements ;)

@tablatronix
Copy link

Can you put this on github so we can see it, and pull it ?

@toorshia
Copy link
Owner

Yeah, sure thing :)

@sankarasr
Copy link

Hello,
http://bit.ly/15RBkKe is showing 404. I wanted a speedometer kind of gauge with thresholds on which the pointer moves. Please inform if this is already implemented or will be implemented in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants