Plotly JS 3D-график со временем по оси Z - PullRequest
0 голосов
/ 13 октября 2019

У меня есть следующие координаты для оси X и Y (всего 509 координат в каждой строке):

var x = [-21.78,-21.7,-21.61,-21.53,-21.44,-21.35,-21.27,-21.18,-21.09,-21,-20.92,-20.84,-20.75,-20.67,-20.57,-20.49,-20.41,-20.32,-20.23,-20.15,-20.06,-19.97,-19.9,-19.8,-19.71,-19.64,-19.54,-19.46,-19.37,-19.29,-19.19,-19.12,-19.03,-18.95,-18.86,-18.77,-18.69,-18.6,-18.51,-18.43,-18.35,-18.26,-18.18,-18.08,-18,-17.92,-17.83,-17.74,-17.66,-17.57,-17.49,-17.4,-17.32,-17.23,-17.15,-17.06,-16.97,-16.89,-16.81,-16.72,-16.63,-16.54,-16.47,-16.37,-16.29,-16.2,-16.12,-16.03,-15.94,-15.86,-15.78,-15.69,-15.61,-15.52,-15.43,-15.35,-15.26,-15.18,-15.09,-15,-14.92,-14.83,-14.75,-14.66,-14.58,-14.49,-14.41,-14.32,-14.24,-14.15,-14.06,-13.98,-13.89,-13.81,-13.73,-13.64,-13.56,-13.47,-13.38,-13.29,-13.21,-13.12,-13.04,-12.95,-12.87,-12.79,-12.69,-12.61,-12.53,-12.44,-12.36,-12.27,-12.19,-12.1,-12.01,-11.93,-11.84,-11.76,-11.67,-11.59,-11.5,-11.42,-11.33,-11.25,-11.16,-11.08,-10.99,-10.91,-10.82,-10.73,-10.65,-10.57,-10.48,-10.4,-10.31,-10.22,-10.14,-10.06,-9.96,-9.88,-9.8,-9.71,-9.63,-9.54,-9.46,-9.37,-9.29,-9.2,-9.12,-9.03,-8.95,-8.86,-8.78,-8.69,-8.6,-8.52,-8.43,-8.35,-8.27,-8.18,-8.1,-8.01,-7.92,-7.84,-7.76,-7.67,-7.59,-7.5,-7.41,-7.33,-7.25,-7.16,-7.07,-6.99,-6.9,-6.82,-6.73,-6.65,-6.56,-6.48,-6.39,-6.3,-6.22,-6.14,-6.05,-5.97,-5.88,-5.8,-5.71,-5.63,-5.54,-5.46,-5.37,-5.29,-5.2,-5.12,-5.03,-4.95,-4.86,-4.77,-4.69,-4.61,-4.52,-4.44,-4.35,-4.27,-4.19,-4.1,-4.02,-3.94,-3.86,-3.77,-3.69,-3.6,-3.52,-3.44,-3.35,-3.27,-3.19,-3.1,-3.02,-2.93,-2.85,-2.77,-2.68,-2.6,-2.51,-2.43,-2.34,-2.26,-2.17,-2.09,-2,-1.92,-1.83,-1.75,-1.66,-1.58,-1.49,-1.41,-1.32,-1.23,-1.15,-1.06,-0.98,-0.89,-0.8,-0.72,-0.63,-0.54,-0.46,-0.37,-0.28,-0.2,-0.11,-0.02,0.06,0.14,0.23,0.32,0.4,0.49,0.58,0.66,0.75,0.84,0.92,1.01,1.1,1.18,1.27,1.35,1.44,1.53,1.61,1.7,1.78,1.87,1.95,2.04,2.12,2.21,2.29,2.38,2.46,2.55,2.63,2.71,2.8,2.88,2.96,3.05,3.13,3.22,3.3,3.38,3.47,3.55,3.63,3.72,3.8,3.88,3.97,4.05,4.13,4.21,4.3,4.38,4.46,4.55,4.63,4.72,4.8,4.89,4.97,5.06,5.14,5.23,5.31,5.4,5.48,5.57,5.65,5.73,5.82,5.91,5.99,6.08,6.16,6.24,6.33,6.41,6.5,6.58,6.67,6.75,6.84,6.92,7.01,7.09,7.18,7.26,7.35,7.43,7.51,7.6,7.68,7.77,7.85,7.94,8.02,8.11,8.19,8.28,8.36,8.45,8.53,8.62,8.7,8.79,8.87,8.95,9.04,9.12,9.21,9.29,9.38,9.47,9.55,9.64,9.72,9.8,9.89,9.97,10.06,10.14,10.23,10.31,10.4,10.48,10.57,10.66,10.74,10.82,10.91,10.99,11.08,11.16,11.25,11.33,11.41,11.5,11.58,11.67,11.75,11.83,11.92,12.01,12.09,12.18,12.26,12.35,12.44,12.52,12.6,12.69,12.77,12.86,12.94,13.02,13.12,13.2,13.28,13.36,13.45,13.54,13.62,13.71,13.79,13.87,13.96,14.04,14.13,14.22,14.3,14.38,14.47,14.56,14.64,14.73,14.81,14.89,14.98,15.06,15.14,15.23,15.32,15.4,15.48,15.57,15.65,15.74,15.82,15.91,15.99,16.08,16.17,16.25,16.33,16.42,16.5,16.59,16.68,16.75,16.84,16.93,17.01,17.1,17.19,17.26,17.36,17.44,17.53,17.61,17.69,17.78,17.86,17.95,18.04,18.11,18.2,18.29,18.38,18.46,18.53,18.63,18.71,18.79,18.88,18.97,19.04,19.14,19.22,19.31,19.39,19.47,19.57,19.64,19.72,19.81,19.89,19.99,20.08,20.15,20.23,20.33,20.41,20.5,20.57,20.67,20.75,20.83,20.92,21.01,21.08,21.18,21.26,21.35,21.43];
var y = [109.09,109.06,109.1,109.06,109.05,109.08,109.09,109.07,109.13,109.11,109.13,109.1,109.08,109.08,109.14,109.11,109.07,109.13,109.11,109.1,109.1,109.15,109.09,109.12,109.16,109.11,109.15,109.15,109.19,109.1,109.19,109.1,109.12,109.14,109.15,109.17,109.15,109.15,109.19,109.16,109.16,109.14,109.13,109.2,109.18,109.15,109.17,109.19,109.16,109.19,109.18,109.18,109.18,109.2,109.17,109.15,109.19,109.17,109.16,109.16,109.2,109.23,109.17,109.22,109.21,109.24,109.21,109.21,109.23,109.2,109.22,109.18,109.2,109.22,109.23,109.19,109.23,109.18,109.27,109.29,109.24,109.24,109.24,109.24,109.19,109.25,109.21,109.29,109.22,109.22,109.31,109.26,109.26,109.23,109.21,109.27,109.22,109.27,109.29,109.31,109.28,109.31,109.28,109.28,109.28,109.27,109.32,109.29,109.29,109.29,109.3,109.28,109.25,109.32,109.32,109.32,109.31,109.33,109.31,109.31,109.3,109.32,109.37,109.32,109.36,109.32,109.31,109.31,109.3,109.37,109.33,109.3,109.37,109.31,109.36,109.34,109.35,109.33,109.39,109.35,109.35,109.37,109.36,109.38,109.36,109.36,109.33,109.39,109.34,109.36,109.34,109.36,109.38,109.4,109.38,109.38,109.44,109.37,109.36,109.39,109.36,109.38,109.4,109.38,109.35,109.41,109.37,109.41,109.41,109.38,109.38,109.47,109.42,109.4,109.46,109.44,109.43,109.43,109.4,109.45,109.45,109.47,109.44,109.46,109.46,109.39,109.45,109.42,109.43,109.42,109.42,109.44,109.51,109.48,109.52,109.41,109.45,109.47,109.53,109.53,109.46,109.5,109.46,109.48,109.45,109.49,109.39,109.33,109.2,109.18,109.06,109.08,108.98,108.91,108.88,108.78,108.71,108.59,108.57,108.54,108.44,108.42,108.32,108.27,108.13,108.06,108.07,107.92,107.89,107.82,107.73,107.74,107.6,107.49,107.48,107.42,107.34,107.25,107.2,107.13,107.08,106.95,106.96,106.8,106.82,106.68,106.64,106.57,106.54,106.47,106.42,106.29,106.22,106.17,106.1,106.01,106.05,106.09,106.18,106.22,106.31,106.35,106.48,106.5,106.58,106.65,106.76,106.84,106.91,106.95,107.04,107.13,107.21,107.3,107.36,107.41,107.5,107.61,107.7,107.78,107.82,107.87,107.95,108.02,108.09,108.13,108.22,108.35,108.42,108.41,108.57,108.59,108.73,108.75,108.82,108.93,108.96,109.04,109.11,109.21,109.29,109.31,109.38,109.48,109.57,109.63,109.7,109.76,109.72,109.73,109.73,109.73,109.77,109.77,109.74,109.76,109.76,109.76,109.78,109.75,109.72,109.77,109.81,109.8,109.76,109.73,109.73,109.72,109.79,109.78,109.81,109.82,109.77,109.77,109.75,109.83,109.83,109.83,109.8,109.84,109.77,109.77,109.83,109.83,109.83,109.8,109.84,109.86,109.86,109.79,109.83,109.83,109.87,109.8,109.84,109.86,109.84,109.83,109.85,109.87,109.85,109.89,109.82,109.88,109.83,109.88,109.89,109.87,109.82,109.86,109.88,109.92,109.92,109.89,109.91,109.88,109.89,109.91,109.9,109.89,109.9,109.86,109.86,109.88,109.88,109.9,109.9,109.92,109.91,109.93,109.97,109.93,109.97,109.94,109.96,110,109.98,109.95,109.97,109.95,109.97,109.96,109.93,109.96,109.97,109.93,109.99,109.97,109.98,110.01,109.93,109.98,110,109.99,109.96,109.98,110.01,109.98,110,110,110.02,110.01,110.01,109.98,110.02,110,110.02,109.99,110.03,109.98,110,110.02,110,110.04,110.06,110.05,110.01,110.07,110.07,110.04,110.11,110.06,110.06,110.07,110.07,110.05,110.06,110.06,110.08,110.05,110.13,110.09,110.05,110.13,110.09,110.11,110.1,110.12,110.07,110.14,110.07,110.11,110.08,110.1,110.12,110.12,110.12,110.12,110.08,110.15,110.13,110.08,110.1,110.1,110.19,110.11,110.15,110.18,110.19,110.14,110.19,110.12,110.16,110.15,110.18,110.22,110.13,110.21,110.21,110.18,110.21,110.16,110.15,110.24,110.22,110.16,110.19,110.18,110.23,110.18,110.19,110.2,110.21,110.19,110.26,110.18,110.22,110.18,110.24];

