You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a new idea about autorefresh, that is trigger.
We already have the autorefresh function. If triggers are added to this function, then the dashboard will be equivalent to adding many, many possibilities. Rather than explain this feature first, I will give you an example of a possible configuration to give you an idea of how powerful it can be.
here is our chart config:
events-source:
title: Number of events by source
db: jobs
query: SELECT source, count(*) as count FROM events WHERE TRUE [[ AND date >= date(:date_start) ]] [[ AND date <= date(:date_end) ]] GROUP BY source ORDER BY count DESC
library: vega-lite
display:
mark: { type: arc, tooltip: true }
encoding:
color: { field: source, type: nominal }
theta: { field: count, type: quantitative }
if we enable autorefresh, the page will auto reload after a period of time. That time spot is the key magic comes in. We may add config to this part
action:
def trigger_action(row):
if row.count > 3:
do_sth() # alerts, actions connect to other system, or anything you want!
else:
pass
Of course, I'm a bit fanciful. If python can be supported here, it will bring many, many possibilities. But considering that the workload here is relatively large, it may be very difficult to implement.
If we don't use python, but just use javascript to accomplish this, like this:
action:
function trigger_action(row){
if(row.count > 3){
fetch(....) // it is just a webhook concept!
}
}
then we just put the function to setInterval()!
It’s just that javascript has to deal with issues such as cross-domain issues.
However, we can not think about how to implement this first, but first imagine this function beautifully.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi @rclement how are you doing 😄
I have a new idea about
autorefresh
, that is trigger.We already have the autorefresh function. If triggers are added to this function, then the dashboard will be equivalent to adding many, many possibilities. Rather than explain this feature first, I will give you an example of a possible configuration to give you an idea of how powerful it can be.
here is our chart config:
if we enable
autorefresh
, the page will auto reload after a period of time. That time spot is the key magic comes in. We may add config to this partOf course, I'm a bit fanciful. If python can be supported here, it will bring many, many possibilities. But considering that the workload here is relatively large, it may be very difficult to implement.
If we don't use python, but just use javascript to accomplish this, like this:
then we just put the function to
setInterval()
!It’s just that javascript has to deal with issues such as cross-domain issues.
However, we can not think about how to implement this first, but first imagine this function beautifully.
Beta Was this translation helpful? Give feedback.
All reactions