ferstl / depgraph-maven-plugin

A Maven plugin that generates dependency graphs in various formats (DOT, GML, PlantUML, JSON and Text)
Apache License 2.0
561 stars 85 forks source link

Styling is badly-documented #169

Closed kevinwright closed 1 year ago

kevinwright commented 1 year ago

Starting with https://github.com/ferstl/depgraph-maven-plugin/wiki/Styling I first tried the following styling json file

{
  "node-styles": {
    "some.group.id": {
      "fill-color": "blue"
    }
  }
}

Only to be treated to the thoroughly unhelpful error:

[ERROR] Failed to execute goal com.github.ferstl:depgraph-maven-plugin:4.0.2:aggregate (default-cli) on project *****: Execution default-cli of goal com.github.ferstl:depgraph-maven-plugin:4.0.2:aggregate failed: Unable to read style configuration file:/***/mkDepGraphTheme.json.
[ERROR] Location: line 3, column 11
[ERROR] Details: Missing type id when trying to resolve subtype of [simple type, class com.github.ferstl.depgraph.dependency.dot.style.AbstractNode]: missing type id property 'type' (for POJO property 'node-styles')

On further investigation it turns out that we have to specify "type": "box" (or whatever). This has the impact of losing the default rounded corners, requiring an additional "style": "filled, rounded" to bring them back.

The page also tells an outright lie in claiming that the color property on nodes sets the text color when it actually sets the border color. To set the text color you have to specify e.g. "default-font": { "color": "red" }

It would be really helpful if the wiki page did a better job of explaining all this, and provided the json style file responsible for the example output given at the top.

ferstl commented 1 year ago

Hi @kevinwright Thank you for pointing out the ambiguity regarding the type attribute and the wrong documentation about the outline color. I enhanced the documentation a bit by adding that the type attribute is mandatory in node stylings. I did also see that you made the correction about the outline color. Thank you for that too.

As a feedback from my side I would suggest that you choose your words more wisely when reporting issues to this project. Calling the styling feature "badly documented" is your personal opinion. If you find any mistakes or ambiguities, feel free to create an issue and report them. I will do as much as I can to help. Calling a mistake in the documentation a "an outright lie" is kind of a bold statement. I cannot reconstruct anymore why this mistake was there but it was certainly not intentional.

I put a lot of my private free time into this plugin and into the documentation. You on the other hand can use this project as is and free of charge. This is all you get. If you are not happy with it, feel free to: