Improve agents diagram. #413

Merged
merged 2 commits into from Jul 26, 2014

Projects

None yet

5 participants

@knu
Collaborator
knu commented Jul 25, 2014
  • Fold each agent name after every 20+ characters.
  • Choose the rounded box as node shape.
  • Signify disabled agents with gray color, including arrows.
  • Use a shorter node name to shorten code that often exceeds the limit
    of Google Chart API when an agent with a long name has lots of sources
    and receivers.
  • Use a smaller font size, and specify Helvetica as font family in SVG
    output to match the rest of the site contents.
@knu knu Improve agents diagram.
- Fold each agent name after every 20+ characters.

- Choose the rounded box as node shape.

- Signify disabled agents with gray color, including arrows.

- Use a shorter node name to shorten code that often exceeds the limit
  of Google Chart API when an agent with a long name has lots of sources
  and receivers.

- Use a smaller font size, and specify Helvetica as font family in SVG
  output to match the rest of the site contents.
593630b
@knu
Collaborator
knu commented Jul 25, 2014

As the number and topology of my agents grows, the diagram gets bigger and uglier, so here's my attempt to beautify it!

@coveralls

Coverage Status

Coverage increased (+0.26%) when pulling 593630b on knu:improve_diagram into 67fcfef on cantino:master.

@coveralls

Coverage Status

Coverage increased (+0.26%) when pulling c0810d3 on knu:improve_diagram into 67fcfef on cantino:master.

@snicker
snicker commented Jul 25, 2014

👍 I had gotten a graph so large at one point that the Chart API stopped parsing it. Scenarios saved me!

@virtadpt

Most of my graphs don't render anymore because they're too big. I can't wait to see how this new code works.

@knu
Collaborator
knu commented Jul 26, 2014

This only reduces the size of resulted DOT code to some extent. If you have a vast number of agents it will cause Google's API to choke anyway. Try installing graphviz (make sure it is built with SVG support, i.e. dot -Tsvg -V doesn't err) and enable USE_GRAPHVIZ_DOT, your diagram will be locally generated as an interactive (cickable) SVG without failure.
agent_diagram

@cantino
Owner
cantino commented Jul 26, 2014

I recently installed graphviz and have been enjoying the improved rendering. Looking forward to playing with this too!

Are there any potential security issues around escaping of Agent names?

@knu
Collaborator
knu commented Jul 26, 2014

@cantino I think this change improves security (if any flaw existed) because nodes now look like a#{agent.id}[label="#{escape(agent.name)}"] which would not be interpreted as any directive that might do harm.

This PR reduces the code size in that it allows drawing each edge by a#{agent1.id}->a#{agent2.id} which has a fixed and shorter length.

@cantino cantino merged commit 9d0695f into cantino:master Jul 26, 2014

1 check passed

Details continuous-integration/travis-ci The Travis CI build passed
@cantino
Owner
cantino commented Jul 26, 2014

Sounds great to me. Thanks for your work on this!

@knu knu deleted the knu:improve_diagram branch Aug 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment