Skip to content

Commit

Permalink
Draw edge on the correct svg when multiple svg's exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Magnus Jacobsson authored and Magnus Jacobsson committed Apr 4, 2018
1 parent 9b58f67 commit dc02e7f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/drawEdge.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ function completeAttributes(attributes, defaultAttributes=defaultEdgeAttributes)
export function drawEdge(x1, y1, x2, y2, attributes, options={}) {
attributes = attributes || {};
completeAttributes(attributes);
var svg = d3.select("svg");
var root = this._selection;
var svg = root.selectWithoutDataPropagation("svg");
var graph0 = svg.selectWithoutDataPropagation("g");
var newEdge = graph0.append("g")
.datum(null)
Expand Down Expand Up @@ -204,7 +205,9 @@ export function insertDrawnEdge(name) {
var line = edge.selectWithoutDataPropagation("path");
var arrowHead = edge.selectWithoutDataPropagation("polygon");
}
var graph0 = d3.select("svg").selectWithoutDataPropagation("g");
var root = this._selection;
var svg = root.selectWithoutDataPropagation("svg");
var graph0 = svg.selectWithoutDataPropagation("g");
var graph0Datum = graph0.datum();
var edgeData = this._extractData(edge, graph0Datum.children.length, graph0.datum());
var gDatum = edgeData;
Expand Down

0 comments on commit dc02e7f

Please sign in to comment.