Skip to content

Commit e1fc65d

Browse files
authored
Merge pull request #19 from DatViseR/Dev_new_installation_script_dep_handling_MacOS
Dev new installation script dep handling mac os
2 parents 6815e8b + 5c3503b commit e1fc65d

2 files changed

Lines changed: 984 additions & 743 deletions

File tree

app.R

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,52 @@ library(ggrepel)
1515
library(arrow)
1616
library(DT)
1717
library(plotly)
18-
library(Cairo)
18+
19+
# Cairo Graphics Library - Conditional Loading
20+
# Cairo provides high-quality graphics rendering and is especially beneficial for:
21+
# - Publication-quality plot output with better anti-aliasing
22+
# - Consistent cross-platform graphics rendering
23+
# - Enhanced PDF/PNG export capabilities
24+
# - Better font rendering and Unicode support
25+
#
26+
# macOS Installation Issues:
27+
# Cairo can be problematic on macOS due to:
28+
# - Complex system dependencies (X11, fontconfig, freetype)
29+
# - Conflicts between Homebrew Intel/ARM installations
30+
# - Xcode Command Line Tools version mismatches
31+
# - Different Cairo versions in system vs. Homebrew paths
32+
#
33+
# The app functions without Cairo using R's default graphics devices,
34+
# but users may experience slightly lower quality plot rendering.
35+
36+
if (requireNamespace("Cairo", quietly = TRUE)) {
37+
library(Cairo)
38+
message("✓ Cairo graphics library loaded - enhanced plot rendering available")
39+
} else {
40+
message("ℹ Cairo not available - using default graphics (install Cairo for enhanced rendering)")
41+
}
42+
1943
library(gt)
2044
library(shiny.semantic)
2145
library(semantic.dashboard)
2246
library(gridExtra)
23-
library(webshot2)
47+
48+
# WebShot2 - Conditional Loading
49+
# WebShot2 enables web page screenshots and may depend on Cairo availability
50+
# Falls back gracefully if not available
51+
52+
# This version of the app exports GT tables as HTML files and does not depend on
53+
# webshot2. PDF export depends on webshot2 which is not working in the posit connect cloud - that is why
54+
# export was changed to HTML export. You can enable
55+
#pdf export by modifying the downloadHandler() code for gt tables before installation in your private server
56+
57+
if (requireNamespace("webshot2", quietly = TRUE)) {
58+
library(webshot2)
59+
message("✓ WebShot2 loaded - screenshot capabilities available")
60+
} else {
61+
message("ℹ WebShot2 not available - some export features may be limited")
62+
}
63+
2464
library(shinyalert)
2565
library(tidyr)
2666
library(data.table)

0 commit comments

Comments
 (0)