Skip to content

Commit

Permalink
Merge pull request #60 from duocang/modulization
Browse files Browse the repository at this point in the history
margin issues in D3 heatmap
  • Loading branch information
duocang authored Oct 21, 2023
2 parents aeec6bd + 8a9db23 commit 4f9336d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
11 changes: 10 additions & 1 deletion www/heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,16 @@ Shiny.addCustomMessageHandler('jsondata', function (pmet) {
// top margin automatically fit heatmap in overlap mode because heatmap with overlap can have many
// catagory ledgeds
if (colorIndex == -1) { // overlap heatmap
var topMargin = 20 * clusters.length
if (clusters.length >= 4) {
var topMargin = 20 * clusters.length
} else if (clusters.length == 3) {
var topMargin = 25 * clusters.length
} else if (clusters.length == 2) {
var topMargin = 30 * clusters.length
} else {
var topMargin = 20;
}

} else { // non-overlap heatmap
var topMargin = 40;
}
Expand Down
8 changes: 7 additions & 1 deletion www/shiny.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

.tab-content {
padding-top: 80px;
padding-top: 70px;
margin-top: -20px;
}

#d3Temp {
margin-top: -30px;
margin-left: -20px
}

body {
Expand Down

0 comments on commit 4f9336d

Please sign in to comment.