Я использовал эти значения для создания 2D-графика с использованием Plotly JS. Это работает нормально и выглядит так: enter image description here Figure-1

Теперь я получаю эти значения с помощью API с течением времени. И мне нужно отобразить эти значения с осью Z как время. Поскольку я получаю более 10 строк данных в секунду, со временем по оси Z должно выглядеть примерно так: enter image description here Figure-2

Данные похожи (обычно координаты X и Yнемного различаются при каждом вызове, сохраняя их здесь только для примера):

var x1 = [-21.78,-21.7,-21.61,-21.53,-21.44,-21.35,-21.27,-21.18,-21.09,-21,-20.92,-20.84,-20.75,-20.67,-20.57,-20.49,-20.41,-20.32,-20.23,-20.15,-20.06,-19.97,-19.9,-19.8,-19.71,-19.64,-19.54,-19.46,-19.37,-19.29,-19.19,-19.12,-19.03,-18.95,-18.86,-18.77,-18.69,-18.6,-18.51,-18.43,-18.35,-18.26,-18.18,-18.08,-18,-17.92,-17.83,-17.74,-17.66,-17.57,-17.49,-17.4,-17.32,-17.23,-17.15,-17.06,-16.97,-16.89,-16.81,-16.72,-16.63,-16.54,-16.47,-16.37,-16.29,-16.2,-16.12,-16.03,-15.94,-15.86,-15.78,-15.69,-15.61,-15.52,-15.43,-15.35,-15.26,-15.18,-15.09,-15,-14.92,-14.83,-14.75,-14.66,-14.58,-14.49,-14.41,-14.32,-14.24,-14.15,-14.06,-13.98,-13.89,-13.81,-13.73,-13.64,-13.56,-13.47,-13.38,-13.29,-13.21,-13.12,-13.04,-12.95,-12.87,-12.79,-12.69,-12.61,-12.53,-12.44,-12.36,-12.27,-12.19,-12.1,-12.01,-11.93,-11.84,-11.76,-11.67,-11.59,-11.5,-11.42,-11.33,-11.25,-11.16,-11.08,-10.99,-10.91,-10.82,-10.73,-10.65,-10.57,-10.48,-10.4,-10.31,-10.22,-10.14,-10.06,-9.96,-9.88,-9.8,-9.71,-9.63,-9.54,-9.46,-9.37,-9.29,-9.2,-9.12,-9.03,-8.95,-8.86,-8.78,-8.69,-8.6,-8.52,-8.43,-8.35,-8.27,-8.18,-8.1,-8.01,-7.92,-7.84,-7.76,-7.67,-7.59,-7.5,-7.41,-7.33,-7.25,-7.16,-7.07,-6.99,-6.9,-6.82,-6.73,-6.65,-6.56,-6.48,-6.39,-6.3,-6.22,-6.14,-6.05,-5.97,-5.88,-5.8,-5.71,-5.63,-5.54,-5.46,-5.37,-5.29,-5.2,-5.12,-5.03,-4.95,-4.86,-4.77,-4.69,-4.61,-4.52,-4.44,-4.35,-4.27,-4.19,-4.1,-4.02,-3.94,-3.86,-3.77,-3.69,-3.6,-3.52,-3.44,-3.35,-3.27,-3.19,-3.1,-3.02,-2.93,-2.85,-2.77,-2.68,-2.6,-2.51,-2.43,-2.34,-2.26,-2.17,-2.09,-2,-1.92,-1.83,-1.75,-1.66,-1.58,-1.49,-1.41,-1.32,-1.23,-1.15,-1.06,-0.98,-0.89,-0.8,-0.72,-0.63,-0.54,-0.46,-0.37,-0.28,-0.2,-0.11,-0.02,0.06,0.14,0.23,0.32,0.4,0.49,0.58,0.66,0.75,0.84,0.92,1.01,1.1,1.18,1.27,1.35,1.44,1.53,1.61,1.7,1.78,1.87,1.95,2.04,2.12,2.21,2.29,2.38,2.46,2.55,2.63,2.71,2.8,2.88,2.96,3.05,3.13,3.22,3.3,3.38,3.47,3.55,3.63,3.72,3.8,3.88,3.97,4.05,4.13,4.21,4.3,4.38,4.46,4.55,4.63,4.72,4.8,4.89,4.97,5.06,5.14,5.23,5.31,5.4,5.48,5.57,5.65,5.73,5.82,5.91,5.99,6.08,6.16,6.24,6.33,6.41,6.5,6.58,6.67,6.75,6.84,6.92,7.01,7.09,7.18,7.26,7.35,7.43,7.51,7.6,7.68,7.77,7.85,7.94,8.02,8.11,8.19,8.28,8.36,8.45,8.53,8.62,8.7,8.79,8.87,8.95,9.04,9.12,9.21,9.29,9.38,9.47,9.55,9.64,9.72,9.8,9.89,9.97,10.06,10.14,10.23,10.31,10.4,10.48,10.57,10.66,10.74,10.82,10.91,10.99,11.08,11.16,11.25,11.33,11.41,11.5,11.58,11.67,11.75,11.83,11.92,12.01,12.09,12.18,12.26,12.35,12.44,12.52,12.6,12.69,12.77,12.86,12.94,13.02,13.12,13.2,13.28,13.36,13.45,13.54,13.62,13.71,13.79,13.87,13.96,14.04,14.13,14.22,14.3,14.38,14.47,14.56,14.64,14.73,14.81,14.89,14.98,15.06,15.14,15.23,15.32,15.4,15.48,15.57,15.65,15.74,15.82,15.91,15.99,16.08,16.17,16.25,16.33,16.42,16.5,16.59,16.68,16.75,16.84,16.93,17.01,17.1,17.19,17.26,17.36,17.44,17.53,17.61,17.69,17.78,17.86,17.95,18.04,18.11,18.2,18.29,18.38,18.46,18.53,18.63,18.71,18.79,18.88,18.97,19.04,19.14,19.22,19.31,19.39,19.47,19.57,19.64,19.72,19.81,19.89,19.99,20.08,20.15,20.23,20.33,20.41,20.5,20.57,20.67,20.75,20.83,20.92,21.01,21.08,21.18,21.26,21.35,21.43];
var y1 = [109.09,109.06,109.1,109.06,109.05,109.08,109.09,109.07,109.13,109.11,109.13,109.1,109.08,109.08,109.14,109.11,109.07,109.13,109.11,109.1,109.1,109.15,109.09,109.12,109.16,109.11,109.15,109.15,109.19,109.1,109.19,109.1,109.12,109.14,109.15,109.17,109.15,109.15,109.19,109.16,109.16,109.14,109.13,109.2,109.18,109.15,109.17,109.19,109.16,109.19,109.18,109.18,109.18,109.2,109.17,109.15,109.19,109.17,109.16,109.16,109.2,109.23,109.17,109.22,109.21,109.24,109.21,109.21,109.23,109.2,109.22,109.18,109.2,109.22,109.23,109.19,109.23,109.18,109.27,109.29,109.24,109.24,109.24,109.24,109.19,109.25,109.21,109.29,109.22,109.22,109.31,109.26,109.26,109.23,109.21,109.27,109.22,109.27,109.29,109.31,109.28,109.31,109.28,109.28,109.28,109.27,109.32,109.29,109.29,109.29,109.3,109.28,109.25,109.32,109.32,109.32,109.31,109.33,109.31,109.31,109.3,109.32,109.37,109.32,109.36,109.32,109.31,109.31,109.3,109.37,109.33,109.3,109.37,109.31,109.36,109.34,109.35,109.33,109.39,109.35,109.35,109.37,109.36,109.38,109.36,109.36,109.33,109.39,109.34,109.36,109.34,109.36,109.38,109.4,109.38,109.38,109.44,109.37,109.36,109.39,109.36,109.38,109.4,109.38,109.35,109.41,109.37,109.41,109.41,109.38,109.38,109.47,109.42,109.4,109.46,109.44,109.43,109.43,109.4,109.45,109.45,109.47,109.44,109.46,109.46,109.39,109.45,109.42,109.43,109.42,109.42,109.44,109.51,109.48,109.52,109.41,109.45,109.47,109.53,109.53,109.46,109.5,109.46,109.48,109.45,109.49,109.39,109.33,109.2,109.18,109.06,109.08,108.98,108.91,108.88,108.78,108.71,108.59,108.57,108.54,108.44,108.42,108.32,108.27,108.13,108.06,108.07,107.92,107.89,107.82,107.73,107.74,107.6,107.49,107.48,107.42,107.34,107.25,107.2,107.13,107.08,106.95,106.96,106.8,106.82,106.68,106.64,106.57,106.54,106.47,106.42,106.29,106.22,106.17,106.1,106.01,106.05,106.09,106.18,106.22,106.31,106.35,106.48,106.5,106.58,106.65,106.76,106.84,106.91,106.95,107.04,107.13,107.21,107.3,107.36,107.41,107.5,107.61,107.7,107.78,107.82,107.87,107.95,108.02,108.09,108.13,108.22,108.35,108.42,108.41,108.57,108.59,108.73,108.75,108.82,108.93,108.96,109.04,109.11,109.21,109.29,109.31,109.38,109.48,109.57,109.63,109.7,109.76,109.72,109.73,109.73,109.73,109.77,109.77,109.74,109.76,109.76,109.76,109.78,109.75,109.72,109.77,109.81,109.8,109.76,109.73,109.73,109.72,109.79,109.78,109.81,109.82,109.77,109.77,109.75,109.83,109.83,109.83,109.8,109.84,109.77,109.77,109.83,109.83,109.83,109.8,109.84,109.86,109.86,109.79,109.83,109.83,109.87,109.8,109.84,109.86,109.84,109.83,109.85,109.87,109.85,109.89,109.82,109.88,109.83,109.88,109.89,109.87,109.82,109.86,109.88,109.92,109.92,109.89,109.91,109.88,109.89,109.91,109.9,109.89,109.9,109.86,109.86,109.88,109.88,109.9,109.9,109.92,109.91,109.93,109.97,109.93,109.97,109.94,109.96,110,109.98,109.95,109.97,109.95,109.97,109.96,109.93,109.96,109.97,109.93,109.99,109.97,109.98,110.01,109.93,109.98,110,109.99,109.96,109.98,110.01,109.98,110,110,110.02,110.01,110.01,109.98,110.02,110,110.02,109.99,110.03,109.98,110,110.02,110,110.04,110.06,110.05,110.01,110.07,110.07,110.04,110.11,110.06,110.06,110.07,110.07,110.05,110.06,110.06,110.08,110.05,110.13,110.09,110.05,110.13,110.09,110.11,110.1,110.12,110.07,110.14,110.07,110.11,110.08,110.1,110.12,110.12,110.12,110.12,110.08,110.15,110.13,110.08,110.1,110.1,110.19,110.11,110.15,110.18,110.19,110.14,110.19,110.12,110.16,110.15,110.18,110.22,110.13,110.21,110.21,110.18,110.21,110.16,110.15,110.24,110.22,110.16,110.19,110.18,110.23,110.18,110.19,110.2,110.21,110.19,110.26,110.18,110.22,110.18,110.24];
var z1 = 0.1; //assume this as 1/10 of a second

