Beispiel #1
0
def update_table(chem_dropdown_value):
    """
    Update the table rows.

    :params chem_dropdown_values: selected dropdown values
    """

    return make_dash_table(chem_dropdown_value, df)
Beispiel #2
0
def highlight_molecule(from_chem_dropdown_values, to_chem_dropdown_values,
                       plot_type):
    """
    Selected chemical dropdown values handler.

    :params chem_dropdown_values: selected dropdown values
    :params plot_type: selected plot graph
    """
    global dfs_tracker
    df = dfs_tracker['df']
    chem_dropdown_values = []
    if from_chem_dropdown_values:
        if isinstance(from_chem_dropdown_values, str):
            from_chem_dropdown_values = [from_chem_dropdown_values]
        chem_dropdown_values += from_chem_dropdown_values
    if to_chem_dropdown_values:
        if isinstance(to_chem_dropdown_values, str):
            to_chem_dropdown_values = [to_chem_dropdown_values]
        chem_dropdown_values += to_chem_dropdown_values

    plot = create_plot(x=df["D1"],
                       y=df["D2"],
                       z=df["D3"],
                       size=df["Size"],
                       color=df["Mw"],
                       name=df["Name"],
                       markers=chem_dropdown_values,
                       plot_type=plot_type,
                       interp_dict=interp_dict)

    data_holder = interp_dict['global_data']
    extra_sel = []
    extra_df = None
    if (from_chem_dropdown_values[0] != 'NULL'
            and to_chem_dropdown_values[0] != 'NULL'):
        extra_sel = data_holder['generated'][:]
        extra_df = pd.DataFrame(extra_sel,
                                columns=['NAME', 'PAGE', 'SMILES', 'DESC'])

    return [
        plot,
        make_dash_table(
            to_chem_dropdown_values + extra_sel + from_chem_dropdown_values,
            df, extra_df)
    ]
Beispiel #3
0
                                            target="_blank",
                                        ),
                                        html.P(DRUG_DESCRIPTION, id="chem_desc"),
                                    ],
                                    className="chem__desc__container",
                                ),
                            ],
                            className="one-third column",
                        ),
                    ],
                    className="container card app__content bg-white",
                ),
                html.Div(
                    [
                        html.Table(
                            make_dash_table([STARTING_DRUG], df),
                            id="table-element",
                            className="table__container",
                        )
                    ],
                    className="container bg-white p-0",
                ),
            ],
            className="app__container",
        ),
    ]
)


def df_row_from_hover(hoverData):
    """ Returns row for hover point as a Pandas Series. """
Beispiel #4
0
def update_table():
    return make_dash_table()
Beispiel #5
0
         dcc.Dropdown(
             id="chem_dropdown",
             multi=False,
             options=[{
                 "label": i,
                 "value": i
             } for i in ticker_list],
             placeholder="Select a ticker...",
         )
     ],
     className="app__dropdown",
 ),
 html.Div(
     [
         html.Table(
             make_dash_table(),
             id="table-element",
             className="table__container",
         )
     ],
     className="container bg-white p-0",
 ),
 html.Div(
     [
         html.Div(
             [
                 html.H5(
                     "Price history since before the panic (~Feb. 20th)",
                 ),
                 html.H6(id="quote-and-change",
                         children="SPY: $" + str(current_price) +