Skip to content

Commit

Permalink
Improve scrollbar handling in HTML hierarchy vis
Browse files Browse the repository at this point in the history
  • Loading branch information
opcode81 committed Jul 10, 2024
1 parent 28fc984 commit a9ff795
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 5 additions & 5 deletions notebooks/hierarchy_inference.ipynb

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions resources/jinja_templates/hierarchy.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
height: 100%;
overflow-x: scroll;
overflow-y: scroll;
box-sizing: border-box;
}

#svg {
Expand Down Expand Up @@ -52,15 +53,13 @@

const resizeElements = function() {
console.log("resize");
const scrollbarWidth = 17;
const hierarchyWidth = 380;
var windowWidth = $(window).width();
$hierarchy.width(hierarchyWidth);
$svg.width(windowWidth-hierarchyWidth);
$svg.width(windowWidth-hierarchyWidth-scrollbarWidth);
};

resizeElements();
$(window).on('resize', resizeElements);

// create hierarchy tree
// data: list of objects
var treeData = {{ hierarchyData|safe }};
Expand All @@ -82,6 +81,9 @@
$("#" + node.data["id"]).addClass("visible");
});
});

resizeElements();
$(window).on('resize', resizeElements);
});
</script>

Expand Down

0 comments on commit a9ff795

Please sign in to comment.