var x2 = [-21.78,-21.7,-21.61,-21.53,-21.44,-21.35,-21.27,-21.18,-21.09,-21,-20.92,-20.84,-20.75,-20.67,-20.57,-20.49,-20.41,-20.32,-20.23,-20.15,-20.06,-19.97,-19.9,-19.8,-19.71,-19.64,-19.54,-19.46,-19.37,-19.29,-19.19,-19.12,-19.03,-18.95,-18.86,-18.77,-18.69,-18.6,-18.51,-18.43,-18.35,-18.26,-18.18,-18.08,-18,-17.92,-17.83,-17.74,-17.66,-17.57,-17.49,-17.4,-17.32,-17.23,-17.15,-17.06,-16.97,-16.89,-16.81,-16.72,-16.63,-16.54,-16.47,-16.37,-16.29,-16.2,-16.12,-16.03,-15.94,-15.86,-15.78,-15.69,-15.61,-15.52,-15.43,-15.35,-15.26,-15.18,-15.09,-15,-14.92,-14.83,-14.75,-14.66,-14.58,-14.49,-14.41,-14.32,-14.24,-14.15,-14.06,-13.98,-13.89,-13.81,-13.73,-13.64,-13.56,-13.47,-13.38,-13.29,-13.21,-13.12,-13.04,-12.95,-12.87,-12.79,-12.69,-12.61,-12.53,-12.44,-12.36,-12.27,-12.19,-12.1,-12.01,-11.93,-11.84,-11.76,-11.67,-11.59,-11.5,-11.42,-11.33,-11.25,-11.16,-11.08,-10.99,-10.91,-10.82,-10.73,-10.65,-10.57,-10.48,-10.4,-10.31,-10.22,-10.14,-10.06,-9.96,-9.88,-9.8,-9.71,-9.63,-9.54,-9.46,-9.37,-9.29,-9.2,-9.12,-9.03,-8.95,-8.86,-8.78,-8.69,-8.6,-8.52,-8.43,-8.35,-8.27,-8.18,-8.1,-8.01,-7.92,-7.84,-7.76,-7.67,-7.59,-7.5,-7.41,-7.33,-7.25,-7.16,-7.07,-6.99,-6.9,-6.82,-6.73,-6.65,-6.56,-6.48,-6.39,-6.3,-6.22,-6.14,-6.05,-5.97,-5.88,-5.8,-5.71,-5.63,-5.54,-5.46,-5.37,-5.29,-5.2,-5.12,-5.03,-4.95,-4.86,-4.77,-4.69,-4.61,-4.52,-4.44,-4.35,-4.27,-4.19,-4.1,-4.02,-3.94,-3.86,-3.77,-3.69,-3.6,-3.52,-3.44,-3.35,-3.27,-3.19,-3.1,-3.02,-2.93,-2.85,-2.77,-2.68,-2.6,-2.51,-2.43,-2.34,-2.26,-2.17,-2.09,-2,-1.92,-1.83,-1.75,-1.66,-1.58,-1.49,-1.41,-1.32,-1.23,-1.15,-1.06,-0.98,-0.89,-0.8,-0.72,-0.63,-0.54,-0.46,-0.37,-0.28,-0.2,-0.11,-0.02,0.06,0.14,0.23,0.32,0.4,0.49,0.58,0.66,0.75,0.84,0.92,1.01,1.1,1.18,1.27,1.35,1.44,1.53,1.61,1.7,1.78,1.87,1.95,2.04,2.12,2.21,2.29,2.38,2.46,2.55,2.63,2.71,2.8,2.88,2.96,3.05,3.13,3.22,3.3,3.38,3.47,3.55,3.63,3.72,3.8,3.88,3.97,4.05,4.13,4.21,4.3,4.38,4.46,4.55,4.63,4.72,4.8,4.89,4.97,5.06,5.14,5.23,5.31,5.4,5.48,5.57,5.65,5.73,5.82,5.91,5.99,6.08,6.16,6.24,6.33,6.41,6.5,6.58,6.67,6.75,6.84,6.92,7.01,7.09,7.18,7.26,7.35,7.43,7.51,7.6,7.68,7.77,7.85,7.94,8.02,8.11,8.19,8.28,8.36,8.45,8.53,8.62,8.7,8.79,8.87,8.95,9.04,9.12,9.21,9.29,9.38,9.47,9.55,9.64,9.72,9.8,9.89,9.97,10.06,10.14,10.23,10.31,10.4,10.48,10.57,10.66,10.74,10.82,10.91,10.99,11.08,11.16,11.25,11.33,11.41,11.5,11.58,11.67,11.75,11.83,11.92,12.01,12.09,12.18,12.26,12.35,12.44,12.52,12.6,12.69,12.77,12.86,12.94,13.02,13.12,13.2,13.28,13.36,13.45,13.54,13.62,13.71,13.79,13.87,13.96,14.04,14.13,14.22,14.3,14.38,14.47,14.56,14.64,14.73,14.81,14.89,14.98,15.06,15.14,15.23,15.32,15.4,15.48,15.57,15.65,15.74,15.82,15.91,15.99,16.08,16.17,16.25,16.33,16.42,16.5,16.59,16.68,16.75,16.84,16.93,17.01,17.1,17.19,17.26,17.36,17.44,17.53,17.61,17.69,17.78,17.86,17.95,18.04,18.11,18.2,18.29,18.38,18.46,18.53,18.63,18.71,18.79,18.88,18.97,19.04,19.14,19.22,19.31,19.39,19.47,19.57,19.64,19.72,19.81,19.89,19.99,20.08,20.15,20.23,20.33,20.41,20.5,20.57,20.67,20.75,20.83,20.92,21.01,21.08,21.18,21.26,21.35,21.43];
var y2 = [109.09,109.06,109.1,109.06,109.05,109.08,109.09,109.07,109.13,109.11,109.13,109.1,109.08,109.08,109.14,109.11,109.07,109.13,109.11,109.1,109.1,109.15,109.09,109.12,109.16,109.11,109.15,109.15,109.19,109.1,109.19,109.1,109.12,109.14,109.15,109.17,109.15,109.15,109.19,109.16,109.16,109.14,109.13,109.2,109.18,109.15,109.17,109.19,109.16,109.19,109.18,109.18,109.18,109.2,109.17,109.15,109.19,109.17,109.16,109.16,109.2,109.23,109.17,109.22,109.21,109.24,109.21,109.21,109.23,109.2,109.22,109.18,109.2,109.22,109.23,109.19,109.23,109.18,109.27,109.29,109.24,109.24,109.24,109.24,109.19,109.25,109.21,109.29,109.22,109.22,109.31,109.26,109.26,109.23,109.21,109.27,109.22,109.27,109.29,109.31,109.28,109.31,109.28,109.28,109.28,109.27,109.32,109.29,109.29,109.29,109.3,109.28,109.25,109.32,109.32,109.32,109.31,109.33,109.31,109.31,109.3,109.32,109.37,109.32,109.36,109.32,109.31,109.31,109.3,109.37,109.33,109.3,109.37,109.31,109.36,109.34,109.35,109.33,109.39,109.35,109.35,109.37,109.36,109.38,109.36,109.36,109.33,109.39,109.34,109.36,109.34,109.36,109.38,109.4,109.38,109.38,109.44,109.37,109.36,109.39,109.36,109.38,109.4,109.38,109.35,109.41,109.37,109.41,109.41,109.38,109.38,109.47,109.42,109.4,109.46,109.44,109.43,109.43,109.4,109.45,109.45,109.47,109.44,109.46,109.46,109.39,109.45,109.42,109.43,109.42,109.42,109.44,109.51,109.48,109.52,109.41,109.45,109.47,109.53,109.53,109.46,109.5,109.46,109.48,109.45,109.49,109.39,109.33,109.2,109.18,109.06,109.08,108.98,108.91,108.88,108.78,108.71,108.59,108.57,108.54,108.44,108.42,108.32,108.27,108.13,108.06,108.07,107.92,107.89,107.82,107.73,107.74,107.6,107.49,107.48,107.42,107.34,107.25,107.2,107.13,107.08,106.95,106.96,106.8,106.82,106.68,106.64,106.57,106.54,106.47,106.42,106.29,106.22,106.17,106.1,106.01,106.05,106.09,106.18,106.22,106.31,106.35,106.48,106.5,106.58,106.65,106.76,106.84,106.91,106.95,107.04,107.13,107.21,107.3,107.36,107.41,107.5,107.61,107.7,107.78,107.82,107.87,107.95,108.02,108.09,108.13,108.22,108.35,108.42,108.41,108.57,108.59,108.73,108.75,108.82,108.93,108.96,109.04,109.11,109.21,109.29,109.31,109.38,109.48,109.57,109.63,109.7,109.76,109.72,109.73,109.73,109.73,109.77,109.77,109.74,109.76,109.76,109.76,109.78,109.75,109.72,109.77,109.81,109.8,109.76,109.73,109.73,109.72,109.79,109.78,109.81,109.82,109.77,109.77,109.75,109.83,109.83,109.83,109.8,109.84,109.77,109.77,109.83,109.83,109.83,109.8,109.84,109.86,109.86,109.79,109.83,109.83,109.87,109.8,109.84,109.86,109.84,109.83,109.85,109.87,109.85,109.89,109.82,109.88,109.83,109.88,109.89,109.87,109.82,109.86,109.88,109.92,109.92,109.89,109.91,109.88,109.89,109.91,109.9,109.89,109.9,109.86,109.86,109.88,109.88,109.9,109.9,109.92,109.91,109.93,109.97,109.93,109.97,109.94,109.96,110,109.98,109.95,109.97,109.95,109.97,109.96,109.93,109.96,109.97,109.93,109.99,109.97,109.98,110.01,109.93,109.98,110,109.99,109.96,109.98,110.01,109.98,110,110,110.02,110.01,110.01,109.98,110.02,110,110.02,109.99,110.03,109.98,110,110.02,110,110.04,110.06,110.05,110.01,110.07,110.07,110.04,110.11,110.06,110.06,110.07,110.07,110.05,110.06,110.06,110.08,110.05,110.13,110.09,110.05,110.13,110.09,110.11,110.1,110.12,110.07,110.14,110.07,110.11,110.08,110.1,110.12,110.12,110.12,110.12,110.08,110.15,110.13,110.08,110.1,110.1,110.19,110.11,110.15,110.18,110.19,110.14,110.19,110.12,110.16,110.15,110.18,110.22,110.13,110.21,110.21,110.18,110.21,110.16,110.15,110.24,110.22,110.16,110.19,110.18,110.23,110.18,110.19,110.2,110.21,110.19,110.26,110.18,110.22,110.18,110.24];
var z2 = 0.2; //assume this as 1/10 of a second

