Skip to content

Commit e50be39

Browse files
authored
Update digestR.R
1 parent 44bc40e commit e50be39

File tree

1 file changed

+64
-9
lines changed

1 file changed

+64
-9
lines changed

R/digestR.R

+64-9
Original file line numberDiff line numberDiff line change
@@ -1365,28 +1365,83 @@ popupGui <- function(dev){
13651365
##################################################################################
13661366

13671367

1368+
# splashScreen <- function() {
1369+
1370+
# library(png) # For PNG images
1371+
# par(mar=defaultSettings$mar, cex.axis=defaultSettings$cex.axis,
1372+
# cex.main=defaultSettings$cex.main, bg='black')
1373+
# colMain <- '#b4d0f3'
1374+
# colBack <- '#0065ca'
1375+
# plot(0, 0, type='n', xlab='', ylab='', col.axis='black')
1376+
1377+
# # Load the image and get its dimensions
1378+
# img_path <- system.file("extdata", "DigestRpicture.png", package = "digestR")
1379+
# img <- readPNG(img_path)
1380+
1381+
# # Define plot area without axis
1382+
# plot(0, 0, type='n', xlab='', ylab='', axes=FALSE, xlim=c(-1.5, 1.5), ylim=c(-1.5, 1.5))
1383+
1384+
# # Display the image
1385+
# rasterImage(img, 3, 3, 3, 3)
1386+
1387+
# # Letter positions and modern color scheme for "PANDAS"
1388+
# letters <- c('P', 'A', 'N', 'D', 'A', 'S')
1389+
# x_positions <- c(-0.8, -0.5, -0.2, 0.1, 0.4, 0.7) # Custom X positions for each letter
1390+
# y_positions <- c(0.62, 0.62, 0.62, 0.62, 0.62, 0.62) # Same Y position for all
1391+
# colors <- rep('#4da6ff', 6) # Light blue for all letters
1392+
# cex_values <- rep(5, 6) # Font size for letters
1393+
1394+
# # Add shadow effect to the letters for depth
1395+
# shadow_col <- '#00000050' # Semi-transparent black shadow
1396+
# for (i in 1:length(letters)) {
1397+
# text(x_positions[i] + 0.02, y_positions[i] - 0.02, letters[i], col=shadow_col, cex=cex_values[i], pos=3)
1398+
# text(x_positions[i], y_positions[i], letters[i], col=colors[i], cex=cex_values[i], pos=3)
1399+
# }
1400+
1401+
# # Add black shadow for the title "Peptide Analyzer of Naturally Digested Amino acid Sequences"
1402+
# text(0, -0.4, 'Peptide Analyzer of', col='black', cex=1.80, font=2.3) # Black shadow
1403+
# text(0, -0.4, 'Peptide Analyzer of', col='#4da6ff', cex=1.8, font=2) # Main text
1404+
1405+
# # Shadow for "Naturally Digested Amino acid Sequences"
1406+
# text(0, -0.53, 'Naturally Digested Amino acid Sequences', col='black', cex=1.80, font=2.3) # Black shadow
1407+
# text(0, -0.53, 'Naturally Digested Amino acid Sequences', col='#4da6ff', cex=1.8, font=2) # Main text
1408+
1409+
# # Version and command text, shifted further downwards
1410+
# text(0, -0.75, paste('version 1.0.0', pkgVar$version), col='#00b3b3', font=2) # Dynamic color
1411+
1412+
# # Clean, minimal function list with better spacing and shifted downwards
1413+
# text(0, -0.86, 'gp() - Generate New Proteome', col='#00b3b3', cex=1.1, font = 2) # Light blue
1414+
# text(0, -0.94, 'pm() - Process Mascot files', col='#00b3b3', cex=1.1, font = 2) # Light blue
1415+
# text(0, -1.02, 'fo() - Open *.dcf files', col='#00b3b3', cex=1.1, font = 2) # Light blue
1416+
1417+
# # Force the graphics device to refresh
1418+
# dev.flush()
1419+
# }
1420+
1421+
# splashScreen()
1422+
##################################################################################
1423+
library(png) # For PNG images
13681424

13691425
splashScreen <- function() {
13701426

1371-
library(png) # For PNG images
13721427
par(mar=defaultSettings$mar, cex.axis=defaultSettings$cex.axis,
13731428
cex.main=defaultSettings$cex.main, bg='black')
1429+
13741430
colMain <- '#b4d0f3'
13751431
colBack <- '#0065ca'
1376-
plot(0, 0, type='n', xlab='', ylab='', col.axis='black')
1432+
1433+
# Define plot area without axis
1434+
plot(0, 0, type='n', xlab='', ylab='', axes=FALSE, xlim=c(-1.5, 1.5), ylim=c(-1.5, 1.5))
13771435

13781436
# Load the image and get its dimensions
13791437
img_path <- system.file("extdata", "DigestRpicture.png", package = "digestR")
13801438
img <- readPNG(img_path)
13811439

1382-
# Define plot area without axis
1383-
plot(0, 0, type='n', xlab='', ylab='', axes=FALSE, xlim=c(-1.5, 1.5), ylim=c(-1.5, 1.5))
1384-
1385-
# Display the image
1386-
rasterImage(img, 3, 3, 3, 3)
1440+
# Display the image - fitting it in the entire splash screen area
1441+
rasterImage(img, -1.5, -1.5, 1.5, 1.5)
13871442

13881443
# Letter positions and modern color scheme for "PANDAS"
1389-
letters <- c('P', 'A', 'N', 'D', 'A', 'S')
1444+
letters <- c('P', 'A', 'N', 'D', 'A', 'S')
13901445
x_positions <- c(-0.8, -0.5, -0.2, 0.1, 0.4, 0.7) # Custom X positions for each letter
13911446
y_positions <- c(0.62, 0.62, 0.62, 0.62, 0.62, 0.62) # Same Y position for all
13921447
colors <- rep('#4da6ff', 6) # Light blue for all letters
@@ -1419,7 +1474,7 @@ splashScreen <- function() {
14191474
dev.flush()
14201475
}
14211476

1422-
# splashScreen()
1477+
splashScreen()
14231478

14241479
##################################################################################
14251480

0 commit comments

Comments
 (0)