@@ -15,12 +15,52 @@ library(ggrepel)
1515library(arrow )
1616library(DT )
1717library(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+
1943library(gt )
2044library(shiny.semantic )
2145library(semantic.dashboard )
2246library(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+
2464library(shinyalert )
2565library(tidyr )
2666library(data.table )
0 commit comments