PROBLEMS:
- `makeLabel` uses `c.getContext('2d')` twice for the same canvas element, which returns the same context object; the second call does not reset the transform, so `ctx.scale(dpr, dpr)` is applied cumulatively or incorrectly, leading to distorted or misplaced text rendering.
- In the `animate` loop, `u.scaleY` is initialized to `0.0001` but `u.lift`, `u.em`, and `u.emI` are undefined; the `lerp` function fails to initialize them to their target values correctly, potentially causing NaN or incorrect interpolation for hover effects.
- The `positionTooltip` function projects a point to screen space but does not check if the point is behind the camera (z > 1 in NDC), which can cause the tooltip to appear on the opposite side of the screen when the camera orbits behind the chart.
- The `updateHover` function calls `positionTooltip` even when `hit === hovered` and `pointerActive` is false (e.g., after `pointerleave`), potentially updating the tooltip position for a bar that is no longer being hovered or visible.
- The `setPointer` function sets `pointerActive = true` on `pointermove`, but `pointerleave` only sets it to `false`; if the user moves the mouse outside the canvas without triggering `pointerleave` (e.g., due to UI overlays), the hover state may become stale.
- The `bars` array is exposed via `window.__app`, but the meshes are scaled to `0.0001` initially; external code accessing `bars` before the animation loop completes will see incorrect geometry.
- The `makeLabel` function creates a new `CanvasTexture` for each label without disposing of previous textures, leading to memory leaks if labels are recreated (though not an issue in this static scene, it is poor practice).
- The `axis` and `grid` are added to the scene but not included in the `window.__app` object, making them inaccessible for external manipulation or testing.