ranking = model.getRanking(ranking.getElementType(), ranking.getName());
Workspace workspace = model.getWorkspace();
GraphModel graphModel = graphController.getGraphModel(workspace);
Graph graph = graphModel.getGraphVisible();
Interpolator interpolator = model.getInterpolator();
if (ranking.getElementType().equals(Ranking.NODE_ELEMENT)) {
for (Node node : graph.getNodes()) {
Number value = ranking.getValue(node);
if (value != null) {
float normalizedValue = ranking.normalize(value);
if (transformer.isInBounds(normalizedValue)) {
normalizedValue = interpolator.interpolate(normalizedValue);
transformer.transform(node, normalizedValue);
}
}
}
} else if (ranking.getElementType().equals(Ranking.EDGE_ELEMENT)) {
for (Edge edge : graph.getEdges()) {
Number value = ranking.getValue(edge);
if (value != null) {
float normalizedValue = ranking.normalize(value);
if (transformer.isInBounds(normalizedValue)) {
normalizedValue = interpolator.interpolate(normalizedValue);
transformer.transform(edge, normalizedValue);
}
}
}
}