Package org.gephi.ranking.api

Examples of org.gephi.ranking.api.Interpolator


        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);
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.gephi.ranking.api.Interpolator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.