Better edge width

topo-mov
LEdoian 1 year ago
parent 12b0c6578e
commit 6842020551

@ -225,9 +225,10 @@ class PlaceUnplacedVertices(StyleAnnotator):
return result
def _default_width_for_cost(cost):
from math import log2
if cost <= 2: return 1
return int(log2(cost))
# Maybe use exponential decay?
if cost > 0: return 10/cost
# As thin as possible for no-weight edges (e.g. network → router)
return 0
class EdgeWidthByCost(StyleAnnotator):
idempotent = True
def __init__(self, param):

Loading…
Cancel
Save