本文介绍了从mongodb服务器上的数据创建d3.js图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用node.js从mongodb服务器的数据创建d3.js图?

解决方案

D3.js包括通过网址它使用Node.js®和一些用于MongoDB®的npm模块来专门驱动一个D3.js®可视化。


How can I create d3.js graph from data on mongodb server using node.js?

解决方案

D3.js includes ways to request non-local data either as json or text (csv) via urls and such.

In a setup that is not security sensitive (like local development or a demo environment) you could fairly directly use the mongo rest api if you enable it, which will give you json output for objects.

Or you could write build a simple http server (like in python, perl or go) that execs (python (also subprocess), perl (also backticks and qx{}), go) the mongoexport tool with the right parameters to provide csv output from mongo.

If you already have data in Mongo, and you've got Node already setup, then maybe that's what you want to use:

⇒ ⇒

If so, there's someone out there that's used Node.js® with some npm modules for MongoDB® to specifically drive a D3.js® visualization.

这篇关于从mongodb服务器上的数据创建d3.js图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 19:09