Gbury / ocaml-memgraph

A small library to output memory graph for ocaml values
MIT License
35 stars 3 forks source link

Some of the colour arguments being passed to Graphviz are unquoted #4

Closed erkin closed 1 year ago

erkin commented 1 year ago

Normally Graphviz accepts unquoted keywords (such as SVG or X11 colours) but hex values must be quoted. Calling memgraph after initialising the config with unquoted hex values triggers a syntax error. The following is how I properly configure the colours:

let config =
  Memgraph.Dot.config
    ~external_node_color:(Some "#bababa")
    ~block_node_color:(Some "#535955")
    ~root_node_color:(Some "#0a0a0a")
    ~outline_color:"\"#cccccc\""
    ~background_color:(Some "\"#252a2a\"")
    ~direction:`Horizontal
    ()

From a cursory look at the code, I suspect only the values parsed in styles_with_color get properly quoted and the others parsed in print_list don't.

Gbury commented 1 year ago

Interesting, I'll look at quotation in the dot output this week.

Gbury commented 1 year ago

This is now fixed, sorry about the delay in solving this.