sibvisions / gauges Goto Github PK
View Code? Open in Web Editor NEWA collection of SVG based gauges.
License: Apache License 2.0
A collection of SVG based gauges.
License: Apache License 2.0
Sometimes not all limits are required and thus not set. Anyway this should be covered correctly.
Consider max: 20,
for
steps: [null,null,null,18] - doesn´t work for values x < 18 (color should be colorOK, but is colorWarning)
steps: [2,null,null,18] - doesn´t work for values 2 < x < 18 (color should be colorOK, but is colorWarning)
steps: [null,4,16,null] - for every value colorError, even if no error limit set. colorWarning never shown
I realized while debugging, that ifs aren´t evaluated correctly with null values in getColor(value, steps) method.
Maybe you can use as inspiration our Swing implementation:
double value = Math.max(gauge.minValue, Math.min(gauge.maxValue, ((Number)dataRow.getValue(columnName)).doubleValue()));
if (!Double.isNaN(gauge.minErrorValue) && value <= gauge.minErrorValue)
{
((RingPlot)plot).setSectionPaint("VALUE", LIGHT_RED);
}
else if (!Double.isNaN(gauge.minWarningValue) && value <= gauge.minWarningValue)
{
((RingPlot)plot).setSectionPaint("VALUE", LIGHT_ORANGE);
}
else if (!Double.isNaN(gauge.maxErrorValue) && value >= gauge.maxErrorValue)
{
((RingPlot)plot).setSectionPaint("VALUE", LIGHT_RED);
}
else if (!Double.isNaN(gauge.maxWarningValue) && value >= gauge.maxWarningValue)
{
((RingPlot)plot).setSectionPaint("VALUE", LIGHT_ORANGE);
}
else
{
((RingPlot)plot).setSectionPaint("VALUE", LIGHT_GREEN);
}
I've just implemented a multi-factor-authentication which uses a gauge as a timer, we want to display the remaining time in the middle of the ring gauge in the format "mm:ss". Currently only numbers are accepted in the value property.
It would be nice if there was an additional property for displaying values, like in my case instead of only seconds in "mm:ss" format and a property for calculating like the value property does right now.
In SpeedometerGauge and MeterGauge the axis label does not change, if max or min is changed in configuration and set with gauge.update(state.configurationJson);
Also the needle stays on wrong position, until the value changes in configuration.
If I try to resize Safari (only height), the ring doesn't resize.... works in Chrome without problems.
see video:
https://user-images.githubusercontent.com/1307043/172796212-d881f99f-93c4-4742-8d7a-4e1edbe59853.mp4
For now all gauges are drawing from zero to max.
It should be quite simple to support any min value.
all values just have to be calculated with -min.
so value - min, max - min, minWarning - min, ...
Just for displaying the original min value and max value has to be shown.
If we change the max value of a ring, it won't change or it doesn't update the max - not sure.
Start with e.g. 300000 and after e.g. 3 seconds, change the max to 60000 -> the ring shows the value but doesn't recognize the new max.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.