// и т. д. Я получаю координаты новой строки каждую 1/10 секунды.

НоЯ сталкиваюсь с несколькими трудностями при достижении этого с помощью Plotly JS:

  1. Поскольку в каждой строке 500+ координат, производительность Plotly очень медленная при рисовании с использованием type = 'surface'.

  2. Разница во времени между каждой строкой составляет всего 1/10 секунды, поэтому если мне нужно нарисовать все линии хотя бы на 1 секунду, это сделает рендеринг, поворот, масштабирование и т. Д. Оченьмедленно.

  3. Я использую type = 'surface', трехмерный график имеет большой промежуток по оси Z. Есть ли способ уменьшить разрыв между каждой линией, чтобы график выглядел как поверхность. enter image description here Figure-3

Я делаю это, как в моем коде Angular с Plotly:

class Trace {
  x: number[];
  y: number[];
  z: number[];
  name: '';
  colorscale: '#000000';
  type: 'surface';
  showscale: false
    }

//APIResponse contains X,Y,Z values for each line. There can be 10 or even 100 line data in APIResponse at a time. So looping APIResponse below:

    drawPlot(APIResponse) {
        var lineArray = [];
    var traces = [];
    var trace: Trace;
    var x_inner = [];
    var y_inner = [];
    var z_inner = [];

    var x = [];
    var y = [];
    var z = [];

    // handle response starts
    var index = 0;
    var count = 0;
    for (index = 0; index < APIResponse.length; index++) {
      trace = new Trace();

      x_inner = [];
      y_inner = [];
      z_inner = [];

      x = [];
      y = [];
      z = [];

      lineArray = APIResponse[index].linedata;

      var newindex = 0;
      for(newindex = 0; newindex < lineArray.length; newindex++){
        x_inner.push(lineArray[newindex][0]);
        x.push(x_inner);

        y_inner.push(lineArray[newindex][1]);
        y.push(y_inner);

        z_inner.push(lineArray[newindex][3]);
        z.push(z_inner);

        x_inner = [];
        y_inner = [];
        z_inner = [];

      }

      //console.log(x);
      trace.x = x;
      trace.y = y;
      trace.z = z;
      trace.name = '';
      trace.colorscale = '#000000';
      trace.type = 'surface';
      trace.showscale = false

      traces.push(trace);
   }

    var data = traces;

    console.log(data);

    var layout = {
      title: 'Ribbon Plot',
      showlegend: false,
      autosize: true,
      width: 600,
      height: 600,
      scene: {
        xaxis: { title: 'X Axis' },
        yaxis: { title: 'Y Axis' },
        zaxis: { title: 'Z Axis' }
      }
    };

    Plotly.newPlot('graph', data, layout);
  }

В основном я просто хочупостроить эти линии в 3D со временем по оси Z. Есть ли простое решение, использующее Plotly, чтобы я мог получить результат как рисунок 2? Спасибо.

...