CODAIT / text-extensions-for-pandas

Natural language processing support for Pandas dataframes.
Apache License 2.0
215 stars 34 forks source link

Add backup static HTML rendering to new JavaScript-based span rendering #209

Closed frreiss closed 2 years ago

frreiss commented 3 years ago

In the new JavaScript-based span rendering engine, the static HTML that is initially displayed (before the script tags kick in) looks like this:

         <div class="span-array" data-instance="{_spanarray_instance_counter}">
            If you're reading this message, your notebook viewer does not support Javascript execution. Try pasting the URL into a service like nbviewer.
        </div>

This message doesn't show up in a live notebook, but it will show up in the Github rendering of notebooks and possibly in environments like vscode that can disable JavaScript when rendering untrusted notebooks.

We should replace the above block with a simplified, purely-static version of the live JavaScript/HTML5 visualization. Ideally we should share as much of the backing resources as possible between static and JavaScript-generated versions of the content.

frreiss commented 3 years ago

Note: Probably want to port the fromSpanArray() function in the JavaScript over to Python and have it run as a preprocessing step instead of running in the browser.