unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] ggplot2: fix ggsave('a.svg').
@ 2016-07-05 13:06 Ben Woodcroft
  2016-07-05 13:06 ` [PATCH 1/3] gnu: Add r-gdtools Ben Woodcroft
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ben Woodcroft @ 2016-07-05 13:06 UTC (permalink / raw)
  To: guix-devel

Hi all,

Beforehand, trying to save an SVG file from a plot generated with ggplot did
not work.  'r-svglite' is only a listed as a suggested dependency for gpglot2,
but given that saving SVGs is reasonably central (at least for me), then I
think we should propagate it.

Test code:
$ R
> library(ggplot2)
> qplot(x=c(1,2,3),y=c(3,4,6))
> ggsave('/tmp/a.svg')
Saving 6.99 x 7 in image

Thanks,
ben

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] gnu: Add r-gdtools.
  2016-07-05 13:06 [PATCH] ggplot2: fix ggsave('a.svg') Ben Woodcroft
@ 2016-07-05 13:06 ` Ben Woodcroft
  2016-07-06  5:27   ` Ricardo Wurmus
  2016-07-05 13:06 ` [PATCH 2/3] gnu: Add r-svglite Ben Woodcroft
  2016-07-05 13:06 ` [PATCH 3/3] gnu: r-ggplot2: Add r-svglite to propagated-inputs Ben Woodcroft
  2 siblings, 1 reply; 8+ messages in thread
From: Ben Woodcroft @ 2016-07-05 13:06 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/statistics.scm (r-gdtools): New variable.
---
 gnu/packages/statistics.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index 73c30ae..24fbabe 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -610,6 +610,30 @@ multidimensional conditioning system and a consistent interface to map data to
 aesthetic attributes.")
     (license license:gpl2+)))
 
+(define-public r-gdtools
+  (package
+    (name "r-gdtools")
+    (version "0.0.7")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (cran-uri "gdtools" version))
+       (sha256
+        (base32
+         "1bmnf9d677f2jy8jnb9ymjz1qzm4yrd0qp6k5qrrly06jfffyx7g"))))
+    (build-system r-build-system)
+    (native-inputs
+     `(("r-rcpp" ,r-rcpp)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("cairo" ,cairo)))
+    (home-page "http://cran.r-project.org/web/packages/gdtools")
+    (synopsis "Utilities for graphical rendering")
+    (description
+     "The @code{gdtools} package provides functionalities to get font metrics
+and to generate base64 encoded string from raster matrix.")
+    (license license:gpl3)))
+
 (define-public r-assertthat
   (package
     (name "r-assertthat")
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] gnu: Add r-svglite.
  2016-07-05 13:06 [PATCH] ggplot2: fix ggsave('a.svg') Ben Woodcroft
  2016-07-05 13:06 ` [PATCH 1/3] gnu: Add r-gdtools Ben Woodcroft
@ 2016-07-05 13:06 ` Ben Woodcroft
  2016-07-06  5:30   ` Ricardo Wurmus
  2016-07-05 13:06 ` [PATCH 3/3] gnu: r-ggplot2: Add r-svglite to propagated-inputs Ben Woodcroft
  2 siblings, 1 reply; 8+ messages in thread
From: Ben Woodcroft @ 2016-07-05 13:06 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/statistics.scm (r-svglite): New variable.
---
 gnu/packages/statistics.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index 24fbabe..6f27aa6 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -634,6 +634,31 @@ aesthetic attributes.")
 and to generate base64 encoded string from raster matrix.")
     (license license:gpl3)))
 
