# Takes a node field or attribute as a parameter # Resizes nodes based on their value for that field def adjustSizes(attribute): range = 1.0*(attribute.max - attribute.min) if(range != 0.0): for node in g.nodes: percentile = (node.__getattr__(str(attribute))*1.0 - attribute.min) / range node.height = node.width = percentile*50.0