glejeune / node-graphviz

Node.js interface to the GraphViz graphing tool
http://algorithmique.net
MIT License
197 stars 58 forks source link

class attr is not implemented in attributs.js #45

Open Nusserdt opened 3 years ago

Nusserdt commented 3 years ago

I try to change the class of the edges in the rendered SVG. So I pass the class property as attribute.

After that, the error TypeError: Cannot read property 'type' of undefined occurs in the mustBeQuoted function (graphviz\lib\deps\attributs.js:191:42)

Reason is that class attribute is not implemented in attributs.js (graphviz\lib\deps\attributs.js)

var attrs = {
  "Damping" :            { "usage" : "G",    "type" : "double" },
  "K" :                  { "usage" : "GC",   "type" : "double" },
  "URL" :                { "usage" : "ENGC", "type" : "escString" },
  "area" :               { "usage" : "NC",   "type" : "double" },
  "arrowhead" :          { "usage" : "E",    "type" : "arrowType" },
  "arrowsize" :          { "usage" : "E",    "type" : "double" },
  "arrowtail" :          { "usage" : "E",    "type" : "arrowType" },
  "aspect" :             { "usage" : "G",    "type" : "aspectType" },
  "bb" :                 { "usage" : "G",    "type" : "rect" },
  "bgcolor" :            { "usage" : "GC",   "type" : "color" },
  "center" :             { "usage" : "G",    "type" : "bool" },
  "charset" :            { "usage" : "G",    "type" : "string" },
  "clusterrank" :        { "usage" : "G",    "type" : "clusterMode" },
  "color" :              { "usage" : "ENC",  "type" : "color" },
  "colorscheme" :        { "usage" : "ENCG", "type" : "string" },
...

Is it possible to add class attribute as feature?

dustinlacewell commented 3 years ago

Please?