Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Before the main content: I am creating an R Community on Google Groups. You can join the group using this form.
I’ve been working on a a modern dashboard framework for R using the beautiful Tabler Bootstrap theme. Furthermore, to render Tabler apps using a server I created Tabler Server alongside the process.
Installation
Old version, depends on Shiny:
install.packages("tabler", repos = "https://cran.r-project.org")
New version, does not use Shiny:
# using the R-Universe
install.packages("tabler", repos = "https://pachadotdev.r-universe.dev")
# or using the remotes package
remotes::install_github("pachadotdev/tabler")
Quick Start
Single-script app
The following example uses the “combo” layout to recreate Shiny’s geyser example. The theme options can be adjusted from the code or the theme setting icon that can be hidden. See the example here.
I added a UI-only example to cover the different input elements and their options here.
Modular R package app
Create an R package with modular components:
library(tabler)
pkg_template("mydashboard")
See the package skeleton here. pkg_template() adds a DESCRIPTION and other components required for an R package to work.
For instance, Open Trade Statistics consists in a full dashboard that uses environment variables, SQL connections, caching, and D3 plots. Its code is here, and the result is here.
Loading/Progress bar
I added an example with a progress bar here. The progress bar hides the app while the new plots or other elements are computed.
Login page
This R package provides a login page that you can connect to a database or another system. The example here shows the dashboard after correctly typing the user “SpaceMariner” and password “IDDQD”. There is an example using RSQLite here.
I was thinking about adding a Google/Outlook/GitHub account login but I have no idea how to. If you know how and would like to contribute, please comment here.
Does it run Doom?
Yes. I tested the WebSocket compiling and running the Doom WASM version. See the code here.
Available Layouts
There are additional examples for each of the following layouts:
- Boxed (Default): Basic dashboard with top navbar and constrained width content area. This is the default layout.
- Combo: Combines vertical sidebar navigation with top header.
- Condensed: Compact layout with reduced padding/margins.
- Fluid: Full-width layout without container constraints.
- Fluid Vertical: Full-width layout with vertical sidebar.
- Horizontal: Layout with horizontal navigation menu.
- Navbar Dark: Layout with dark navbar theme.
- Navbar Overlap: Layout where content overlaps with navbar for a modern look.
- Navbar Sticky: Layout with sticky/fixed navbar that stays at the top when scrolling.
- RTL: Right-to-left layout for Hebrew/Arabic languages.
- Vertical: Vertical sidebar layout without top navbar.
- Vertical Right: Vertical sidebar positioned on the right side.
- Vertical Transparent: Vertical layout with transparent sidebar.
Note: tabler allows to pass layout = "navbar" and layout = "navbar-sticky-dark" which are wrappers for a light theme navbar layout and a dark theme sticky navbar layour, respectively.
Differences with Shiny
- Static plots (base, ggplot, tinyplot, etc.) render as SVG and can be downloaded with the right click button.
- URLs are of the form
my.site/myapp?year=2000&country=gbrinstead ofmy.site/myapp?year=2000&country=%22gbr%22
License
Apache License (>= 2)
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
