Skip to content

Add Shape by Partition plugin 1.2.0 - #352

Open
MattArtzAnthro wants to merge 1 commit into
gephi:master-forgefrom
MattArtzAnthro:shape-by-partition-plugin
Open

MattArtzAnthro wants to merge 1 commit into
gephi:master-forgefrom
MattArtzAnthro:shape-by-partition-plugin

Conversation

@MattArtzAnthro

Copy link
Copy Markdown

New plugin or plugin update?

  • New Plugin
  • Update

What is the purpose of this plugin?

Shape by Partition draws each node in Preview as one of eight shapes (circle, square, triangle, diamond, star, cross, downward triangle, hexagon), chosen by the node's value in a categorical column: the shape equivalent of Appearance's colour by partition. It lets a map carry two categorical variables at once, for example colour for detected communities and shape for a known attribute, and it keeps categories readable in greyscale and for colour-blind readers.

  • Every shape has the area of the circle it replaces, so node size still reads the same across categories.
  • Categories are ordered by node count, largest first, the order Appearance uses for a partition, so colouring and shaping by the same column agree.
  • Edges and arrowheads meet each shape's outline rather than the circle Gephi assumes.
  • A legend beside the graph, in Preview and in PNG, SVG and PDF exports, says which shape stands for which category. Naming the column the node colours encode ("Colour legend column") adds a colour section. That section is drawn only when the column explains the colours exactly, because Gephi does not record which column colours came from.
  • Shapes appear in Preview and its exports; Overview keeps drawing circles.

How to test your plugin in Gephi?

  1. Install the built .nbm (Tools > Plugins > Downloaded > Add Plugins…) and restart Gephi.
  2. On the Welcome screen, open the sample Les Miserables.gexf.
  3. Go to Statistics and run Stat. Inference Clustering. It adds a node column Inferred Class (about five groups).
  4. In Appearance > Nodes > Partition, choose Modularity Class and click Apply.
  5. Open Preview. Under Nodes, set Shape partition column to Inferred Class, then click Refresh.
    • Expected: nodes are drawn as circles, squares, triangles, diamonds and stars, one shape per inferred class. A legend titled "Inferred Class" appears to the right of the graph with grey symbols (grey because colour encodes a different column).
  6. Set Colour legend column to Modularity Class, then Refresh.
    • Expected: the legend gains a "Modularity Class" section with one coloured circle per class, matching the node colours.
  7. Set Colour legend column to Degree (run Average Degree first if the column is missing), then Refresh.
    • Expected: no colour section, because degree does not explain the colours. Gephi's log (Help > Show Log Directory, messages.log) says which value broke the match.
  8. Set Shape legend title to any text and Refresh: the heading changes. Untick Shape legend: the legend disappears, and the shapes stay.
  9. Pan and zoom the Preview without clicking Refresh: shapes stay shapes.
  10. Export PNG, SVG and PDF (File > Export): shapes and the legend appear in all three.
  11. For arrowheads, open a directed network, tick Show Edges with arrows, and zoom in on a triangle or star: arrow tips touch the outline.

Checklist before submission

  • Did you merged with the master branch to get the latest updates?
  • Did you build and test the plugin successfully locally?
  • Did you include metadata (e.g. plugin author, license) in the pom.xml file
  • Did you make sure NOT to include any unnecessary files in your PR?
  • Did you write unit tests to test your plugin functionalities?

Built against Gephi 0.11.1 (gephi-plugin-parent 0.11.1) and tested in Gephi 0.11.3 on macOS: 85 unit tests (including drawing the legend into G2D, SVG and PDF targets), a branch-coverage floor, and the steps above run by hand on the bundled Les Misérables sample.


The plugin, its tests and this submission were worked out together with Claude, Anthropic's AI assistant. I built, ran, and verified everything on my own machine, and I am happy to re-run any of it.

Draws nodes in Preview as one of eight shapes chosen by a categorical column, fits edges and arrowheads to each shape, and adds a legend for shape and, optionally, colour.
@MattArtzAnthro

Copy link
Copy Markdown
Author

A note for when CI is approved here: it will fail before reaching this module, the same as other open PRs. Two existing poms (CircularLayout and OrderedLayout) each declare one dependency twice, and the Maven on GitHub's ubuntu-latest runner now rejects that while reading the project. #353 removes the duplicates (8 deletions, no plugin change). With it, the full build passes on the same runner. This module builds and passes its 85 tests on JDK 17, the version the PR workflow uses.

As with the PR, the diagnosis was worked out together with Claude, Anthropic's AI assistant. I built, ran, and verified everything on my own machine, and I am happy to re-run any of it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant