plotly / dash-daq

Control components for Dash
MIT License
141 stars 40 forks source link

Gauge - Incorrect value displayed if value outside range of gauge #113

Closed henrykeithturner closed 3 years ago

henrykeithturner commented 4 years ago

Hi all,

I've noticed that if the value plotted on daq.gauge exceeds the max or min value of the gauge, then the value displayed also sets to being equal to the max or min value, rather than displaying the actual value. This can be misleading when extreme instances occur. I've attached an example below, where the values are set outside the limits, causing incorrect numbers to be displayed.

I was also wondering if it would be better for the pointer to point slightly beyond the limits of the gauge in this case, to indicate the value has gone beyond the limit.

Thanks!

import dash
import dash_daq as daq
import dash_html_components as html

app = dash.Dash(__name__)

app.layout = html.Div([
    daq.Gauge(
        label="Value is greater than max limit",
        min=0,
        max=10,
        value=15,
        showCurrentValue=True,
    ),
    daq.Gauge(
        label="Value is lower than min limit",
        min=0,
        max=10,
        value=-5,
        showCurrentValue=True,
    ),
])

if __name__ == '__main__':
    app.run_server(debug=True)

image