Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
DivadNojnarg committed Feb 2, 2023
1 parent 5b388dc commit be12a09
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 13 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: shinyHeatmap
Title: Usage Heatmap for Shiny apps
Version: 0.2.1.9000
Version: 0.2.2.9000
Authors@R:
person("David", "Granjon", , "dgranjon@ymail.com", role = c("aut", "cre"))
Description: Have you ever wondered how people are enjoying your Shiny app?
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# shinyHeatmap 0.2.2.9000

## Minor change
- Adjust z-index for pushar overlay, pushbar and heatmap canvas.
- Remove delay in R code.
- More space between heatmap buttons (toggle and options).

# shinyHeatmap 0.2.1.9000

## New feature
Expand Down
2 changes: 0 additions & 2 deletions R/heatmap.R
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,6 @@ download_heatmap <- function(

# Init heatmap container (once)
observeEvent(target(), {
# Init heatmap container without tracking
Sys.sleep(timeout/1000 + 1)
session$sendCustomMessage(
"initialize_container",
list(
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ init_heatmap_storage <- function(session, trigger) {
download_heatmap_ui <- function() {
pushbar(
class = "shiny-input-panel",
style = "background: gainsboro",
style = "background: gainsboro; z-index: 99999",
from = "bottom",
id = "shiny-heatmap-ui",
h1("shinyHeatmap UI"),
Expand Down
4 changes: 2 additions & 2 deletions inst/examples/navbar/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ server <- function(input, output, session) {
# trigger = reactive(input$navbar),
# target = "body"
#)
download_heatmap(trigger = reactive(input$navbar), target = "body")
#process_heatmap(trigger = reactive(input$navbar), target = "body")
#download_heatmap(trigger = reactive(input$navbar), target = "body")
process_heatmap(trigger = reactive(input$navbar), target = "body")

output$plot <- renderPlot({
plot(cars, type=input$plotType)
Expand Down
13 changes: 9 additions & 4 deletions inst/heatmap.js-2.0.5/shiny-heatmap.js

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions srcjs/exts/shiny-heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ $(document).ready(function(){
});

Shiny.addCustomMessageHandler('initialize_container', function(m) {
// Set timeout to wait for a given time. Useful if the app
// takes time to load and DOM elements are not all here.
setTimeout(function() {
heatmapContainer = document.querySelector(m.target);
if (!!m.track) {
Expand Down Expand Up @@ -78,7 +80,7 @@ $(document).ready(function(){
$heatmapUITrigger.css({
position: 'fixed',
top: '20px',
right: '140px',
right: '180px',
height: '40px',
'border-radius': '5px',
'z-index': '99999',
Expand Down Expand Up @@ -114,6 +116,8 @@ $(document).ready(function(){
$('body').append([$heatmapUITrigger, $toggleHeatmap]);
// Don't forget to bind new shiny input
Shiny.bindAll();

$('.pushbar_overlay').css('z-index', 99998)
}

// Show canvas each time data are updated
Expand All @@ -131,8 +135,9 @@ $(document).ready(function(){
});

// set z-index to make sure it is always visible
// Must be below the download button with 99999 z-index.
// Must be below the download button with 99999 z-index and
// the pushbar_overlay with 99998 z-index.
$(document).on('heatmap-added', function(m) {
$(".heatmap-canvas").css("z-index", 99998);
$(".heatmap-canvas").css("z-index", 99997);
});
});

0 comments on commit be12a09

Please sign in to comment.