Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IRISCC-Dashboard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KIT
imkasf-top
IRISCC-Dashboard
Commits
eba42795
Commit
eba42795
authored
1 week ago
by
Florian Obersteiner
Browse files
Options
Downloads
Patches
Plain Diff
auto-disable checkbox if no data
parent
cb27d6d9
No related branches found
No related tags found
1 merge request
!11
draft auto-deployment
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/callbacks.py
+22
-2
22 additions, 2 deletions
src/callbacks.py
with
22 additions
and
2 deletions
src/callbacks.py
+
22
−
2
View file @
eba42795
...
...
@@ -3,8 +3,7 @@ import logging as log
import
pandas
as
pd
import
plotly.graph_objects
as
go
import
xarray
as
xr
from
dash
import
Dash
from
dash.dependencies
import
Input
,
Output
from
dash
import
Dash
,
Input
,
Output
,
State
from
plotly.subplots
import
make_subplots
...
...
@@ -237,3 +236,24 @@ def register_timeseries_plot(app: Dash, timeseries_data: pd.DataFrame, var_info:
fig_ts
.
update_yaxes
(
title
=
f
"
{
secondary_variable
}
{
unit_secondary
}
"
,
secondary_y
=
True
)
return
[
fig_ts
]
def
register_trajdatamissing_response
(
app
:
Dash
):
"""
Register callback to Disable the
"
show trajectories
"
checkbox if there is no
trajectory data.
"""
@app.callback
(
Output
(
"
trajectories-checkbox
"
,
"
value
"
),
Input
(
"
confirm-trajdata-warning
"
,
"
submit_n_clicks
"
),
# need at least on input field for the callback to work
State
(
"
trajectories-checkbox
"
,
"
value
"
),
)
def
handle_confirmation_response
(
submit_clicks
,
current_values
):
if
current_values
is
None
:
return
[]
if
current_values
[
0
]
==
1
:
return
[]
return
current_values
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment