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