'Returns a JS script HTML fragment, which will populate the container.
Args:
trace: binary-encoded MasterTrace string.
master_spec: Master spec proto (parsed), which can improve the layout. May
be required in future versions.
Returns:
unicode with HTML contents.'

def show_trace(self, trace, master_spec=None):

    html = '\n                <meta    charset="utf-8"/>\n                <script    type=\'text/javascript\'>\n                document.getElementById("{elt_id}").innerHTML    =    "";        //    Clear    previous.\n                visualizeToDiv({json},    "{elt_id}",    {master_spec_json});\n                </script>\n                '.format(json=parse_trace_json(trace), master_spec_json=_optional_master_spec_json(master_spec), elt_id=self.elt_id)
    return unicode(html, 'utf-8')
