Пример #1
0
# ----------------------------------------------------------------------------
# Load the demo data from ChemMD.
nmr_nodes = [loaders.node_demo_by_key("SIPOS_NMR"), ]

main_df, metadata_df, metadata_dict = chemmd.io.output.prepare_nodes_for_bokeh(
    loaders.NMR_GROUPS["x_groups"],
    loaders.NMR_GROUPS["y_groups"],
    nmr_nodes)


# ----------------------------------------------------------------------------
# Table creation
# ----------------------------------------------------------------------------
table = table_layout(
    loaders.NMR_GROUPS["x_groups"],
    loaders.NMR_GROUPS["y_groups"],
    main_df,
    metadata_df,
    metadata_dict)

table_panel = bk.models.Panel(child=table, title="Data Table")


# ----------------------------------------------------------------------------
# Tab creation
# ----------------------------------------------------------------------------
tabs = bk.models.widgets.Tabs(tabs=[table_panel])

# Add the created tabs to the current document.
bk.io.curdoc().add_root(tabs)
Пример #2
0
    raise FileNotFoundError

try:
    # Prepare those created nodes for Bokeh.
    main_df, metadata_df, metadata_dict = chemmd.io.output.prepare_nodes_for_bokeh(
        groups["x_groups"], groups["y_groups"], nodes)

except Exception as error:
    # Log the error.
    logger.error(f"Unable to parse the data for display, " f"due to {error}")
    raise error

# ----------------------------------------------------------------------------
# Table creation
# ----------------------------------------------------------------------------
table = table_layout(groups["x_groups"], groups["y_groups"], main_df,
                     metadata_df, metadata_dict)
table_panel = bk.models.Panel(child=table, title="Data Table")

# ----------------------------------------------------------------------------
# Scatter plot creation
# ----------------------------------------------------------------------------
scatter = scatter_layout(groups["x_groups"], groups["y_groups"], main_df,
                         metadata_df, metadata_dict)
scatter_panel = bk.models.Panel(child=table, title="Scatter")

# ----------------------------------------------------------------------------
# Tab creation
# ----------------------------------------------------------------------------
tabs = bk.models.widgets.Tabs(tabs=[table_panel, scatter_panel])
# Add the created tabs to the current document.
bk.io.curdoc().add_root(tabs)