示例#1
0
def update_output_divi(asdf):
    b = a[a.iloc[:, 1] == asdf]['1'].values[0]
    c = f"digraph {b}"

    return dash_interactive_graphviz.DashInteractiveGraphviz(
        id="graph",
        dot_source=c,
        style={
            'display': 'inline-block',
            'height': '600px'
        })
示例#2
0
     [
         dbc.Button("Generuj drzewo",
                    id="create_tree_button",
                    color="secondary"),
         dbc.Button("Wynik .DOT",
                    id="positioned-toast-toggle-dot",
                    color="success"),
         dbc.Button("Wynik .JSON",
                    id="positioned-toast-toggle-json",
                    color="warning"),
         dbc.Button("Wynik .XML",
                    id="positioned-toast-toggle-xml",
                    color="danger"),
         dash_interactive_graphviz.DashInteractiveGraphviz(
             id="tree",
             dot_source=dot_source,
             style={
                 'height': '75vh',
             }),
     ],
     md=12,
 ),
 dbc.Toast(
     "DOT",
     id="positioned-toast-dot",
     header="DOT",
     is_open=False,
     dismissable=True,
     icon="success",
     style={
         "position": "fixed",
         "top": 66,
app = dash.Dash(__name__)

# A simple list of edges
edges = [
    ("a", "b"),
    ("a", "c"),
    ("c", "b"),
    ("b", "a"),
]


app.layout = html.Div(
    [
        html.Div(
            dash_interactive_graphviz.DashInteractiveGraphviz(id="gv", dot_source="edges"),
            style=dict(flexGrow=1, position="relative"),
        )        
    ],
    style=dict(position="absolute", height="100%", width="100%", display="flex"),
)




@app.callback(
    Output("gv", "dot_source"),
    Input("gv", "selected_node"),
    Input("gv", "selected_edge"),
)
def show_graph(selected_node, selected_edge):
示例#4
0
"""
An example showing how to highlight a node on sleection
"""
import dash_interactive_graphviz
import dash
from dash.dependencies import Input, Output
import dash_html_components as html
import dash_core_components as dcc

app = dash.Dash(__name__)

app.layout = html.Div(
    [
        html.Div(
            dash_interactive_graphviz.DashInteractiveGraphviz(id="gv"),
            style=dict(flexGrow=1, position="relative"),
        )
    ],
    style=dict(position="absolute",
               height="100%",
               width="100%",
               display="flex"),
)

# A simple list of edges
edges = [
    ("a", "b"),
    ("a", "c"),
    ("c", "b"),
    ("b", "a"),
]
示例#5
0
                    html.Div(id='div-differences', children=''),
                ]),
                style={'backgroundColor': 'rgba(232, 236, 241, 1)'}, className='mt-1'
            )
        ], width=3),

        dbc.Col([
            dcc.Slider(
                id='window-slider',
                step=None,
                included=False,
                min=0,
                max=0,
                value=0,
                marks={}),
            dash_interactive_graphviz.DashInteractiveGraphviz(id="current-model", dot_source=''),
        ], width=9, style={'height': '75vh'})
    ], className='mt-1'),

    dbc.Row([
        dbc.Col([
            html.Div(id='status-ipdd', style={'display': 'none'}),
            html.Div(id='diff', style={'display': 'none'}),

            dcc.Interval(
                id='check-ipdd-finished',
                interval=1 * 1000,  # in milliseconds
                n_intervals=0,
                disabled=True)
        ])
    ]),