Skip to content

Commit

Permalink
Column labels now align baseline to middle instead of bottom
Browse files Browse the repository at this point in the history
Signed-off-by: Abeshouse, Adam A./Sloan Kettering Institute <abeshoua@mskcc.org>
  • Loading branch information
Abeshouse, Adam A./Sloan Kettering Institute authored and onursumer committed May 10, 2022
1 parent 757cb1b commit bce9c3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/oncoprintjs/dist/oncoprint.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -33950,6 +33950,7 @@ var OncoprintWebGLCellView = (function () {
view.column_label_ctx.fillStyle = "rgba(0,0,0,1)";
view.column_label_ctx.font = (view.supersampling_ratio*font_size)+"px "+font_family;
view.column_label_ctx.textAlign = "left";
view.column_label_ctx.textBaseline = "middle";
for (var i=0; i<ids.length; i++) {
if (ids[i] in labels) {
var x = (x_map[ids[i]] + cell_width/2 - scroll_x)*view.supersampling_ratio;
Expand Down Expand Up @@ -34492,7 +34493,8 @@ var OncoprintWebGLCellView = (function () {
"font-weight":"normal",
"text-anchor":"start",
"fill":"black",
"transform":"rotate("+COLUMN_LABEL_ANGLE+","+x+","+column_label_y+")"
"transform":"rotate("+COLUMN_LABEL_ANGLE+","+x+","+column_label_y+")",
"alignment-baseline":"middle"
});
textElt.textContent = labels[id];
root.appendChild(textElt);
Expand Down
4 changes: 3 additions & 1 deletion packages/oncoprintjs/src/js/oncoprintwebglcellview.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ var OncoprintWebGLCellView = (function () {
view.column_label_ctx.fillStyle = "rgba(0,0,0,1)";
view.column_label_ctx.font = (view.supersampling_ratio*font_size)+"px "+font_family;
view.column_label_ctx.textAlign = "left";
view.column_label_ctx.textBaseline = "middle";
for (var i=0; i<ids.length; i++) {
if (ids[i] in labels) {
var x = (x_map[ids[i]] + cell_width/2 - scroll_x)*view.supersampling_ratio;
Expand Down Expand Up @@ -1031,7 +1032,8 @@ var OncoprintWebGLCellView = (function () {
"font-weight":"normal",
"text-anchor":"start",
"fill":"black",
"transform":"rotate("+COLUMN_LABEL_ANGLE+","+x+","+column_label_y+")"
"transform":"rotate("+COLUMN_LABEL_ANGLE+","+x+","+column_label_y+")",
"alignment-baseline":"middle"
});
textElt.textContent = labels[id];
root.appendChild(textElt);
Expand Down

0 comments on commit bce9c3d

Please sign in to comment.