MCPcopy Index your code
hub / github.com/plotly/plotly.js / createSpikes

Function createSpikes

stackgl_modules/index.js:21850–21918  ·  view source on GitHub ↗
(gl, options)

Source from the content-addressed store, hash-verified

21848
21849
21850function createSpikes(gl, options) {
21851 //Create buffers
21852 var data = [ ]
21853
21854 function line(x,y,z,i,l,h) {
21855 var row = [x,y,z, 0,0,0, 1]
21856 row[i+3] = 1
21857 row[i] = l
21858 data.push.apply(data, row)
21859 row[6] = -1
21860 data.push.apply(data, row)
21861 row[i] = h
21862 data.push.apply(data, row)
21863 data.push.apply(data, row)
21864 row[6] = 1
21865 data.push.apply(data, row)
21866 row[i] = l
21867 data.push.apply(data, row)
21868 }
21869
21870 line(0,0,0, 0, 0, 1)
21871 line(0,0,0, 1, 0, 1)
21872 line(0,0,0, 2, 0, 1)
21873
21874 line(1,0,0, 1, -1,1)
21875 line(1,0,0, 2, -1,1)
21876
21877 line(0,1,0, 0, -1,1)
21878 line(0,1,0, 2, -1,1)
21879
21880 line(0,0,1, 0, -1,1)
21881 line(0,0,1, 1, -1,1)
21882
21883 var buffer = createBuffer(gl, data)
21884 var vao = createVAO(gl, [{
21885 type: gl.FLOAT,
21886 buffer: buffer,
21887 size: 3,
21888 offset: 0,
21889 stride: 28
21890 }, {
21891 type: gl.FLOAT,
21892 buffer: buffer,
21893 size: 3,
21894 offset: 12,
21895 stride: 28
21896 }, {
21897 type: gl.FLOAT,
21898 buffer: buffer,
21899 size: 1,
21900 offset: 24,
21901 stride: 28
21902 }])
21903
21904 //Create shader
21905 var shader = createShader(gl)
21906 shader.attributes.position.location = 0
21907 shader.attributes.color.location = 1

Callers 1

createSceneFunction · 0.85

Calls 4

createBufferFunction · 0.85
createVAOFunction · 0.85
createShaderFunction · 0.85
lineFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…