Skip to content

Commit

Permalink
Merge pull request #443 from veg/gh-439
Browse files Browse the repository at this point in the history
making node font size a configurable option
  • Loading branch information
stevenweaver authored Oct 16, 2023
2 parents 846df03 + 9c43b0a commit d6e18ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 5 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1052,9 +1052,9 @@ <h4 class="modal-title">Task in progress</h4>
tree.display.update();
});

console.log('Setting label within the tree display');
console.log(id);
console.log(selection_set[id]);
//console.log('Setting label within the tree display');
//console.log(id);
//console.log(selection_set[id]);
tree.display.selectionLabel(selection_set[id]);
tree.display.update();
}
Expand Down Expand Up @@ -1202,7 +1202,7 @@ <h4 class="modal-title">Task in progress</h4>
}
}
} catch (e) {
console.log("Could not process stylesheet : " + ss); // eslint-disable-line
//console.log("Could not process stylesheet : " + ss); // eslint-disable-line
}
}

Expand Down Expand Up @@ -1294,6 +1294,7 @@ <h4 class="modal-title">Task in progress</h4>
"draw-size-bubbles": false,
"bubble-styler": d => { return 5 },
"node-styler": node_colorizer,
"font-size": 12,
zoom: false,
"edge-styler": edge_colorizer
});
Expand Down
8 changes: 5 additions & 3 deletions src/render/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ class TreeRender {
this.scales = [1, 1];
this.size = [1, 1];
this.fixed_width = [14, 30];
this.font_size = 12;
this.scale_bar_font_size = 12;
this.offsets = [0, this.font_size / 2];

this.draw_branch = draw_line;
this.draw_scale_bar = null;
Expand All @@ -46,7 +44,6 @@ class TreeRender {
this.layout_listener_handler = function() {};
this.node_styler = undefined;
this.edge_styler = undefined;
this.shown_font_size = this.font_size;
this.selection_attribute_name = "selected";
this.right_most_leaf = 0;
this.label_width = 0;
Expand All @@ -65,6 +62,7 @@ class TreeRender {
scaling: true,
bootstrap: false,
"color-fill": true,
"font-size": 14,
"internal-names": false,
selectable: true,
// restricted-selectable can take an array of predetermined
Expand Down Expand Up @@ -111,6 +109,10 @@ class TreeRender {

this.options = _.defaults(options, default_options);

this.font_size = this.options["font-size"];
this.offsets = [0, this.font_size / 2];
this.shown_font_size = this.font_size;

this.width = this.options.width || 800;
this.height = this.options.height || 600;

Expand Down

0 comments on commit d6e18ed

Please sign in to comment.