Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let coordinates: [number, number];
coordinates = defaultLinkDatum.source;
coordinates = defaultLinkDatum.target;
// Test generator factories ==========================================================
let defaultLink: d3Shape.Link;
defaultLink = d3Shape.linkHorizontal();
defaultLink = d3Shape.linkVertical();
let link: d3Shape.Link, HierarchyPointNode>;
link = d3Shape.linkHorizontal, HierarchyPointNode>();
link = d3Shape.linkVertical, HierarchyPointNode>();
let svgLink: d3Shape.Link, HierarchyPointNode>;
svgLink = d3Shape.linkHorizontal, HierarchyPointNode>();
svgLink = d3Shape.linkVertical, HierarchyPointNode>();
let defaultLinkRadial: d3Shape.LinkRadial;
defaultLinkRadial = d3Shape.linkRadial();
let radialLink: d3Shape.LinkRadial, HierarchyPointNode>;
radialLink = d3Shape.linkRadial, HierarchyPointNode>();
let svgLinkRadial: d3Shape.LinkRadial, HierarchyPointNode>;
link.circularPathData.verticalLeftInnerExtent = link.circularPathData.verticalFullExtent + link.circularPathData.leftLargeArcRadius;
link.circularPathData.verticalRightInnerExtent = link.circularPathData.verticalFullExtent + link.circularPathData.rightLargeArcRadius;
}
}
// all links
link.circularPathData.leftInnerExtent = link.circularPathData.sourceX + link.circularPathData.leftNodeBuffer;
link.circularPathData.rightInnerExtent = link.circularPathData.targetX - link.circularPathData.rightNodeBuffer;
link.circularPathData.leftFullExtent = link.circularPathData.sourceX + link.circularPathData.leftLargeArcRadius + link.circularPathData.leftNodeBuffer;
link.circularPathData.rightFullExtent = link.circularPathData.targetX - link.circularPathData.rightLargeArcRadius - link.circularPathData.rightNodeBuffer;
}
if (link.circular) {
link.path = createCircularPathString(link);
} else {
var normalPath = linkHorizontal().source(function (d) {
var x = d.source.x0 + (d.source.x1 - d.source.x0);
var y = d.y0;
return [x, y];
}).target(function (d) {
var x = d.target.x0;
var y = d.y1;
return [x, y];
});
link.path = normalPath(link);
}
});
}
return c
}
this.colors =
{
'entity': {
categories: colorGen(this.colorMapCategories, 'entity'),
tags: colorGen(this.colorMapTags, 'entity'),
range: (v) => defaultColor['entity']
},
'address': {
categories: colorGen(this.colorMapCategories, 'address'),
tags: colorGen(this.colorMapTags, 'address'),
range: (v) => defaultColor['address']
}
}
this.linker = linkHorizontal()
.x(([node, isSource, scale]) => isSource ? node.getXForLinks() + node.getWidthForLinks() : node.getXForLinks() - this.arrowSummit)
.y(([node, isSource, scale]) => node.getYForLinks() + node.getHeightForLinks() / 2)
this.shadowLinker = linkHorizontal()
.x(([node, isSource]) => isSource ? node.getXForLinks() + node.getWidthForLinks() : node.getXForLinks())
.y(([node, isSource]) => node.getYForLinks() + node.getHeightForLinks() / 2)
this.snapshots = []
this.currentSnapshotIndex = -1
// initialize with true to allow initial snapshot
this.dirty = true
this.createSnapshot()
}
setCategoryColors (cc) {
link.circularPathData.verticalLeftInnerExtent = link.circularPathData.verticalFullExtent + link.circularPathData.leftLargeArcRadius;
link.circularPathData.verticalRightInnerExtent = link.circularPathData.verticalFullExtent + link.circularPathData.rightLargeArcRadius;
}
}
// all links
link.circularPathData.leftInnerExtent = link.circularPathData.sourceX + link.circularPathData.leftNodeBuffer;
link.circularPathData.rightInnerExtent = link.circularPathData.targetX - link.circularPathData.rightNodeBuffer;
link.circularPathData.leftFullExtent = link.circularPathData.sourceX + link.circularPathData.leftLargeArcRadius + link.circularPathData.leftNodeBuffer;
link.circularPathData.rightFullExtent = link.circularPathData.targetX - link.circularPathData.rightLargeArcRadius - link.circularPathData.rightNodeBuffer;
}
if (link.circular) {
link.path = createCircularPathString(link);
} else {
var normalPath = linkHorizontal().source(function (d) {
var x = d.source.x0 + (d.source.x1 - d.source.x0);
var y = d.y0;
return [x, y];
}).target(function (d) {
var x = d.target.x0;
var y = d.y1;
return [x, y];
});
link.path = normalPath(link);
}
});
}
return data => {
const link = linkHorizontal();
link.x(x);
link.y(y);
link.source(source);
link.target(target);
return link(data);
};
}
function createGenerator(props, generator?: Link): Link {
generator = generator || d3.linkHorizontal();
return args.reduce((acc: Link, arg) => {
const prop = props[arg];
if (prop) {
return acc[arg](prop);
}
return acc;
}, generator);
}
() =>
linkHorizontal()
.context(null)
.source(d => d.start)
.target(d => d.end)
.x(d => d.x)
.y(d => d.y),
[]
_makeDependencyLines(lines, lineClass) {
const linkGenerator = linkHorizontal()
.x(d => d[0] + this.p_r)
.y(d => d[1] + this.p_r)
this.depLineSVGGrp
.selectAll(`path.dep2.${lineClass}`)
.data(lines.map(line => this._lineConverter(line)))
.enter()
.append('path')
.attr('d', linkGenerator)
.attr('class', d => `dep2 ${lineClass} ${d.type}`)
}
path: (xScale, yScale) => linkHorizontal().x(d => xScale(getX(d))).y(d => yScale(getY(d))),
offset: () => ''