<jupyter_start><jupyter_text>Debug ways to size the viewerEspecially: how can we control the height of the viewer?<jupyter_code>from IPython.display import display, HTML, Javascript
import gatenlp
from gatenlp import Document
from gatenlp.gatenlpconfig import gatenlpconfig
from gatenlp.serialization.default import HtmlAnnViewerSerializer
from gatenlp import init_notebook

# init_notebook()
gatenlpconfig.notebook_js_initialized
doc = Document("This is just some document")
anns = doc.annset()
anns.add(0,2,"ANN")
anns.add(4,7,"ANN")
anns.add(9,13,"ANN")
html = doc.save_mem(fmt="html-ann-viewer", offline=True, add_js=True, notebook=True)
with open("debug-viewer-size-html.html", "wt" ) as outfp:
    print(html, file=outfp)
# read in the manually modified HTML and inject here
with open("debug-viewer-size-html-modified.html", "rt") as infp:
    mhtml = infp.read()

display(HTML(mhtml))<jupyter_output><empty_output><jupyter_text>Notes: * When I remove the height for -content alltogether, nothing changes* when I set the height to a smaller value, the docview size is the same, but shown in a smaller viewport with a vertical scrollbar<jupyter_code>with open("debug1.html", "rt") as infp:
    mhtml = infp.read()
display(HTML(mhtml))
with open("debug2.html", "rt") as infp:
    html2 = infp.read()
display(HTML(html2))
from gatenlp import gatenlpconfig
gatenlpconfig.doc_html_repr_height1_nostretch = "max-height: 10em;"
doc = Document("this is just some text\nthis is just some text\nthis is just some text\nthis is just some text\nthis is just some text\nthis is just some text\nthis is just some text\nthis is just some text\nthis is just some text\nthis is just some text\nthis is just some text\nthis is just some text\nthis is just some text\nthis is just some text\nthis is just some text\nthis is just some text\nthis is just some text\n")
anns = doc.annset()
anns.add(0,1,"Ann1")
anns.add(0,1,"Ann2")
anns.add(0,1,"Ann3")
anns.add(0,1,"Ann4")
anns.add(0,1,"Ann5")
anns.add(0,1,"Ann6")
doc
html = doc.save_mem(fmt="html-ann-viewer", stretch_height=True, notebook=True)
display(HTML(html))
doc2 = Document("")
doc2<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11636532220676866, 'fraction_numerical': 0.01576263328697265, 'mean_word_length': 5.894568690095847, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '507032', 'license': 'Apache-2.0', 'n_tokens_mistral': 768, 'n_tokens_neox': 754, 'n_words': 224, 'path': 'debug/debug-viewer-size.ipynb', 'repo_name': 'gitter-badger/python-gatenlp', 'size': '2157'}