I can use the attr
method to change attributes of a cell, e.g. to set the stroke of a link:
conn.attr({'.connection': { stroke: 'red' }});
But I would rather set such attributes in the css file, e.g. as in this
.connection {
stroke: #999;
}
.connection.error {
stroke: #F00;
}
Is there a way to add such classes to the generated SVG?
I tried
conn.attr({'.connection': { class: 'error' }});
but that removes the .connection
class, which is important. It works to write
conn.attr({'.connection': { class: 'connection error' }});
but clearly that will not scale to having multiple orthogonal classes (error
, highlighted
...)
Vectorizer
will work on the DOM objects, which are owned by the view (ElementView
), while the above affects the model object (Element
). – Quieten