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

Small CSS improvements #64

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

Small CSS improvements #64

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 10, 2022

These are tiny and work for me. I have not done too much browser testing, only with a recent Firefox.

585350d makes sure that SVGs are at most 75% of the viewport height.

Before:

rng2d-before-attr-tab

After:

rng2d-after-attr-tab

231d2cb allows breaking words (or long regexes, as it were) within the attribute tables (or any other table cells).

Before:

rng2d-before

After:

rng2d-after

@jloehel Do you want to review? (The descriptions in the bugs were rather short, so I guess it would make sense to know I am actually fixing the bug in question rather than something random.)

@ghost ghost requested a review from jloehel January 12, 2022 15:09
Copy link
Collaborator

@jloehel jloehel left a comment

Choose a reason for hiding this comment

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

Hi Stefan,

thanks for asking. I tested it quickly against the docbook.rng. Huge graphs get really tiny, hard to read. I am not sure about the change. I had the idea to make the graphs interactive with https://github.com/d3/d3. But it's also some kind of overhead. Something like that in example: https://observablehq.com/@d3/collapsible-tree. Anyway, I haven't had the time for it.

@ghost
Copy link
Author

ghost commented Jan 20, 2022

Thanks for checking, Jürgen! It worked for me, but I guess my RNG schema is not quite as large as DocBook. Ultimately, I guess this may not have an easy (universal) CSS-based solution then :/ Maybe the generator could classify SVG images by their rough (vertical) size and add an HTML class to them?

Making graphs interactive sounds like a very good idea as well though. (One [unrelated] interactivity option that I was missing was being able to click links within the SVG. Not sure if it's possible to embed links with Graphviz.)

I am going to pick 231d2cb off here and merge it, I think that one works suitably well.

@jloehel
Copy link
Collaborator

jloehel commented Jan 20, 2022

Thanks for checking, Jürgen! It worked for me, but I guess my RNG schema is not quite as large as DocBook. Ultimately, I guess this may not have an easy (universal) CSS-based solution then :/ Maybe the generator could classify SVG images by their rough (vertical) size and add an HTML class to them?

That's true. The DocBook schema has really large graphs. The idea sounds good. I guess we can use the size from here:

rng2doc/src/rng2doc/rng.py

Lines 156 to 158 in dfdc888

svg = etree.fromstring(graph.create_svg())
svg.attrib.pop("width")
svg.attrib.pop("height")

instead of throwing it away. I am not even sure why I did it. The commit message does not help. My mistake.

Making graphs interactive sounds like a very good idea as well though. (One [unrelated] interactivity option that I was missing was being able to click links within the SVG. Not sure if it's possible to embed links with Graphviz.)

Linking should be possible with the URL attribute. But we can move the discussion to #23.

I am going to pick 231d2cb off here and merge it, I think that one works suitably well.

👍

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