<jupyter_start><jupyter_text>Load demo data<jupyter_code>gauss = regulus.load('gauss4')<jupyter_output><empty_output><jupyter_text>A simple tree view<jupyter_code>b = BaseTreeView(gauss)
b
b.attr = 'span'<jupyter_output><empty_output><jupyter_text>A full tree view<jupyter_code>v = TreeView(gauss)
v
v.attr = 'child_fitness'<jupyter_output><empty_output><jupyter_text>The same TreeView can be displayed multiple timesNote: Changing one view will cause the other view to change as well (same model)<jupyter_code>v<jupyter_output><empty_output><jupyter_text>Different TreeViews of the same tree are independent<jupyter_code>v2 = TreeView(gauss, attr='span')
v2<jupyter_output><empty_output><jupyter_text>Autoif auto == True than a filter for the current attribue will be added to the filters on the botttom.try selection a different attribue from the dropdown menu<jupyter_code>v2.auto = False<jupyter_output><empty_output><jupyter_text>Views can be coordinated- note that the two views use the same filter - The second tree now shows one attribute but filter based on the attribute in the first tree<jupyter_code>v2.filters = v.filters
v2.auto = True<jupyter_output><empty_output><jupyter_text>Side Panel<jupyter_code>p = SidePanel(title='Separate panel')
p.add(v, header="First TreeView")<jupyter_output><empty_output><jupyter_text>Use the top left buttons to close/open the child, expand or remove it- A child can also be open/closed by clicking on it's header- A child doesn't need to have a header<jupyter_code>p.add(v2)
v3 = TreeView(gauss)
p.insert(1, v3, header='Third view')<jupyter_output><empty_output><jupyter_text>Views can be removed programatrically<jupyter_code>p.remove(v)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0937682003494467, 'fraction_numerical': 0.005824111822947, 'mean_word_length': 8.236559139784946, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, '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': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '207640', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 606, 'n_tokens_neox': 594, 'n_words': 155, 'path': 'examples/1-treeview.ipynb', 'repo_name': 'yarden-livnat/ipyregulus', 'size': '1717'}