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

Add tree-like visualization of the AudioSet Ontology #22

Merged
merged 13 commits into from
Jun 12, 2017
Merged

Add tree-like visualization of the AudioSet Ontology #22

merged 13 commits into from
Jun 12, 2017

Conversation

xavierfav
Copy link
Contributor

@xavierfav xavierfav commented May 16, 2017

Tree-like visualization of the AudioSet Ontology added in the dataset page #4 :

  • models: add get_dict_tree() in Taxonomy class for formating the data as needed by the visualisation library
  • views: add "ontology" context variable in dataset()
  • client: add tree in tab for navigating between table and tree

@xavierfav xavierfav changed the title Iss4 Add tree-like visualization of the AudioSet Ontology May 16, 2017
Copy link
Member

@ffont ffont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some rather minor comments for improvements. It's mostly done. Cool!

@@ -56,6 +56,30 @@ def paths(node_id, cur=list()):

return hierarchy_paths

def get_dict_tree(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a docstring here describing what the function does.
I also suggest to change the name to get_taxonomy_as_tree.

@@ -32,6 +33,7 @@ def dataset(request, short_name):
dataset = get_object_or_404(Dataset, short_name=short_name)
user_is_maintainer = dataset.user_is_maintainer(request.user)
form_errors = False
ontology = dataset.taxonomy.get_dict_tree()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use taxonomy_tree as variable name instead of ontology.

<div id="dataset_taxonomy_table_placeholder">
<!-- MENU -->
<div class="ui inverted menu">
<a class="item" onclick="openTab(event, 'dataset_taxonomy_table_placeholder')">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add class active so is active by default.

<!-- MENU -->
<div class="ui inverted menu">
<a class="item" onclick="openTab(event, 'dataset_taxonomy_table_placeholder')">
<i class="list layout icon"></i> Content
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I'd put "Table" instead of "Content". "Content" would apply to both visualisations in my opinion.

@@ -0,0 +1,169 @@
{% block content %}

<style>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this css should be in /static/css/main.css.

}
</style>

<div id="dataset_taxonomy_tree_placeholder" class="tabcontent" style="display: none;">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These instructions are ugly hehe ;)
At least you should change the font-face so it's not different than the rest of the website. Probably by wrapping everything in a <p>. Have a look at semantic ui docs and maybe find something to put the instructions in like a message box.

Also I don't like the text on the left/on the right to differentiate. I'd put all titles on the left, and then maybe add a plus [+] symbol next to titles that can be expanded. This is just a suggestion. Also make all font-sizes and circles bigger.

@xavierfav
Copy link
Contributor Author

Changes done.
Still there is a problem when we open a lot of nodes:
They get too close from each other and texts overlap.

A sort of adaptive height of the tree container would be the best, but it is not currently implemented.

@xavierfav
Copy link
Contributor Author

Just saw another small problem: color restrictions do not correspond to ours.
Going to fix it now

@xavierfav
Copy link
Contributor Author

Ready

@ffont ffont merged commit 7e12ef4 into master Jun 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants