Skip to content

Commit 62cff98

Browse files
committed
Add edges for (strongly) connected components
1 parent 3fd7260 commit 62cff98

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

Python/Web/Dashboard/app.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -674,12 +674,12 @@ def getUTMProj(point: shapely.Point) -> int:
674674
"OMF" : [("omf.place_{}", lon.ScatterplotLayer)],
675675
},
676676
"conn_comp": {
677-
"OSM" : [("results.connected_components_{}_osm", lon.ScatterplotLayer)],
678-
"OMF" : [("results.connected_components_{}_omf", lon.ScatterplotLayer)],
677+
"OSM" : [("results.connected_components_{}_osm", lon.ScatterplotLayer), ("osm.edge_with_cost_{}", lon.PathLayer)],
678+
"OMF" : [("results.connected_components_{}_omf", lon.ScatterplotLayer), ("omf.edge_with_cost_{}", lon.PathLayer)],
679679
},
680680
"strongly_comp": {
681-
"OSM" : [("results.strong_components_{}_osm", lon.ScatterplotLayer)],
682-
"OMF" : [("results.strong_components_{}_omf", lon.ScatterplotLayer)],
681+
"OSM" : [("results.strong_components_{}_osm", lon.ScatterplotLayer), ("osm.edge_with_cost_{}", lon.PathLayer)],
682+
"OMF" : [("results.strong_components_{}_omf", lon.ScatterplotLayer), ("omf.edge_with_cost_{}", lon.PathLayer)],
683683
},
684684
"isolated_nodes": {
685685
"OSM" : [("results.isolated_nodes_{}_osm", lon.ScatterplotLayer)],
@@ -1915,7 +1915,7 @@ def colorRange():
19151915
# Check all layers
19161916
for layer in omfLayers + osmLayers:
19171917

1918-
# If the layer is of point type, we change with the appropriate
1918+
# If the layer is of type point, we change with the appropriate
19191919
if type(layer) == lon._layer.ScatterplotLayer:
19201920

19211921
if layer in omfLayers:
@@ -1937,6 +1937,17 @@ def colorRange():
19371937
values = gdfcopy["id"],
19381938
cmap = colorMap
19391939
)
1940+
1941+
# Edges with cost for connected components
1942+
if type(layer) == lon._layer.PathLayer:
1943+
# Line color and width
1944+
colorLine = getColorFromColorPicker(colorPickerLine)
1945+
1946+
width = input.width_min_pixels()
1947+
1948+
layer.width_min_pixels = width
1949+
1950+
layer.get_color = colorLine
19401951

19411952

19421953
### Components Dataframe modification handler ###

0 commit comments

Comments
 (0)