+(define-public r-svglite
+  (package
+    (name "r-svglite")
+    (version "1.1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (cran-uri "svglite" version))
+       (sha256
+        (base32
+         "11ryicjglfi6jvkk4jgg5kra42qbs5z2zid7jjhlslpjcljfwc70"))))
+    (build-system r-build-system)
+    (native-inputs  `(("r-rcpp" ,r-rcpp)))
+    (propagated-inputs
+     `(("r-bh" ,r-bh)
+       ("r-gdtools" ,r-gdtools)))
+    (home-page "https://github.com/hadley/svglite")
+    (synopsis "An 'SVG' Graphics Device")
+    (description
+     "@code{svglite} is a graphics device that produces clean SVG (Scalable
+Vector Graphics) output, suitable for use on the web, or hand editing.
+Compared to the built-in @code{svg()}, @code{svglite} is considerably faster,
+produces smaller files, and leaves text as is.")
+    (license license:gpl2+)))
+
 (define-public r-assertthat
   (package
     (name "r-assertthat")
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] gnu: r-ggplot2: Add r-svglite to propagated-inputs.
  2016-07-05 13:06 [PATCH] ggplot2: fix ggsave('a.svg') Ben Woodcroft
  2016-07-05 13:06 ` [PATCH 1/3] gnu: Add r-gdtools Ben Woodcroft
  2016-07-05 13:06 ` [PATCH 2/3] gnu: Add r-svglite Ben Woodcroft
@ 2016-07-05 13:06 ` Ben Woodcroft
  2016-07-06  5:31   ` Ricardo Wurmus
  2 siblings, 1 reply; 8+ messages in thread
From: Ben Woodcroft @ 2016-07-05 13:06 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/statistics.scm (r-ggplot2)[propagated-inputs]: Add
r-svglite.
---
 gnu/packages/statistics.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index 6f27aa6..b4e810a 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -598,7 +598,8 @@ legends.")
        ("r-plyr" ,r-plyr)
        ("r-proto" ,r-proto)
        ("r-reshape2" ,r-reshape2)
-       ("r-scales" ,r-scales)))
+       ("r-scales" ,r-scales)
+       ("r-svglite" ,r-svglite)))
     (home-page "http://ggplot2.org")
     (synopsis "An implementation of the grammar of graphics")
     (description
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] gnu: Add r-gdtools.
  2016-07-05 13:06 ` [PATCH 1/3] gnu: Add r-gdtools Ben Woodcroft
@ 2016-07-06  5:27   ` Ricardo Wurmus
  0 siblings, 0 replies; 8+ messages in thread
From: Ricardo Wurmus @ 2016-07-06  5:27 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel


Ben Woodcroft <donttrustben@gmail.com> writes:

> * gnu/packages/statistics.scm (r-gdtools): New variable.
> ---
>  gnu/packages/statistics.scm | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>
> diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
> index 73c30ae..24fbabe 100644
> --- a/gnu/packages/statistics.scm
> +++ b/gnu/packages/statistics.scm
> @@ -610,6 +610,30 @@ multidimensional conditioning system and a consistent interface to map data to
>  aesthetic attributes.")
>      (license license:gpl2+)))
>  
> +(define-public r-gdtools
> +  (package
> +    (name "r-gdtools")
> +    (version "0.0.7")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (cran-uri "gdtools" version))
> +       (sha256
> +        (base32
> +         "1bmnf9d677f2jy8jnb9ymjz1qzm4yrd0qp6k5qrrly06jfffyx7g"))))
> +    (build-system r-build-system)
> +    (native-inputs
> +     `(("r-rcpp" ,r-rcpp)
> +       ("pkg-config" ,pkg-config)))
> +    (inputs
> +     `(("cairo" ,cairo)))
> +    (home-page "http://cran.r-project.org/web/packages/gdtools")
> +    (synopsis "Utilities for graphical rendering")
> +    (description
> +     "The @code{gdtools} package provides functionalities to get font metrics
> +and to generate base64 encoded string from raster matrix.")
> +    (license license:gpl3)))
> +

Looks like this is indeed “GPLv3 only”.  The README states “The gdtools
package is licensed under the GPLv3.”

Without that notice it would have been GPLv3 or later, because that’s
how the license field in DESCRIPTION files is usually interpreted.

This patch looks good to me.  Thanks!

