echarts-gl draw surfaces
when drawing a surface with echarts-gl, a two-dimensional array is provided. Echarts error prompts you to provide a two-dimensional array in the main order of behavior:
echarts-gl.js:51001 Uncaught (in promise) Error: Invalid data. data should be a row major 2d array.
at ExtendedClass._getDataShape (echarts-gl.js:51001)
at ExtendedClass.render (echarts-gl.js:50617)
at Task.progress (echarts.js:23685)
at doProgress (echarts.js:22678)
at Task.taskProto.perform (echarts.js:22601)
at echarts.js:26562
at ExtendedClass.<anonymous> (echarts.js:20645)
at Array.forEach (<anonymous>)
at each$1 (echarts.js:524)
at ExtendedClass.eachSeries (echarts.js:20643)
An example of a two-dimensional array in echarts-gl. With this two-dimensional array, you can draw a surface. I took a look at this two-dimensional array. The first element (x coordinate) of each element in the array (each element in the one-dimensional array corresponds to x, y, z coordinates) is arranged from small to large. If you mess up this order, you can"t draw a surface, but it doesn"t matter if you mess up the order of y or z, you can draw a surface.
data: [
[-1,-1,0],[-0.5,-1,0],[0,-1,0],[0.5,-1,0],[1,-1,0],
[-1,-0.5,0],[-0.5,-0.5,1],[0,-0.5,0],[0.5,-0.5,-1],[1,-0.5,0],
[-1,0,0],[-0.5,0,0],[0,0,0],[0.5,0,0],[1,0,0],
[-1,0.5,0],[-0.5,0.5,-1],[0,0.5,0],[0.5,0.5,1],[1,0.5,0],
[-1,1,0],[-0.5,1,0],[0,1,0],[0.5,1,0],[1,1,0]
]
the surface drawn is as follows:
what is a two-dimensional array in the main order of behavior?