Example #1
0
def disasternamesgetter():
    global df_dis
    try:
        df_dis = ResilDashboard.FEMADisasters(statewidget.value)
        disaster_list = list(set(df_dis.title))
        disaster_list.append('All')
        disasterwidget.options = disaster_list
        disasterwidget.value = 'All'
    except Exception:
        disasterwidget.options = ['All']
        disasterwidget.value = 'All'
Example #2
0
def filterrunner(stateinput, zipinput, searchinput):
    grid = ResilDashboard.DsireFilterer(dsire, stateinput, zipinput,
                                        searchinput)
    grid.set_index('Program Name', inplace=True)
    grid = grid[[
        'Implementing Sector', 'Program Category', 'Program Type',
        'Technology Type', 'Energy Category'
    ]]
    col_options = {
        'width': 80,
    }
    col_defs = {
        'Program Name': {
            'width': 400,
        }
    }

    qgrid_widget = qgrid.show_grid(grid,
                                   column_options=col_options,
                                   column_definitions=col_defs,
                                   show_toolbar=False)
    display(qgrid_widget)
    disasternamesgetter()
Example #3
0
def gasrunner(stateinput, zipinput):
    plot = ResilDashboard.ElectricityorGasPlotter(state=stateinput,
                                                  zipcode=zipinput,
                                                  resource='Gas')
    display(HTML(plot))
Example #4
0
def maprunner(stateinput, disasterinput):
    html = ResilDashboard.FEMAMapper(state=stateinput,
                                     disaster_name=disasterinput,
                                     df_dis=df_dis)
    display(HTML(html))
Example #5
0
def ratesrunner(stateinput):
    plot = ResilDashboard.UtilityRatesPlotter(state=stateinput)
    display(HTML(plot))
Example #6
0
def resourcemixrunner(stateinput):
    plot = ResilDashboard.ResourceMixPlotter(state=stateinput)
    display(HTML(plot))
Example #7
0
import ResilDashboard
import warnings
import qgrid
warnings.filterwarnings("ignore")

from IPython.core.display import display, HTML
display(HTML("<style>.container { width:85% !important; }</style>"))
display(
    HTML(
        "<style>.output_wrapper, .output {height:auto !important; max-height:5000px;}.output_scroll {box-shadow:none !important; webkit-box-shadow:none !important;}</style>"
    ))

style = {'description_width': '150px'}
layout = {'width': '300px'}

dsire = ResilDashboard.NewDsireChecker()


def dsirelinkapplier(row):
    id_ = row.id
    name_ = row['Program Name']
    link = f'<a href = "http://programs.dsireusa.org/system/program/detail/{id_}" target="_blank">{name_}</a>'
    return link


dsire['Program Name'] = dsire.apply(dsirelinkapplier, axis=1)

states = sorted(list(set(dsire['State'])))

statewidget = widgets.Select(options=states,
                             value='Florida',