Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getStackedData causes an error if XY-Plot maps data into series children #47

Closed
akam9865 opened this issue Apr 7, 2016 · 4 comments
Closed

Comments

@akam9865
Copy link

akam9865 commented Apr 7, 2016

var data = child.props.data; on line 109 of series-utils.js will fail if the XY-Plot maps data into children such as this case:

{dataSets.map((set, index) => {
  return (
    <LineSeries
      key={index}
      data={set.points}
      onNearestX={this.onNearestX.bind(null, set.name)}
      color={colorMap[set.name]} />
  );
})}

which will send an array of children to the getStackedData function, and child.props will be undefined, causing this error: Uncaught TypeError: Cannot read property 'data' of undefined

@chrisirhc
Copy link
Contributor

I'm not sure I understand you, which version of the code are you looking at? I couldn't find var data = child.props.data in https://github.com/uber-common/react-vis/blob/add769142b65300ae37fc620e5b440c6c6191743/src/lib/utils/series-utils.js .

Could you write a fuller example with example data? A good example is one that's minimal and demonstrates the bug.

@chrisirhc
Copy link
Contributor

Oh I see you're referring to compile code probably of at the following line https://github.com/uber-common/react-vis/blob/add769142b65300ae37fc620e5b440c6c6191743/src/lib/utils/series-utils.js#L76 . However, how would the array be sent to getStackedData, isn't this function being applied to each child (in this forEach)?

@bulyonov bulyonov added the bug label Apr 8, 2016
@bulyonov
Copy link
Contributor

@akam9865 , could you confirm if you still have this issue?

@bulyonov
Copy link
Contributor

I accidentally found a source of issue. It is the same as #54 .
I'm closing this task as a duplicate since the other one has an example for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants