gpt4 book ai didi

javascript - 在 cubism.js 中使用 CSV 数据

转载 作者:行者123 更新时间:2023-11-29 22:17:32 24 4
gpt4 key购买 nike

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

文件格式为:

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

其中 Ux,y,z 是三维风速,即北风/南风、东风/西风,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 也会这样做。

如有任何帮助,我们将不胜感激。

最佳答案

在我看来,您正在尝试使用 cubism.js 在一个地平线上进行两次绘图,这似乎是不可能的,因为我自己也试图实现这一目标,但我才意识到一个地平线只需要发生时的单个值,但您始终可以将 Ux 和 Uy 分成两个不同的范围,从而实现您想要的结果。

关于javascript - 在 cubism.js 中使用 CSV 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14241224/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com