How do I clear settings from the Drupal object?
drupal_add_js adds javascript to the page &lt;head&gt;, so as far as I know you can't change that anymore with AJAX. Thus placing it in an AJAX callback doesn't work. You need to solve this at Javascript level in the the browser.

You'll have to make sure all data for all options is sent to the client during rendering and then use simple jQuery selectors to enter the correct part of data into the visualizer.