palerdot / react-d3-speedometer

React Speedometer component using d3.js ⚛️
https://palerdot.in/react-d3-speedometer/
MIT License
230 stars 57 forks source link

zoom in or out not take parent width #155

Open IsAmitprajapati opened 1 year ago

IsAmitprajapati commented 1 year ago

when i was zoom in does not take the parent width and height

Screenshot 2022-10-10 105107
palerdot commented 1 year ago

This is outside the scope of what the library can do. When you zoom in/out with browser tools, the browser infers the text size and mostly increases/decreases the text size to match the zoom. It is possible that it can apply the same logic to some elements like images. In any case, the width/height has not changed during zooming in/out. Just how it is shown is changed by the browser. For the library to rerender, the width has to change which is not the case when zooming is happening.

palerdot commented 1 year ago

Think of a magnifying glass. When you look via magnifying glass, things look bigger, but the thing itself has not gotten bigger. This is just how browsers 'decide' to show you things. When the width/height actually changes, then parent width/height will be taken.

I'm just keeping it open so that people don't keep creating new issues for this.

grifin85 commented 1 year ago

This problem is because this library is not responsive-friendly, I have tried to fix it using resize event, but do not help me.