mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-04-25 07:52:35 +02:00
Added a nan handling for network kpis and an scaler. (#568)
Added a nan handling for network kpis and an scaler.
This commit is contained in:
commit
2f0fe65b59
@ -128,7 +128,14 @@ def create_2d_graph( # noqa PLR0913
|
|||||||
|
|
||||||
# Highlight the Node Size with regard to the selected Metric.
|
# Highlight the Node Size with regard to the selected Metric.
|
||||||
if metric not in ("None", "Ohne"):
|
if metric not in ("None", "Ohne"):
|
||||||
node_trace.marker.size = list(np.sqrt(metrics[metric]) * 200)
|
sqrt = np.sqrt(metrics[metric].fillna(0))
|
||||||
|
min_value = sqrt.min()
|
||||||
|
max_value = sqrt.max()
|
||||||
|
if min_value == max_value or min_value is max_value:
|
||||||
|
min_value = 0
|
||||||
|
max_value = 0.5
|
||||||
|
results = (((sqrt - min_value) / (max_value - min_value)) + 0.25) * 20
|
||||||
|
node_trace.marker.size = list(results)
|
||||||
|
|
||||||
# Add Relation_Type as a Description for the edges.
|
# Add Relation_Type as a Description for the edges.
|
||||||
if edge_annotation is True: # this code be moved and used as hover data
|
if edge_annotation is True: # this code be moved and used as hover data
|
||||||
|
@ -174,7 +174,14 @@ def create_3d_graph( # noqa : PLR0913
|
|||||||
|
|
||||||
# Highlight the Node Size with regard to the selected Metric.
|
# Highlight the Node Size with regard to the selected Metric.
|
||||||
if metric not in ("None", "Ohne"):
|
if metric not in ("None", "Ohne"):
|
||||||
node_trace.marker.size = list(np.cbrt(metrics[metric]) * 200)
|
sqrt = np.cbrt(metrics[metric].fillna(0))
|
||||||
|
min_value = sqrt.min()
|
||||||
|
max_value = sqrt.max()
|
||||||
|
if min_value == max_value or min_value is max_value:
|
||||||
|
min_value = 0
|
||||||
|
max_value = 1
|
||||||
|
results = (((sqrt - min_value) / (max_value - min_value)) + 0.25) * 20
|
||||||
|
node_trace.marker.size = list(results)
|
||||||
|
|
||||||
# Set the Color and width of Edges for better highlighting.
|
# Set the Color and width of Edges for better highlighting.
|
||||||
edge_trace.line = {"color": "rgb(255,105,180)", "width": edge_thickness}
|
edge_trace.line = {"color": "rgb(255,105,180)", "width": edge_thickness}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user