Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
281 commits
Select commit Hold shift + click to select a range
2ce3064
use chosenWidget, to get add_row(..., selectedWidget=chosenWidget)
Apr 21, 2020
f5fda49
added extraneous code for edge case of null column type
Apr 21, 2020
1c4f5d6
Going back
Apr 21, 2020
a1cd4c8
bump version
Apr 21, 2020
626e557
Bugfix, !is.null(colType) shoud be is.null(colType)
Apr 21, 2020
f64c688
cosemetic cleansing
Apr 21, 2020
b7ea7ff
Update README.md
mslegrand Apr 22, 2020
98def82
Update README.md
mslegrand Apr 22, 2020
525023a
Update README.md
mslegrand Apr 22, 2020
36376ed
Update README.md
mslegrand Apr 25, 2020
bc6d892
Update README.md
mslegrand Apr 25, 2020
298276f
For unknown reasons we can no longer loads an svg, so added workaroun…
May 1, 2020
19d54c5
Merge branch 'master' of https://github.com/mslegrand/pointR
May 1, 2020
b41b470
bug fix: make graph unselectable
May 3, 2020
31e16db
use crosshair cursor for point mode
May 3, 2020
a32f1df
bug fix: tib[[x,y]] => tib[[y]][[x]]
May 5, 2020
9c1648e
remove list entry option from modal
May 5, 2020
b8bf579
getTibMatCol if null set to 0
May 5, 2020
95d354f
get orderingreorder width
May 5, 2020
d024e64
seperated slider widget treatment form other widgets
May 5, 2020
c5b77cd
use columntype to decide how to set value in Tib col
May 5, 2020
3ff67b9
remove fucntion pointRLogoSVG()
May 5, 2020
7f8a516
remove sampleProjects
mslegrand May 6, 2020
3e71856
Remove sampleProjects from pointR
mslegrand May 6, 2020
0ee9501
Update README.md
mslegrand May 6, 2020
8c15b4d
Update README.md
mslegrand May 6, 2020
a8633c4
replace NA by 0
mslegrand May 6, 2020
5eff94e
bug fix: [[x,y]] => [[y]][[x]]
mslegrand May 6, 2020
9a00b01
Merge pull request #77 from mslegrand/widgets
mslegrand May 6, 2020
0ea5336
Update README.md
mslegrand May 11, 2020
453633a
Update README.md
mslegrand May 11, 2020
98d5bcf
uncommented moveByX, moveByY, it seems that these are necessary for d…
mslegrand May 14, 2020
d424b14
added gradientUnits to gradients
mslegrand May 14, 2020
a1c1dd6
added reference to RStudio shinh and to electron
mslegrand May 16, 2020
4e1b6fe
replace ctrlKey with shiftKey
mslegrand May 16, 2020
359b7b3
Merge pull request #78 from mslegrand/widgets
mslegrand May 17, 2020
cfe5617
added updateRowPicker for max points
mslegrand May 17, 2020
91bf14d
Merge pull request #79 from mslegrand/widgets
mslegrand May 17, 2020
82031eb
bug fix, clean out old preprocs when updating
mslegrand Jun 1, 2020
cdc8418
Merge pull request #80 from mslegrand/widgets
mslegrand Jun 2, 2020
58b814d
sve button now calls saveAs if file is unnamed
mslegrand Jun 2, 2020
4195137
remove tooltip forfile paht from menu
mslegrand Jun 2, 2020
3324ea3
explicitly add getDxy, context to environment for moveTo
mslegrand Jun 3, 2020
f21661f
explicity andd getPoint, context to environment for ptMove
mslegrand Jun 3, 2020
1e52fb8
inserted into environments movePoint, insertPoint, moveMatrix
mslegrand Jun 3, 2020
61fcd8b
removed stringr lib call.
mslegrand Jul 1, 2020
fcdd8d4
removed log of ui variable
mslegrand Jul 1, 2020
d9ef169
fix home for windows under electron
mslegrand Jul 5, 2020
3b620ae
normalize files to qvoid repeats (~ vs /usr/home..)
mslegrand Aug 5, 2020
083a757
Rewrite of preproc io
mslegrand Sep 20, 2020
0e06cf3
ReactiveChartBuilder
mslegrand Sep 21, 2020
222bab7
rename writeAuxPreprocPoints to write writeAuxPreprocList
mslegrand Sep 21, 2020
72cf64b
added shinyalert for execption handling
mslegrand Sep 21, 2020
3a458c9
bump version
mslegrand Sep 21, 2020
7afa708
Merge pull request #81 from mslegrand/widgets
mslegrand Sep 21, 2020
73a9105
set keep.source=TRUE
mslegrand Sep 22, 2020
1e516cd
Merge pull request #82 from mslegrand/widgets
mslegrand Sep 23, 2020
0ce9a8f
style for footer text
mslegrand Sep 25, 2020
c2e14f6
added some safety checks for getPreProcScriptName
mslegrand Sep 25, 2020
2ea6403
added getScriptName
mslegrand Sep 26, 2020
c33170d
adding name of current preproc script to footer
mslegrand Sep 26, 2020
e2c7426
reinit preprocscriptDB upon project change
mslegrand Sep 29, 2020
019e6e9
bump version
mslegrand Sep 29, 2020
bb16ea3
Merge pull request #83 from mslegrand/widgets
mslegrand Sep 29, 2020
5616ac1
improved rowIndex handling: try to match value when changing tibs
mslegrand Sep 30, 2020
40d351f
added some tooltips
mslegrand Oct 1, 2020
751087d
creates .templates as a subdir of .ptR dir
mslegrand Oct 2, 2020
6a369e9
place colourable as first choice for colourable cols
mslegrand Oct 2, 2020
14623ac
add to menu 'add template', 'remove template'
mslegrand Oct 2, 2020
1d4c58d
remove reactiveChartBldr project from startup menu
mslegrand Oct 6, 2020
d08c359
removing reactiveChartBldr from initial projects
mslegrand Oct 6, 2020
2cd0c66
edit newProject menu
mslegrand Oct 6, 2020
1c34adb
enable/disable user templates as appropriate
mslegrand Oct 6, 2020
a2bfad3
rework new proj template modal
mslegrand Oct 6, 2020
a11ebe2
indexing bug fix for setting tib value
mslegrand Oct 6, 2020
4093cd5
bug fix for values set by preproc script
mslegrand Oct 6, 2020
fa469af
Turnoff logger
mslegrand Oct 7, 2020
5b3043c
commment out debug info
mslegrand Oct 7, 2020
ca47be5
add immutable widget to db
mslegrand Oct 7, 2020
2782958
bump version
mslegrand Oct 7, 2020
4234fd8
ace modified to remove the use of bold for element tags (bold causes …
mslegrand Oct 7, 2020
bffd981
Merge pull request #84 from mslegrand/widgets
mslegrand Oct 7, 2020
c09f183
Added feature to reload file if changed externally (valid for electro…
mslegrand Oct 10, 2020
e31455f
Added feature to reload file if changed externally (valid for electro…
mslegrand Oct 10, 2020
551a7df
comment out alert
mslegrand Oct 22, 2020
733cd76
fix polygon and polyine dnds
mslegrand Oct 22, 2020
20dee4c
remove the .pprj from the name prior to substitution in dnds @project…
mslegrand Oct 22, 2020
7878458
normalize paths for watcher
mslegrand Oct 22, 2020
8adf77a
use variable initialValue as value for controls
mslegrand Oct 22, 2020
aacad16
clean up presentation by adding box element
mslegrand Oct 22, 2020
fb0b547
set params$CMDS<-c(...)
mslegrand Oct 22, 2020
e981558
remove quote around CMDS[...]
mslegrand Oct 22, 2020
6a97465
use @projectName@ in dnds
mslegrand Oct 22, 2020
ced4038
add extract attr from element
mslegrand Oct 22, 2020
a2709c8
clean up sampleShapes
mslegrand Oct 22, 2020
daf625d
Leading uppercase for @Projectname@
mslegrand Nov 3, 2020
ed2e414
reworked shinyInputControl template
mslegrand Nov 3, 2020
067e289
update comments for shinyInputControl template
mslegrand Dec 1, 2020
8795efb
hide edit preproc when no preproc is available
mslegrand Dec 12, 2020
49dca17
using jqScrollBar for asset and column buttons
mslegrand Dec 18, 2020
3d76b32
radioGroupButtons => jqScrollBar
mslegrand Dec 18, 2020
c1e21c0
1. added restrictMode, labelMode to displayOptions
mslegrand Dec 22, 2020
39aaf0d
styling of ace tabs
mslegrand Dec 22, 2020
9cc110a
styling of ace tabs
mslegrand Dec 22, 2020
0f5328e
remove dangleing comma
mslegrand Dec 24, 2020
e16f971
Add custom Choice Sets
mslegrand Dec 24, 2020
e989c53
return NULL instead of 'none'
mslegrand Dec 25, 2020
435adc4
clean up modal dialog input for new column
mslegrand Dec 25, 2020
19f0457
added import column choice set
mslegrand Dec 26, 2020
0135d79
moved files into choiceSet dir
mslegrand Dec 28, 2020
dbba218
file rename to choiceSet
mslegrand Dec 28, 2020
055a596
file rename to choice set
mslegrand Dec 28, 2020
1fd6e31
ColSet => ChoiceSet
mslegrand Dec 28, 2020
15b3b07
ColSet => ChoiceSet
mslegrand Dec 28, 2020
7b2029c
Merge branch 'Hilbert' of https://github.com/mslegrand/pointR into Hi…
mslegrand Dec 28, 2020
72cb1c5
ColSet=> ChoiceSet
mslegrand Dec 28, 2020
9fc6c05
nchar <8 =>nchar <6
mslegrand Dec 28, 2020
846a0d8
cosmetic cleanup
mslegrand Dec 28, 2020
28a4282
added getChoiceSetElements
mslegrand Dec 29, 2020
6172851
added getChoiceElements
mslegrand Dec 29, 2020
79bc8fc
sync choiceSetName with choiceSetValues
mslegrand Dec 29, 2020
a5fcac9
allow blanks in choiceSetEntries
mslegrand Dec 29, 2020
ad5a8aa
Allow to remove choiceSet when violaged
mslegrand Dec 30, 2020
a4c2b80
tibEntryChoices now obtained from choiceSetDB
mslegrand Dec 30, 2020
3a36fcf
EdTib shows only choice in widget selection
mslegrand Dec 30, 2020
60dbab0
choiceSets have beeen added to widget selector and are now treated li…
mslegrand Dec 31, 2020
320f6ea
cosemetic
mslegrand Dec 31, 2020
b9b2ed4
removal of final vestiges of choiceDB
mslegrand Dec 31, 2020
51e54f4
file naming for validation
mslegrand Dec 31, 2020
e8b32a2
bump version
mslegrand Dec 31, 2020
40505cd
pruning dead rows from widgetDB
mslegrand Jan 4, 2021
c4c2fd0
fix bug with integer type
mslegrand Jan 4, 2021
f13ee3c
bug fix, choics =>cs
mslegrand Jan 5, 2021
172899a
Merge pull request #85 from mslegrand/Hilbert
mslegrand Jan 5, 2021
20ae334
added predoc to request
mslegrand Jan 20, 2021
f092e02
adding getEnvList to replace new.env()
mslegrand Jan 20, 2021
daf3a11
adding aceReplaceBlock, updateRmdDependents, and preDoc
mslegrand Jan 20, 2021
1c52875
change to .ace_highlight-marker
mslegrand Jan 20, 2021
b3c3505
add link to newPage
mslegrand Jan 20, 2021
7729527
add link to addFileTab (new Page)
mslegrand Jan 20, 2021
22d4c06
adding link to ptRAce
mslegrand Jan 20, 2021
1d5c14d
if preDoc returned, extract into theBlocks
mslegrand Jan 20, 2021
ad5e5e4
adding Edit Code Block to context menu
mslegrand Jan 20, 2021
26cfc6c
add cmd to update dependents if Rmd
mslegrand Jan 20, 2021
ac71cc0
add extractCodeBlock
mslegrand Jan 20, 2021
21a2c59
add link to session, if link was provided
mslegrand Jan 20, 2021
2951f48
added handler to "Edit Code Block" for rmds
mslegrand Jan 20, 2021
5cfc463
replace new.env() with getEnvList()
mslegrand Jan 20, 2021
3ff681f
mssg$docFilePath => getFileDescriptor(tabId)$filePath
mslegrand Jan 20, 2021
7239407
comment out debugging
mslegrand Jan 20, 2021
3529906
patch needed to make tagndrag to work as before
mslegrand Jan 21, 2021
829c791
e$message
mslegrand Jan 22, 2021
3115acd
reload only if pageId, colname, noOfRows exists
mslegrand Jan 23, 2021
2e36d41
e$message
mslegrand Jan 23, 2021
46eb211
keep star visable when active
mslegrand Jan 23, 2021
606e695
clean up debug info
mslegrand Jan 23, 2021
55b7bbc
clean up comments
mslegrand Jan 23, 2021
a63e09d
added primitive debug helper
mslegrand Jan 23, 2021
6985cc4
comment out debug statements
mslegrand Jan 23, 2021
03885a9
commented out debug statement
mslegrand Jan 23, 2021
b21c4da
e$message
mslegrand Jan 23, 2021
caf39fd
code to create anchors for rmd code block, add to
mslegrand Jan 23, 2021
0349033
if anchor name and code block text is received from client then crea…
mslegrand Jan 23, 2021
27aec66
patch
mslegrand Jan 23, 2021
28fbb2d
bump version
mslegrand Jan 23, 2021
21855e5
goodName =>goodRName (bug fix for new column name ='stroke.width'
mslegrand Jan 23, 2021
f5dad6e
fix rollback for new files without ok
mslegrand Jan 23, 2021
9a522b8
request$sender=>request$cmd
mslegrand Jan 25, 2021
caec02f
replace sendFileTabsMessage with fileDescDB()tabId
mslegrand Jan 25, 2021
c87bfb3
track and close child files of Rmd when Rmd closes or project closes …
mslegrand Jan 27, 2021
1ca1dd2
add feature to place block label as tab name for block tab
mslegrand Jan 27, 2021
7f4045d
rmd scroll to block corresponding to last tab block
mslegrand Jan 28, 2021
6b791c7
reset range to null
mslegrand Jan 29, 2021
c7ad85d
comment out debug
mslegrand Jan 29, 2021
1f200f5
scroll rmd canvas to last edited tab block
mslegrand Jan 29, 2021
586da5f
context menu edit block to be visible for Rmd mode only.
mslegrand Jan 30, 2021
f046ccc
remove duplicate Edit Code Block
mslegrand Jan 31, 2021
a8b59aa
set source for rrmdPanelTag (kludge but ...)
mslegrand Jan 31, 2021
e3314fd
cosemeti
mslegrand Feb 7, 2021
dae0d65
save only if fileDescriptor exists
mslegrand Feb 8, 2021
9f9e30a
store and save input$pages only if has no parent
mslegrand Feb 8, 2021
3f245a7
adding block insertion to menu
mslegrand Feb 8, 2021
ed60e77
Merge branch 'master' into Riemann
mslegrand Feb 10, 2021
224cd34
Merge pull request #86 from mslegrand/Riemann
mslegrand Feb 10, 2021
db1386c
bug fix: allow . and _ in colume names
mslegrand Feb 11, 2021
cf0f4aa
Merge branch 'Riemann' of https://github.com/mslegrand/pointR into Ri…
mslegrand Feb 11, 2021
f34e6e6
remove offending } at line 486
mslegrand Feb 11, 2021
07921e7
cosmetic
mslegrand Feb 11, 2021
6552f51
add _ to goodRName
mslegrand Feb 11, 2021
344d07d
Merge pull request #87 from mslegrand/Riemann
mslegrand Feb 11, 2021
628ac82
limited functionality for dndsnipptes
mslegrand Jun 18, 2021
9aa417b
grid and backdrop enable if in parmode
mslegrand Jun 25, 2021
7f35f6d
use labelColor for stroke for pointlabels
mslegrand Jun 25, 2021
860b720
if parMode is not null (presumably dnippets) set labelColor to white
mslegrand Jun 25, 2021
5a04347
remove debug code
mslegrand Jun 25, 2021
741d1d1
handling dnippets childwindow
mslegrand Jun 25, 2021
f921553
add defaults to dnippet svg
mslegrand Jun 25, 2021
bcb61c9
add labelColor to determine the stroke for labes
mslegrand Jun 25, 2021
db5a11a
remove labelColor from displayOptins
mslegrand Jun 25, 2021
aee2948
remove cat
mslegrand Jun 25, 2021
cb3814e
add labelColor as param to showPts.compound
mslegrand Jun 25, 2021
7bb200e
remove displayOpt labelColor
mslegrand Jun 25, 2021
bf5be80
bug fix for case when we have a viewBox attribute attached to the svg
mslegrand Jun 25, 2021
a302e0f
eliminating need for user to specify WH for dnds
mslegrand Jul 4, 2021
b1be1a4
bump version
mslegrand Jul 21, 2021
af05a40
disable logger
mslegrand Jul 21, 2021
2d9f3e1
comment out debug log
mslegrand Jul 21, 2021
587b203
remove explicit usage of WH
mslegrand Jul 21, 2021
5a67a4d
Merge pull request #88 from mslegrand/dndpopup
mslegrand Jul 21, 2021
e6f148e
added insert dnds, refactored insert svg-ptR block, added label for e…
mslegrand Aug 19, 2021
07116b9
debug commented
mslegrand Aug 20, 2021
5a6286a
DEBUG_LOG=FALSE; bump version
mslegrand Aug 20, 2021
058ceaa
enable/disable newColumn for dnippets
mslegrand Aug 27, 2021
6a8f508
Merge pull request #89 from mslegrand/dndpopup
mslegrand Sep 17, 2021
fd04ba2
getEnvList should simply return an env to use
mslegrand Sep 22, 2021
a019046
change getEnvList from reactive to function
mslegrand Oct 21, 2021
816eebb
handle case where fd$filePath is anon
mslegrand Oct 21, 2021
495840f
add keycode for mouse click preproc
mslegrand Oct 21, 2021
43d5ea1
added comments
mslegrand Oct 21, 2021
40b408c
changed templated comments
mslegrand Oct 21, 2021
7d14287
added help windows for preprocs
mslegrand Oct 21, 2021
405f6c5
reformat
mslegrand Oct 21, 2021
965bdf0
replace new.env() with getEnvList()
mslegrand Oct 21, 2021
45e73b3
knit snippet in getEnvList enviroment
mslegrand Oct 22, 2021
17c3670
knit in envir=getEnvList
mslegrand Oct 22, 2021
7085e09
fix rect dnds
mslegrand Nov 5, 2021
b45b842
dash in project name is displayed as spaces
mslegrand Nov 5, 2021
32bf526
dash in project name displayed as spaces
mslegrand Nov 5, 2021
625722a
remove projectTemplate- prefix using sub instead of split
mslegrand Nov 5, 2021
ed6d708
replace - with space in projectName in h2 header of modal
mslegrand Nov 5, 2021
1e769e0
remove useShinyalert
mslegrand Mar 29, 2022
2b2849e
cleanup debug code
mslegrand Mar 29, 2022
f806b36
````=>```
mslegrand Mar 29, 2022
02e55a5
change default wh
mslegrand Mar 29, 2022
3e64f25
spell out TRUE (instead of just T)
mslegrand Mar 29, 2022
97a147a
add markdow package
mslegrand Mar 29, 2022
88442d9
bump version to 0.5.0
mslegrand Mar 29, 2022
cd34e65
markdown=>rmarkdown
mslegrand May 8, 2022
cc28334
www/memuHelper.js => menuHelper.js
mslegrand May 8, 2022
788b4bc
add check for panDoc
mslegrand May 8, 2022
5c26e77
fix backtics
mslegrand May 8, 2022
c05a25d
fix bug for keyword search
mslegrand May 8, 2022
a231e30
update to use electron 18
mslegrand May 8, 2022
6a2cc04
bump version
mslegrand May 8, 2022
6dc606a
add char handler to keys
mslegrand May 23, 2022
ff93fe3
Do not load pages for files that are no longer there.
mslegrand May 23, 2022
f1bd5f0
remove menu if no files, remove files if they don't exist
mslegrand May 26, 2022
843451f
bug fix: length(input$pages) => length(input$pages)>0
mslegrand Jun 19, 2022
cb54087
bug fix:
mslegrand Jun 19, 2022
85eaf87
added youtube playlist; bumped version
mslegrand Jun 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: pointR
Type: Package
Date: 2019-12-30
Date: 2021-08-20
Title: pointR
Version: 0.4.1.11
Version: 0.5.3
Author: M.S.Legrand
Maintainer: M.S.Legrand <slegrand3.14@gmail.com>
Description: pointR is a shiny-based IDE for svgR
Expand All @@ -20,6 +20,7 @@ Imports:
shinyDMDMenu,
shinyFiles,
shinythemes,
shinyalert,
colourpicker,
shinyWidgets,
bsplus,
Expand All @@ -29,7 +30,7 @@ Imports:
shinyjqui
Suggests:
testthat
RoxygenNote: 6.1.1
RoxygenNote: 7.1.1
Remotes:
mslegrand/shinyDMDMenu,
mslegrand/svgR,
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NOTICE

Copyright (c) 2020 M. S. Legrand. All rights reserved
Copyright (c) 2021 M. S. Legrand. All rights reserved

The pointR package as a whole is distributed under the GPL-3 License,
GNU GENERAL PUBLIC LICENSE version 3, see below.
Expand Down
56 changes: 37 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,61 @@
# pointR

**pointR** is an R package providing a *shiny-based* minimalist ide for R scripting using svgR
- ***Videos on pointR*** can be found at http://mslegrand.github.io/pointRmedia/.
## Installation

For a full featured install go to http://mslegrand.github.io/pointR/. There you will find package installers for linux, mac and windows.

## pointR and ptR

- **pointR** is an R package providing a *shiny-based* minimalist IDE for R scripting using svgR. **pointR** is primarly written in R, with a little bit of javascript for seasoning.
- **ptR** is an **Electron** wrapper around **pointR**.
- Using **Electron**
- Removes potential hiccups by removing and dependency on the local browser
- Provides independent windows for help
- Provides an integrated approach for building **shiny custom inputs**

- ***Related information*** can be found at http://mslegrand.github.io/svgR/.
- ***Rambling thoughts*** can be found on the wiki at https://github.com/mslegrand/pointR/wiki

## Some Points on PointR
## Some Points on pointR
- pointR is a shiny server application
- pointR uses the ACE editor for coding
- pointR is intended to ease the writing of R scripts using svgR.
- pointR is an attempt to bridge the gap between coding and point&click.
- svgR bridges the gap between R and SVG

## Try Out
- runGitHub("pointR", "mslegrand")

# Installation
- install.packages("devtools")
- library(devtools)
- install_github("shiny", "rstudio")
- install_github("shinyAce", "trestletech")
- install_github("shinyjs", "daattali")
- install_github("svgR", "mslegrand")

# Reporting issues
## Some Points on ptR
- ptR is an Electron wrapper around pointR
- ptR is javascript (since Electron is)
- Electron is required for full functionality (such as building shiny input controls)



## Building from Source

0. Warning, you might find this painful.
1. [Download pointR](https://github.com/mslegrand/pointR) and build the **pointR** library
2. [Download ptR](https://github.com/mslegrand/ptR) and place in a folder (like pointR-electron/ptRMigrate)
3. cd to ptRMigrate and edit script ./build/mklib.sh to copy the ptR lib to 2 locations (for testing & production)
4. Install node.js, npm, electon
5. from terminal run **npm start**

**NOTE** I've built both on linux and mac machines, but not windows.


## Reporting issues
Please report any bugs/issue in the
[Github Issue tracker](https://github.com/mslegrand/pointR)

#Contributing
If you wish to contribute to the pointR project, now is the time. Thanks.

# Caution
## Caution
To quote from TrestleTech: *As with any online application, it is a genuinely bad idea to allow arbitrary users to execute code on your server.* **BE CAREFUL!!**

# Licensing
## Licensing

NOTICE

Copyright (c) 2018 M. S. Legrand. All rights reserved
Copyright (c) 2020 M. S. Legrand. All rights reserved

The pointR package as a whole is distributed under the GPL-3 License,
GNU GENERAL PUBLIC LICENSE version 3, see below.
Expand Down
34 changes: 27 additions & 7 deletions inst/App/fileIO/dndSnippetLoader.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ dripplets2Rmd<-function( drps ){
unlist(str_split(drps, '\n'))->drps
indx<-m[2,]
drps[indx]<-paste(
"temp$root$setAttr('width',480)",
"temp$root$setAttr('height',320)",
"temp$root$setAttr('viewBox','0 0 48 32')",
"temp$root$setAttr('width',48)",
"temp$root$setAttr('height',32)",
# "temp$root$setAttr('viewBox','0 0 48 32')",
"temp$root$setAttr('stroke','#00FFFF')",
"temp$root$setAttr('fill','#00FFFF')",
"temp$root$prependChildren(
svgR:::use(filter=svgR:::filter( filterUnits='userSpaceOnUse', svgR:::feFlood(flood.color='black') ) )
)",
Expand All @@ -35,7 +37,7 @@ dripplets2Rmd<-function( drps ){
drps<-str_replace(drps, "\noutput: dnd_snippet", "\noutput: html_document")
drps<-str_replace_all(drps, "POPUP\\s*\n```\n(.+)\n```", "### \\1")
drps<-str_replace_all(drps, "\nSNIPPET\\s*","\n")
drps<-str_replace_all(drps, "\nSVGR\\s*\n```\n", '\n\n```\\{r, echo=FALSE, results=\'asis\'\\}\n')
drps<-str_replace_all(drps, "\nSVGR\\s*\n```\n", '\n\n```\\{r, echo=FALSE, results=\'asis\'\\}\nWH=c(48,32)\n')
drps
}

Expand Down Expand Up @@ -95,7 +97,15 @@ extractDripplet<-function(dr ){
if(all(m>0)){
rtv<-tt
rtv<-tryCatch({
svg<-as.character(eval(parse(text=tt['SVGR']), new.env()))
# svg<-as.character(eval(parse(text=tt['SVGR']), new.env()))
# svg<-eval(parse(text=tt['SVGR']), new.env())
svg<-eval(parse(text=tt['SVGR']), list(WH=c(48,32)))
svg$root$setAttr('stroke','#00FFFF')
svg$root$setAttr('fill','#00FFFF')
svg$root$setAttr('width',48)
svg$root$setAttr('height',32)
#set width, height???
svg<-as.character(svg)
rtv["SVGR"]<-svg
names(rtv)<-c('hint','snip','logo')[m]
rtv
Expand All @@ -119,10 +129,20 @@ dripplets2List2<-function(drps){
rtv<-extractDripplet(dr)
rtv
})

s.upper<-function(s){
paste(toupper(substring(s, 1, 1)), substring(s, 2),
sep = "", collapse = " ")
}
drps<-lapply(drps, function(dr){
dr['snip']<-gsub("\\```","```" , dr['snip'])
dr
})
if(!is.null(editOption$currentProjectName)){
cname<-sub('\\.pprj$','', editOption$currentProjectName)
Cname<-s.upper(cname)
drps<-lapply(drps, function(dr){
dr['snip']<-gsub('@projectName@', editOption$currentProjectName, dr['snip'])
dr['snip']<-gsub('@projectName@', cname , dr['snip'])
dr['snip']<-gsub('@ProjectName@', Cname , dr['snip'])
dr
})
}
Expand Down
1 change: 1 addition & 0 deletions inst/App/fileIO/genShinyFilesOpenButtons.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ UIGenShinyOpenFilesButtons<-function(){
shinyFilesButton("buttonFileOpen", label="", title="Open File", multiple=FALSE, class='hiddenButton'),
shinyFilesButton("buttonFileOpenProject", label="", title="Select Project to Open", multiple=FALSE, class='hiddenButton'),

shinyFilesButton("buttonChoiceSetImport", label="", title="Import Choice Set", multiple=FALSE, class='hiddenButton'),
shinyFilesButton("buttonSnippetImport", label="", title="Import Snippets", multiple=FALSE, class='hiddenButton'),
shinyFilesButton("buttonDnippetImport", label="", title="Import Dnippets", multiple=FALSE, class='hiddenButton'),
shinyFilesButton("buttonPreProcPtImport", label="", title="Import PreProcessors for points", multiple=FALSE, class='hiddenButton'),
Expand Down
2 changes: 1 addition & 1 deletion inst/App/fileIO/genShinyFilesSaveButtons.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ saveButtonFileNames<-setNames(paste0('buttonFileSave', extMode.TB$ext), extMode.
UIGenShinySaveFilesButtons<-function(){
tt<-setNames(as.list(extMode.TB$ext),extMode.TB$mode)
fileTypes<-lapply(tt, function(x){
xx<-c(x,tt[tt!=x])
xx<-c(x,tt[tt!=x]) #move the prefered mode to the top
setNames(as.list(xx),xx)
})
tmp<-lapply(extMode.TB$mode, function(mode){
Expand Down
20 changes: 15 additions & 5 deletions inst/App/fileIO/observeRequestStartUp.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,21 @@ observeEvent(trigger$startup, {
} else {

}
disableDMDM(
session,
menuBarId="editNavBar",
entry="customControl"
)

updateNewProjectMenu(session)
updateRemoveTemplateMenu(session)
resetWatcher()
readAuxChoices()
log.fout(startup)
}, priority=100)


resetWatcher<-reactive({
if(usingElectron){
allFilePaths<-getAllNamedFiles()$filePath
allFilePaths<-normalizePath(allFilePaths)
# cat('pointR::resetWatcher: allFilePaths')
# print(allFilePaths)
sendPtRManagerMessage(sender="cmd.electron", resetWatcher=allFilePaths)
}
})
46 changes: 35 additions & 11 deletions inst/App/fileIO/serverFileDescriptor.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@

fileDescDB<-reactiveVal(
tibble(
tabId='bogus',
isSaved=FALSE,
filePath="?",
anonNo =1,
mode='ptr'
)[0,]
initialFileDescDB()
)

getNextAnonymousFileName<-reactive({
Expand All @@ -20,22 +14,24 @@ getNextAnonFileNum<-reactive({
})

# to be called from serverFileTab.R::addFileTab
addFileDesc<-function( pageId, docFilePath, fileSaveStatus, fileMode){
addFileDesc<-function( pageId, docFilePath, fileSaveStatus, fileMode, parId=NA, parMode=NA){
if(identical(docFilePath,"?")){
anonNo<-getNextAnonFileNum()
} else {
anonNo<-0
}
if(is.null(parId)){
parId=NA
}
tb<-tibble(tabId=pageId, isSaved=fileSaveStatus,
filePath=docFilePath, anonNo, mode=fileMode)
filePath=docFilePath, anonNo, mode=fileMode, parId=parId, parMode=parMode)
fd<- fileDescDB()
fd<-bind_rows(fd,tb)
fileDescDB(fd)
}


getMode<-reactive({
# cat('>---> getMode\n')
tabId<-input$pages # getTibTabId()
if(is.null(tabId) || identical(tabId, 'bogus')){
mode<-NULL
Expand All @@ -48,6 +44,22 @@ getMode<-reactive({
mode
})

getParMode<-reactive({
# cat('>---> getParMode\n')
tabId<-input$pages # getTibTabId()
# cat(paste('tabId=',format(tabId)))
if(is.null(tabId) || identical(tabId, 'bogus')){
parMode<-NULL
} else {
fd<-fileDescDB()
parMode<-fd[fd$tabId==input$pages,]$parMode
if(length(parMode)>0 && is.na(parMode)){
parMode<-NULL
}
}
parMode
})

# in getModeX we need to insert flag to enable/disable appmode
# we could use shinyjs to query a property of a (hidden) node?
# or use ptR.js to do an on.change ?
Expand Down Expand Up @@ -121,7 +133,7 @@ setFileDescSaved<-function(pageId, fileSaveStatus){
fd[fd$tabId==pageId,"isSaved"]<-fileSaveStatus
fileDescDB(fd)
}
cat('setFileDescSaved: pageId=',pageId,', savedStatus=',fileSaveStatus,"\n")
# cat('setFileDescSaved: pageId=',pageId,', savedStatus=',fileSaveStatus,"\n")

sendFileTabsMessage(tabId=pageId, sender='savedStatus', saveStatus=fileSaveStatus)
log.fout(setFileDescSaved)
Expand All @@ -137,6 +149,15 @@ getAllNamedUnsavedFiles<-reactive({
fd
})

getAllNamedFiles <- function(){
fd<-fileDescDB()
fd<-filter(fd, filePath!="?")
fd
}




# get the saved status for the current page
getFileSavedStatus<-reactive({
pageId<-input$pages
Expand Down Expand Up @@ -177,3 +198,6 @@ removeFileDesc<-function(pageId, path=getWorkSpaceDir() ){
# cat('<---< removeFileDesc\n')
}




7 changes: 4 additions & 3 deletions inst/App/fileIO/serverGenShinyFilesSaveObservers.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ genShinySaveFilesObservers<-function(input, session){
if('cancel' %in% names(rtList)){
if(rtList$cancel=='close'){
tabId=popTabRequest()
if(mssg$docFilePath!="?"){
addToRecentFiles(mssg$docFilePath)
docFilePath=getFileDescriptor(tabId)$filePath
if(!is.null(docFilePath) && docFilePath!="?"){
addToRecentFiles(docFilePath)
}
closeTabNow(tabId)
} else {
setTabRequest(sender=NULL, tabs=NULL)
setTabRequest(cmd=NULL, tabs=NULL)
}
} else {
fp.dt<-parseSavePath(c(home='~'), rtList)
Expand Down
15 changes: 12 additions & 3 deletions inst/App/fileIO/serverLoadWorkSpace.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,23 @@ restoreWorkSpace<-reactive({
}
wsPages<-list()


ptRproj<-pprj()

selectedTab<-readCurrentTab()
tabs=c()

# 1. load all pages into a list.
for(filePath in fileWSPaths){

page<-readRDS(filePath)
# A. assign tabIds to each page
id=basename(filePath)
if(!is.null(ptRproj$pathToProj)){
docFilePath=page$fileDescriptor.filePath
page$fileDescriptor.filePath<-sub( ptRproj$pathToProj, editOption$currentProjectDirectory, docFilePath)
if(!file.exists(page$fileDescriptor.filePath)){
next # omit this, else saving will cause an error
}
saveRDS(page,filePath)
}
wsPages[[id]]<-page
Expand All @@ -53,10 +56,14 @@ restoreWorkSpace<-reactive({
if(length(tibAs)>0){
names(tibAs)<-gsub(pattern, '', names(tibAs))
tibAs[sapply(tibAs,is.null)]<-NA
setdiff(names(initTib),names(tibAs))->tmp
if(length(tmp)>0){
tmp<-sapply(tmp, function(x){NA}, USE.NAMES = T)
tibAs<-c(tibAs,tmp)
}
}
tibAs
})

rtv<-bind_rows( rtv)
if(ncol(rtv)==0){
rtv<-initTib
Expand Down Expand Up @@ -88,10 +95,12 @@ restoreWorkSpace<-reactive({
fileSaveStatus=page$fileDescriptor.isSaved

txt=page$code
if(fileSaveStatus==TRUE && file.exists(docFilePath)){

if(identical(fileSaveStatus,TRUE) && file.exists(docFilePath)){
tryCatch(
{txt<-paste(readLines(docFilePath), collapse="\n")},
error=function(e){
e<-e$message
cat("Unable to read file:", paste(e, collapse="\n"))
return(NULL) #bail
}
Expand Down
Loading