Install v2png program from vega (node.js module) on Windows

一笑奈何 提交于 2019-12-10 16:10:08

问题


The export_png() function in the R ggvis package requires us to have the program vg2png installed, from the node.js module vega. (source: R Documentation )

I have node and npm installed on windows, and I ran npm install vega.

This is the output that I got on running npm install vega:

C:\Users\username>npm install -g trifacta/vega
\


> canvas@1.1.6 install C:\Users\username\AppData\Roaming\npm\node_modules\vega\node_modules\canvas
> node-gyp rebuild

|
C:\Users\username\AppData\Roaming\npm\node_modules\vega\node_modules\canvas>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bi
n\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Node Commands

Syntax:
    node {operator} [options] [arguments]

Parameters:
        /? or /help   - Display this help message.
        list          - List nodes or node history or the cluster
        listcores     - List cores on the cluster
        view          - View properties of a node
        online        - Set nodes or node to online state
        offline       - Set nodes or node to offline state
        pause         - Pause node [deprecated]
        resume        - Resume node [deprecated]

For more information about HPC command-line tools,
see http://go.microsoft.com/fwlink/?LinkId=120724.
C:\Users\username\AppData\Roaming\npm\vg2svg -> C:\Users\username\AppData\Roaming\npm\node_modules\vega\bin\vg2svg
C:\Users\username\AppData\Roaming\npm\vg2png -> C:\Users\username\AppData\Roaming\npm\node_modules\vega\bin\vg2png
vega@1.5.0 C:\Users\username\AppData\Roaming\npm\node_modules\vega
├── yargs@2.3.0 (wordwrap@0.0.2)
├── canvas@1.1.6 (nan@1.2.0)
├── d3@3.5.5
├── request@2.53.0 (caseless@0.9.0, json-stringify-safe@5.0.0, forever-agent@0.5.2, aws-sign2@0.5.0, stringstream@0.0.4, oauth-sign@0.6.0, tunnel-agen
t@0.4.0, isstream@0.1.2, node-uuid@1.4.3, qs@2.3.3, combined-stream@0.0.7, form-data@0.2.0, tough-cookie@0.12.1, mime-types@2.0.10, http-signature@0.1
0.1, hawk@2.3.1, bl@0.9.4)
├── topojson@1.6.18 (queue-async@1.0.7, rw@0.1.4, optimist@0.3.7, shapefile@0.3.0)
└── d3-geo-projection@0.2.14 (brfs@1.4.0)

I'm not sure if it has installed correctly. Now, when I run:

mtcars %>% 
  ggvis(x = ~wt) %>% 
  export_png()

I get the following error:

Writing to file plot.png

Error in vega_file(vis, file = file, type = "png") :

Conversion program vg2pngnot found.

Is there a specific way in which vega has to be installed on Windows, which would resolve this error?

来源:https://stackoverflow.com/questions/29411999/install-v2png-program-from-vega-node-js-module-on-windows

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!