TideGatesApp
Bases: BootstrapTemplate
The web application is based on the Bootstrap template provided by Panel. It displays a map (an instance of the TGMap class) in the sidebar. The main content area has a Tabs widget with five tabs: a welcome message, a help page, the main page (described below) and two tabs for displaying outputs.
The application also displays several small help buttons next to the main widgets. Clicking one of these buttons brings up a floating window with information about the widget.
The main tab (labeled "Start") displays the widgets that allow the user to specify optimization parameters: region names, budget levels, and restoration targets. It also has a Run button. When the user clicks this button the callback function makes sure the necessary parameters have been defined and then uses the template's modal dialog area. Clicking the "OK" button in that dialog invokes another callback, defined here, that runs the optimizer.
| Parameters: |
|
|---|
Source code in src/tidegates/widgets.py
837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 | |
section_head(s, b=None)
Create an HTML header for one of the sections in the Start tab.
src/tidegates/widgets.py
938 939 940 941 942 943 | |
validate_settings(_)
Callback function invoked when the user clicks the Run Optimizer button.
src/tidegates/widgets.py
945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 | |
run_optimizer(_)
Callback function invoked when the user clicks the Continue button after verifying the parameter options.
Use the settings in the budget widgets to figure out the sequence of budget levels to use. Instantiate an OP object with the budget settings and values from the other parameter widgets, then use that widget to run OptiPass.
src/tidegates/widgets.py
964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 | |
add_output_pane(op=None)
After running OptiPass call this method to add tabs to the main panel to show the results.
| Parameters: |
|
|---|
src/tidegates/widgets.py
1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 | |
map_help_cb(_)
Callback function for the help button next to the map in the sidebar.
src/tidegates/widgets.py
1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 | |
region_help_cb(_)
Callback function for the help button next to the region box widget in the start tab.
src/tidegates/widgets.py
1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 | |
budget_help_cb(_)
Callback function for the help button next to the budget box widget in the start tab.
src/tidegates/widgets.py
1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 | |
target_help_cb(_)
Callback function for the help button next to the target box widget in the start tab.
src/tidegates/widgets.py
1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 | |
climate_help_cb(_)
Callback function for the help button next to the climate scenario checkbox in the start tab.
src/tidegates/widgets.py
1086 1087 1088 1089 1090 1091 1092 1093 1094 | |