Tag: vega

使用bot框架和Vega库在聊天机器人中显示图表

我正在使用Microsoft Bot Framework和Vega库构build数据可视化机器人。 我遵循github中的代码 。 谁能告诉我我的代码有什么问题? 但是,当我运行我的代码时出现错误: / – waterfall() step 1 of 1 / – Session.send() (node:11934) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property 'getContext' of null / – Session.sendBatch() sending 1 message(s) 这是我的代码: var sendVega = require('./botbuilder-vega'); // skip the setup server & create session process function sendVegaChart(session){ var […]

获取ggvis :: export_png()工作

目标 将ggvis图导出为PNG文件(包含在.Rmd文档中)。 问题 我对Node.js一无所知,除了它是伟大的,我应该知道更多。 我甚至可以: library(ggvis) mtcars %>% ggvis(~mpg, ~wt) %>% export_png() Writing to file plot.png Guessing layer_points() module.js:340 throw err; ^ Error: Cannot find module 'd3' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (/usr/local/src/vega/index.js:11:6) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at […]