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

VictoryScatter doesn't render points when all z values are the same #833

Closed
richardbutler opened this issue Nov 10, 2017 · 0 comments · Fixed by FormidableLabs/victory-chart#539
Assignees

Comments

@richardbutler
Copy link

When all points have the same z (bubbleProperty, or whatever) value, then the svg paths get given NaNs. It appears this is due to a division by zero because the breadth of the z domain is zero.

Just editing the example from the docs, you can observe this behaviour:

<VictoryChart
  theme={VictoryTheme.material}
  domain={{ x: [0, 5], y: [0, 7] }}
>
  <VictoryScatter
    style={{ data: { fill: "#c43a31" } }}
    size={7}
    bubbleProperty="z"
    data={[
      { x: 1, y: 2, z: 3 }, // Change this z to 4 and it renders
      { x: 2, y: 3, z: 3 },
      { x: 3, y: 5, z: 3 },
      { x: 4, y: 4, z: 3 },
      { x: 5, y: 7, z: 3 }
    ]}
  />
</VictoryChart>

I don't know the best course of action for this - whether to use the minBubbleSize for these points, or pick the average of the min and maxBubbleSize.

Thoughts?

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

Successfully merging a pull request may close this issue.

2 participants