victory icon indicating copy to clipboard operation
victory copied to clipboard

VictoryScatter size function no longer includes active param

Open tkiethanom opened this issue 9 years ago • 5 comments

After upgrading from 0.21 to 0.24 the VictoryScatter component does not include the active param for the size function like it used to. Was this removed intentionally? If so what is the work around to get this kind of functionality back?

<VictoryScatter
size={(d, active) => {
  console.log(active); // undefined

  return active ? 5 : 3;
}}               
/>

tkiethanom avatar Oct 30 '17 23:10 tkiethanom

@tkiethanom this is a regression. I'll get it cleaned up for the next release.

boygirl avatar Oct 31 '17 22:10 boygirl

@tkiethanom actually, I'm not able to reproduce this issue in the latest version. Note that undefined is the expected value for active if the prop has not explicitly been set.

I think what might be going on is that the evaluation of functional props has been moved down to the level of the primitive component, so Point in this example. If you're writing your own dataComponent for VictoryScatter, you'll want to evaluate this prop within your component.

I'm going to close this issue, since I can't reproduce it, but please let me know if you have more questions, or if you can't get this working correctly.

boygirl avatar Nov 01 '17 20:11 boygirl

@boygirl So this example https://formidable.com/open-source/victory/gallery/voronoi-tooltips-grouped doesn't work with the latest version right?

tkiethanom avatar Nov 03 '17 18:11 tkiethanom

@tkiethanom I opened a related issue #926. I found that the scatter dots do receive the active prop but not when they are being moused over directly.

JayFields avatar Feb 09 '18 17:02 JayFields

For anyone still wondering about this, the way to use active is now:

<VictoryScatter
  size={({active}) => {
    return active ? 5 : 3;
  }}               
/>

tkiethanom avatar Feb 15 '20 02:02 tkiethanom