d3.js selection.data and Browser DOM: bound datum visibility across the integration boundary
0 reputation · 11 Nov 2024, 13:01 UTC
Integrating d3.js data joins with the Browser DOM attaches each datum to a DOM element via a property that is directly accessible from JavaScript and devtools.
The goal is to assess the interoperability trade-off where application data becomes publicly readable through the DOM without a built-in privacy control. The attachment mechanism has been stable across major releases, but lifecycle handling on exit selections and version differences create uncertainty about reference persistence and encapsulation.
Is there a documented way to keep bound data non-public on DOM nodes without breaking joins, transitions, and event handling? Does d3 guarantee clearing of the data reference on detached nodes after an exit selection, or can references linger until garbage collection? What supported interoperability patterns exist when sensitive data must not be exposed through the d3.js and Browser DOM integration boundary?