使用带有cubism.js的CSV数据

时间:2013-01-09 16:00:32

标签: javascript cubism.js

我是cubism.js的新手;但是想用它来绘制一些以60hz到20hz之间的各种速率收集和存储的CSV数据。

文件格式为:

"TIMESTAMP","RECORD","Ux","Uy","Uz","Ts"

其中Ux,y,z为3d风速,即北/南,东/西风,Ts为温度。

"2011-07-21 07:03:03.1",24640835,0.0055,-0.03925,0.24075,24.18286,0.7445,-1.0425,-0.18225,24.21899,6.16675,-1.3475,0.58375,24.67505,33,27,27
"2011-07-21 07:03:03.15",24640836,0.00575,-0.03325,0.2435,24.19662,0.62075,-1.236,-0.19275,24.24136,6.25275,-1.3685,0.49575,24.70435,34,28,28
"2011-07-21 07:03:03.2",24640837,0.0275,-0.00925,0.22075,24.15018,0.467,-1.28625,-0.2165,24.24478,6.54625,-1.238,0.30025,24.73019,35,29,29
"2011-07-21 07:03:03.25",24640838,0.032,0.0045,0.1975,24.19492,0.50375,-1.307,-0.1965,24.2706,6.552001,-1.45625,0.57125,24.63718,36,30,30
"2011-07-21 07:03:03.3",24640839,0.017,0.00475,0.1775,24.15878,0.457,-1.14025,-0.14825,24.27231,6.407001,-1.223,0.534,24.72845,37,31,31
"2011-07-21 07:03:03.35",24640840,-0.04,0.042,0.154,24.18115,0.43525,-1.06975,-0.072,24.2775,6.39425,-1.1755,0.558,24.71469,38,32,32
"2011-07-21 07:03:03.4",24640841,-0.061,0.06525,0.14375,24.16907,0.59825,-0.8595001,-0.101,24.25513,6.21225,-1.25075,0.5785,24.76633,39,33,33
"2011-07-21 07:03:03.45",24640842,-0.04725,0.072,0.12175,24.16052,0.5330001,-0.7,-0.0815,24.26715,6.17925,-0.8412501,0.3965,24.73706,40,34,34
"2011-07-21 07:03:03.5",24640843,-0.06175,0.06075,0.0865,24.15189,0.58925,-0.74575,0.00525,24.25165,6.263,-0.9675,0.056,24.78186,41,35,35
"2011-07-21 07:03:03.55",24640844,-0.032,0.08575001,0.07300001,24.15878,0.546,-0.77,0.1255,24.29126,6.353,-1.08975,-0.03825,24.76288,42,36,36

我可以使用d3.csv或其他javascript方法轻松读取数据;但我不确定如何将其格式化为立体主义。

Ux正风速将从下往上显示,负数将从上到下显示,Uy,Uz也会这样做。

对此的任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:2)

对我来说,你试图用cubism.js在一个地平线上进行两次绘图,这似乎不可能,因为我自己也试图实现这一点,但我只是意识到只有一个地平线在发生的时间内只接受一个值,但你总是可以将Ux和Uy分成两个不同的视野,这样你就可以达到你想要的效果。