Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QueryR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Lopez
QueryR
Commits
5e07d081
Commit
5e07d081
authored
6 years ago
by
stepan
Browse files
Options
Downloads
Patches
Plain Diff
Keep the private versions of SVG functions for backward compatibility
parent
10909673
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/grDevices/R/fastrGridDevices.R
+15
-20
15 additions, 20 deletions
...ruffle/r/library/fastrGrid/grDevices/R/fastrGridDevices.R
with
15 additions
and
20 deletions
com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/grDevices/R/fastrGridDevices.R
+
15
−
20
View file @
5e07d081
...
...
@@ -21,38 +21,24 @@
eval
(
expression
({
assignInNs
<-
function
(
x
,
val
)
{
ns
<-
asNamespace
(
"grDevices"
)
unlockBinding
(
x
,
ns
)
assign
(
x
,
val
,
envir
=
ns
,
inherits
=
T
)
lockBinding
(
x
,
ns
)
}
# This should be preffered way of starting the FastR java device.
# For compatibility reasons, both X11 and awt end up calling C_X11.
# In the future, this function may support extra parameters like a
# reference to java 2D graphics object, which will be used for the drawing.
assignInNs
(
'awt'
,
function
(
width
=
NULL
,
height
=
NULL
,
graphicsObj
=
NULL
)
{
awt
<-
function
(
width
=
NULL
,
height
=
NULL
,
graphicsObj
=
NULL
)
invisible
(
.External2
(
grDevices
:::
C_X11
,
".FASTR.AWT"
,
width
,
height
,
graphicsObj
))
})
# Allows to get the SVG code from SVG device, it also closes the device,
# but the contents are not saved to the given file.
assignInNs
(
'
svg.off
'
,
function
(
which
=
dev.cur
())
{
svg.off
<-
function
(
which
=
dev.cur
())
{
if
(
which
==
1
)
{
stop
(
"cannot shut down device 1 (the null device)"
)
}
.External
(
C_devoff
,
as.integer
(
-
which
))
}
)
}
# Allows to get the SVG code from SVG device without closing it
# the symbol info should be constant
svgStringSymbol
<-
list
(
name
=
'svgstring'
)
assignInNs
(
'svg.string'
,
function
()
{
.External
(
svgStringSymbol
)
})
# Adds help files for the new public functions
.fastr.addHelpPath
(
'/com/oracle/truffle/r/library/fastrGrid/grDevices/Rd'
)
svg.string
<-
function
()
.External
(
svgStringSymbol
)
# GnuR version only works with "X11cairo" device. Our version of savePlot
# works with "awt" device and "X11cairo", which is for us only alias for
...
...
@@ -103,4 +89,13 @@ eval(expression({
grid
:::
grid.refresh
()
}
}),
asNamespace
(
"grDevices"
))
\ No newline at end of file
}),
asNamespace
(
"grDevices"
))
# export new public functions
exports
<-
asNamespace
(
"grDevices"
)[[
".__NAMESPACE__."
]][[
'exports'
]]
assign
(
'svg.off'
,
'svg.off'
,
envir
=
exports
)
assign
(
'svg.string'
,
'svg.string'
,
envir
=
exports
)
assign
(
'awt'
,
'awt'
,
envir
=
exports
)
# add help files for the new public functions
.fastr.addHelpPath
(
'/com/oracle/truffle/r/library/fastrGrid/grDevices/Rd'
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment