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.

d3.select(...).datum(...).date is not a function

See original GitHub issue

Using the following piece of code I’m getting the follow error Uncaught TypeError: d3.select(...).datum(...).date is not a function :

         d3.select('#chart_placeholder').datum(data)
                                        .date((d)=>{
                                            return d.data;
                                        }),
                                        .call(eventDropsChart);

or the variation :

         d3.select('#chart_placeholder').datum(data)
                                        .date(function(d){
                                            return d.data;
                                        })
                                        .call(eventDropsChart);

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
generallcommented, May 8, 2017

According to the demo.js file, date function should be called from eventDropsChart object. So the example in README.md should be changed to something like this:

var eventDropsChart = d3.chart.eventDrops()
  .date(d => d.date);

d3.select('#chart_placeholder')
  .datum(data)
  .call(eventDropsChart);
0reactions
JulianoEngineercommented, May 9, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

D3js: When to use .datum() and .data()? - Stack Overflow
datum gives the accepted answer: Gets or sets the bound data for each selected element. Unlike the selection.data method, this method does not...
Read more >
D3.js selection.each() Function - GeeksforGeeks
In function datum(d) and index(i) are given as the parameters. By using this method one can access parent and child data simultaneously. Syntax:....
Read more >
Selections - D3 wiki
A selection is an array of elements pulled from the current document. D3 uses [[CSS3|http://www.w3.org/TR/css3-selectors/]] to select elements.
Read more >
Changes in D3 4.0 · Alex(Shaojie) Deng
on in d3-selection. The dispatch.on method now validates that the specifier listener is a function, rather than throwing an error in the future....
Read more >
D3.js 7 documentation - DevDocs
D3.js 7.6.1 API documentation with instant search, offline support, ... contours.smooth - set whether or not the generated contours are smoothed.
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