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 visualisation of the taxonomy #4

Open
ffont opened this issue Mar 28, 2017 · 6 comments
Open

Add tree-like visualisation of the taxonomy #4

ffont opened this issue Mar 28, 2017 · 6 comments
Assignees

Comments

@ffont
Copy link
Member

ffont commented Mar 28, 2017

It would be good to be able to explore the taxonomy with a tree-like visualisation as an alternative to the current list-based visualisation. Maybe user could chose which one to look at in a "tabbed" interface. Potential useful Javascript libraries for the tree-like structure:

@jordipons
Copy link
Contributor

I attach a tree-like visualization of the AudioSet Ontology: https://github.com/jordipons/AudioSetOntologyTree

Now we just need to decide some details about the visualization, specially the "color code" we aim to use.

@ffont
Copy link
Member Author

ffont commented May 5, 2017

Nice!
To integrate it with Freesound Datasets you'll need to be able to run a local installation of it. Have docker up and running, etc...

The preprocessing step should not really be needed, as Freesound Dataset already has some routines to build a tree structure out of the ontology provided with the AudioSet format (a list). We should probably add a method in the Taxonomy class which formats the data as needed by the visualisation library, and then pass this to the template with your visualisation code. Alternatively we can also setup an endpoint which returns the JSON of the taxonomy formatted as needed, and then load this JSON from the html (closer to what you're actually doing in your example).

@ffont
Copy link
Member Author

ffont commented Jun 12, 2017

Current implementation from #22 has been deployed.
Some small things that could be improved:

  • Click on category name links to explore page for category (maybe we need an "external link" button or something similar as right now when clicking in the name it opens the corresponding part of the tree.
  • User same red color for abstract or other types of non-normal classes as is used in the table version.

@xavierfav
Copy link
Contributor

  • Recently an event has been added for allowing to scroll on y-axis by mouse down & mouse move and allow easy navigation in the tree.

  • The width of the container is not high enough for displaying the entire tree (e.g. with Mallet percussion).

  • I propose to use popups similar to the one used in the annotation pages to display some informations about a category (Paths with links to category explore page, description, examples). A click on the [+] would open the tree, and a click on the name of a category would open the popup.

Once finished, peharps this tree could be great option for choosing a category to contribute to, since it is a nice way to navigate through all the categories of the AudioSet Ontology.

@aframires
Copy link
Collaborator

I have a simple suggestion to improve the navigation on the tree structure:

When you press a category, the tree navigator could automatically scroll on the y-axis to the position of the newly opened category.

I believe this would enable easier navigation, without having to resort to the mouse down & mouse move event.

@xavierfav
Copy link
Contributor

xavierfav commented Oct 18, 2018

I think it is a good idea and it should not be too complicated.
The tree is in this file freesound-datasets/datasets/templates/datasets/ontology_tree.html.

When a node is clicked, the click function is called, which takes care of updating the D3 links:

function click(d) {
  if (d.children) {     // children nodes of the clicked node are already displayed
    d._children = d.children;
    d.children = null;
  } else {              // children nodes are not displayed
    d.children = d._children;
    d._children = null;
  }
  update(d);
}

We could also scroll back to to the original node when it is closed.
The position of a node can be accessed from its properties: d.x and d.y.
It seems that y is the horizontal axis.
So basically we need to scroll the tree container around the position of the (children or clicked) node.
Something like:

document.getElementById('ontology_placeholder').scrollLeft = d.children[0].y 
                                                             - offset

or (depending on the case):

document.getElementById('ontology_placeholder').scrollLeft = d.y - offset

@aframires, if you want you can try to setup a development version of the website (I can help you on that but it should not be too complicated - We <3 Docker)
Work in the branch iss4 (you should merge master into it to have it up to date), develop the proposed feature, create a pull request (referencing this issue #4 inside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants