Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function visualizeExpected(canvas, point) {
var circle = svgCreate('circle');
svgAttr(circle, {
dx: point.x,
dy: point.y,
r: 4
});
svgAppend(canvas._svg, circle);
return circle;
}
connection.waypoints.forEach(function(p, idx) {
var bendpoint = addBendpoint(gfx);
svgAppend(gfx, bendpoint);
translate(bendpoint, p.x, p.y);
});
function replaceVisualGraphics(gfx, shape) {
var visual = gfx && getVisual(gfx);
if (visual) {
svgRemove(visual);
visual = svgCreate('g');
svgClasses(visual).add('djs-visual');
svgAppend(gfx, visual);
graphicsFactory.drawShape(visual, shape);
}
}
function drawMarker(type, parentGfx, d, attrs) {
attrs = assign({ 'data-marker': type }, attrs);
attrs = styles.computeStyle(attrs, ['no-fill'], {
strokeWidth: 2,
stroke: 'black'
});
const path = svgCreate('path');
svgAttr(path, { d: d });
svgAttr(path, attrs);
svgAppend(parentGfx, path);
return path;
}
function drawPath(parentGfx, d, attrs) {
attrs = computeStyle(attrs, [ 'no-fill' ], {
strokeWidth: 2,
stroke: 'black'
});
var path = svgCreate('path');
svgAttr(path, { d: d });
svgAttr(path, attrs);
svgAppend(parentGfx, path);
return path;
}
function drawMarker(type, parentGfx, d, attrs) {
attrs = assign({ 'data-marker': type }, attrs);
attrs = styles.computeStyle(attrs, ['no-fill'], {
strokeWidth: 2,
stroke: 'black'
});
const path = svgCreate('path');
svgAttr(path, { d: d });
svgAttr(path, attrs);
svgAppend(parentGfx, path);
return path;
}
function drawPath(parentGfx, d, attrs) {
attrs = computeStyle(attrs, [ 'no-fill' ], {
strokeWidth: 2,
stroke: 'black'
});
var path = svgCreate('path');
svgAttr(path, { d: d });
svgAttr(path, attrs);
svgAppend(parentGfx, path);
return path;
}
function drawPolygon(parentGfx, points, attrs) {
var pointsString = points.map(function(point) {
return point.x + ',' + point.y;
}).join(' ');
var polygon = svgCreate('polygon');
svgAttr(polygon, {
points: pointsString
});
svgAttr(polygon, attrs);
svgAppend(parentGfx, polygon);
return polygon;
}
function drawPath(parentGfx, d, attrs) {
attrs = computeStyle(attrs, [ 'no-fill' ], {
strokeWidth: 2,
stroke: 'black'
});
var path = svgCreate('path');
svgAttr(path, { d: d });
svgAttr(path, attrs);
svgAppend(parentGfx, path);
return path;
}
function drawPath(p, d, attrs) {
attrs = computeStyle(attrs, [ 'no-fill' ], {
strokeWidth: 2,
stroke: 'black'
});
var path = svgCreate('path');
svgAttr(path, { d: d });
svgAttr(path, attrs);
svgAppend(p, path);
return path;
}