question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Curved edges changes to line after dragging a node

See original GitHub issue

I’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:open
  • Created 5 years ago
  • Reactions:10
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
raman-nbgcommented, Jan 13, 2021

Can we reopen this issue please? It is clear that this bug is not fixed, yet.

2reactions
marjan-georgievcommented, Jan 14, 2021

Reopening

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inkscape: The Bezier (Pen) Tool - Tutor Via Computer
You can adjust the shape of the curves by activating the Nodes tool and then clicking and dragging the nodes on the path...
Read more >
How to Round Corners in Illustrator - YouTube
When that Corner Widget is dragged it will round out the corner. This is a non-destructive process that can be easily adjusted after...
Read more >
Edit connector lines, arrows, or points - Microsoft Support
Add or delete points, edit line weight and color, change or reverse arrow types, and make connectors curved, angled, or straight.
Read more >
11. Navigation and Layout - Cytoscape manual
Hold down the Shift or Ctrl key ( Command on Macs) and left-click a node, edge or annotation to add it to the...
Read more >
Add lines and arrows in Keynote on Mac - Apple Support
In Keynote on your Mac, add and edit straight or curved lines, add endpoints such as arrows, circles, or squares, and connect two...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found