Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
direct changes in ui
Browse files Browse the repository at this point in the history
  • Loading branch information
iopapamanoglou committed Oct 23, 2024
1 parent 6ff340d commit 3262529
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/faebryk/exporters/visualize/interactive_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def add_node_type(self, node_type: str, color: str):
# If 'greedy', uses heuristic to find feedback arc set
"acyclicer": None,
# Algorithm to assign rank to nodes: 'network-simplex', 'tight-tree' or 'longest-path'

Check failure on line 136 in src/faebryk/exporters/visualize/interactive_params.py

View workflow job for this annotation

GitHub Actions / pytest

Ruff (E501)

src/faebryk/exporters/visualize/interactive_params.py:136:89: E501 Line too long (90 > 88)
"ranker": None,
"ranker": "tight-tree",
# Number of ranks to keep between source and target of the edge
# "minLen": lambda edge: 1,
# Higher weight edges are generally made shorter and straighter
Expand Down Expand Up @@ -190,19 +190,17 @@ def buttons(layout: Layout):
{"label": "longest-path", "value": "longest-path"},
],
),
html.Button("Apply Changes", id="apply-changes-button"),
],
)
layout.div_children.insert(-2, html_controls)

@app.callback(
Output("graph-view", "layout"),
Input("apply-changes-button", "n_clicks"),
State("layout-radio", "value"),
State("layout-dagre-ranker", "value"),
Input("layout-radio", "value"),
Input("layout-dagre-ranker", "value"),
State("graph-view", "layout"),
)
def absolute_layout(n_clicks, layout_radio, layout_dagre_ranker, current_layout):
def absolute_layout(layout_radio, layout_dagre_ranker, current_layout):
print(layout_radio, layout_dagre_ranker)
layout.set_type(layout_radio, current_layout)

Expand Down
2 changes: 1 addition & 1 deletion test/core/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ def test_visualize_chain():
else:
import typer

typer.run(test_visualize_chain)
typer.run(test_visualize)

0 comments on commit 3262529

Please sign in to comment.