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

"innerComponent is not a function" in CustomSVGSeries when animation is set. #598

Closed
sradevski opened this issue Sep 8, 2017 · 4 comments

Comments

@sradevski
Copy link
Contributor

When trying to generate a CustomSVGSeries, I get the error written in the title. This only happens when animation is enabled. Also, if animation is enabled and I don't specify a customComponent function, it works properly.

I investigated the cause of it, and it seems that in the Animation component the customComponent field in the interpolated data object is turned into an object (instead of being a function as it is in the child.props.data).

My code:

const getMarkSeries = series =>
  <CustomSVGSeries
    key={`${series.id}mark`}
    animation
    data={series.data.map(entry => ({
      ...entry,
      size: 5,
      customComponent: () =>
        markShapesGenerator(series.markType, 5, {
          stroke: series.color,
          fill: series.color,
        }),
    }))}
  />;

react version: 15.6.1
react-vis version: 1.7.2

@mcnuttandrew
Copy link
Contributor

Hey @sradevski

You've highlighted a problem we have unfortunately seen before (#579 among other places). Generally I'm working on a long term solution to address these interpolation issues, however I've also filed a PR (#600) that will allow you to specify your customComponent function at the root level (directly on the series rather on the datum). This should address the problem in letter, but not in spirit i think!

@sradevski
Copy link
Contributor Author

@mcnuttandrew

Thank you for the very quick response. I also forgot to mention the props validation for the root level custom component, thanks for picking that one up as well. I will be waiting for the PR to be merged. 👍

@mcnuttandrew
Copy link
Contributor

mcnuttandrew commented Sep 11, 2017

Fwiw, the long term solution to our interpolation problems relates this PR (d3/d3-interpolate#43)

@sradevski
Copy link
Contributor Author

This is likely outdated by now and might not be relevant anymore. Reopen if necessary.

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

No branches or pull requests

2 participants