Skip to content

Commit

Permalink
documentation about heatmap options
Browse files Browse the repository at this point in the history
  • Loading branch information
DivadNojnarg committed Jul 1, 2022
1 parent 9ae7d61 commit d1977e0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,33 @@ server <- function(input, output, session) {
shinyApp(ui = ui, server = server)
```

### Options

`{shinyHeatmap}` allows to tweak the heatmap style with few lines of code. This may
be achieved with the __options__ parameter that expects a list of properties available
in the heatmap.js [documentation](https://www.patrick-wied.at/static/heatmapjs/docs.html).
For instance, below we change the points radius and color:

```r
download_heatmap(
options = list(
radius = 10,
maxOpacity = .5,
minOpacity = 0,
blur = .75,
gradient = list(
".5" = "blue",
".8" = "red",
".95" = "white"
)
)
)
```

This is ideal if your app contains custom design like in the following example.

<img src="man/figures/shinyHeatmap-theming-1.png">

## Acknowledgement

`{shinyHeatmap}` is proudly powered by the excellent and free [heatmap.js](https://github.com/pa7/heatmap.js) library. Thanks [@pa7](https://github.com/pa7) for making this possible.
7 changes: 7 additions & 0 deletions inst/examples/options/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@
library(shiny)
library(shinyHeatmap)

thematic::thematic_shiny()

# Define UI for application that draws a histogram
ui <- with_heatmap(
fluidPage(
theme = bslib::bs_theme(
version = 5,
fg = "#FFF",
bg = "#000"
),
# Application title
titlePanel("Old Faithful Geyser Data"),
# Sidebar with a slider input for number of bins
Expand Down
Binary file added man/figures/shinyHeatmap-theming-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d1977e0

Please sign in to comment.