initBlock = {
const arrays = {
a_position: {numComponents: 2, data: grid},
a_val: {numComponents: 1, data: new Float32Array(values.buffer,0,nverts)},
indices: {numComponents: 3, data: indices}
};
const bufferInfo = twgl.createBufferInfoFromArrays(gl, arrays);
twgl.setBuffersAndAttributes(gl, programInfo, bufferInfo);
const projectionMatrix = mat4.create();
mat4.ortho(projectionMatrix,-1,1, -1, 1, 0, 1.);
const cmap = new Uint8Array([158, 1, 66, 255, 185, 31, 72, 255, 209, 60, 75, 255, 228, 86, 73, 255, 240, 112, 74, 255, 248, 142, 83, 255, 252, 172, 99, 255, 253, 198, 118, 255, 254, 221, 141, 255, 254, 238, 163, 255, 251, 248, 176, 255, 241, 249, 171, 255, 224, 243, 160, 255, 200, 233, 159, 255, 169, 220, 162, 255, 137, 207, 165, 255, 105, 189, 169, 255, 78, 164, 176, 255, 66, 136, 181, 255, 74, 108, 174, 255, 94, 79, 162, 255]);
const cmapTex = twgl.createTexture(gl, {mag: gl.LINEAR, min:gl.LINEAR, src: cmap, width:21, height:1} );
const uniforms = {u_matrix: projectionMatrix, u_cmap: cmapTex};
twgl.setUniforms(programInfo, uniforms);
gl.drawElements(gl.TRIANGLES, ntris*3, gl.UNSIGNED_INT, 0);
}