Closed FabienLelaquais closed 5 months ago
Any hint ?
Google charts has a wrapper for React: https://github.com/RakanNimer/react-google-charts a bit big and redundant with plotly.js but well supported and it looks like it is possible to load only part of the whole package https://developers.google.com/chart A big drawback is that this google visualization library cannot be used offline ! https://developers.google.com/chart/interactive/faq#offline
Another candidate would be https://martin36.github.io/react-gauge-chart/ which provides a unique and configurable gauge
We could also design our own ;-) SVG is fun ;-)
or wrap a set of SVG/js components
Plotly also provides gauge: https://plotly.com/python/gauge-charts/
It does indeed (and even in js https://plotly.com/javascript/gauge-charts/)
On Thu, Oct 5, 2023 at 1:53 PM FlorianJacta @.***> wrote:
Plotly also provides gauge: https://plotly.com/python/gauge-charts/
— Reply to this email directly, view it on GitHub https://github.com/Avaiga/taipy/issues/551, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVQBA5AQS7E3N3ZLXLP5FUTX52NURAVCNFSM5OOQJ2FKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZUHA3TGMZZGYZA . You are receiving this because you were assigned.Message ID: @.***>
So that what we'll use. Thanks @FlorianJacta
plotly provides only one type of gauge (indicator) Private Zenhub Image
In the develop version for 3.1, it is possible to create gauges through the chart:
import plotly.graph_objects as go
from taipy.gui import Gui
fig = go.Figure(go.Indicator(
domain = {'x': [0, 1], 'y': [0, 1]},
value = 450,
mode = "gauge+number+delta",
title = {'text': "Speed"},
delta = {'reference': 380},
gauge = {'axis': {'range': [None, 500]},
'steps' : [
{'range': [0, 250], 'color': "lightgray"},
{'range': [250, 400], 'color': "gray"}],
'threshold' : {'line': {'color': "red", 'width': 4}, 'thickness': 0.75, 'value': 490}}))
Gui('<|chart|figure={fig}|>').run()
@FabienLelaquais
I want either to be able to create a metric (no gauge, just numbers):
(For me, the "metric" is the easiest to use in applications and the most useful.)
Or a gauge:
The goal is to be UX user-friendly and look nice with the Style kit. This is useful to display metrics/KPI like in these examples:
In my experience, end users frequently asked a mouse over text to explain how to interpret a KPI. It could make sense to add an optional description as a text property.
What would that feature address
Synthetical representation of complex datasets if am excellent feature to propose to end users: one simple graphical object can represent a value, a trend, that can be understood in a glance. We want to come up with a minimal set of easy-to-configure controls that can be used in such a Business User context.
Description of the ideal solution
A minimal set of highly customizable controls can be used just like any other control to represent such synthetic views of some data.
See if Plotly Express gauges could be a temporary workaround.
From the Taipy GUI standpoint, the initial proposal is:
this element has the following properties:
printf
format string applied to value. Default :no format.printf
format string applied to delta. Default :no format.Use cases:
<|50|metrics|>
<|50|metrics|type=linear|>
<|50|metrics|type=none|>
<|50|metrics|min=-100|max=100|>
<|20|metrics|type=linear|delta=5|>
<|50|metrics|format=%.2f%%|>
Acceptance Criteria