question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add X11 color preview to GraphViz files

See original GitHub issue

Description

When the (built-in) GraphViz syntax is active, please inject the phantoms for detected X11 colors.

digraph D {

  A [shape=diamond]
  B [shape=box]
  C [shape=circle]

  A -> B [style=dashed, color=grey]
  A -> C [color=indianred2]
  A -> D [penwidth=5, arrowhead=none]

}

I don’t know if it’s possible to differentiate injection by scope, but if so, it would be even better if embedded HTML/CSS had the CSS colors injected, and the rest of source.dot had X11 colors.

digraph D {

  node [shape=plaintext]

  some_node [
   label=<
     <table border="0" cellborder="1" cellspacing="0">
       <tr><td bgcolor="yellow">Foo</td></tr>
       <tr><td bgcolor="lightblue"><font color="#0000ff">Bar</font></td></tr>
       <tr><td bgcolor="#f0e3ff"><font color="#ff1020">Baz</font></td></tr>
     </table>>
  ];

}

Support Info

  • ST ver.: 4125
  • Platform: osx
  • Arch: x64
  • Plugin ver.: 3.8.0
  • Install via PC: True
  • mdpopups ver.: 4.2.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
facelessusercommented, Jan 14, 2022

I cut a release this morning as I wanted to also get some of the fixes out there. Hopefully, this provides enough functionality without giving too many false positives. As long as it’s balanced enough to be useful without being annoying, I think it should be fine,

1reaction
facelessusercommented, Jan 13, 2022

Yeah. I will probably skip HSV (for now). If GraphViz scoped bgcolor, color, etc. with something special to make them stand out as color attributes, it’d be easier to avoid false positives. I may play around and see if we can maybe use some look behinds to maybe check the attributes. If something like that worked, it’d be easy to do HSV, but right now I worry the non-specific color notation for HSV, coupled with no real scoping to indicate you are in an attribute that allows color, will just cause colors to appear in weird places.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Color Names - Graphviz
aliceblue antiquewhite antiquewhite1 antiquewhite2 antiquewhite3 antiquewhite4 aqua aquamarine aquamarine1 aquamarine2 aquamarine3 aquamarine4 azure azure1 azure2 azure3 azure4 beige bisque bisque1
Read more >
Attributes - Graphviz
Thus, to set the color of a node abc , one would use. digraph { abc [color = red] } ... If the...
Read more >
FAQ - Graphviz
Read about the color attribute for more information. ... This can be done in the graph file or on the command line.
Read more >
color | Graphviz
At present, Graphviz recognizes the default color scheme X11 , and the Brewer color schemes (cf. ColorBrewer). Please note that Brewer color ......
Read more >
Output Formats - Graphviz
Format Command‑line parameter Description BMP bmp Windows Bitmap CGImage cgimage Apple Core Graphics DOT canon dot gv xdot xdot1.2 xdot1.4 Graphviz Language
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found