Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions docs/ssvc-explorer/simple.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm.. I saw the rows to be off any 6% when the number of rows to show were somewhere close to 70 rows. The number could be greater as the number of rows increase. Can this be more dynamic? I am probably doing something wrong as I am calculating this svg_height variable..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the height calculation to be dynamic. The adjustment now scales with tree size:

  • Base: 6% for ≤60 rows
  • Larger trees: +0.1% per additional row (e.g., 70 rows = 7%, 100 rows = 10%)

This provides better coverage for trees with more rows. Commit: e8f4a4b

Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ const graphModule = (function() {
height = 800 - margin.top - margin.bottom
if(showFullTree) {
var add_offset = 0
if(raw.length > 60 )
add_offset = (raw.length - 60)*5
height = 1300 - margin.top - margin.bottom + add_offset
if(raw.length > 60)
add_offset = (raw.length - 60)*10
height = Math.max(1300, raw.length * 20) - margin.top - margin.bottom + add_offset
}
duration = 750
tree = d3.layout.tree()
Expand Down Expand Up @@ -309,6 +309,10 @@ const graphModule = (function() {

var yOffset = 90;
var xOffset = -xMin + yOffset;
var newHeight = xMax - xMin + 2 * yOffset;
if (newHeight > parseInt($('svg.mgraph').attr("height"))) {
$('svg.mgraph').attr("height", newHeight);
}
svg.attr("transform", "translate(" + 100 + "," + xOffset + ")");
}
function check_children(d,a,b) {
Expand Down
Loading