Bowen7 / react-rough-fiber

A React renderer for rendering hand-drawn SVGs.
https://react-rough-fiber.amind.app
MIT License
399 stars 8 forks source link

Crash on using LineRadial #4

Open shawncao opened 2 months ago

shawncao commented 2 months ago

First, great project! Read your blog as well, very nice.

my project mainly uses Visx, everything works fine, except one big issue when rendering Radar chart which internally uses LineRadial, the component is from @visx/shape, looks like there is an infinite loop, and eventually web page crashes.

Any idea what goes wrong?

shawncao commented 2 months ago

sorry, wrong cause, looks like this component is the reason:

      <polygon
        points={pointString}
        fill={color}
        fillOpacity={0.3}
        stroke={color}
        strokeWidth={1}
      />

with pointString = 9.607161186670409,35.85441366515768 0,0 56.11481564366243,56.11481564366244 49.88201564660811,28.799395161290327 172.26603347167708,46.15854455204867 31.572670250896056,1.933268478164736e-15 113.74503645498297,-30.47789066116128 61.70590083691523,-35.62591845878134 66.37236258927814,-66.37236258927814 79.14500448028679,-137.083168925123 33.01771488292477,-123.2237894928982 3.3440319622308944e-15,-27.306093189964155 -4.196231322913506,-15.660548497425195 -53.11888440860212,-92.00460663707722 -99.86023644114114,-99.86023644114125 -97.91654923223072,-56.53214605734772 -4.533316670307292,-1.2146985408433886 -150.61017025089603,-2.766663943751966e-14 -170.20543498517384,45.6064088516652 -115.28288060549438,66.55860215053755 -109.81609082953295,109.8160908295329 -99.19791666666674,171.81583167165013 -26.612940758477887,99.32084704945976 -2.9051277671880895e-14,118.61084229390681

Bowen7 commented 2 months ago

I created a CodeSandbox to reproduce this: https://codesandbox.io/s/quirky-oskar-f382c4?file=/src/App.tsx:0-1745. I don't find any issue with the polygon. But there was an issue with the ref when I tried the lineradial of visx. I have published the 0.0.5 version to fix it.

I don't know if this is the issue that you encountered. If you still have the crash, please create a minimal repo or sandbox.