Skip to content

Comments

feat: enable custom graph model input#67

Closed
powlaa wants to merge 2 commits intoiurysza:mainfrom
powlaa:feat/enable-input-of-graphmodels
Closed

feat: enable custom graph model input#67
powlaa wants to merge 2 commits intoiurysza:mainfrom
powlaa:feat/enable-input-of-graphmodels

Conversation

@powlaa
Copy link
Contributor

@powlaa powlaa commented Oct 24, 2025

🚀 Description

Adds support for providing a custom graph model input so that the task can be extended to render a custom graph. Previously, the plugin only allowed generation of graphs based on the detected module relationships within a Gradle project.

To enable this, I have changed the visibility from internal to public for:

  • graphModels and projectDirectory since these are the fields that need to be set
  • Module and GraphParseResult to allow import of these classes in order to create the necessary data structure
  • GraphConfig.Builder.build() to enable creation of a GraphConfig object

📄 Motivation and Context

In some scenarios, users may want to visualise relationships beyond Gradle's built-in module model, i. e. external dependencies. By allowing a custom graph model to be provided, the plugin can now support these extended use cases without affecting existing functionality.

🧪 How Has This Been Tested?

  • Tested locally with both
    • Standard Gradle projects (no custom graph input) to verify graphs continue to generate as before
    • Custom Graph model input to confirm correct Mermaid graph output (using the sample given in the README.md)

📦 Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

✅ Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@iurysza
Copy link
Owner

iurysza commented Nov 18, 2025

Hey @powlaa, thanks for the PR.

A few thoughts:
The README example shows a hardcoded graph. Help me understand the real scenario. Are you generating this from external sources dynamically? If it's static, I wonder if pure Mermaid snippet might be simpler.

Now as for the API design, exposing these internals increase our API by a lot, which limits future refactoring (without breaking changes). I wonder if having a specific configuration for this would work better.

Cheers

@iurysza
Copy link
Owner

iurysza commented Dec 15, 2025

Closing for now. ✌️

@iurysza iurysza closed this Dec 15, 2025
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.

2 participants