vasturiano / timelines-chart

Timelines Chart
http://vasturiano.github.io/timelines-chart/example/categorical/
MIT License
551 stars 121 forks source link

onLabelClick leads to Uncaught TypeError: e.split is not a function #100

Closed mbehr1 closed 3 years ago

mbehr1 commented 3 years ago

version 2.11.1

With the following code:

const handleLabelClick = (a,b)=>{
    console.log(`handleLabelClick`, a, b);
}
timelineChart
    .zScaleLabel('actions')
    .zQualitative(true)
    .useUtc(true)
    .data(timelineData)
    .dateMarker(Date.now() + 5*1000)
    .onSegmentClick(handleSegmentClick)
    .onLabelClick(handleLabelClick)
  (document.getElementById('timeline'));

I get a

Uncaught TypeError: e.split is not a function
    at SVGTextElement.<anonymous> (timelines-chart:5)
    at SVGTextElement.<anonymous> (timelines-chart:2)

(onSegmentClick works)

Any idea how to avoid/change?

vasturiano commented 3 years ago

Thanks for the report @mbehr1. There was a bug causing this issue on click events, existing since the recent upgrade to d3-selection v2.

This is now fixed in the latest version (2.11.2), so if you update your dependencies you shouldn't experience the issue any more.

mbehr1 commented 3 years ago

@vasturiano thx! Works!