TransformerLensOrg / CircuitsVis

Mechanistic Interpretability Visualizations using React
https://alan-cooney.github.io/CircuitsVis/
MIT License
192 stars 29 forks source link

Fix weird AttentionHead resizing bug. #63

Closed UFO-101 closed 1 year ago

UFO-101 commented 1 year ago

Chart.js charts resizing is weird. Responsive chart elements (which all are by default) require the parent element to have position: 'relative' and no sibling elements. There were previously issues that only occured at particular display sizes and zoom levels.

Example: Before

https://github.com/alan-cooney/CircuitsVis/assets/47218308/ee540fd2-e989-4cc3-89a0-0df9a95bd4ff

After

https://github.com/alan-cooney/CircuitsVis/assets/47218308/0d1f2514-1726-4fe0-af3a-6c269e347de4

See: https://www.chartjs.org/docs/latest/configuration/responsive.html#important-note https://stackoverflow.com/a/48770978/7086623

alan-cooney commented 1 year ago

Thanks both!