Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing redundant tree_data from the HTML / JS #163

Closed
fedarko opened this issue May 26, 2020 · 1 comment · Fixed by #231
Closed

Removing redundant tree_data from the HTML / JS #163

fedarko opened this issue May 26, 2020 · 1 comment · Fixed by #231
Assignees

Comments

@fedarko
Copy link
Collaborator

fedarko commented May 26, 2020

Not urgent, but there's code in _plot.py that does the following:

empress/empress/_plot.py

Lines 82 to 89 in 6e4bbd3

for i, node in enumerate(empress_tree.postorder(include_self=True), 1):
tree_data[i] = {
'name': node.name,
'color': [0.75, 0.75, 0.75],
'sampVal': 1,
'visible': True,
'single_samp': False
}

Since color and sampVal are the same for every node, it should be possible to omit these from the JSON. For trees with lots of nodes this would cut down on QZV size (and probably memory usage in the visualization) by a decent amount.

Even though attributes like color are changed dynamically in the visualization, we should be able to infer that -- for example -- a missing color for some node means that that node has the default color, aka [0.75, 0.75, 0.75] or whatever the default color is set to (#143).

@ElDeveloper
Copy link
Member

See if possible to reduce as many of the attributes saved here.

@ElDeveloper ElDeveloper added this to the Second Alpha Release milestone Jun 22, 2020
@kwcantrell kwcantrell linked a pull request Jul 2, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants