Skip to content

How to make RankingLabelSizeTransformer work? #1606

Closed
@Kalethars

Description

    Column nodeSizeCol = graphModel.getNodeTable().getColumn("Weight");
    Function sizeRanking = appearanceModel.getNodeFunction(graph, nodeSizeCol, RankingNodeSizeTransformer.class);
    RankingNodeSizeTransformer sizeTransformer = (RankingNodeSizeTransformer) sizeRanking.getTransformer();
    sizeTransformer.setMaxSize(80);
    sizeTransformer.setMinSize(10);
    appearanceController.transform(sizeRanking);


    Column labelSizeCol = graphModel.getNodeTable().getColumn("Weight");
    Function sizeRanking2 = appearanceModel.getNodeFunction(graph, labelSizeCol, RankingLabelSizeTransformer.class);
    RankingLabelSizeTransformer sizeTransformer2 = (RankingLabelSizeTransformer) sizeRanking2.getTransformer();
    sizeTransformer2.setMaxSize(4);
    sizeTransformer2.setMinSize(1);
    appearanceController.transform(sizeRanking2);


    model.getProperties().putValue(PreviewProperty.SHOW_NODE_LABELS, Boolean.TRUE);
    model.getProperties().putValue(PreviewProperty.NODE_LABEL_FONT, new java.awt.Font("Comic Sans MS", 0, 12));
    model.getProperties().putValue(PreviewProperty.NODE_LABEL_PROPORTIONAL_SIZE, Boolean.FALSE);

I have written these codes, and I find the node sizes change while the label sizes are 12. I have tried this in Gephi GUI and it works well. How can I make label size adjustment work?

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions