side of it. To make it accessible outside of <code>renderValue</code> requires a tiny but consequential change without which resizing the widget will not be doable for instance.</p>
<p>The <code>controller</code> variable has to be declared outside of the <code>renderValue</code> function, inside the <code>factory</code>. This was in fact indicated from the onset by the following comment: <code>// TODO: define shared variables for this instance</code> (generated by <code>htmlwidgets::scaffoldWidget</code>).