Skip to content

Commit

Permalink
No fill color during drag if style doesn't contain "filled"
Browse files Browse the repository at this point in the history
The fix is a workaround for magjac/d3-graphviz#83
  • Loading branch information
magjac committed Aug 21, 2018
1 parent 3465ee8 commit eb25015
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,10 @@ class Graph extends React.Component {
drawNode(x0, y0, nodeName, attributes) {
// FIXME: remove extra copy when https://github.com/magjac/d3-graphviz/issues/81 is fixed
let attributesCopy = Object.assign({}, attributes);
// FIXME: remove workaround when https://github.com/magjac/d3-graphviz/issues/83 is fixed
if (!attributesCopy.style || !attributesCopy.style.includes('filled')) {
attributesCopy.fillcolor = 'none';
}
this.graphviz.drawNode(x0, y0, nodeName, attributesCopy);
};

Expand All @@ -565,6 +569,10 @@ class Graph extends React.Component {
attributes = Object.assign(this.currentNodeAttributes, attributes);
// FIXME: remove extra copy when https://github.com/magjac/d3-graphviz/issues/81 is fixed
let attributesCopy = Object.assign({}, attributes);
// FIXME: remove workaround when https://github.com/magjac/d3-graphviz/issues/83 is fixed
if (!attributesCopy.style || !attributesCopy.style.includes('filled')) {
attributesCopy.fillcolor = 'none';
}
this.graphviz.updateDrawnNode(x0, y0, nodeName, attributesCopy);
this.graphviz.insertDrawnNode(nodeName);
this.graphviz._drawnNode = null;
Expand Down

0 comments on commit eb25015

Please sign in to comment.