diff --git a/ontology/ontology.json b/ontology/ontology.json index df657c9..52cd6fc 100644 --- a/ontology/ontology.json +++ b/ontology/ontology.json @@ -264,6 +264,8 @@ "soup": {}, "tea": {} }, + "tech": { + }, "miscellaneous": { "bicycle": {}, "make-up": {}, diff --git a/static/html/print.html b/static/html/print.html index be06c7e..faf54f9 100644 --- a/static/html/print.html +++ b/static/html/print.html @@ -1,3 +1,4 @@ + diff --git a/static/ontology/index.js b/static/ontology/index.js index bcab5a4..d514a4e 100644 --- a/static/ontology/index.js +++ b/static/ontology/index.js @@ -51,6 +51,22 @@ function resize() { update(root); } +function zoom(size) { + height = size; + tree.size([height, width]); + svg.attr("width", width).attr("height", height + margin.top + margin.bottom) + document.querySelector('svg').attributes.height.value = height + margin.top + margin.bottom + resize() +} + + +document.querySelector('.zoom button.plus').addEventListener('click', function(event) { + zoom(height*1.5) +}) +document.querySelector('.zoom button.minus').addEventListener('click', function(event) { + zoom(height/1.5) +}) + function get_color(d) { if (d.children || d._children) { @@ -95,7 +111,8 @@ function update(source) { }) .text(function(d) { if (d.children || d._children) { - return d.name; + //return d.name; + return d.name + '(' + (d.children || d._children).length +')'; } return d.name + ' (' + d.size + ')'; })