Quantcast
Channel: Developer topics
Viewing all articles
Browse latest Browse all 17884

d3 v5 makes my life difficult

$
0
0

I have updated my d3 library from v3 to v5 (d3@5.3.0)

 

Now im facing the consequences Smiley Happy

 

I got everything working except for d3.selection

In the v3 this was the correct way to spell it:

private chartSelection: d3.selection.Update<ChartDataPoint>;
private svg: d3.Selection<SVGElement>;

But now since v4 it wants even more than that (by sudden, it wants 4 arguments!!)

 

Check it out:

 

Generic type 'Selection<GElement, Datum, PElement, PDatum>'

/* The first generic "GElement" refers to the type of the selected element(s).
The second generic "Datum" refers to the type of the datum of a selected element(s).
The third generic "PElement" refers to the type of the parent element(s) in the D3 selection.
The fourth generic "PDatum" refers to the type of the datum of the parent element(s).
A D3 Selection of elements. */

I dont get it how to use this masterpiece

 

Does anyone can help me here?

 


Viewing all articles
Browse latest Browse all 17884

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>