~~ Ricardo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] gnu: Add r-svglite.
  2016-07-05 13:06 ` [PATCH 2/3] gnu: Add r-svglite Ben Woodcroft
@ 2016-07-06  5:30   ` Ricardo Wurmus
  2016-07-07 10:16     ` Ben Woodcroft
  0 siblings, 1 reply; 8+ messages in thread
From: Ricardo Wurmus @ 2016-07-06  5:30 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel


Ben Woodcroft <donttrustben@gmail.com> writes:

> * gnu/packages/statistics.scm (r-svglite): New variable.
> ---
>  gnu/packages/statistics.scm | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>
> diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
> index 24fbabe..6f27aa6 100644
> --- a/gnu/packages/statistics.scm
> +++ b/gnu/packages/statistics.scm
> @@ -634,6 +634,31 @@ aesthetic attributes.")
>  and to generate base64 encoded string from raster matrix.")
>      (license license:gpl3)))
>  
> +(define-public r-svglite
> +  (package
> +    (name "r-svglite")
> +    (version "1.1.0")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (cran-uri "svglite" version))
> +       (sha256
> +        (base32
> +         "11ryicjglfi6jvkk4jgg5kra42qbs5z2zid7jjhlslpjcljfwc70"))))
> +    (build-system r-build-system)
> +    (native-inputs  `(("r-rcpp" ,r-rcpp)))
> +    (propagated-inputs
> +     `(("r-bh" ,r-bh)
> +       ("r-gdtools" ,r-gdtools)))
> +    (home-page "https://github.com/hadley/svglite")
> +    (synopsis "An 'SVG' Graphics Device")

How about just “SVG graphics device”?

> +    (description
> +     "@code{svglite} is a graphics device that produces clean SVG (Scalable
> +Vector Graphics) output, suitable for use on the web, or hand
> editing.

How about

    @dfn{SVG} (Scalable Vector Graphics)

?

> +Compared to the built-in @code{svg()}, @code{svglite} is considerably faster,
> +produces smaller files, and leaves text as is.")
> +    (license license:gpl2+)))
> +

The rest looks fine.

~~ Ricardo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] gnu: r-ggplot2: Add r-svglite to propagated-inputs.
  2016-07-05 13:06 ` [PATCH 3/3] gnu: r-ggplot2: Add r-svglite to propagated-inputs Ben Woodcroft
@ 2016-07-06  5:31   ` Ricardo Wurmus
  0 siblings, 0 replies; 8+ messages in thread
From: Ricardo Wurmus @ 2016-07-06  5:31 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel


Ben Woodcroft <donttrustben@gmail.com> writes:

> * gnu/packages/statistics.scm (r-ggplot2)[propagated-inputs]: Add
> r-svglite.
> ---
>  gnu/packages/statistics.scm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
> index 6f27aa6..b4e810a 100644
> --- a/gnu/packages/statistics.scm
> +++ b/gnu/packages/statistics.scm
> @@ -598,7 +598,8 @@ legends.")
>         ("r-plyr" ,r-plyr)
>         ("r-proto" ,r-proto)
>         ("r-reshape2" ,r-reshape2)
> -       ("r-scales" ,r-scales)))
> +       ("r-scales" ,r-scales)
> +       ("r-svglite" ,r-svglite)))
>      (home-page "http://ggplot2.org")
>      (synopsis "An implementation of the grammar of graphics")
>      (description

Looks good to me.  Thank you!

~~ Ricardo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] gnu: Add r-svglite.
  2016-07-06  5:30   ` Ricardo Wurmus
@ 2016-07-07 10:16     ` Ben Woodcroft
  0 siblings, 0 replies; 8+ messages in thread
From: Ben Woodcroft @ 2016-07-07 10:16 UTC (permalink / raw)
  To: Ricardo Wurmus, Ben Woodcroft; +Cc: guix-devel



On 06/07/16 13:30, Ricardo Wurmus wrote:
> Ben Woodcroft <donttrustben@gmail.com> writes:
>
[..]
>> ---
>> +    (synopsis "An 'SVG' Graphics Device")
> How about just “SVG graphics device”?
>
>> +    (description
>> +     "@code{svglite} is a graphics device that produces clean SVG (Scalable
>> +Vector Graphics) output, suitable for use on the web, or hand
>> editing.
> How about
>
>      @dfn{SVG} (Scalable Vector Graphics)
>
> ?

Thanks for the review. I pushed this set with both these changes.

ben

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-07-07 10:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-05 13:06 [PATCH] ggplot2: fix ggsave('a.svg') Ben Woodcroft
2016-07-05 13:06 ` [PATCH 1/3] gnu: Add r-gdtools Ben Woodcroft
2016-07-06  5:27   ` Ricardo Wurmus
2016-07-05 13:06 ` [PATCH 2/3] gnu: Add r-svglite Ben Woodcroft
2016-07-06  5:30   ` Ricardo Wurmus
2016-07-07 10:16     ` Ben Woodcroft
2016-07-05 13:06 ` [PATCH 3/3] gnu: r-ggplot2: Add r-svglite to propagated-inputs Ben Woodcroft
2016-07-06  5:31   ` Ricardo Wurmus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).