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.

Curve is not a function

See original GitHub issue

Hello,

I’m submitting a …

[ x ] bug report
[ ] feature request
[ ] support request

Current behavior Links between nodes are not drawn at all, because of this error:

TypeError: curve is not a function at line (line.js:21) at GraphComponent../src/index.ts.GraphComponent.generateLine (index.js:38714) at _loop_1 (index.js:38562) at GraphComponent../src/index.ts.GraphComponent.draw (index.js:38579) at index.js:38681 at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:425) at Object.onInvokeTask (core.js:4744) at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:424) at Zone.webpackJsonp.../../../../zone.js/dist/zone.js.Zone.runTask (zone.js:192) at webpackJsonp.../../../../zone.js/dist/zone.js.ZoneTask.invokeTask (zone.js:499)

It seems it’s missing some dependencies, although I’ve got D3 4.13.0 installed. Maybe wrong version?

Expected behavior Links between nodes drawn correctly without errors.

Reproduction of the problem I used the provided example just with nodes, links and SVG templates and example data. Without any more attributes and options.

Please tell us about your environment: Windows 10, Apache, PhpStorm

  • ngx-graph version: 4.0.2

  • Angular version: 5.0.0

  • Browser: All

  • Language: TypeScript 2.4.2

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

10reactions
isaacplmanncommented, Feb 2, 2018

You need to assign a curve function to the <ngx-graph> component.

// component.ts file
import * as shape from 'd3-shape';

@Component({...})
export class WhateverComponent {
  // ...

  curve: any = shape.curveLinear; // or some other function from d3-shape
}

// component.html
<ngx-graph [curve]="curve" ...><ngx-graph>
3reactions
CoreyColecommented, Aug 1, 2018

Should this be added to readme?

Read more comments on GitHub >

github_iconTop Results From Across the Web

"TypeError: curve is not a function. (In 'curve(buffer = path ...
I am working through a d3.js Linkedin Learning course, creating graphs and interpolating them by type. Link to course video here. I keep...
Read more >
What is the difference between a function and a curve?
A curve is a graphical representation of the relation between two (or more) variables (an equation), where for each x there may be...
Read more >
Relations and Determining Whether a Relation is a Function
Use the vertical line test to determine whether or not a graph represents a function. If a vertical line is moved across the...
Read more >
Identify Functions Using Graphs | College Algebra
If we can draw any vertical line that intersects a graph more than once, then the graph does not define a function because...
Read more >
A function is not a graph | Making Your Own Sense
“A function is a curve”, says their experience, but where is the curve here? We get around this by extending their picture of...
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