Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't fill plain shaped nodes #10172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

makelinux
Copy link
Contributor

@makelinux makelinux commented Jul 6, 2023

for configuration with
DOT_NODE_ATTR = shape=plaintext

because filling is intended for record or box shaped Graphviz nodes.
Plain shaped root node is already highlighted with bold font
and Truncated is already marked with italic font
in function DotNode::writeLabel.

Mark Undefined with dark gray color.

The legend before:
image

The legend after:
image

This PR continues #9463

@albert-github albert-github added the needinfo reported bug is incomplete, please add additional info label Jul 6, 2023
@albert-github
Copy link
Collaborator

The gray fill color is to indicate a special feature (see the explanation with the legend graph).

  • A filled gray box represents the struct or class for which the graph is generated.

So when using this it would also be necessary to adjust the first line of text.

  • I assume you explicitly set the shape to plain, what is the reason?

  • In the graphviz documentation we see (https://graphviz.org/doc/info/shapes.html):

    As the figures suggest, the shapes rect and rectangle are synonyms for box, and none is a synonym for plaintext. The shape plain is similar to these two, except that it also enforces width=0 height=0 margin=0, which guarantees that the actual size of the node is entirely determined by the label. This is useful, for example, when using HTML-like labels. Also, unlike the rest, we have shown these three, as well as underline, without style=filled to indicate the normal use. If fill were turned on, the label text would appear in a filled rectangle.

    I don't see from this that it is not allowed to use the fill (it might not be intended but that doesn't mean it is not allowed).

  • why is the "undocumented" box in your example still gray? Due to the "plain" change shouldn't this loose the gray filling as well? (due to the cut-off I cannot see what happens here with the "Truncated" filled box)

@makelinux
Copy link
Contributor Author

I've updated the patch and the description.

Fill is allowed for shapes in Graphviz. Boxes can be removed for aesthetic purposes accordingly subjective taste with my accepted PR: #9463

@makelinux makelinux changed the title don't fill plain shaped root node don't fill plain shaped nodes Jul 7, 2023
for configuration with
DOT_NODE_ATTR = shape=plaintext

because filling is intended for record or box shaped Graphviz nodes.
Plain shaped root node is already highlighted with bold font
and Truncated is already marked woth italic font
in function DotNode::writeLabel.

Mark `Undefined` with dark gray color.
@makelinux
Copy link
Contributor Author

@albert-github , would you like please to review?

Comment on lines +1042 to +1043
"For the default configuration, "
"the boxes in the above graph have the following meaning:\n"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that the "legend" is in the "old" stile even when using "shape=plain" and thus having an inconsistent "legend" with the images?
The "legend" should follow the current status (there might also be some places already where the color description doesn't fit).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean legend text? For default configuration the legend image is consistent with legend text. For another style configuration legend images are inconsistent with the hard-coded legend text.
What do you suggest?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the legend (and its texts) should express the the way the graphs are generated (i.e. colors, shapes and texts).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have contradiction between flexible graph generation rigid text description on many languages.

Hypothetically it is possible to translate arbitrary graph style to description to all languages with help of AI.

@albert-github
Copy link
Collaborator

I already expressed my opinion before and now placed a, small, review as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo reported bug is incomplete, please add additional info
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants