Curved edges changes to line after dragging a node
See original GitHub issueI’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here
Current behavior curve set to shape.curveLinear from d3-shape. For the first render the edges have curveLinear shape. After drag and move a node the connected edges will be simple lines and not curveLinears.
Expected behavior Edges should keep curveLinear shape when the nodes are dragged around.
Reproduction of the problem See the demo: https://swimlane.github.io/ngx-graph/
import {Component, OnInit} from ‘@angular/core’;
import * as shape from ‘d3-shape’;
@Component({ selector: ‘app-xxxx’, templateUrl: ‘./xxxx.component.html’, styleUrls: [‘./xxxx.component.scss’] }) export class XxxxComponent implements OnInit {
constructor() { }
curve = (points) => shape.curveLinear(points); // or some other function from d3-shape // curve : any = shape.curveLinear;
nodes = [ { id: ‘start’, label: ‘start’ }, { id: ‘1’, label: ‘Query ThreatConnect’, }, { id: ‘2’, label: ‘Query XForce’, }, { id: ‘3’, label: ‘Format Results’ }, { id: ‘4’, label: ‘Search Splunk’ }, { id: ‘5’, label: ‘Block LDAP’ }, { id: ‘6’, label: ‘Email Results’ } ]; links = [ { source: ‘start’, target: ‘1’, label: ‘links to’ }, { source: ‘start’, target: ‘2’ }, { source: ‘1’, target: ‘3’, label: ‘related to’ }, { source: ‘2’, target: ‘4’ }, { source: ‘2’, target: ‘6’ }, { source: ‘3’, target: ‘5’ } ];
ngOnInit() {
}
}
<ngx-graph #graph [view]=“view” [links]=“links” [nodes]=“nodes” [curve]=“curve” [scheme]=“{ name: ‘vivid’, selectable: true, group: ‘Ordinal’, domain: [ ‘#647c8a’, ‘#3f51b5’, ‘#2196f3’, ‘#00b862’, ‘#afdf0a’, ‘#a7b61a’, ‘#f3e562’, ‘#ff9800’, ‘#ff5722’, ‘#ff4514’ ] }” [orientation]=“LR”
<ng-template #defsTemplate> <svg:marker id=“arrow” viewBox=“0 -5 10 10” refX=“8” refY=“0” markerWidth=“4” markerHeight=“4” orient=“auto”> <svg:path d=“M0,-5L10,0L0,5” class=“arrow-head” /> </svg:marker> </ng-template>
<ng-template #nodeTemplate let-node> <svg:g class=“node” ngx-tooltip [tooltipPlacement]=“‘top’” [tooltipType]=“‘tooltip’” [tooltipTitle]=“node.label”> <svg:rect [attr.width]=“node.width” [attr.height]=“node.height” [attr.fill]=“node.options.color” /> <svg:text alignment-baseline=“central” [attr.x]=“10” [attr.y]=“node.height / 2”>{{node.label}}</svg:text> </svg:g> </ng-template>
<ng-template #linkTemplate let-link> <svg:g class=“edge”> <svg:path class=“line” stroke-width=“2” marker-end=“url(#arrow)” > </svg:path> <svg:text class=“edge-label” text-anchor=“middle”> <textPath class=“text-path” [attr.href]=“‘#’ + link.id” [style.dominant-baseline]=“link.dominantBaseline” startOffset=“50%”> {{link.label}} </textPath> </svg:text> </svg:g> </ng-template>
</ngx-graph>Angular CLI: 1.7.4 Node: 7.10.1 OS: linux x64 Chromium Version 65.0.3325.181 (Official Build) Built on Ubuntu , running on Ubuntu 16.04 (64-bit)
Issue Analytics
- State:
 - Created 5 years ago
 - Reactions:10
 - Comments:17 (4 by maintainers)
 

Top Related StackOverflow Question
Can we reopen this issue please? It is clear that this bug is not fixed, yet.
Reopening