diff --git a/devtools/regl_codegen/server.mjs b/devtools/regl_codegen/server.mjs index 6d2bc76efa3..389bd2b82d4 100644 --- a/devtools/regl_codegen/server.mjs +++ b/devtools/regl_codegen/server.mjs @@ -17,7 +17,7 @@ import { var args = minimist(process.argv.slice(2), {}); var PORT = args.port || 3000; -var reglTraceList = ['parcoords', 'scattergl', 'scatterpolargl', 'splom']; +const reglTraceList = args.trace ? [args.trace] : ['parcoords', 'scattergl', 'scatterpolargl', 'scatterternarygl', 'splom']; const _static = sirv(constants.pathToRoot, { dev: true, diff --git a/draftlogs/8083_add.md b/draftlogs/8083_add.md new file mode 100644 index 00000000000..ff08f3dac64 --- /dev/null +++ b/draftlogs/8083_add.md @@ -0,0 +1 @@ + - Add the `scatterternarygl` trace for ternary plots with WebGL [[#8083](https://github.com/plotly/plotly.js/pull/8083)] diff --git a/lib/index-strict.js b/lib/index-strict.js index 976695f8443..11487cccb86 100644 --- a/lib/index-strict.js +++ b/lib/index-strict.js @@ -12,6 +12,7 @@ Plotly.register([ require('./histogram2dcontour'), require('./contour'), require('./scatterternary'), + require('../src/traces/scatterternarygl/strict'), require('./violin'), require('./funnel'), require('./waterfall'), diff --git a/lib/index.js b/lib/index.js index f61d8ab484d..17470e3308f 100644 --- a/lib/index.js +++ b/lib/index.js @@ -12,6 +12,7 @@ Plotly.register([ require('./histogram2dcontour'), require('./contour'), require('./scatterternary'), + require('./scatterternarygl'), require('./violin'), require('./funnel'), require('./waterfall'), diff --git a/lib/scatterternarygl.js b/lib/scatterternarygl.js new file mode 100644 index 00000000000..9325d55e59b --- /dev/null +++ b/lib/scatterternarygl.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../src/traces/scatterternarygl'); diff --git a/src/generated/regl-codegen/a05bf3c1b12ac6d06248a1605bddec766ce3c5beca448738b9fcb95625273f0b b/src/generated/regl-codegen/a05bf3c1b12ac6d06248a1605bddec766ce3c5beca448738b9fcb95625273f0b new file mode 100644 index 00000000000..15c193442b6 --- /dev/null +++ b/src/generated/regl-codegen/a05bf3c1b12ac6d06248a1605bddec766ce3c5beca448738b9fcb95625273f0b @@ -0,0 +1,694 @@ +module.exports = function anonymous(g0,g48,g50,g114,g122,g124,g130,g132,g202 +) { +"use strict"; +var v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26,v27,v28,v29,v30,v31,v32,v33,v34,v35,v36,v37,v38,v39,v40,v41,v42,v43,v44,v45,v46,v47,v111,v199; +v1=g0.gl; +v2=g0.context; +v3=g0.strings; +v4=g0.next; +v5=g0.current; +v6=g0.draw; +v7=g0.elements; +v8=g0.buffer; +v9=g0.shader; +v10=g0.attributes; +v11=g0.vao; +v12=g0.uniforms; +v13=g0.framebuffer; +v14=g0.extensions; +v15=g0.timer; +v16=g0.isBufferArgs; +v17=v4.blend_color; +v18=v5.blend_color; +v19=v4.blend_equation; +v20=v5.blend_equation; +v21=v4.blend_func; +v22=v5.blend_func; +v23=v4.depth_range; +v24=v5.depth_range; +v25=v4.colorMask; +v26=v5.colorMask; +v27=v4.polygonOffset_offset; +v28=v5.polygonOffset_offset; +v29=v4.sample_coverage; +v30=v5.sample_coverage; +v31=v4.stencil_func; +v32=v5.stencil_func; +v33=v4.stencil_opFront; +v34=v5.stencil_opFront; +v35=v4.stencil_opBack; +v36=v5.stencil_opBack; +v37=v4.scissor_box; +v38=v5.scissor_box; +v39=v4.viewport; +v40=v5.viewport; +v41={ +"points":0,"point":0,"lines":1,"line":1,"triangles":4,"triangle":4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6} +; +v42={ +"never":512,"less":513,"<":513,"equal":514,"=":514,"==":514,"===":514,"lequal":515,"<=":515,"greater":516,">":516,"notequal":517,"!=":517,"!==":517,"gequal":518,">=":518,"always":519} +; +v43={ +"0":0,"1":1,"zero":0,"one":1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776} +; +v44={ +"add":32774,"subtract":32778,"reverse subtract":32779} +; +v45={ +"0":0,"zero":0,"keep":7680,"replace":7681,"increment":7682,"decrement":7683,"increment wrap":34055,"decrement wrap":34056,"invert":5386} +; +v46={ +"int8":5120,"int16":5122,"int32":5124,"uint8":5121,"uint16":5123,"uint32":5125,"float":5126,"float32":5126} +; +v47={ +"cw":2304,"ccw":2305} +; +v111={ +} +; +v199={ +} +; +return { +"draw":function(a0){ +var v49,v51,v52,v53,v100,v101,v102,v103,v104,v105,v106,v107,v108,v109,v110,v112,v113; +v49=v14.angle_instanced_arrays; +v51=v13.next; +v13.next=g50; +v52=v2.framebufferWidth; +v2.framebufferWidth=g50.width; +v53=v2.framebufferHeight; +v2.framebufferHeight=g50.height; +if(g50!==v13.cur){ +if(g50){ +v1.bindFramebuffer(36160,g50.framebuffer); +} +else{ +v1.bindFramebuffer(36160,null); +} +v13.cur=g50; +} +if(v5.dirty){ +var v54,v55,v56,v57,v58,v59,v60,v61,v62,v63,v64,v65,v66,v67,v68,v69,v70,v71,v72,v73,v74,v75,v76,v77,v78,v79,v80,v81,v82,v83,v84,v85,v86,v87,v88,v89,v90,v91,v92,v93,v94,v95,v96,v97,v98,v99; +v54=v4.dither; +if(v54!==v5.dither){ +if(v54){ +v1.enable(3024); +} +else{ +v1.disable(3024); +} +v5.dither=v54; +} +v55=v4.blend_enable; +if(v55!==v5.blend_enable){ +if(v55){ +v1.enable(3042); +} +else{ +v1.disable(3042); +} +v5.blend_enable=v55; +} +v56=v17[0]; +v57=v17[1]; +v58=v17[2]; +v59=v17[3]; +if(v56!==v18[0]||v57!==v18[1]||v58!==v18[2]||v59!==v18[3]){ +v1.blendColor(v56,v57,v58,v59); +v18[0]=v56; +v18[1]=v57; +v18[2]=v58; +v18[3]=v59; +} +v60=v19[0]; +v61=v19[1]; +if(v60!==v20[0]||v61!==v20[1]){ +v1.blendEquationSeparate(v60,v61); +v20[0]=v60; +v20[1]=v61; +} +v62=v21[0]; +v63=v21[1]; +v64=v21[2]; +v65=v21[3]; +if(v62!==v22[0]||v63!==v22[1]||v64!==v22[2]||v65!==v22[3]){ +v1.blendFuncSeparate(v62,v63,v64,v65); +v22[0]=v62; +v22[1]=v63; +v22[2]=v64; +v22[3]=v65; +} +v66=v4.depth_enable; +if(v66!==v5.depth_enable){ +if(v66){ +v1.enable(2929); +} +else{ +v1.disable(2929); +} +v5.depth_enable=v66; +} +v67=v4.depth_func; +if(v67!==v5.depth_func){ +v1.depthFunc(v67); +v5.depth_func=v67; +} +v68=v23[0]; +v69=v23[1]; +if(v68!==v24[0]||v69!==v24[1]){ +v1.depthRange(v68,v69); +v24[0]=v68; +v24[1]=v69; +} +v70=v4.depth_mask; +if(v70!==v5.depth_mask){ +v1.depthMask(v70); +v5.depth_mask=v70; +} +v71=v25[0]; +v72=v25[1]; +v73=v25[2]; +v74=v25[3]; +if(v71!==v26[0]||v72!==v26[1]||v73!==v26[2]||v74!==v26[3]){ +v1.colorMask(v71,v72,v73,v74); +v26[0]=v71; +v26[1]=v72; +v26[2]=v73; +v26[3]=v74; +} +v75=v4.cull_enable; +if(v75!==v5.cull_enable){ +if(v75){ +v1.enable(2884); +} +else{ +v1.disable(2884); +} +v5.cull_enable=v75; +} +v76=v4.cull_face; +if(v76!==v5.cull_face){ +v1.cullFace(v76); +v5.cull_face=v76; +} +v77=v4.frontFace; +if(v77!==v5.frontFace){ +v1.frontFace(v77); +v5.frontFace=v77; +} +v78=v4.lineWidth; +if(v78!==v5.lineWidth){ +v1.lineWidth(v78); +v5.lineWidth=v78; +} +v79=v4.polygonOffset_enable; +if(v79!==v5.polygonOffset_enable){ +if(v79){ +v1.enable(32823); +} +else{ +v1.disable(32823); +} +v5.polygonOffset_enable=v79; +} +v80=v27[0]; +v81=v27[1]; +if(v80!==v28[0]||v81!==v28[1]){ +v1.polygonOffset(v80,v81); +v28[0]=v80; +v28[1]=v81; +} +v82=v4.sample_alpha; +if(v82!==v5.sample_alpha){ +if(v82){ +v1.enable(32926); +} +else{ +v1.disable(32926); +} +v5.sample_alpha=v82; +} +v83=v4.sample_enable; +if(v83!==v5.sample_enable){ +if(v83){ +v1.enable(32928); +} +else{ +v1.disable(32928); +} +v5.sample_enable=v83; +} +v84=v29[0]; +v85=v29[1]; +if(v84!==v30[0]||v85!==v30[1]){ +v1.sampleCoverage(v84,v85); +v30[0]=v84; +v30[1]=v85; +} +v86=v4.stencil_enable; +if(v86!==v5.stencil_enable){ +if(v86){ +v1.enable(2960); +} +else{ +v1.disable(2960); +} +v5.stencil_enable=v86; +} +v87=v4.stencil_mask; +if(v87!==v5.stencil_mask){ +v1.stencilMask(v87); +v5.stencil_mask=v87; +} +v88=v31[0]; +v89=v31[1]; +v90=v31[2]; +if(v88!==v32[0]||v89!==v32[1]||v90!==v32[2]){ +v1.stencilFunc(v88,v89,v90); +v32[0]=v88; +v32[1]=v89; +v32[2]=v90; +} +v91=v33[0]; +v92=v33[1]; +v93=v33[2]; +v94=v33[3]; +if(v91!==v34[0]||v92!==v34[1]||v93!==v34[2]||v94!==v34[3]){ +v1.stencilOpSeparate(v91,v92,v93,v94); +v34[0]=v91; +v34[1]=v92; +v34[2]=v93; +v34[3]=v94; +} +v95=v35[0]; +v96=v35[1]; +v97=v35[2]; +v98=v35[3]; +if(v95!==v36[0]||v96!==v36[1]||v97!==v36[2]||v98!==v36[3]){ +v1.stencilOpSeparate(v95,v96,v97,v98); +v36[0]=v95; +v36[1]=v96; +v36[2]=v97; +v36[3]=v98; +} +v99=v4.scissor_enable; +if(v99!==v5.scissor_enable){ +if(v99){ +v1.enable(3089); +} +else{ +v1.disable(3089); +} +v5.scissor_enable=v99; +} +} +v100=v2.framebufferWidth; +v101=v2.framebufferHeight; +v102=v2.viewportWidth; +v2.viewportWidth=v100; +v103=v2.viewportHeight; +v2.viewportHeight=v101; +v1.viewport(0,0,v100,v101); +v40[0]=0; +v40[1]=0; +v40[2]=v100; +v40[3]=v101; +v104=v2.framebufferWidth; +v105=v2.framebufferHeight; +v1.scissor(0,0,v104,v105); +v38[0]=0; +v38[1]=0; +v38[2]=v104; +v38[3]=v105; +v106=v5.profile; +if(v106){ +v107=performance.now(); +g48.count++; +} +v108=v9.frag; +v109=v9.vert; +v110=v9.program(v109,v108); +v1.useProgram(v110.program); +v11.setVAO(null); +v112=v110.id; +v113=v111[v112]; +if(v113){ +v113.call(this,a0); +} +else{ +v113=v111[v112]=g114(v110); +v113.call(this,a0); +} +v5.dirty=true; +v11.setVAO(null); +v13.next=v51; +v2.framebufferWidth=v52; +v2.framebufferHeight=v53; +v2.viewportWidth=v102; +v2.viewportHeight=v103; +if(v106){ +g48.cpuTime+=performance.now()-v107; +} +} +,"scope":function(a0,a1,a2){ +var v115,v116,v117,v118,v119,v120,v121,v123,v125,v126,v127,v128,v129,v131,v133,v134,v135,v136,v137; +v115=v13.next; +v13.next=g50; +v116=v2.framebufferWidth; +v2.framebufferWidth=g50.width; +v117=v2.framebufferHeight; +v2.framebufferHeight=g50.height; +v118=v2.framebufferWidth; +v119=v2.framebufferHeight; +v120=v2.viewportWidth; +v2.viewportWidth=v118; +v121=v2.viewportHeight; +v2.viewportHeight=v119; +v123=v39[0]; +v39[0]=g122; +v125=v39[1]; +v39[1]=g124; +v126=v39[2]; +v39[2]=v118; +v127=v39[3]; +v39[3]=v119; +v128=v2.framebufferWidth; +v129=v2.framebufferHeight; +v131=v37[0]; +v37[0]=g130; +v133=v37[1]; +v37[1]=g132; +v134=v37[2]; +v37[2]=v128; +v135=v37[3]; +v37[3]=v129; +v136=v5.profile; +if(v136){ +v137=performance.now(); +g48.count++; +} +v5.dirty=true; +a1(v2,a0,a2); +v13.next=v115; +v2.framebufferWidth=v116; +v2.framebufferHeight=v117; +v2.viewportWidth=v120; +v2.viewportHeight=v121; +v39[0]=v123; +v39[1]=v125; +v39[2]=v126; +v39[3]=v127; +v37[0]=v131; +v37[1]=v133; +v37[2]=v134; +v37[3]=v135; +if(v136){ +g48.cpuTime+=performance.now()-v137; +} +v5.dirty=true; +} +,"batch":function(a0,a1){ +var v138,v139,v140,v141,v188,v189,v190,v191,v192,v193,v194,v195,v196,v197,v198,v200,v201; +v138=v14.angle_instanced_arrays; +v139=v13.next; +v13.next=g50; +v140=v2.framebufferWidth; +v2.framebufferWidth=g50.width; +v141=v2.framebufferHeight; +v2.framebufferHeight=g50.height; +if(g50!==v13.cur){ +if(g50){ +v1.bindFramebuffer(36160,g50.framebuffer); +} +else{ +v1.bindFramebuffer(36160,null); +} +v13.cur=g50; +} +if(v5.dirty){ +var v142,v143,v144,v145,v146,v147,v148,v149,v150,v151,v152,v153,v154,v155,v156,v157,v158,v159,v160,v161,v162,v163,v164,v165,v166,v167,v168,v169,v170,v171,v172,v173,v174,v175,v176,v177,v178,v179,v180,v181,v182,v183,v184,v185,v186,v187; +v142=v4.dither; +if(v142!==v5.dither){ +if(v142){ +v1.enable(3024); +} +else{ +v1.disable(3024); +} +v5.dither=v142; +} +v143=v4.blend_enable; +if(v143!==v5.blend_enable){ +if(v143){ +v1.enable(3042); +} +else{ +v1.disable(3042); +} +v5.blend_enable=v143; +} +v144=v17[0]; +v145=v17[1]; +v146=v17[2]; +v147=v17[3]; +if(v144!==v18[0]||v145!==v18[1]||v146!==v18[2]||v147!==v18[3]){ +v1.blendColor(v144,v145,v146,v147); +v18[0]=v144; +v18[1]=v145; +v18[2]=v146; +v18[3]=v147; +} +v148=v19[0]; +v149=v19[1]; +if(v148!==v20[0]||v149!==v20[1]){ +v1.blendEquationSeparate(v148,v149); +v20[0]=v148; +v20[1]=v149; +} +v150=v21[0]; +v151=v21[1]; +v152=v21[2]; +v153=v21[3]; +if(v150!==v22[0]||v151!==v22[1]||v152!==v22[2]||v153!==v22[3]){ +v1.blendFuncSeparate(v150,v151,v152,v153); +v22[0]=v150; +v22[1]=v151; +v22[2]=v152; +v22[3]=v153; +} +v154=v4.depth_enable; +if(v154!==v5.depth_enable){ +if(v154){ +v1.enable(2929); +} +else{ +v1.disable(2929); +} +v5.depth_enable=v154; +} +v155=v4.depth_func; +if(v155!==v5.depth_func){ +v1.depthFunc(v155); +v5.depth_func=v155; +} +v156=v23[0]; +v157=v23[1]; +if(v156!==v24[0]||v157!==v24[1]){ +v1.depthRange(v156,v157); +v24[0]=v156; +v24[1]=v157; +} +v158=v4.depth_mask; +if(v158!==v5.depth_mask){ +v1.depthMask(v158); +v5.depth_mask=v158; +} +v159=v25[0]; +v160=v25[1]; +v161=v25[2]; +v162=v25[3]; +if(v159!==v26[0]||v160!==v26[1]||v161!==v26[2]||v162!==v26[3]){ +v1.colorMask(v159,v160,v161,v162); +v26[0]=v159; +v26[1]=v160; +v26[2]=v161; +v26[3]=v162; +} +v163=v4.cull_enable; +if(v163!==v5.cull_enable){ +if(v163){ +v1.enable(2884); +} +else{ +v1.disable(2884); +} +v5.cull_enable=v163; +} +v164=v4.cull_face; +if(v164!==v5.cull_face){ +v1.cullFace(v164); +v5.cull_face=v164; +} +v165=v4.frontFace; +if(v165!==v5.frontFace){ +v1.frontFace(v165); +v5.frontFace=v165; +} +v166=v4.lineWidth; +if(v166!==v5.lineWidth){ +v1.lineWidth(v166); +v5.lineWidth=v166; +} +v167=v4.polygonOffset_enable; +if(v167!==v5.polygonOffset_enable){ +if(v167){ +v1.enable(32823); +} +else{ +v1.disable(32823); +} +v5.polygonOffset_enable=v167; +} +v168=v27[0]; +v169=v27[1]; +if(v168!==v28[0]||v169!==v28[1]){ +v1.polygonOffset(v168,v169); +v28[0]=v168; +v28[1]=v169; +} +v170=v4.sample_alpha; +if(v170!==v5.sample_alpha){ +if(v170){ +v1.enable(32926); +} +else{ +v1.disable(32926); +} +v5.sample_alpha=v170; +} +v171=v4.sample_enable; +if(v171!==v5.sample_enable){ +if(v171){ +v1.enable(32928); +} +else{ +v1.disable(32928); +} +v5.sample_enable=v171; +} +v172=v29[0]; +v173=v29[1]; +if(v172!==v30[0]||v173!==v30[1]){ +v1.sampleCoverage(v172,v173); +v30[0]=v172; +v30[1]=v173; +} +v174=v4.stencil_enable; +if(v174!==v5.stencil_enable){ +if(v174){ +v1.enable(2960); +} +else{ +v1.disable(2960); +} +v5.stencil_enable=v174; +} +v175=v4.stencil_mask; +if(v175!==v5.stencil_mask){ +v1.stencilMask(v175); +v5.stencil_mask=v175; +} +v176=v31[0]; +v177=v31[1]; +v178=v31[2]; +if(v176!==v32[0]||v177!==v32[1]||v178!==v32[2]){ +v1.stencilFunc(v176,v177,v178); +v32[0]=v176; +v32[1]=v177; +v32[2]=v178; +} +v179=v33[0]; +v180=v33[1]; +v181=v33[2]; +v182=v33[3]; +if(v179!==v34[0]||v180!==v34[1]||v181!==v34[2]||v182!==v34[3]){ +v1.stencilOpSeparate(v179,v180,v181,v182); +v34[0]=v179; +v34[1]=v180; +v34[2]=v181; +v34[3]=v182; +} +v183=v35[0]; +v184=v35[1]; +v185=v35[2]; +v186=v35[3]; +if(v183!==v36[0]||v184!==v36[1]||v185!==v36[2]||v186!==v36[3]){ +v1.stencilOpSeparate(v183,v184,v185,v186); +v36[0]=v183; +v36[1]=v184; +v36[2]=v185; +v36[3]=v186; +} +v187=v4.scissor_enable; +if(v187!==v5.scissor_enable){ +if(v187){ +v1.enable(3089); +} +else{ +v1.disable(3089); +} +v5.scissor_enable=v187; +} +} +v188=v2.framebufferWidth; +v189=v2.framebufferHeight; +v190=v2.viewportWidth; +v2.viewportWidth=v188; +v191=v2.viewportHeight; +v2.viewportHeight=v189; +v1.viewport(0,0,v188,v189); +v40[0]=0; +v40[1]=0; +v40[2]=v188; +v40[3]=v189; +v192=v2.framebufferWidth; +v193=v2.framebufferHeight; +v1.scissor(0,0,v192,v193); +v38[0]=0; +v38[1]=0; +v38[2]=v192; +v38[3]=v193; +v194=v5.profile; +if(v194){ +v195=performance.now(); +g48.count+=a1; +} +v196=v9.frag; +v197=v9.vert; +v198=v9.program(v197,v196); +v1.useProgram(v198.program); +v11.setVAO(null); +v200=v198.id; +v201=v199[v200]; +if(v201){ +v201.call(this,a0,a1); +} +else{ +v201=v199[v200]=g202(v198); +v201.call(this,a0,a1); +} +v5.dirty=true; +v11.setVAO(null); +v13.next=v139; +v2.framebufferWidth=v140; +v2.framebufferHeight=v141; +v2.viewportWidth=v190; +v2.viewportHeight=v191; +if(v194){ +g48.cpuTime+=performance.now()-v195; +} +} +,} + +} \ No newline at end of file diff --git a/src/generated/regl-codegen/ac155a28876770d366446d2217773f063d32b967782ca4b908945212df473aa8 b/src/generated/regl-codegen/ac155a28876770d366446d2217773f063d32b967782ca4b908945212df473aa8 new file mode 100644 index 00000000000..712d8a1a079 --- /dev/null +++ b/src/generated/regl-codegen/ac155a28876770d366446d2217773f063d32b967782ca4b908945212df473aa8 @@ -0,0 +1,1031 @@ +module.exports = function anonymous(g0,g48,g102,g103,g108,g124,g128,g129,g149,g151,g153,g155,g157,g159,g163,g165,g171,g173,g174,g190,g203,g205,g259,g260 +) { +"use strict"; +var v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26,v27,v28,v29,v30,v31,v32,v33,v34,v35,v36,v37,v38,v39,v40,v41,v42,v43,v44,v45,v46,v47,v49; +v1=g0.gl; +v2=g0.context; +v3=g0.strings; +v4=g0.next; +v5=g0.current; +v6=g0.draw; +v7=g0.elements; +v8=g0.buffer; +v9=g0.shader; +v10=g0.attributes; +v11=g0.vao; +v12=g0.uniforms; +v13=g0.framebuffer; +v14=g0.extensions; +v15=g0.timer; +v16=g0.isBufferArgs; +v17=v4.blend_color; +v18=v5.blend_color; +v19=v4.blend_equation; +v20=v5.blend_equation; +v21=v4.blend_func; +v22=v5.blend_func; +v23=v4.depth_range; +v24=v5.depth_range; +v25=v4.colorMask; +v26=v5.colorMask; +v27=v4.polygonOffset_offset; +v28=v5.polygonOffset_offset; +v29=v4.sample_coverage; +v30=v5.sample_coverage; +v31=v4.stencil_func; +v32=v5.stencil_func; +v33=v4.stencil_opFront; +v34=v5.stencil_opFront; +v35=v4.stencil_opBack; +v36=v5.stencil_opBack; +v37=v4.scissor_box; +v38=v5.scissor_box; +v39=v4.viewport; +v40=v5.viewport; +v41={ +"points":0,"point":0,"lines":1,"line":1,"triangles":4,"triangle":4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6} +; +v42={ +"never":512,"less":513,"<":513,"equal":514,"=":514,"==":514,"===":514,"lequal":515,"<=":515,"greater":516,">":516,"notequal":517,"!=":517,"!==":517,"gequal":518,">=":518,"always":519} +; +v43={ +"0":0,"1":1,"zero":0,"one":1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776} +; +v44={ +"add":32774,"subtract":32778,"reverse subtract":32779} +; +v45={ +"0":0,"zero":0,"keep":7680,"replace":7681,"increment":7682,"decrement":7683,"increment wrap":34055,"decrement wrap":34056,"invert":5386} +; +v46={ +"int8":5120,"int16":5122,"int32":5124,"uint8":5121,"uint16":5123,"uint32":5125,"float":5126,"float32":5126} +; +v47={ +"cw":2304,"ccw":2305} +; +v49={ +} +; +v49.x=0; +v49.y=0; +return { +"draw":function(a0){ +var v50,v51,v52,v53,v94,v95,v96,v97,v98,v99,v100,v101,v104,v105,v106,v107,v109,v110,v111,v112,v113,v114,v115,v116,v117,v118,v119,v120,v121,v122,v123,v125,v126,v127,v130,v131,v132,v133; +v50=v14.angle_instanced_arrays; +v51=v13.next; +v13.next=null; +v52=v2.framebufferWidth; +v2.framebufferWidth=v2.drawingBufferWidth; +v53=v2.framebufferHeight; +v2.framebufferHeight=v2.drawingBufferHeight; +if(null!==v13.cur){ +if(null){ +v1.bindFramebuffer(36160,null.framebuffer); +} +else{ +v1.bindFramebuffer(36160,null); +} +v13.cur=null; +} +if(v5.dirty){ +var v54,v55,v56,v57,v58,v59,v60,v61,v62,v63,v64,v65,v66,v67,v68,v69,v70,v71,v72,v73,v74,v75,v76,v77,v78,v79,v80,v81,v82,v83,v84,v85,v86,v87,v88,v89,v90,v91,v92,v93; +v54=v4.dither; +if(v54!==v5.dither){ +if(v54){ +v1.enable(3024); +} +else{ +v1.disable(3024); +} +v5.dither=v54; +} +v55=v17[0]; +v56=v17[1]; +v57=v17[2]; +v58=v17[3]; +if(v55!==v18[0]||v56!==v18[1]||v57!==v18[2]||v58!==v18[3]){ +v1.blendColor(v55,v56,v57,v58); +v18[0]=v55; +v18[1]=v56; +v18[2]=v57; +v18[3]=v58; +} +v59=v19[0]; +v60=v19[1]; +if(v59!==v20[0]||v60!==v20[1]){ +v1.blendEquationSeparate(v59,v60); +v20[0]=v59; +v20[1]=v60; +} +v61=v4.depth_func; +if(v61!==v5.depth_func){ +v1.depthFunc(v61); +v5.depth_func=v61; +} +v62=v23[0]; +v63=v23[1]; +if(v62!==v24[0]||v63!==v24[1]){ +v1.depthRange(v62,v63); +v24[0]=v62; +v24[1]=v63; +} +v64=v4.depth_mask; +if(v64!==v5.depth_mask){ +v1.depthMask(v64); +v5.depth_mask=v64; +} +v65=v25[0]; +v66=v25[1]; +v67=v25[2]; +v68=v25[3]; +if(v65!==v26[0]||v66!==v26[1]||v67!==v26[2]||v68!==v26[3]){ +v1.colorMask(v65,v66,v67,v68); +v26[0]=v65; +v26[1]=v66; +v26[2]=v67; +v26[3]=v68; +} +v69=v4.cull_enable; +if(v69!==v5.cull_enable){ +if(v69){ +v1.enable(2884); +} +else{ +v1.disable(2884); +} +v5.cull_enable=v69; +} +v70=v4.cull_face; +if(v70!==v5.cull_face){ +v1.cullFace(v70); +v5.cull_face=v70; +} +v71=v4.frontFace; +if(v71!==v5.frontFace){ +v1.frontFace(v71); +v5.frontFace=v71; +} +v72=v4.lineWidth; +if(v72!==v5.lineWidth){ +v1.lineWidth(v72); +v5.lineWidth=v72; +} +v73=v4.polygonOffset_enable; +if(v73!==v5.polygonOffset_enable){ +if(v73){ +v1.enable(32823); +} +else{ +v1.disable(32823); +} +v5.polygonOffset_enable=v73; +} +v74=v27[0]; +v75=v27[1]; +if(v74!==v28[0]||v75!==v28[1]){ +v1.polygonOffset(v74,v75); +v28[0]=v74; +v28[1]=v75; +} +v76=v4.sample_alpha; +if(v76!==v5.sample_alpha){ +if(v76){ +v1.enable(32926); +} +else{ +v1.disable(32926); +} +v5.sample_alpha=v76; +} +v77=v4.sample_enable; +if(v77!==v5.sample_enable){ +if(v77){ +v1.enable(32928); +} +else{ +v1.disable(32928); +} +v5.sample_enable=v77; +} +v78=v29[0]; +v79=v29[1]; +if(v78!==v30[0]||v79!==v30[1]){ +v1.sampleCoverage(v78,v79); +v30[0]=v78; +v30[1]=v79; +} +v80=v4.stencil_enable; +if(v80!==v5.stencil_enable){ +if(v80){ +v1.enable(2960); +} +else{ +v1.disable(2960); +} +v5.stencil_enable=v80; +} +v81=v4.stencil_mask; +if(v81!==v5.stencil_mask){ +v1.stencilMask(v81); +v5.stencil_mask=v81; +} +v82=v31[0]; +v83=v31[1]; +v84=v31[2]; +if(v82!==v32[0]||v83!==v32[1]||v84!==v32[2]){ +v1.stencilFunc(v82,v83,v84); +v32[0]=v82; +v32[1]=v83; +v32[2]=v84; +} +v85=v33[0]; +v86=v33[1]; +v87=v33[2]; +v88=v33[3]; +if(v85!==v34[0]||v86!==v34[1]||v87!==v34[2]||v88!==v34[3]){ +v1.stencilOpSeparate(v85,v86,v87,v88); +v34[0]=v85; +v34[1]=v86; +v34[2]=v87; +v34[3]=v88; +} +v89=v35[0]; +v90=v35[1]; +v91=v35[2]; +v92=v35[3]; +if(v89!==v36[0]||v90!==v36[1]||v91!==v36[2]||v92!==v36[3]){ +v1.stencilOpSeparate(v89,v90,v91,v92); +v36[0]=v89; +v36[1]=v90; +v36[2]=v91; +v36[3]=v92; +} +v93=v4.scissor_enable; +if(v93!==v5.scissor_enable){ +if(v93){ +v1.enable(3089); +} +else{ +v1.disable(3089); +} +v5.scissor_enable=v93; +} +} +v94=v2["drawingBufferWidth"]; +v49.width=v94; +v95=v2["drawingBufferHeight"]; +v49.height=v95; +v96=v49.x|0; +v97=v49.y|0; +v98="width" in v49?v49.width|0:(v2.framebufferWidth-v96); +v99="height" in v49?v49.height|0:(v2.framebufferHeight-v97); +v100=v2.viewportWidth; +v2.viewportWidth=v98; +v101=v2.viewportHeight; +v2.viewportHeight=v99; +v1.viewport(v96,v97,v98,v99); +v40[0]=v96; +v40[1]=v97; +v40[2]=v98; +v40[3]=v99; +if(g102){ +v1.enable(3042); +} +else{ +v1.disable(3042); +} +v5.blend_enable=g102; +v1.blendFuncSeparate(1,771,1,771); +v22[0]=1; +v22[1]=771; +v22[2]=1; +v22[3]=771; +if(g103){ +v1.enable(2929); +} +else{ +v1.disable(2929); +} +v5.depth_enable=g103; +v104=v2.framebufferWidth; +v105=v2.framebufferHeight; +v1.scissor(0,0,v104,v105); +v38[0]=0; +v38[1]=0; +v38[2]=v104; +v38[3]=v105; +v106=v5.profile; +if(v106){ +v107=performance.now(); +g48.count++; +} +v1.useProgram(g108.program); +v109=v14.angle_instanced_arrays; +v11.setVAO(null); +v110=a0["positions"]; +v111=false; +v112=1; +v113=0; +v114=0; +v115=0; +v116=0; +v117=null; +v118=0; +v119=false; +v120=5126; +v121=0; +v122=0; +v123=0; +if(v16(v110)){ +v111=true; +v117=v8.createStream(34962,v110); +v120=v117.dtype; +} +else{ +v117=v8.getBuffer(v110); +if(v117){ +v120=v117.dtype; +} +else if("constant" in v110){ +v112=2; +if(typeof v110.constant === "number"){ +v113=v110.constant; +v114=v115=v116=0; +} +else{ +v113=v110.constant.length>0?v110.constant[0]:0; +v114=v110.constant.length>1?v110.constant[1]:0; +v115=v110.constant.length>2?v110.constant[2]:0; +v116=v110.constant.length>3?v110.constant[3]:0; +} +} +else{ +if(v16(v110.buffer)){ +v117=v8.createStream(34962,v110.buffer); +} +else{ +v117=v8.getBuffer(v110.buffer); +} +v120="type" in v110?v46[v110.type]:v117.dtype; +v119=!!v110.normalized; +v118=v110.size|0; +v121=v110.offset|0; +v122=v110.stride|0; +v123=v110.divisor|0; +} +} +v125=g124.location; +v126=v10[v125]; +if(v112===1){ +if(!v126.buffer){ +v1.enableVertexAttribArray(v125); +} +v127=v118||2; +if(v126.type!==v120||v126.size!==v127||v126.buffer!==v117||v126.normalized!==v119||v126.offset!==v121||v126.stride!==v122){ +v1.bindBuffer(34962,v117.buffer); +v1.vertexAttribPointer(v125,v127,v120,v119,v122,v121); +v126.type=v120; +v126.size=v127; +v126.buffer=v117; +v126.normalized=v119; +v126.offset=v121; +v126.stride=v122; +} +if(v126.divisor!==v123){ +v109.vertexAttribDivisorANGLE(v125,v123); +v126.divisor=v123; +} +} +else{ +if(v126.buffer){ +v1.disableVertexAttribArray(v125); +v126.buffer=null; +} +if(v126.x!==v113||v126.y!==v114||v126.z!==v115||v126.w!==v116){ +v1.vertexAttrib4f(v125,v113,v114,v115,v116); +v126.x=v113; +v126.y=v114; +v126.z=v115; +v126.w=v116; +} +} +v1.uniform1i(g128.location,g129.bind()); +v130=v6.elements; +if(v130){ +v1.bindBuffer(34963,v130.buffer.buffer); +} +else if(v11.currentVAO){ +v130=v7.getElements(v11.currentVAO.elements); +if(v130)v1.bindBuffer(34963,v130.buffer.buffer); +} +v131=v6.primitive; +v132=v6.offset; +v133=v6.instances; +if(v133>0){ +if(v130){ +v109.drawElementsInstancedANGLE(v131,3,v130.type,v132<<((v130.type-5121)>>1),v133); +} +else{ +v109.drawArraysInstancedANGLE(v131,v132,3,v133); +} +} +else if(v133<0){ +if(v130){ +v1.drawElements(v131,3,v130.type,v132<<((v130.type-5121)>>1)); +} +else{ +v1.drawArrays(v131,v132,3); +} +} +v5.dirty=true; +v11.setVAO(null); +v13.next=v51; +v2.framebufferWidth=v52; +v2.framebufferHeight=v53; +v2.viewportWidth=v100; +v2.viewportHeight=v101; +if(v106){ +g48.cpuTime+=performance.now()-v107; +} +if(v111){ +v8.destroyStream(v117); +} +g129.unbind(); +} +,"scope":function(a0,a1,a2){ +var v134,v135,v136,v137,v138,v139,v140,v141,v142,v143,v144,v145,v146,v147,v148,v150,v152,v154,v156,v158,v160,v161,v162,v164,v166,v167,v168,v169,v170,v172,v175,v176,v177,v178,v179,v180,v181,v182,v183,v184,v185,v186,v187,v188,v189,v191,v192,v193,v194,v195,v196,v197,v198,v199,v200,v201,v202,v204,v206; +v134=v13.next; +v13.next=null; +v135=v2.framebufferWidth; +v2.framebufferWidth=v2.drawingBufferWidth; +v136=v2.framebufferHeight; +v2.framebufferHeight=v2.drawingBufferHeight; +v137=v2["drawingBufferWidth"]; +v49.width=v137; +v138=v2["drawingBufferHeight"]; +v49.height=v138; +v139=v49.x|0; +v140=v49.y|0; +v141="width" in v49?v49.width|0:(v2.framebufferWidth-v139); +v142="height" in v49?v49.height|0:(v2.framebufferHeight-v140); +v143=v2.viewportWidth; +v2.viewportWidth=v141; +v144=v2.viewportHeight; +v2.viewportHeight=v142; +v145=v39[0]; +v39[0]=v139; +v146=v39[1]; +v39[1]=v140; +v147=v39[2]; +v39[2]=v141; +v148=v39[3]; +v39[3]=v142; +v150=v4.blend_enable; +v4.blend_enable=g149; +v152=v21[0]; +v21[0]=g151; +v154=v21[1]; +v21[1]=g153; +v156=v21[2]; +v21[2]=g155; +v158=v21[3]; +v21[3]=g157; +v160=v4.depth_enable; +v4.depth_enable=g159; +v161=v2.framebufferWidth; +v162=v2.framebufferHeight; +v164=v37[0]; +v37[0]=g163; +v166=v37[1]; +v37[1]=g165; +v167=v37[2]; +v37[2]=v161; +v168=v37[3]; +v37[3]=v162; +v169=v5.profile; +if(v169){ +v170=performance.now(); +g48.count++; +} +v172=v6.count; +v6.count=g171; +v175=v12[g174]; +v12[g174]=g173; +v176=a0["positions"]; +v177=false; +v178=1; +v179=0; +v180=0; +v181=0; +v182=0; +v183=null; +v184=0; +v185=false; +v186=5126; +v187=0; +v188=0; +v189=0; +if(v16(v176)){ +v177=true; +v183=v8.createStream(34962,v176); +v186=v183.dtype; +} +else{ +v183=v8.getBuffer(v176); +if(v183){ +v186=v183.dtype; +} +else if("constant" in v176){ +v178=2; +if(typeof v176.constant === "number"){ +v179=v176.constant; +v180=v181=v182=0; +} +else{ +v179=v176.constant.length>0?v176.constant[0]:0; +v180=v176.constant.length>1?v176.constant[1]:0; +v181=v176.constant.length>2?v176.constant[2]:0; +v182=v176.constant.length>3?v176.constant[3]:0; +} +} +else{ +if(v16(v176.buffer)){ +v183=v8.createStream(34962,v176.buffer); +} +else{ +v183=v8.getBuffer(v176.buffer); +} +v186="type" in v176?v46[v176.type]:v183.dtype; +v185=!!v176.normalized; +v184=v176.size|0; +v187=v176.offset|0; +v188=v176.stride|0; +v189=v176.divisor|0; +} +} +v191=g190.state; +g190.state=v178; +v192=g190.x; +g190.x=v179; +v193=g190.y; +g190.y=v180; +v194=g190.z; +g190.z=v181; +v195=g190.w; +g190.w=v182; +v196=g190.buffer; +g190.buffer=v183; +v197=g190.size; +g190.size=v184; +v198=g190.normalized; +g190.normalized=v185; +v199=g190.type; +g190.type=v186; +v200=g190.offset; +g190.offset=v187; +v201=g190.stride; +g190.stride=v188; +v202=g190.divisor; +g190.divisor=v189; +v204=v9.vert; +v9.vert=g203; +v206=v9.frag; +v9.frag=g205; +v5.dirty=true; +a1(v2,a0,a2); +v13.next=v134; +v2.framebufferWidth=v135; +v2.framebufferHeight=v136; +v2.viewportWidth=v143; +v2.viewportHeight=v144; +v39[0]=v145; +v39[1]=v146; +v39[2]=v147; +v39[3]=v148; +v4.blend_enable=v150; +v21[0]=v152; +v21[1]=v154; +v21[2]=v156; +v21[3]=v158; +v4.depth_enable=v160; +v37[0]=v164; +v37[1]=v166; +v37[2]=v167; +v37[3]=v168; +if(v169){ +g48.cpuTime+=performance.now()-v170; +} +v6.count=v172; +v12[g174]=v175; +if(v177){ +v8.destroyStream(v183); +} +g190.state=v191; +g190.x=v192; +g190.y=v193; +g190.z=v194; +g190.w=v195; +g190.buffer=v196; +g190.size=v197; +g190.normalized=v198; +g190.type=v199; +g190.offset=v200; +g190.stride=v201; +g190.divisor=v202; +v9.vert=v204; +v9.frag=v206; +v5.dirty=true; +} +,"batch":function(a0,a1){ +var v207,v208,v209,v210,v251,v252,v253,v254,v255,v256,v257,v258,v261,v262,v263,v264,v265,v266,v267; +v207=v14.angle_instanced_arrays; +v208=v13.next; +v13.next=null; +v209=v2.framebufferWidth; +v2.framebufferWidth=v2.drawingBufferWidth; +v210=v2.framebufferHeight; +v2.framebufferHeight=v2.drawingBufferHeight; +if(null!==v13.cur){ +if(null){ +v1.bindFramebuffer(36160,null.framebuffer); +} +else{ +v1.bindFramebuffer(36160,null); +} +v13.cur=null; +} +if(v5.dirty){ +var v211,v212,v213,v214,v215,v216,v217,v218,v219,v220,v221,v222,v223,v224,v225,v226,v227,v228,v229,v230,v231,v232,v233,v234,v235,v236,v237,v238,v239,v240,v241,v242,v243,v244,v245,v246,v247,v248,v249,v250; +v211=v4.dither; +if(v211!==v5.dither){ +if(v211){ +v1.enable(3024); +} +else{ +v1.disable(3024); +} +v5.dither=v211; +} +v212=v17[0]; +v213=v17[1]; +v214=v17[2]; +v215=v17[3]; +if(v212!==v18[0]||v213!==v18[1]||v214!==v18[2]||v215!==v18[3]){ +v1.blendColor(v212,v213,v214,v215); +v18[0]=v212; +v18[1]=v213; +v18[2]=v214; +v18[3]=v215; +} +v216=v19[0]; +v217=v19[1]; +if(v216!==v20[0]||v217!==v20[1]){ +v1.blendEquationSeparate(v216,v217); +v20[0]=v216; +v20[1]=v217; +} +v218=v4.depth_func; +if(v218!==v5.depth_func){ +v1.depthFunc(v218); +v5.depth_func=v218; +} +v219=v23[0]; +v220=v23[1]; +if(v219!==v24[0]||v220!==v24[1]){ +v1.depthRange(v219,v220); +v24[0]=v219; +v24[1]=v220; +} +v221=v4.depth_mask; +if(v221!==v5.depth_mask){ +v1.depthMask(v221); +v5.depth_mask=v221; +} +v222=v25[0]; +v223=v25[1]; +v224=v25[2]; +v225=v25[3]; +if(v222!==v26[0]||v223!==v26[1]||v224!==v26[2]||v225!==v26[3]){ +v1.colorMask(v222,v223,v224,v225); +v26[0]=v222; +v26[1]=v223; +v26[2]=v224; +v26[3]=v225; +} +v226=v4.cull_enable; +if(v226!==v5.cull_enable){ +if(v226){ +v1.enable(2884); +} +else{ +v1.disable(2884); +} +v5.cull_enable=v226; +} +v227=v4.cull_face; +if(v227!==v5.cull_face){ +v1.cullFace(v227); +v5.cull_face=v227; +} +v228=v4.frontFace; +if(v228!==v5.frontFace){ +v1.frontFace(v228); +v5.frontFace=v228; +} +v229=v4.lineWidth; +if(v229!==v5.lineWidth){ +v1.lineWidth(v229); +v5.lineWidth=v229; +} +v230=v4.polygonOffset_enable; +if(v230!==v5.polygonOffset_enable){ +if(v230){ +v1.enable(32823); +} +else{ +v1.disable(32823); +} +v5.polygonOffset_enable=v230; +} +v231=v27[0]; +v232=v27[1]; +if(v231!==v28[0]||v232!==v28[1]){ +v1.polygonOffset(v231,v232); +v28[0]=v231; +v28[1]=v232; +} +v233=v4.sample_alpha; +if(v233!==v5.sample_alpha){ +if(v233){ +v1.enable(32926); +} +else{ +v1.disable(32926); +} +v5.sample_alpha=v233; +} +v234=v4.sample_enable; +if(v234!==v5.sample_enable){ +if(v234){ +v1.enable(32928); +} +else{ +v1.disable(32928); +} +v5.sample_enable=v234; +} +v235=v29[0]; +v236=v29[1]; +if(v235!==v30[0]||v236!==v30[1]){ +v1.sampleCoverage(v235,v236); +v30[0]=v235; +v30[1]=v236; +} +v237=v4.stencil_enable; +if(v237!==v5.stencil_enable){ +if(v237){ +v1.enable(2960); +} +else{ +v1.disable(2960); +} +v5.stencil_enable=v237; +} +v238=v4.stencil_mask; +if(v238!==v5.stencil_mask){ +v1.stencilMask(v238); +v5.stencil_mask=v238; +} +v239=v31[0]; +v240=v31[1]; +v241=v31[2]; +if(v239!==v32[0]||v240!==v32[1]||v241!==v32[2]){ +v1.stencilFunc(v239,v240,v241); +v32[0]=v239; +v32[1]=v240; +v32[2]=v241; +} +v242=v33[0]; +v243=v33[1]; +v244=v33[2]; +v245=v33[3]; +if(v242!==v34[0]||v243!==v34[1]||v244!==v34[2]||v245!==v34[3]){ +v1.stencilOpSeparate(v242,v243,v244,v245); +v34[0]=v242; +v34[1]=v243; +v34[2]=v244; +v34[3]=v245; +} +v246=v35[0]; +v247=v35[1]; +v248=v35[2]; +v249=v35[3]; +if(v246!==v36[0]||v247!==v36[1]||v248!==v36[2]||v249!==v36[3]){ +v1.stencilOpSeparate(v246,v247,v248,v249); +v36[0]=v246; +v36[1]=v247; +v36[2]=v248; +v36[3]=v249; +} +v250=v4.scissor_enable; +if(v250!==v5.scissor_enable){ +if(v250){ +v1.enable(3089); +} +else{ +v1.disable(3089); +} +v5.scissor_enable=v250; +} +} +v251=v2["drawingBufferWidth"]; +v49.width=v251; +v252=v2["drawingBufferHeight"]; +v49.height=v252; +v253=v49.x|0; +v254=v49.y|0; +v255="width" in v49?v49.width|0:(v2.framebufferWidth-v253); +v256="height" in v49?v49.height|0:(v2.framebufferHeight-v254); +v257=v2.viewportWidth; +v2.viewportWidth=v255; +v258=v2.viewportHeight; +v2.viewportHeight=v256; +v1.viewport(v253,v254,v255,v256); +v40[0]=v253; +v40[1]=v254; +v40[2]=v255; +v40[3]=v256; +if(g259){ +v1.enable(3042); +} +else{ +v1.disable(3042); +} +v5.blend_enable=g259; +v1.blendFuncSeparate(1,771,1,771); +v22[0]=1; +v22[1]=771; +v22[2]=1; +v22[3]=771; +if(g260){ +v1.enable(2929); +} +else{ +v1.disable(2929); +} +v5.depth_enable=g260; +v261=v2.framebufferWidth; +v262=v2.framebufferHeight; +v1.scissor(0,0,v261,v262); +v38[0]=0; +v38[1]=0; +v38[2]=v261; +v38[3]=v262; +v263=v5.profile; +if(v263){ +v264=performance.now(); +g48.count+=a1; +} +v1.useProgram(g108.program); +v265=v14.angle_instanced_arrays; +var v285,v286,v287,v288; +v11.setVAO(null); +v1.uniform1i(g128.location,g129.bind()); +v285=v6.elements; +if(v285){ +v1.bindBuffer(34963,v285.buffer.buffer); +} +else if(v11.currentVAO){ +v285=v7.getElements(v11.currentVAO.elements); +if(v285)v1.bindBuffer(34963,v285.buffer.buffer); +} +v286=v6.primitive; +v287=v6.offset; +v288=v6.instances; +for(v266=0; +v2660?v268.constant[0]:0; +v272=v268.constant.length>1?v268.constant[1]:0; +v273=v268.constant.length>2?v268.constant[2]:0; +v274=v268.constant.length>3?v268.constant[3]:0; +} +} +else{ +if(v16(v268.buffer)){ +v275=v8.createStream(34962,v268.buffer); +} +else{ +v275=v8.getBuffer(v268.buffer); +} +v278="type" in v268?v46[v268.type]:v275.dtype; +v277=!!v268.normalized; +v276=v268.size|0; +v279=v268.offset|0; +v280=v268.stride|0; +v281=v268.divisor|0; +} +} +v282=g124.location; +v283=v10[v282]; +if(v270===1){ +if(!v283.buffer){ +v1.enableVertexAttribArray(v282); +} +v284=v276||2; +if(v283.type!==v278||v283.size!==v284||v283.buffer!==v275||v283.normalized!==v277||v283.offset!==v279||v283.stride!==v280){ +v1.bindBuffer(34962,v275.buffer); +v1.vertexAttribPointer(v282,v284,v278,v277,v280,v279); +v283.type=v278; +v283.size=v284; +v283.buffer=v275; +v283.normalized=v277; +v283.offset=v279; +v283.stride=v280; +} +if(v283.divisor!==v281){ +v265.vertexAttribDivisorANGLE(v282,v281); +v283.divisor=v281; +} +} +else{ +if(v283.buffer){ +v1.disableVertexAttribArray(v282); +v283.buffer=null; +} +if(v283.x!==v271||v283.y!==v272||v283.z!==v273||v283.w!==v274){ +v1.vertexAttrib4f(v282,v271,v272,v273,v274); +v283.x=v271; +v283.y=v272; +v283.z=v273; +v283.w=v274; +} +} +if(v288>0){ +if(v285){ +v265.drawElementsInstancedANGLE(v286,3,v285.type,v287<<((v285.type-5121)>>1),v288); +} +else{ +v265.drawArraysInstancedANGLE(v286,v287,3,v288); +} +} +else if(v288<0){ +if(v285){ +v1.drawElements(v286,3,v285.type,v287<<((v285.type-5121)>>1)); +} +else{ +v1.drawArrays(v286,v287,3); +} +} +if(v269){ +v8.destroyStream(v275); +} +} +g129.unbind(); +v5.dirty=true; +v11.setVAO(null); +v13.next=v208; +v2.framebufferWidth=v209; +v2.framebufferHeight=v210; +v2.viewportWidth=v257; +v2.viewportHeight=v258; +if(v263){ +g48.cpuTime+=performance.now()-v264; +} +} +,} + +} \ No newline at end of file diff --git a/src/plot_api/subroutines.js b/src/plot_api/subroutines.js index 666f3e7b6a5..3b45df635bd 100644 --- a/src/plot_api/subroutines.js +++ b/src/plot_api/subroutines.js @@ -772,6 +772,7 @@ exports.redrawReglTraces = function(gd) { var fullData = gd._fullData; var cartesianIds = []; var polarIds = []; + var ternaryIds = []; var i, sp; if(fullLayout._hasOnlyLargeSploms) { @@ -792,6 +793,8 @@ exports.redrawReglTraces = function(gd) { Lib.pushUnique(cartesianIds, trace.xaxis + trace.yaxis); } else if(trace.type === 'scatterpolargl') { Lib.pushUnique(polarIds, trace.subplot); + } else if(trace.type === 'scatterternarygl') { + Lib.pushUnique(ternaryIds, trace.subplot); } } } @@ -805,6 +808,11 @@ exports.redrawReglTraces = function(gd) { sp = fullLayout[polarIds[i]]._subplot; if(sp._scene) sp._scene.draw(); } + + for(i = 0; i < ternaryIds.length; i++) { + sp = fullLayout[ternaryIds[i]]._subplot; + if(sp._scene) sp._scene.draw(); + } } }; diff --git a/src/plots/ternary/index.js b/src/plots/ternary/index.js index 12147231744..1845f67b049 100644 --- a/src/plots/ternary/index.js +++ b/src/plots/ternary/index.js @@ -2,6 +2,7 @@ var Ternary = require('./ternary'); +var Registry = require('../../registry'); var getSubplotCalcData = require('../../plots/get_data').getSubplotCalcData; var counterRegex = require('../../lib').counterRegex; var TERNARY = 'ternary'; @@ -64,9 +65,25 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) for(var i = 0; i < oldTernaryKeys.length; i++) { var oldTernaryKey = oldTernaryKeys[i]; var oldTernary = oldFullLayout[oldTernaryKey]._subplot; + var newTernary = newFullLayout[oldTernaryKey]; + + if(oldTernary && oldTernary._scene) { + var hasRegl = newFullData.some(function(trace) { + return ( + trace.visible === true && + trace.subplot === oldTernaryKey && + Registry.traceIs(trace, 'regl') + ); + }); + + if(!newTernary || !hasRegl) { + oldTernary._scene.destroy(); + } + } - if(!newFullLayout[oldTernaryKey] && !!oldTernary) { + if(!newTernary && oldTernary) { oldTernary.plotContainer.remove(); + if(oldTernary.topPlotContainer) oldTernary.topPlotContainer.remove(); oldTernary.clipDef.remove(); oldTernary.clipDefRelative.remove(); oldTernary.layers['a-title'].remove(); @@ -76,6 +93,8 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) } }; +exports.toSVG = require('../cartesian').toSVG; + exports.updateFx = function(gd) { var fullLayout = gd._fullLayout; fullLayout._ternarylayer diff --git a/src/plots/ternary/ternary.js b/src/plots/ternary/ternary.js index 836bee45a8f..1ced995ca4a 100644 --- a/src/plots/ternary/ternary.js +++ b/src/plots/ternary/ternary.js @@ -4,6 +4,8 @@ var d3 = require('@plotly/d3'); var Registry = require('../../registry'); var Lib = require('../../lib'); +var clearGlCanvases = require('../../lib/clear_gl_canvases'); +var redrawReglTraces = require('../../plot_api/subroutines').redrawReglTraces; var strTranslate = Lib.strTranslate; var _ = Lib._; var Color = require('../../components/color'); @@ -56,12 +58,17 @@ proto.plot = function(ternaryCalcData, fullLayout) { var graphSize = fullLayout._size; _this._hasClipOnAxisFalse = false; + _this._hasRegl = false; + for(var i = 0; i < ternaryCalcData.length; i++) { var trace = ternaryCalcData[i][0].trace; if(trace.cliponaxis === false) { _this._hasClipOnAxisFalse = true; - break; + } + + if(trace.visible === true && Registry.traceIs(trace, 'regl')) { + _this._hasRegl = true; } } @@ -107,6 +114,13 @@ proto.updateLayers = function(ternaryLayout) { var _this = this; var layers = _this.layers; + // restore promoted axes before reordering the ternary SVG layers + if(_this.topPlotContainer) { + _this.topPlotContainer.selectAll('g.toplevel').each(function() { + _this.plotContainer.node().appendChild(this); + }); + } + // inside that container, we have one container for the data, and // one each for the three axes around it. @@ -166,6 +180,25 @@ proto.updateLayers = function(ternaryLayout) { }); toplevel.order(); + + // move 'above traces' axes to the top SVG so they remain above regl traces + if(_this._hasRegl) { + if(!_this.topPlotContainer) { + _this.topPlotContainer = _this.graphDiv._fullLayout._toppaper + .insert('g', '.indicatorlayer') + .classed(_this.id + '-axis-above', true) + .style('pointer-events', 'none'); + } + + var topNode = _this.topPlotContainer.node(); + + ['a', 'b', 'c'].forEach(function(letter) { + if(ternaryLayout[letter + 'axis'].layer === 'above traces') { + topNode.appendChild(layers[letter + 'axis'].node()); + topNode.appendChild(layers[letter + 'line'].node()); + } + }); + } }; var whRatio = Math.sqrt(4 / 3); @@ -738,6 +771,20 @@ proto.initInteractions = function() { _this.drawAxes(false); + if (_this._scene) { + // update the projected cartesian range (x = c - b, y = a) and redraw regl traces while panning + _this._scene.update({ + range: [ + mins.a + 2 * mins.c - _this.sum, + mins.a, + _this.sum - mins.a - 2 * mins.b, + _this.sum - mins.b - mins.c + ] + }); + clearGlCanvases(gd); + redrawReglTraces(gd); + } + if(_this._hasClipOnAxisFalse) { _this.plotContainer .select('.scatterlayer').selectAll('.trace') diff --git a/src/traces/scatterternary/hover.js b/src/traces/scatterternary/hover.js index 404da45598b..30d3e63824e 100644 --- a/src/traces/scatterternary/hover.js +++ b/src/traces/scatterternary/hover.js @@ -6,11 +6,15 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) { var scatterPointData = scatterHover(pointData, xval, yval, hovermode); if(!scatterPointData || scatterPointData[0].index === false) return; + return module.exports.formatPoint(scatterPointData, pointData); +}; + +module.exports.formatPoint = function(scatterPointData, pointData) { var newPointData = scatterPointData[0]; // if hovering on a fill, we don't show any point data so the label is // unchanged from what scatter gives us - except that it needs to - // be constrained to the trianglular plot area, not just the rectangular + // be constrained to the triangular plot area, not just the rectangular // area defined by the synthetic x and y axes // TODO: in some cases the vertical middle of the shape is not within // the triangular viewport at all, so the label can become disconnected diff --git a/src/traces/scatterternarygl/attributes.ts b/src/traces/scatterternarygl/attributes.ts new file mode 100644 index 00000000000..883e2485e6f --- /dev/null +++ b/src/traces/scatterternarygl/attributes.ts @@ -0,0 +1,39 @@ +import type { AttributeMap } from '../../types/lib/attributes'; + +// There is type warning when using import (ESM), keep using require for now +const ternaryAttrs = require('../scatterternary/attributes'); +const scatterGlAttrs = require('../scattergl/attributes'); + +// No cliponaxis and hoveron +const attributes = { + a: ternaryAttrs.a, + b: ternaryAttrs.b, + c: ternaryAttrs.c, + sum: ternaryAttrs.sum, + mode: ternaryAttrs.mode, + text: ternaryAttrs.text, + texttemplate: ternaryAttrs.texttemplate, + texttemplatefallback: ternaryAttrs.texttemplatefallback, + hoverinfo: ternaryAttrs.hoverinfo, + hovertext: ternaryAttrs.hovertext, + hovertemplate: ternaryAttrs.hovertemplate, + hovertemplatefallback: ternaryAttrs.hovertemplatefallback, + line: { + color: scatterGlAttrs.line.color, + width: scatterGlAttrs.line.width, + dash: scatterGlAttrs.line.dash, + // no backoff and smoothing + // and only 'linear' value for shape, so no need to expose + editType: 'calc' + }, + connectgaps: scatterGlAttrs.connectgaps, + fill: ternaryAttrs.fill, + fillcolor: scatterGlAttrs.fillcolor, + marker: scatterGlAttrs.marker, + textfont: scatterGlAttrs.textfont, + textposition: scatterGlAttrs.textposition, + selected: scatterGlAttrs.selected, + unselected: scatterGlAttrs.unselected +} as const satisfies AttributeMap; + +export default attributes; diff --git a/src/traces/scatterternarygl/base_index.js b/src/traces/scatterternarygl/base_index.js new file mode 100644 index 00000000000..5e1b9ae4066 --- /dev/null +++ b/src/traces/scatterternarygl/base_index.js @@ -0,0 +1,24 @@ +'use strict'; + +module.exports = { + moduleType: 'trace', + name: 'scatterternarygl', + basePlotModule: require('../../plots/ternary'), + categories: ['gl', 'regl', 'ternary', 'symbols', 'showLegend', 'scatter-like'], + attributes: require('./attributes').default, + supplyDefaults: require('./defaults'), + calc: require('./calc'), + colorbar: require('../scatter/marker_colorbar'), + formatLabels: require('./format_labels'), + hoverPoints: require('./hover'), + selectPoints: require('../scattergl/select'), + eventData: require('./event_data'), + meta: { + hrName: 'scatter_ternary_gl', + description: [ + 'Provides similar functionality to the *scatter* type but on a ternary phase diagram', + 'using the WebGL plotting engine.', + 'The data is provided by at least two arrays out of `a`, `b`, `c` triplets.' + ].join(' ') + } +}; diff --git a/src/traces/scatterternarygl/calc.js b/src/traces/scatterternarygl/calc.js new file mode 100644 index 00000000000..39321d39fae --- /dev/null +++ b/src/traces/scatterternarygl/calc.js @@ -0,0 +1,76 @@ +'use strict'; + +const isNumeric = require('fast-isnumeric'); +const cluster = require('@plotly/point-cluster'); + +const calcColorscale = require('../scatter/colorscale_calc'); +const TOO_MANY_POINTS = require("../scattergl/constants"); + +module.exports = function calc(gd, trace) { + const displaySum = gd._fullLayout[trace.subplot].sum; + const normSum = trace.sum || displaySum; + + const len = trace._length; + const aIn = trace.a; + const bIn = trace.b; + const cIn = trace.c; + const a = (trace._a = new Float64Array(len)); + const b = (trace._b = new Float64Array(len)); + const c = (trace._c = new Float64Array(len)); + const x = new Float64Array(len); + const positions = new Array(len * 2); + const hasTooManyPoints = len >= TOO_MANY_POINTS; + const ids = hasTooManyPoints ? null : new Array(len); + + for (let i = 0; i < len; i++) { + // infer the missing component from the other two + let ai = aIn ? aIn[i] : normSum - bIn[i] - cIn[i]; + let bi = bIn ? bIn[i] : normSum - aIn[i] - cIn[i]; + let ci = cIn ? cIn[i] : normSum - aIn[i] - bIn[i]; + + if (isNumeric(ai) && isNumeric(bi) && isNumeric(ci)) { + ai = +ai; + bi = +bi; + ci = +ci; + + const total = ai + bi + ci; + + if (Number.isFinite(total) && total !== 0) { + const norm = displaySum / total; + ai *= norm; + bi *= norm; + ci *= norm; + } else { + ai = bi = ci = NaN; + } + } else { + ai = bi = ci = NaN; + } + + if (!Number.isFinite(ai) || !Number.isFinite(bi) || !Number.isFinite(ci)) { + ai = bi = ci = NaN; + } + + a[i] = ai; + b[i] = bi; + c[i] = ci; + x[i] = positions[2 * i] = ci - bi; + positions[2 * i + 1] = ai; + + if(ids) ids[i] = i; + } + + calcColorscale(gd, trace); + + // adopt the same approach of scattergl: build the tree only when len >= TOO_MANY_POINTS + // caveat: see https://github.com/plotly/plotly.js/pull/8052 + const stash = { a, b, c, x, y: a, rawx: x, rawy: a, positions }; + + if(hasTooManyPoints) { + stash.tree = cluster(positions); + } else { + stash.ids = ids; + } + + return [{ x: false, y: false, t: stash, trace }]; +}; diff --git a/src/traces/scatterternarygl/defaults.js b/src/traces/scatterternarygl/defaults.js new file mode 100644 index 00000000000..de6217d1f18 --- /dev/null +++ b/src/traces/scatterternarygl/defaults.js @@ -0,0 +1,89 @@ +'use strict'; + +const Lib = require('../../lib'); + +const subTypes = require('../scatter/subtypes'); +const handleMarkerDefaults = require('../scatter/marker_defaults'); +const handleLineDefaults = require('../scatter/line_defaults'); +const handleTextDefaults = require('../scatter/text_defaults'); +const handleFillColorDefaults = require('../scatter/fillcolor_defaults'); +const helpers = require('../scattergl/helpers'); +const PTS_LINESONLY = require('../scatter/constants').PTS_LINESONLY; + + +const attributes = require('./attributes').default; + +module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) { + function coerce(attr, dflt) { + return Lib.coerce(traceIn, traceOut, attributes, attr, dflt); + } + + var isOpen = traceIn.marker ? helpers.isOpenSymbol(traceIn.marker.symbol) : false; + const isBubble = subTypes.isBubble(traceIn); + + const a = coerce('a'); + const b = coerce('b'); + const c = coerce('c'); + + const componentCount = Number(!!a) + Number(!!b) + Number(!!c); + + // allow any one array to be missing + const len = componentCount < 2 + ? 0 + : Math.min( + a?.length ?? Infinity, + b?.length ?? Infinity, + c?.length ?? Infinity + ); + + if (!len) { + traceOut.visible = false; + return; + } + + traceOut._length = len; + + coerce('sum'); + + coerce('text'); + coerce('hovertext'); + coerce('hovertemplate'); + coerce('hovertemplatefallback'); + + coerce('mode', len < PTS_LINESONLY ? 'lines+markers' : 'lines'); + + if (subTypes.hasMarkers(traceOut)) { + handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, { + noAngleRef: true, + noLineDash: true, + noStandOff: true + }); + coerce('marker.line.width', isOpen || isBubble ? 1 : 0); + } + + if (subTypes.hasLines(traceOut)) { + handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce); + coerce('connectgaps'); + } + + if (subTypes.hasText(traceOut)) { + coerce('texttemplate'); + coerce('texttemplatefallback'); + handleTextDefaults(traceIn, traceOut, layout, coerce, { + noFontShadow: true, + noFontLineposition: true, + noFontTextcase: true + }); + } + + // no cliponaxis + + coerce('fill'); + if (traceOut.fill !== 'none') { + handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce); + } + + // no hoveron + + Lib.coerceSelectionMarkerOpacity(traceOut, coerce); +}; diff --git a/src/traces/scatterternarygl/event_data.js b/src/traces/scatterternarygl/event_data.js new file mode 100644 index 00000000000..379ac5dc53c --- /dev/null +++ b/src/traces/scatterternarygl/event_data.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = function (out, pt, trace, cd, pointNumber) { + if (pt.xa) out.xaxis = pt.xa; + if (pt.ya) out.yaxis = pt.ya; + + // normalized coordinates are stored in trace._a, _b and _c in ../calc.js + out.a = trace._a[pointNumber]; + out.b = trace._b[pointNumber]; + out.c = trace._c[pointNumber]; + + // no fill-hover because scattergl (scatterternarygl) does not currently support hoveron + + return out; +}; diff --git a/src/traces/scatterternarygl/format_labels.js b/src/traces/scatterternarygl/format_labels.js new file mode 100644 index 00000000000..7a1a7482b5d --- /dev/null +++ b/src/traces/scatterternarygl/format_labels.js @@ -0,0 +1,13 @@ +'use strict'; + +const scatterTernaryFormatLabels = require('../scatterternary/format_labels'); + +module.exports = function (cdi, trace, fullLayout) { + const i = cdi.i; + + if (!('a' in cdi)) cdi.a = trace._a[i]; + if (!('b' in cdi)) cdi.b = trace._b[i]; + if (!('c' in cdi)) cdi.c = trace._c[i]; + + return scatterTernaryFormatLabels(cdi, trace, fullLayout); +}; diff --git a/src/traces/scatterternarygl/hover.js b/src/traces/scatterternarygl/hover.js new file mode 100644 index 00000000000..a4481ca855f --- /dev/null +++ b/src/traces/scatterternarygl/hover.js @@ -0,0 +1,26 @@ +'use strict'; + +const hover = require('../scattergl/hover'); +const ternaryHover = require('../scatterternary/hover'); + +module.exports = function (pointData, xval, yval, hovermode) { + const cd = pointData.cd; + const stash = cd[0].t; + + const scatterPointData = hover.hoverPoints(pointData, xval, yval, hovermode); + + // scattergl may return pointData without an index when no point is found + if (!scatterPointData || scatterPointData[0].index === undefined || scatterPointData[0].index === false) return; + + const point = scatterPointData[0]; + const i = point.index; + const cdi = point.cd[i]; + + cdi.a = stash.a[i]; + cdi.b = stash.b[i]; + cdi.c = stash.c[i]; + + ternaryHover.formatPoint(scatterPointData, pointData); + + return scatterPointData; +}; diff --git a/src/traces/scatterternarygl/index.js b/src/traces/scatterternarygl/index.js new file mode 100644 index 00000000000..fcabd3a5437 --- /dev/null +++ b/src/traces/scatterternarygl/index.js @@ -0,0 +1,7 @@ +'use strict'; + +var index = require('./base_index'); + +index.plot = require('./plot'); + +module.exports = index; diff --git a/src/traces/scatterternarygl/plot.js b/src/traces/scatterternarygl/plot.js new file mode 100644 index 00000000000..fc3ead03fcc --- /dev/null +++ b/src/traces/scatterternarygl/plot.js @@ -0,0 +1,198 @@ +'use strict'; + +const Lib = require("../../lib"); +const prepareRegl = require('../../lib/prepare_regl'); + +const scatterglPlot = require('../scattergl/plot'); +const sceneUpdate = require('../scattergl/scene_update'); +const convert = require('../scattergl/convert'); +const TOO_MANY_POINTS = require('../scattergl/constants').TOO_MANY_POINTS; + +const reglPrecompiled = {}; + +const vertexShaderSource = [ + 'precision highp float;', + 'attribute vec2 position;', + 'varying vec2 uv;', + 'void main() {', + ' uv = position;', + ' gl_Position = vec4(position * 2.0 - 1.0, 0.0, 1.0);', + '}' +].join('\n'); + +const fragmentShaderSource = [ + 'precision highp float;', + 'uniform sampler2D source;', + 'varying vec2 uv;', + 'void main() {', + ' gl_FragColor = texture2D(source, uv);', + '}' +].join('\n'); + +module.exports = function plot(gd, subplot, moduleCalcData) { + if (!moduleCalcData.length) return; + + const scene = sceneUpdate(gd, subplot); + + for (const [cd] of moduleCalcData) { + const trace = cd.trace; + const stash = cd.t; + const positions = stash.positions; + const opts = convert.style(gd, trace); + const len = trace._length; + + trace._xA = subplot.xaxis; + trace._yA = subplot.yaxis; + + // re-build x/y for hover/select/zoom + const x = (stash.x = new Float64Array(len)); + const y = (stash.y = new Float64Array(len)); + + const amin = subplot.aaxis.range[0]; + const bmin = subplot.baxis.range[1]; + const cmin = subplot.caxis.range[1]; + + for (let i = 0; i < len; i++) { + const inside = stash.a[i] >= amin && stash.b[i] >= bmin && stash.c[i] >= cmin; + + x[i] = inside ? stash.rawx[i] : NaN; + y[i] = inside ? stash.rawy[i] : NaN; + } + + if (opts.marker) { + opts.marker.positions = opts.markerSel.positions = opts.markerUnsel.positions = positions; + + if (len >= TOO_MANY_POINTS) { + opts.marker.cluster = stash.tree; + } + + scene.scatter2d = scene.scatter2d || true; + } + + if (opts.line) { + Lib.extendFlat(opts.line, convert.linePositions(gd, trace, positions)); + + scene.line2d = scene.line2d || true; + } + + if (opts.fill) { + scene.fill2d = scene.fill2d || true; + } + + if (opts.text) { + Lib.extendFlat( + opts.text, + {positions: positions}, + convert.textPosition(gd, trace, opts.text, opts.marker) + ); + Lib.extendFlat( + opts.textSel, + {positions: positions}, + convert.textPosition(gd, trace, opts.text, opts.markerSel) + ); + Lib.extendFlat( + opts.textUnsel, + {positions: positions}, + convert.textPosition(gd, trace, opts.text, opts.markerUnsel) + ); + + scene.glText = scene.glText || true; + } + + scene.lineOptions.push(opts.line); + scene.fillOptions.push(opts.fill); + scene.markerOptions.push(opts.marker); + scene.markerSelectedOptions.push(opts.markerSel); + scene.markerUnselectedOptions.push(opts.markerUnsel); + scene.textOptions.push(opts.text); + scene.textSelectedOptions.push(opts.textSel); + scene.textUnselectedOptions.push(opts.textUnsel); + scene.selectBatch.push([]); + scene.unselectBatch.push([]); + + stash._scene = scene; + stash.index = scene.count++; + } + + if (!prepareRegl(gd, ['ANGLE_instanced_arrays', 'OES_element_index_uint'], reglPrecompiled)) { + scene.init(); + return; + } + + scatterglPlot(gd, subplot, moduleCalcData); + + // create the ternary clipping layer once for the lifetime of scattergl scene + if (scene.ternaryClip) return; + + // render the shared scattergl layers offscreen, then composite them through a triangle + const targets = (scene.ternaryClip = gd._fullLayout._glcanvas + .data() + .slice(0, 2) // scattergl uses contextLayer and focusLayer + .map(({ regl }) => { + const framebuffer = regl.framebuffer({ width: 1, height: 1, depth: false, stencil: false }); + const scope = regl({ framebuffer }); + const composite = regl({ + framebuffer: null, // render to the canvas drawing buffer + viewport: { + x: 0, + y: 0, + width: regl.context('drawingBufferWidth'), + height: regl.context('drawingBufferHeight') + }, + vert: vertexShaderSource, + frag: fragmentShaderSource, + attributes: { position: regl.prop('positions') }, + uniforms: { source: framebuffer }, + count: 3, + depth: { enable: false }, + blend: { enable: true, func: { src: 'one', dst: 'one minus src alpha' } } + }); + + return { regl, framebuffer, scope, composite }; + })); + + const draw = scene.draw; + const destroy = scene.destroy; + + scene.draw = () => { + const layout = gd._fullLayout; + + const left = subplot.x0 / layout.width; + const right = (subplot.x0 + subplot.w) / layout.width; + const bottom = 1 - (subplot.y0 + subplot.h) / layout.height; + const top = 1 - subplot.y0 / layout.height; + + const positions = [ + [left, bottom], + [right, bottom], + [(left + right) / 2, top] + ]; + + for (const target of targets) { + const canvas = target.regl._gl.canvas; + + if (target.framebuffer.width !== canvas.width || target.framebuffer.height !== canvas.height) { + target.framebuffer.resize(canvas.width, canvas.height); + } + + target.scope(() => target.regl.clear({ color: [0, 0, 0, 0] })); + } + + // draw once while both contexts are scoped to their framebuffers + targets[0].scope(() => targets[1].scope(draw)); + + for (const target of targets) { + target.composite({ positions }); + } + }; + + scene.destroy = () => { + for (const target of targets) { + target.framebuffer.destroy(); + } + + destroy(); + }; +}; + +module.exports.reglPrecompiled = reglPrecompiled; diff --git a/src/traces/scatterternarygl/plot_strict.js b/src/traces/scatterternarygl/plot_strict.js new file mode 100644 index 00000000000..22e9ed10739 --- /dev/null +++ b/src/traces/scatterternarygl/plot_strict.js @@ -0,0 +1,13 @@ +'use strict'; + +var plot = require('./plot'); + +var reglPrecompiled = require('./regl_precompiled'); + +var reglPrecompiledDep = require('../scattergl/regl_precompiled'); + +Object.assign(plot.reglPrecompiled, reglPrecompiled); + +Object.assign(plot.reglPrecompiled, reglPrecompiledDep); + +module.exports = plot; \ No newline at end of file diff --git a/src/traces/scatterternarygl/regl_precompiled.js b/src/traces/scatterternarygl/regl_precompiled.js new file mode 100644 index 00000000000..5d187f993ac --- /dev/null +++ b/src/traces/scatterternarygl/regl_precompiled.js @@ -0,0 +1,27 @@ +'use strict'; +var v0 = require('../../generated/regl-codegen/3e771157d23b4793771f65d83e6387262ed73d488209157f19a7fa027bddd71b'); +var v1 = require('../../generated/regl-codegen/49e82bba439f1d9d441c17ba252d05640bc63fefdf22d1219993633af7730210'); +var v2 = require('../../generated/regl-codegen/8902aff2b23b600f8103bcc84a8af2999d28795208aedadc2db06f921f9c7034'); +var v3 = require('../../generated/regl-codegen/8fad2284703471df7c0e0d0a7b96d983e8c53f6d707dd55d5921c1eab71f6623'); +var v4 = require('../../generated/regl-codegen/a05bf3c1b12ac6d06248a1605bddec766ce3c5beca448738b9fcb95625273f0b'); +var v5 = require('../../generated/regl-codegen/ac155a28876770d366446d2217773f063d32b967782ca4b908945212df473aa8'); +var v6 = require('../../generated/regl-codegen/bfc540da96a87fcc039073cb37b45e6b81ef5ee6ef3529d726ceed8336354019'); +var v7 = require('../../generated/regl-codegen/cbf700f001fff25b649fba9c37fa0dc6631c1cdee318ad49473d28ec10dcee81'); +var v8 = require('../../generated/regl-codegen/db1b82c68771e7f5012fad1fbdae7ff23b526e58d2995bf6dd2cf30024e0f41d'); +var v9 = require('../../generated/regl-codegen/dbd1cc9126a137a605df67dc0706e55116f04e33b4545a80042031752de5aef5'); +var v10 = require('../../generated/regl-codegen/fe5b6844077cde1bdd7273f4495969fad93500c26a69b62e74ec2664c447bcc7'); + +/* eslint-disable quote-props */ +module.exports = { + '3e771157d23b4793771f65d83e6387262ed73d488209157f19a7fa027bddd71b': v0, + '49e82bba439f1d9d441c17ba252d05640bc63fefdf22d1219993633af7730210': v1, + '8902aff2b23b600f8103bcc84a8af2999d28795208aedadc2db06f921f9c7034': v2, + '8fad2284703471df7c0e0d0a7b96d983e8c53f6d707dd55d5921c1eab71f6623': v3, + 'a05bf3c1b12ac6d06248a1605bddec766ce3c5beca448738b9fcb95625273f0b': v4, + 'ac155a28876770d366446d2217773f063d32b967782ca4b908945212df473aa8': v5, + 'bfc540da96a87fcc039073cb37b45e6b81ef5ee6ef3529d726ceed8336354019': v6, + 'cbf700f001fff25b649fba9c37fa0dc6631c1cdee318ad49473d28ec10dcee81': v7, + 'db1b82c68771e7f5012fad1fbdae7ff23b526e58d2995bf6dd2cf30024e0f41d': v8, + 'dbd1cc9126a137a605df67dc0706e55116f04e33b4545a80042031752de5aef5': v9, + 'fe5b6844077cde1bdd7273f4495969fad93500c26a69b62e74ec2664c447bcc7': v10 +}; diff --git a/src/traces/scatterternarygl/strict.js b/src/traces/scatterternarygl/strict.js new file mode 100644 index 00000000000..edea996117e --- /dev/null +++ b/src/traces/scatterternarygl/strict.js @@ -0,0 +1,7 @@ +'use strict'; + +var index = require('./base_index'); + +index.plot = require('./plot_strict'); + +module.exports = index; diff --git a/src/types/core/events.d.ts b/src/types/core/events.d.ts index 616fd80bebd..983395cf174 100644 --- a/src/types/core/events.d.ts +++ b/src/types/core/events.d.ts @@ -51,6 +51,12 @@ export interface PlotScatterDataPoint { * numbers. */ export interface PlotDatum { + /** Normalized ternary component a. */ + a?: number; + /** Normalized ternary component b. */ + b?: number; + /** Normalized ternary component c. */ + c?: number; /** Index of the trace producing this point. */ curveNumber: number; /** The trace this point belongs to. */ diff --git a/src/types/generated/entry_points/index-strict.d.ts b/src/types/generated/entry_points/index-strict.d.ts index 570cc647ccb..df61024786e 100644 --- a/src/types/generated/entry_points/index-strict.d.ts +++ b/src/types/generated/entry_points/index-strict.d.ts @@ -6,8 +6,8 @@ /** * Type surface of `plotly.js/lib/index-strict`. * - * It pre-registers the 46 trace modules of the strict bundle: - * bar, barpolar, box, candlestick, carpet, choropleth, choroplethmap, cone, contour, contourcarpet, densitymap, funnel, funnelarea, heatmap, histogram, histogram2d, histogram2dcontour, icicle, image, indicator, isosurface, mesh3d, ohlc, parcats, parcoords, pie, sankey, scatter, scattergl, scatter3d, scattercarpet, scattergeo, scattermap, scatterpolar, scatterpolargl, scattersmith, scatterternary, splom, streamtube, sunburst, surface, table, treemap, violin, volume, waterfall. + * It pre-registers the 47 trace modules of the strict bundle: + * bar, barpolar, box, candlestick, carpet, choropleth, choroplethmap, cone, contour, contourcarpet, densitymap, funnel, funnelarea, heatmap, histogram, histogram2d, histogram2dcontour, icicle, image, indicator, isosurface, mesh3d, ohlc, parcats, parcoords, pie, sankey, scatter, scattergl, scatter3d, scattercarpet, scattergeo, scattermap, scatterpolar, scatterpolargl, scattersmith, scatterternary, scatterternarygl, splom, streamtube, sunburst, surface, table, treemap, violin, volume, waterfall. * * The type surface is the same as the full bundle, so this re-exports the * main declaration. A trace that is not registered at runtime still diff --git a/src/types/generated/entry_points/scatterternarygl.d.ts b/src/types/generated/entry_points/scatterternarygl.d.ts new file mode 100644 index 00000000000..31614824806 --- /dev/null +++ b/src/types/generated/entry_points/scatterternarygl.d.ts @@ -0,0 +1,19 @@ +/** + * Generated from lib/scatterternarygl.js by tasks/generate_entry_point_types.mjs. + * Do not edit by hand — run `npm run entry-point-types` to regenerate. + */ + +import type { RegisterTraceModule } from '../../core/api'; + +/** + * The `scatterternarygl` trace module, for `Plotly.register`. + * + * @example + * import * as Plotly from 'plotly.js/lib/core'; + * import * as scatterternarygl from 'plotly.js/lib/scatterternarygl'; + * + * Plotly.register([scatterternarygl]); + */ +declare const scatterternarygl: RegisterTraceModule & { name: 'scatterternarygl' }; + +export = scatterternarygl; diff --git a/src/types/generated/schema.d.ts b/src/types/generated/schema.d.ts index 5283911ff43..14930dd32d3 100644 --- a/src/types/generated/schema.d.ts +++ b/src/types/generated/schema.d.ts @@ -34,7 +34,7 @@ export type TransitionEasing = 'linear' | 'quad' | 'cubic' | 'sin' | 'exp' | 'ci export type ToImageFormat = 'png' | 'jpeg' | 'webp' | 'svg' | 'full-json'; -export type TraceType = 'bar' | 'barpolar' | 'box' | 'candlestick' | 'carpet' | 'choropleth' | 'choroplethmap' | 'cone' | 'contour' | 'contourcarpet' | 'densitymap' | 'funnel' | 'funnelarea' | 'heatmap' | 'histogram' | 'histogram2d' | 'histogram2dcontour' | 'icicle' | 'image' | 'indicator' | 'isosurface' | 'mesh3d' | 'ohlc' | 'parcats' | 'parcoords' | 'pie' | 'quiver' | 'sankey' | 'scatter' | 'scatter3d' | 'scattercarpet' | 'scattergeo' | 'scattergl' | 'scattermap' | 'scatterpolar' | 'scatterpolargl' | 'scattersmith' | 'scatterternary' | 'splom' | 'streamtube' | 'sunburst' | 'surface' | 'table' | 'treemap' | 'violin' | 'volume' | 'waterfall'; +export type TraceType = 'bar' | 'barpolar' | 'box' | 'candlestick' | 'carpet' | 'choropleth' | 'choroplethmap' | 'cone' | 'contour' | 'contourcarpet' | 'densitymap' | 'funnel' | 'funnelarea' | 'heatmap' | 'histogram' | 'histogram2d' | 'histogram2dcontour' | 'icicle' | 'image' | 'indicator' | 'isosurface' | 'mesh3d' | 'ohlc' | 'parcats' | 'parcoords' | 'pie' | 'quiver' | 'sankey' | 'scatter' | 'scatter3d' | 'scattercarpet' | 'scattergeo' | 'scattergl' | 'scattermap' | 'scatterpolar' | 'scatterpolargl' | 'scattersmith' | 'scatterternary' | 'scatterternarygl' | 'splom' | 'streamtube' | 'sunburst' | 'surface' | 'table' | 'treemap' | 'violin' | 'volume' | 'waterfall'; /** @deprecated Renamed to TraceType. */ export type PlotType = TraceType; @@ -9724,6 +9724,196 @@ export interface ScatterternaryData { visible?: true | false | 'legendonly'; } +export interface ScatterternaryglData { + /** Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary.sum`. */ + a?: Datum[] | Datum[][] | TypedArray; + /** Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary.sum`. */ + b?: Datum[] | Datum[][] | TypedArray; + /** Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary.sum`. */ + c?: Datum[] | Datum[][] | TypedArray; + /** + * Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + * @default false + */ + connectgaps?: boolean; + /** Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements */ + customdata?: Datum[] | Datum[][] | TypedArray; + /** + * Sets the area to fill with a solid color. Use with `fillcolor` if not *none*. scatterternary has a subset of the options available to scatter. *toself* connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. *tonext* fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like *toself* if there is no trace before it. *tonext* should not be used if one trace does not enclose the other. + * @default 'none' + */ + fill?: 'none' | 'toself' | 'tonext'; + /** Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. */ + fillcolor?: Color; + /** + * Determines what trace information appears on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. + * @default 'all' + */ + hoverinfo?: 'a' | 'b' | 'c' | 'text' | 'name' | 'all' | 'none' | 'skip' | (string & {}) | ('a' | 'b' | 'c' | 'text' | 'name' | 'all' | 'none' | 'skip' | (string & {}))[]; + hoverlabel?: HoverLabel; + /** Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. Variables that can't be found will be replaced with the specifier. For example, a template of "data: %{x}, %{y}" will result in a value of "data: 1, %{y}" if x is 1 and y is missing. Variables with an undefined value will be replaced with the fallback value. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, all attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. Anything contained in tag `` is displayed in the secondary box, for example `%{fullData.name}`. To hide the secondary box completely, use an empty tag ``. */ + hovertemplate?: string | string[]; + /** + * Fallback string that's displayed when a variable referenced in a template is missing. If the boolean value 'false' is passed in, the specifier with the missing variable will be displayed. + * @default '-' + */ + hovertemplatefallback?: any; + /** Sets hover text elements associated with each (a,b,c) point. If a single string, the same string appears over all the data points. If an array of strings, the items are mapped in order to the data points in (a,b,c). To be seen, trace `hoverinfo` must contain a *text* flag. */ + hovertext?: string | string[]; + /** Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. */ + ids?: Datum[] | Datum[][] | TypedArray; + /** + * Sets the reference to a legend to show this trace in. References to these legends are *legend*, *legend2*, *legend3*, etc. Settings for these legends are set in the layout, under `layout.legend`, `layout.legend2`, etc. + * @default 'legend' + */ + legend?: string; + /** Sets the legend group for this trace. Traces and shapes part of the same legend group hide/show at the same time when toggling legend items. */ + legendgroup?: string; + legendgrouptitle?: LegendGroupTitle; + /** + * Sets the legend rank for this trace. Items and groups with smaller ranks are presented on top/left side while with *reversed* `legend.traceorder` they are on bottom/right side. The default legendrank is 1000, so that you can use ranks less than 1000 to place certain items before all unranked items, and ranks greater than 1000 to go after all unranked items. When having unranked or equal rank items shapes would be displayed after traces i.e. according to their order in data and layout. + * @default 1000 + */ + legendrank?: number; + /** + * Sets the width (in px or fraction) of the legend for this trace. + * Minimum: 0 + */ + legendwidth?: number; + line?: { + /** Sets the line color. */ + color?: Color; + /** + * Sets the style of the lines. + * @default 'solid' + */ + dash?: Dash; + /** + * Sets the line width (in px). + * @default 2 + * Minimum: 0 + */ + width?: number; + }; + marker?: _internal.Marker; + /** Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. */ + meta?: any; + /** + * Determines the drawing mode for this scatter trace. If the provided `mode` includes *text* then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover. If there are less than 20 points and the trace is not stacked then the default is *lines+markers*. Otherwise, *lines*. + * @default 'markers' + */ + mode?: 'lines' | 'markers' | 'text' | 'none' | (string & {}); + /** Sets the trace name. The trace name appears as the legend item and on hover. */ + name?: string; + /** + * Sets the opacity of the trace. + * @default 1 + * Range: [0, 1] + */ + opacity?: number; + selected?: { + marker?: { + /** Sets the marker color of selected points. */ + color?: Color; + /** + * Sets the marker opacity of selected points. + * Range: [0, 1] + */ + opacity?: number; + /** + * Sets the marker size of selected points. + * Minimum: 0 + */ + size?: number; + }; + textfont?: Font; + }; + /** Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect. */ + selectedpoints?: any; + /** + * Determines whether or not an item corresponding to this trace is shown in the legend. + * @default true + */ + showlegend?: boolean; + /** + * Sets a reference between this trace's data coordinates and a ternary subplot. If *ternary* (the default value), the data refer to `layout.ternary`. If *ternary2*, the data refer to `layout.ternary2`, and so on. + * @default 'ternary' + */ + subplot?: string; + /** + * The number each triplet should sum to, if only two of `a`, `b`, and `c` are provided. This overrides `ternary.sum` to normalize this specific trace, but does not affect the values displayed on the axes. 0 (or missing) means to use ternary.sum + * @default 0 + * Minimum: 0 + */ + sum?: number; + /** Sets text elements associated with each (a,b,c) point. If a single string, the same string appears over all the data points. If an array of strings, the items are mapped in order to the data points in (a,b,c). If trace `hoverinfo` contains a *text* flag and *hovertext* is not set, these elements will be seen in the hover labels. */ + text?: string | string[]; + /** Sets the text font. */ + textfont?: { + color?: Color | Color[]; + /** HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available. */ + family?: string | string[]; + /** + * Minimum: 1 + */ + size?: number | number[]; + /** + * Sets whether a font should be styled with a normal or italic face from its family. + * @default 'normal' + */ + style?: 'normal' | 'italic' | ('normal' | 'italic')[]; + /** + * Sets the variant of the font. + * @default 'normal' + */ + variant?: 'normal' | 'small-caps' | ('normal' | 'small-caps')[]; + /** + * Sets the weight (or boldness) of the font. + * @default 'normal' + */ + weight?: 'normal' | 'bold' | ('normal' | 'bold')[]; + }; + /** + * Sets the positions of the `text` elements with respects to the (x,y) coordinates. + * @default 'middle center' + */ + textposition?: 'top left' | 'top center' | 'top right' | 'middle left' | 'middle center' | 'middle right' | 'bottom left' | 'bottom center' | 'bottom right' | ('top left' | 'top center' | 'top right' | 'middle left' | 'middle center' | 'middle right' | 'bottom left' | 'bottom center' | 'bottom right')[]; + /** Template string used for rendering the information text that appears on points. Note that this will override `textinfo`. Variables are inserted using %{variable}, for example "y: %{y}". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. Variables that can't be found will be replaced with the specifier. For example, a template of "data: %{x}, %{y}" will result in a value of "data: 1, %{y}" if x is 1 and y is missing. Variables with an undefined value will be replaced with the fallback value. All attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. Finally, the template string has access to variables `a`, `b`, `c` and `text`. */ + texttemplate?: string | string[]; + /** + * Fallback string that's displayed when a variable referenced in a template is missing. If the boolean value 'false' is passed in, the specifier with the missing variable will be displayed. + * @default '-' + */ + texttemplatefallback?: any; + type?: 'scatterternarygl'; + /** Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions. */ + uid?: string; + /** Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. */ + uirevision?: any; + unselected?: { + marker?: { + /** Sets the marker color of unselected points, applied only when a selection exists. */ + color?: Color; + /** + * Sets the marker opacity of unselected points, applied only when a selection exists. + * Range: [0, 1] + */ + opacity?: number; + /** + * Sets the marker size of unselected points, applied only when a selection exists. + * Minimum: 0 + */ + size?: number; + }; + textfont?: Font; + }; + /** + * Determines whether or not this trace is visible. If *legendonly*, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). + * @default true + */ + visible?: true | false | 'legendonly'; +} + export interface SplomData { /** Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements */ customdata?: Datum[] | Datum[][] | TypedArray; @@ -11838,6 +12028,7 @@ export type Data = | Partial | Partial | Partial + | Partial | Partial | Partial | Partial diff --git a/tasks/generate_entry_point_types.mjs b/tasks/generate_entry_point_types.mjs index f698423c713..6646b07e93e 100644 --- a/tasks/generate_entry_point_types.mjs +++ b/tasks/generate_entry_point_types.mjs @@ -126,7 +126,7 @@ const RE_NAME = /\bname: '([\w-]+)'/; /** * `var index = require('./base_index');` … `module.exports = index;` * - * Four gl traces (parcoords, scattergl, scatterpolargl, splom) build their + * Five gl traces (parcoords, scattergl, scatterpolargl, scatterternarygl, splom) build their * descriptor in `base_index.js` and patch one field in `index.js`, so the * lookup follows this single level of indirection. */ diff --git a/tasks/util/constants.js b/tasks/util/constants.js index 09a20a7a423..f8636c29ad1 100644 --- a/tasks/util/constants.js +++ b/tasks/util/constants.js @@ -127,6 +127,7 @@ var partialBundleTraces = { 'scatterpolargl', 'scattersmith', 'scatterternary', + 'scatterternarygl', 'splom', 'streamtube', 'sunburst', diff --git a/test/image/baselines/scatterternarygl_clipping.png b/test/image/baselines/scatterternarygl_clipping.png new file mode 100644 index 00000000000..70c274283ff Binary files /dev/null and b/test/image/baselines/scatterternarygl_clipping.png differ diff --git a/test/image/baselines/scatterternarygl_fills.png b/test/image/baselines/scatterternarygl_fills.png new file mode 100644 index 00000000000..d69a2a9e864 Binary files /dev/null and b/test/image/baselines/scatterternarygl_fills.png differ diff --git a/test/image/baselines/scatterternarygl_lines.png b/test/image/baselines/scatterternarygl_lines.png new file mode 100644 index 00000000000..37badcbef3b Binary files /dev/null and b/test/image/baselines/scatterternarygl_lines.png differ diff --git a/test/image/baselines/scatterternarygl_markers.png b/test/image/baselines/scatterternarygl_markers.png new file mode 100644 index 00000000000..22788a96661 Binary files /dev/null and b/test/image/baselines/scatterternarygl_markers.png differ diff --git a/test/image/mocks/scatterternarygl_clipping.json b/test/image/mocks/scatterternarygl_clipping.json new file mode 100644 index 00000000000..44be021de71 --- /dev/null +++ b/test/image/mocks/scatterternarygl_clipping.json @@ -0,0 +1,80 @@ +{ + "data": [ + { + "type": "scatterternarygl", + "mode": "lines+markers", + "a": [ + 70, + 15, + 15, + 70 + ], + "b": [ + 15, + 70, + 15, + 15 + ], + "c": [ + 15, + 15, + 70, + 15 + ], + "line": { + "color": "#e11", + "width": 7 + }, + "marker": { + "color": "#e11", + "size": 24, + "line": { + "color": "#7f0000", + "width": 2 + } + } + } + ], + "layout": { + "ternary": { + "sum": 100, + "aaxis": { + "title": { + "text": "A" + }, + "min": 15, + "showgrid": true, + "showline": true, + "linecolor": "#333", + "linewidth": 3, + "layer": "above traces" + }, + "baxis": { + "title": { + "text": "B" + }, + "min": 15, + "showgrid": true, + "showline": true, + "linecolor": "#333", + "linewidth": 3, + "layer": "above traces" + }, + "caxis": { + "title": { + "text": "C" + }, + "min": 15, + "showgrid": true, + "showline": true, + "linecolor": "#333", + "linewidth": 3, + "layer": "above traces" + } + }, + "showlegend": false, + "width": 700, + "height": 500, + "autosize": false + } +} diff --git a/test/image/mocks/scatterternarygl_fills.json b/test/image/mocks/scatterternarygl_fills.json new file mode 100644 index 00000000000..f967bef63ab --- /dev/null +++ b/test/image/mocks/scatterternarygl_fills.json @@ -0,0 +1,118 @@ +{ + "data": [ + { + "type": "scatterternarygl", + "mode": "lines", + "a": [ + 80, + 55, + 55, + 80 + ], + "b": [ + 10, + 35, + 10, + 10 + ], + "c": [ + 10, + 10, + 35, + 10 + ], + "fill": "toself", + "fillcolor": "rgba(99,110,250,0.35)", + "line": { + "color": "#636efa", + "width": 2 + }, + "name": "A-rich" + }, + { + "type": "scatterternarygl", + "mode": "lines", + "a": [ + 10, + 35, + 10, + 10 + ], + "b": [ + 80, + 55, + 55, + 80 + ], + "c": [ + 10, + 10, + 35, + 10 + ], + "fill": "toself", + "fillcolor": "rgba(239,85,59,0.35)", + "line": { + "color": "#ef553b", + "width": 2 + }, + "name": "B-rich" + }, + { + "type": "scatterternarygl", + "mode": "lines", + "a": [ + 10, + 35, + 10, + 10 + ], + "b": [ + 10, + 10, + 35, + 10 + ], + "c": [ + 80, + 55, + 55, + 80 + ], + "fill": "toself", + "fillcolor": "rgba(0,204,150,0.35)", + "line": { + "color": "#00cc96", + "width": 2 + }, + "name": "C-rich" + } + ], + "layout": { + "ternary": { + "sum": 100, + "aaxis": { + "title": { + "text": "A" + }, + "showgrid": true + }, + "baxis": { + "title": { + "text": "B" + }, + "showgrid": true + }, + "caxis": { + "title": { + "text": "C" + }, + "showgrid": true + } + }, + "showlegend": true, + "width": 700, + "height": 500, + "autosize": false + } +} diff --git a/test/image/mocks/scatterternarygl_lines.json b/test/image/mocks/scatterternarygl_lines.json new file mode 100644 index 00000000000..bce5fda30d6 --- /dev/null +++ b/test/image/mocks/scatterternarygl_lines.json @@ -0,0 +1,393 @@ +{ + "data": [ + { + "type": "scatterternarygl", + "mode": "lines", + "a": [ + 0, + 10, + 0 + ], + "b": [ + 100, + 90, + 90 + ], + "c": [ + 0, + 0, + 10 + ], + "line": { + "color": "#c00" + } + }, + { + "type": "scatterternarygl", + "mode": "lines", + "a": [ + 0, + 10, + 15, + 0 + ], + "b": [ + 90, + 90, + 85, + 70 + ], + "c": [ + 10, + 0, + 0, + 30 + ], + "line": { + "color": "#c00" + } + }, + { + "type": "scatterternarygl", + "mode": "lines", + "a": [ + 0, + 15, + 20, + 20, + 5, + 5, + 0 + ], + "b": [ + 70, + 85, + 80, + 53, + 53, + 45, + 50 + ], + "c": [ + 30, + 0, + 0, + 32, + 42, + 50, + 50 + ], + "line": { + "color": "#c00" + } + }, + { + "type": "scatterternarygl", + "mode": "lines", + "a": [ + 20, + 35, + 35, + 28, + 20 + ], + "b": [ + 80, + 65, + 45, + 45, + 53 + ], + "c": [ + 0, + 0, + 20, + 27, + 32 + ], + "line": { + "color": "#c00" + } + }, + { + "type": "scatterternarygl", + "mode": "lines", + "a": [ + 35, + 35, + 55 + ], + "b": [ + 65, + 45, + 45 + ], + "c": [ + 0, + 20, + 0 + ], + "line": { + "color": "#c00" + } + }, + { + "type": "scatterternarygl", + "mode": "lines", + "a": [ + 55, + 100, + 60, + 40, + 40 + ], + "b": [ + 45, + 0, + 0, + 20, + 45 + ], + "c": [ + 0, + 0, + 40, + 40, + 15 + ], + "line": { + "color": "#c00" + } + }, + { + "type": "scatterternarygl", + "mode": "lines", + "a": [ + 40, + 40, + 28, + 28 + ], + "b": [ + 45, + 20, + 20, + 45 + ], + "c": [ + 15, + 40, + 52, + 27 + ], + "line": { + "color": "#c00" + } + }, + { + "type": "scatterternarygl", + "mode": "lines", + "a": [ + 60, + 40, + 40 + ], + "b": [ + 0, + 0, + 20 + ], + "c": [ + 40, + 60, + 40 + ], + "line": { + "color": "#c00" + } + }, + { + "type": "scatterternarygl", + "mode": "lines", + "a": [ + 28, + 28, + 40, + 40 + ], + "b": [ + 0, + 20, + 20, + 0 + ], + "c": [ + 72, + 52, + 40, + 60 + ], + "line": { + "color": "#c00" + } + }, + { + "type": "scatterternarygl", + "mode": "lines", + "a": [ + 0, + 28, + 28, + 12, + 12, + 0 + ], + "b": [ + 50, + 22, + 0, + 0, + 8, + 20 + ], + "c": [ + 50, + 50, + 72, + 88, + 80, + 80 + ], + "line": { + "color": "#c00" + } + }, + { + "type": "scatterternarygl", + "mode": "lines", + "a": [ + 0, + 0, + 12, + 12 + ], + "b": [ + 0, + 20, + 8, + 0 + ], + "c": [ + 100, + 80, + 80, + 88 + ], + "line": { + "color": "#c00" + } + }, + { + "type": "scatterternarygl", + "mode": "lines", + "a": [ + 28, + 28, + 5, + 5, + 20 + ], + "b": [ + 45, + 22, + 45, + 53, + 53 + ], + "c": [ + 27, + 50, + 50, + 42, + 32 + ], + "line": { + "color": "#c00" + } + } + ], + "layout": { + "ternary": { + "aaxis": { + "title": { + "text": "Clay" + }, + "min": 0.01, + "linewidth": 2, + "ticks": "outside", + "ticklen": 8, + "showgrid": true, + "tickvals": [ + 0.2, + 0.4, + 0.6, + 0.8 + ], + "ticktext": [ + "20%", + "40%", + "60%", + "80%" + ] + }, + "baxis": { + "title": { + "text": "Sand" + }, + "min": 0.01, + "linewidth": 2, + "ticks": "outside", + "ticklen": 8, + "showgrid": true, + "tickvals": [ + 0.2, + 0.4, + 0.6, + 0.8 + ], + "ticktext": [ + "20%", + "40%", + "60%", + "80%" + ] + }, + "caxis": { + "title": { + "text": "Silt" + }, + "min": 0.01, + "linewidth": 2, + "ticks": "outside", + "ticklen": 8, + "showgrid": true, + "tickvals": [ + 0.2, + 0.4, + 0.6, + 0.8 + ], + "ticktext": [ + "20%", + "40%", + "60%", + "80%" + ] + } + }, + "showlegend": false, + "width": 700, + "height": 450, + "autosize": false + } +} diff --git a/test/image/mocks/scatterternarygl_markers.json b/test/image/mocks/scatterternarygl_markers.json new file mode 100644 index 00000000000..d0028edf0fc --- /dev/null +++ b/test/image/mocks/scatterternarygl_markers.json @@ -0,0 +1,99 @@ +{ + "data": [ + { + "type": "scatterternarygl", + "mode": "markers+text", + "a": [ + 75, + 70, + 75, + 5, + 10, + 10, + 20, + 10, + 15, + 10, + 20 + ], + "b": [ + 25, + 10, + 20, + 60, + 80, + 90, + 70, + 20, + 5, + 10, + 10 + ], + "c": [ + 0, + 20, + 5, + 35, + 10, + 0, + 10, + 70, + 80, + 80, + 70 + ], + "text": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11" + ], + "textposition": "top center", + "marker": { + "size": 12, + "color": "#636efa", + "line": { + "color": "#222", + "width": 1 + } + } + } + ], + "layout": { + "ternary": { + "sum": 100, + "aaxis": { + "title": { + "text": "A" + }, + "showline": true, + "showgrid": true + }, + "baxis": { + "title": { + "text": "B" + }, + "showline": true, + "showgrid": true + }, + "caxis": { + "title": { + "text": "C" + }, + "showline": true, + "showgrid": true + } + }, + "showlegend": false, + "width": 700, + "height": 500, + "autosize": false + } +} diff --git a/test/plot-schema.json b/test/plot-schema.json index 3f8728d1b01..c482b328b0b 100644 --- a/test/plot-schema.json +++ b/test/plot-schema.json @@ -73325,6 +73325,1940 @@ }, "type": "scatterternary" }, + "scatterternarygl": { + "animatable": false, + "attributes": { + "a": { + "description": "Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary.sum`.", + "editType": "calc", + "valType": "data_array" + }, + "b": { + "description": "Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary.sum`.", + "editType": "calc", + "valType": "data_array" + }, + "c": { + "description": "Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary.sum`.", + "editType": "calc", + "valType": "data_array" + }, + "connectgaps": { + "description": "Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.", + "dflt": false, + "editType": "calc", + "valType": "boolean" + }, + "customdata": { + "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", + "editType": "calc", + "valType": "data_array" + }, + "fill": { + "description": "Sets the area to fill with a solid color. Use with `fillcolor` if not *none*. scatterternary has a subset of the options available to scatter. *toself* connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. *tonext* fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like *toself* if there is no trace before it. *tonext* should not be used if one trace does not enclose the other.", + "dflt": "none", + "editType": "calc", + "valType": "enumerated", + "values": [ + "none", + "toself", + "tonext" + ] + }, + "fillcolor": { + "description": "Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.", + "editType": "calc", + "valType": "color" + }, + "hoverinfo": { + "arrayOk": true, + "description": "Determines what trace information appears on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", + "dflt": "all", + "editType": "none", + "extras": [ + "all", + "none", + "skip" + ], + "flags": [ + "a", + "b", + "c", + "text", + "name" + ], + "valType": "flaglist" + }, + "hoverlabel": { + "align": { + "arrayOk": true, + "description": "Sets the horizontal alignment of the text content within hover label box. Has an effect only if the hover label text spans more two or more lines", + "dflt": "auto", + "editType": "none", + "valType": "enumerated", + "values": [ + "left", + "right", + "auto" + ] + }, + "bgcolor": { + "arrayOk": true, + "description": "Sets the background color of the hover labels for this trace", + "editType": "none", + "valType": "color" + }, + "bordercolor": { + "arrayOk": true, + "description": "Sets the border color of the hover labels for this trace.", + "editType": "none", + "valType": "color" + }, + "editType": "none", + "font": { + "color": { + "arrayOk": true, + "editType": "none", + "valType": "color" + }, + "description": "Sets the font used in hover labels.", + "editType": "none", + "family": { + "arrayOk": true, + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.", + "editType": "none", + "noBlank": true, + "strict": true, + "valType": "string" + }, + "lineposition": { + "arrayOk": true, + "description": "Sets the kind of decoration line(s) with text, such as an *under*, *over* or *through* as well as combinations e.g. *under+over*, etc.", + "dflt": "none", + "editType": "none", + "extras": [ + "none" + ], + "flags": [ + "under", + "over", + "through" + ], + "valType": "flaglist" + }, + "role": "object", + "shadow": { + "arrayOk": true, + "description": "Sets the shape and color of the shadow behind text. *auto* places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.", + "dflt": "none", + "editType": "none", + "valType": "string" + }, + "size": { + "arrayOk": true, + "editType": "none", + "min": 1, + "valType": "number" + }, + "style": { + "arrayOk": true, + "description": "Sets whether a font should be styled with a normal or italic face from its family.", + "dflt": "normal", + "editType": "none", + "valType": "enumerated", + "values": [ + "normal", + "italic" + ] + }, + "textcase": { + "arrayOk": true, + "description": "Sets capitalization of text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized.", + "dflt": "normal", + "editType": "none", + "valType": "enumerated", + "values": [ + "normal", + "word caps", + "upper", + "lower" + ] + }, + "variant": { + "arrayOk": true, + "description": "Sets the variant of the font.", + "dflt": "normal", + "editType": "none", + "valType": "enumerated", + "values": [ + "normal", + "small-caps", + "all-small-caps", + "all-petite-caps", + "petite-caps", + "unicase" + ] + }, + "weight": { + "arrayOk": true, + "description": "Sets the weight (or boldness) of the font.", + "dflt": "normal", + "editType": "none", + "extras": [ + "normal", + "bold" + ], + "max": 1000, + "min": 1, + "valType": "integer" + } + }, + "namelength": { + "arrayOk": true, + "description": "Sets the default length (in number of characters) of the trace name in the hover labels for all traces. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", + "dflt": 15, + "editType": "none", + "min": -1, + "valType": "integer" + }, + "role": "object", + "showarrow": { + "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", + "dflt": true, + "editType": "none", + "valType": "boolean" + } + }, + "hovertemplate": { + "arrayOk": true, + "description": "Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example \"y: %{y}\" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. Variables that can't be found will be replaced with the specifier. For example, a template of \"data: %{x}, %{y}\" will result in a value of \"data: 1, %{y}\" if x is 1 and y is missing. Variables with an undefined value will be replaced with the fallback value. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, all attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. Anything contained in tag `` is displayed in the secondary box, for example `%{fullData.name}`. To hide the secondary box completely, use an empty tag ``.", + "dflt": "", + "editType": "none", + "valType": "string" + }, + "hovertemplatefallback": { + "description": "Fallback string that's displayed when a variable referenced in a template is missing. If the boolean value 'false' is passed in, the specifier with the missing variable will be displayed.", + "dflt": "-", + "editType": "none", + "valType": "any" + }, + "hovertext": { + "arrayOk": true, + "description": "Sets hover text elements associated with each (a,b,c) point. If a single string, the same string appears over all the data points. If an array of strings, the items are mapped in order to the data points in (a,b,c). To be seen, trace `hoverinfo` must contain a *text* flag.", + "dflt": "", + "editType": "style", + "valType": "string" + }, + "ids": { + "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.", + "editType": "calc", + "valType": "data_array" + }, + "legend": { + "description": "Sets the reference to a legend to show this trace in. References to these legends are *legend*, *legend2*, *legend3*, etc. Settings for these legends are set in the layout, under `layout.legend`, `layout.legend2`, etc.", + "dflt": "legend", + "editType": "style", + "valType": "subplotid" + }, + "legendgroup": { + "description": "Sets the legend group for this trace. Traces and shapes part of the same legend group hide/show at the same time when toggling legend items.", + "dflt": "", + "editType": "style", + "valType": "string" + }, + "legendgrouptitle": { + "editType": "style", + "font": { + "color": { + "editType": "style", + "valType": "color" + }, + "description": "Sets this legend group's title font.", + "editType": "style", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.", + "editType": "style", + "noBlank": true, + "strict": true, + "valType": "string" + }, + "lineposition": { + "description": "Sets the kind of decoration line(s) with text, such as an *under*, *over* or *through* as well as combinations e.g. *under+over*, etc.", + "dflt": "none", + "editType": "style", + "extras": [ + "none" + ], + "flags": [ + "under", + "over", + "through" + ], + "valType": "flaglist" + }, + "role": "object", + "shadow": { + "description": "Sets the shape and color of the shadow behind text. *auto* places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.", + "dflt": "none", + "editType": "style", + "valType": "string" + }, + "size": { + "editType": "style", + "min": 1, + "valType": "number" + }, + "style": { + "description": "Sets whether a font should be styled with a normal or italic face from its family.", + "dflt": "normal", + "editType": "style", + "valType": "enumerated", + "values": [ + "normal", + "italic" + ] + }, + "textcase": { + "description": "Sets capitalization of text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized.", + "dflt": "normal", + "editType": "style", + "valType": "enumerated", + "values": [ + "normal", + "word caps", + "upper", + "lower" + ] + }, + "variant": { + "description": "Sets the variant of the font.", + "dflt": "normal", + "editType": "style", + "valType": "enumerated", + "values": [ + "normal", + "small-caps", + "all-small-caps", + "all-petite-caps", + "petite-caps", + "unicase" + ] + }, + "weight": { + "description": "Sets the weight (or boldness) of the font.", + "dflt": "normal", + "editType": "style", + "extras": [ + "normal", + "bold" + ], + "max": 1000, + "min": 1, + "valType": "integer" + } + }, + "role": "object", + "text": { + "description": "Sets the title of the legend group.", + "dflt": "", + "editType": "style", + "valType": "string" + } + }, + "legendrank": { + "description": "Sets the legend rank for this trace. Items and groups with smaller ranks are presented on top/left side while with *reversed* `legend.traceorder` they are on bottom/right side. The default legendrank is 1000, so that you can use ranks less than 1000 to place certain items before all unranked items, and ranks greater than 1000 to go after all unranked items. When having unranked or equal rank items shapes would be displayed after traces i.e. according to their order in data and layout.", + "dflt": 1000, + "editType": "style", + "valType": "number" + }, + "legendwidth": { + "description": "Sets the width (in px or fraction) of the legend for this trace.", + "editType": "style", + "min": 0, + "valType": "number" + }, + "line": { + "color": { + "description": "Sets the line color.", + "editType": "calc", + "valType": "color" + }, + "dash": { + "description": "Sets the style of the lines.", + "dflt": "solid", + "editType": "calc", + "valType": "enumerated", + "values": [ + "dash", + "dashdot", + "dot", + "longdash", + "longdashdot", + "solid" + ] + }, + "editType": "calc", + "role": "object", + "width": { + "description": "Sets the line width (in px).", + "dflt": 2, + "editType": "calc", + "min": 0, + "valType": "number" + } + }, + "marker": { + "angle": { + "arrayOk": true, + "description": "Sets the marker angle in respect to `angleref`.", + "dflt": 0, + "editType": "calc", + "valType": "angle" + }, + "autocolorscale": { + "description": "Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.colorscale`. Has an effect only if in `marker.color` is set to a numerical array. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", + "dflt": true, + "editType": "calc", + "impliedEdits": {}, + "valType": "boolean" + }, + "cauto": { + "description": "Determines whether or not the color domain is computed with respect to the input data (here in `marker.color`) or the bounds set in `marker.cmin` and `marker.cmax` Has an effect only if in `marker.color` is set to a numerical array. Defaults to `false` when `marker.cmin` and `marker.cmax` are set by the user.", + "dflt": true, + "editType": "calc", + "impliedEdits": {}, + "valType": "boolean" + }, + "cmax": { + "description": "Sets the upper bound of the color domain. Has an effect only if in `marker.color` is set to a numerical array. Value should have the same units as in `marker.color` and if set, `marker.cmin` must be set as well.", + "dflt": null, + "editType": "calc", + "impliedEdits": { + "cauto": false + }, + "valType": "number" + }, + "cmid": { + "description": "Sets the mid-point of the color domain by scaling `marker.cmin` and/or `marker.cmax` to be equidistant to this point. Has an effect only if in `marker.color` is set to a numerical array. Value should have the same units as in `marker.color`. Has no effect when `marker.cauto` is `false`.", + "dflt": null, + "editType": "calc", + "impliedEdits": {}, + "valType": "number" + }, + "cmin": { + "description": "Sets the lower bound of the color domain. Has an effect only if in `marker.color` is set to a numerical array. Value should have the same units as in `marker.color` and if set, `marker.cmax` must be set as well.", + "dflt": null, + "editType": "calc", + "impliedEdits": { + "cauto": false + }, + "valType": "number" + }, + "color": { + "arrayOk": true, + "description": "Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.cmin` and `marker.cmax` if set.", + "editType": "calc", + "valType": "color" + }, + "coloraxis": { + "description": "Sets a reference to a shared color axis. References to these shared color axes are *coloraxis*, *coloraxis2*, *coloraxis3*, etc. Settings for these shared color axes are set in the layout, under `layout.coloraxis`, `layout.coloraxis2`, etc. Note that multiple color scales can be linked to the same color axis.", + "dflt": null, + "editType": "calc", + "regex": "/^coloraxis([2-9]|[1-9][0-9]+)?$/", + "valType": "subplotid" + }, + "colorbar": { + "bgcolor": { + "description": "Sets the color of padded area.", + "dflt": "rgba(0,0,0,0)", + "editType": "calc", + "valType": "color" + }, + "bordercolor": { + "description": "Sets the axis line color.", + "dflt": "#444", + "editType": "calc", + "valType": "color" + }, + "borderwidth": { + "description": "Sets the width (in px) or the border enclosing this color bar.", + "dflt": 0, + "editType": "calc", + "min": 0, + "valType": "number" + }, + "dtick": { + "description": "Sets the step in-between ticks on this color bar. Use with `tick0`. Must be a positive number. Note: unlike on x/y axes, the special *log* and *date* string forms (*L*, *D1*, *D2*, *M*) are not supported here: this axis is always linear, so such strings are silently ignored and the step is set to 1.", + "editType": "calc", + "impliedEdits": { + "tickmode": "linear" + }, + "valType": "any" + }, + "editType": "calc", + "exponentformat": { + "description": "Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If *none*, it appears as 1,000,000,000. If *e*, 1e+9. If *E*, 1E+9. If *power*, 1x10^9 (with 9 in a super script). If *SI*, 1G. If *B*, 1B. *SI* uses prefixes from \"femto\" f (10^-15) to \"tera\" T (10^12). *SI extended* covers instead the full SI range from \"quecto\" q (10^-30) to \"quetta\" Q (10^30). If *SI* or *SI extended* is used and the exponent is beyond the above ranges, the formatting rule will automatically be switched to the power notation.", + "dflt": "B", + "editType": "calc", + "valType": "enumerated", + "values": [ + "none", + "e", + "E", + "power", + "SI", + "B", + "SI extended" + ] + }, + "labelalias": { + "description": "Replacement text for specific tick or hover labels. For example using {US: 'USA', CA: 'Canada'} changes US to USA and CA to Canada. The labels we would have shown must match the keys exactly, after adding any tickprefix or ticksuffix. For negative numbers the minus sign symbol used (U+2212) is wider than the regular ascii dash. That means you need to use −1 instead of -1. labelalias can be used with any axis type, and both keys (if needed) and values (if desired) can include html-like tags or MathJax.", + "dflt": false, + "editType": "calc", + "valType": "any" + }, + "len": { + "description": "Sets the length of the color bar This measure excludes the padding of both ends. That is, the color bar length is this length minus the padding on both ends.", + "dflt": 1, + "editType": "calc", + "min": 0, + "valType": "number" + }, + "lenmode": { + "description": "Determines whether this color bar's length (i.e. the measure in the color variation direction) is set in units of plot *fraction* or in *pixels. Use `len` to set the value.", + "dflt": "fraction", + "editType": "calc", + "valType": "enumerated", + "values": [ + "fraction", + "pixels" + ] + }, + "minexponent": { + "description": "Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `tickformat` is *SI* or *B*.", + "dflt": 3, + "editType": "calc", + "min": 0, + "valType": "number" + }, + "nticks": { + "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", + "dflt": 0, + "editType": "calc", + "min": 0, + "valType": "integer" + }, + "orientation": { + "description": "Sets the orientation of the colorbar.", + "dflt": "v", + "editType": "calc", + "valType": "enumerated", + "values": [ + "h", + "v" + ] + }, + "outlinecolor": { + "description": "Sets the axis line color.", + "dflt": "#444", + "editType": "calc", + "valType": "color" + }, + "outlinewidth": { + "description": "Sets the width (in px) of the axis line.", + "dflt": 1, + "editType": "calc", + "min": 0, + "valType": "number" + }, + "role": "object", + "separatethousands": { + "description": "If \"true\", even 4-digit integers are separated", + "dflt": false, + "editType": "calc", + "valType": "boolean" + }, + "showexponent": { + "description": "If *all*, all exponents are shown besides their significands. If *first*, only the exponent of the first tick is shown. If *last*, only the exponent of the last tick is shown. If *none*, no exponents appear.", + "dflt": "all", + "editType": "calc", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showticklabels": { + "description": "Determines whether or not the tick labels are drawn.", + "dflt": true, + "editType": "calc", + "valType": "boolean" + }, + "showtickprefix": { + "description": "If *all*, all tick labels are displayed with a prefix. If *first*, only the first tick is displayed with a prefix. If *last*, only the last tick is displayed with a suffix. If *none*, tick prefixes are hidden.", + "dflt": "all", + "editType": "calc", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showticksuffix": { + "description": "Same as `showtickprefix` but for tick suffixes.", + "dflt": "all", + "editType": "calc", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "thickness": { + "description": "Sets the thickness of the color bar This measure excludes the size of the padding, ticks and labels.", + "dflt": 30, + "editType": "calc", + "min": 0, + "valType": "number" + }, + "thicknessmode": { + "description": "Determines whether this color bar's thickness (i.e. the measure in the constant color direction) is set in units of plot *fraction* or in *pixels*. Use `thickness` to set the value.", + "dflt": "pixels", + "editType": "calc", + "valType": "enumerated", + "values": [ + "fraction", + "pixels" + ] + }, + "tick0": { + "description": "Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is *log*, then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", + "editType": "calc", + "impliedEdits": { + "tickmode": "linear" + }, + "valType": "any" + }, + "tickangle": { + "description": "Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.", + "dflt": "auto", + "editType": "calc", + "valType": "angle" + }, + "tickcolor": { + "description": "Sets the tick color.", + "dflt": "#444", + "editType": "calc", + "valType": "color" + }, + "tickfont": { + "color": { + "editType": "calc", + "valType": "color" + }, + "description": "Sets the color bar's tick label font", + "editType": "calc", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.", + "editType": "calc", + "noBlank": true, + "strict": true, + "valType": "string" + }, + "lineposition": { + "description": "Sets the kind of decoration line(s) with text, such as an *under*, *over* or *through* as well as combinations e.g. *under+over*, etc.", + "dflt": "none", + "editType": "calc", + "extras": [ + "none" + ], + "flags": [ + "under", + "over", + "through" + ], + "valType": "flaglist" + }, + "role": "object", + "shadow": { + "description": "Sets the shape and color of the shadow behind text. *auto* places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.", + "dflt": "none", + "editType": "calc", + "valType": "string" + }, + "size": { + "editType": "calc", + "min": 1, + "valType": "number" + }, + "style": { + "description": "Sets whether a font should be styled with a normal or italic face from its family.", + "dflt": "normal", + "editType": "calc", + "valType": "enumerated", + "values": [ + "normal", + "italic" + ] + }, + "textcase": { + "description": "Sets capitalization of text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized.", + "dflt": "normal", + "editType": "calc", + "valType": "enumerated", + "values": [ + "normal", + "word caps", + "upper", + "lower" + ] + }, + "variant": { + "description": "Sets the variant of the font.", + "dflt": "normal", + "editType": "calc", + "valType": "enumerated", + "values": [ + "normal", + "small-caps", + "all-small-caps", + "all-petite-caps", + "petite-caps", + "unicase" + ] + }, + "weight": { + "description": "Sets the weight (or boldness) of the font.", + "dflt": "normal", + "editType": "calc", + "extras": [ + "normal", + "bold" + ], + "max": 1000, + "min": 1, + "valType": "integer" + } + }, + "tickformat": { + "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: *%h* for half of the year as a decimal number as well as *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", + "dflt": "", + "editType": "calc", + "valType": "string" + }, + "tickformatstops": { + "items": { + "tickformatstop": { + "dtickrange": { + "description": "range [*min*, *max*], where *min*, *max* - dtick values which describe some zoom level, it is possible to omit *min* or *max* value by passing *null*", + "editType": "calc", + "items": [ + { + "editType": "calc", + "valType": "any" + }, + { + "editType": "calc", + "valType": "any" + } + ], + "valType": "info_array" + }, + "editType": "calc", + "enabled": { + "description": "Determines whether or not this stop is used. If `false`, this stop is ignored even within its `dtickrange`.", + "dflt": true, + "editType": "calc", + "valType": "boolean" + }, + "name": { + "description": "When used in a template, named items are created in the output figure in addition to any items the figure already has in this array. You can modify these items in the output figure by making your own item with `templateitemname` matching this `name` alongside your modifications (including `visible: false` or `enabled: false` to hide it). Has no effect outside of a template.", + "editType": "calc", + "valType": "string" + }, + "role": "object", + "templateitemname": { + "description": "Used to refer to a named item in this array in the template. Named items from the template will be created even without a matching item in the input figure, but you can modify one by making an item with `templateitemname` matching its `name`, alongside your modifications (including `visible: false` or `enabled: false` to hide it). If there is no template or no matching item, this item will be hidden unless you explicitly show it with `visible: true`.", + "editType": "calc", + "valType": "string" + }, + "value": { + "description": "string - dtickformat for described zoom level, the same as *tickformat*", + "dflt": "", + "editType": "calc", + "valType": "string" + } + } + }, + "role": "object" + }, + "ticklabeloverflow": { + "description": "Determines how we handle tick labels that would overflow either the graph div or the domain of the axis. The default value for inside tick labels is *hide past domain*. In other cases the default is *hide past div*.", + "editType": "calc", + "valType": "enumerated", + "values": [ + "allow", + "hide past div", + "hide past domain" + ] + }, + "ticklabelposition": { + "description": "Determines where tick labels are drawn relative to the ticks. Left and right options are used when `orientation` is *h*, top and bottom when `orientation` is *v*.", + "dflt": "outside", + "editType": "calc", + "valType": "enumerated", + "values": [ + "outside", + "inside", + "outside top", + "inside top", + "outside left", + "inside left", + "outside right", + "inside right", + "outside bottom", + "inside bottom" + ] + }, + "ticklabelstep": { + "description": "Sets the spacing between tick labels as compared to the spacing between ticks. A value of 1 (default) means each tick gets a label. A value of 2 means shows every 2nd label. A larger value n means only every nth tick is labeled. `tick0` determines which labels are shown. Not implemented for axes with `type` *log* or *multicategory*, or when `tickmode` is *array*.", + "dflt": 1, + "editType": "calc", + "min": 1, + "valType": "integer" + }, + "ticklen": { + "description": "Sets the tick length (in px).", + "dflt": 5, + "editType": "calc", + "min": 0, + "valType": "number" + }, + "tickmode": { + "description": "Sets the tick mode for this axis. If *auto*, the number of ticks is set via `nticks`. If *linear*, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` (*linear* is the default value if `tick0` and `dtick` are provided). If *array*, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. (*array* is the default value if `tickvals` is provided).", + "editType": "calc", + "impliedEdits": {}, + "valType": "enumerated", + "values": [ + "auto", + "linear", + "array" + ] + }, + "tickprefix": { + "description": "Sets a tick label prefix.", + "dflt": "", + "editType": "calc", + "valType": "string" + }, + "ticks": { + "description": "Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If *outside* (*inside*), this axis' are drawn outside (inside) the axis lines.", + "dflt": "", + "editType": "calc", + "valType": "enumerated", + "values": [ + "outside", + "inside", + "" + ] + }, + "ticksuffix": { + "description": "Sets a tick label suffix.", + "dflt": "", + "editType": "calc", + "valType": "string" + }, + "ticktext": { + "description": "Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to *array*. Used with `tickvals`.", + "editType": "calc", + "valType": "data_array" + }, + "tickvals": { + "description": "Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "editType": "calc", + "valType": "data_array" + }, + "tickwidth": { + "description": "Sets the tick width (in px).", + "dflt": 1, + "editType": "calc", + "min": 0, + "valType": "number" + }, + "title": { + "editType": "calc", + "font": { + "color": { + "editType": "calc", + "valType": "color" + }, + "description": "Sets this color bar's title font.", + "editType": "calc", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.", + "editType": "calc", + "noBlank": true, + "strict": true, + "valType": "string" + }, + "lineposition": { + "description": "Sets the kind of decoration line(s) with text, such as an *under*, *over* or *through* as well as combinations e.g. *under+over*, etc.", + "dflt": "none", + "editType": "calc", + "extras": [ + "none" + ], + "flags": [ + "under", + "over", + "through" + ], + "valType": "flaglist" + }, + "role": "object", + "shadow": { + "description": "Sets the shape and color of the shadow behind text. *auto* places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.", + "dflt": "none", + "editType": "calc", + "valType": "string" + }, + "size": { + "editType": "calc", + "min": 1, + "valType": "number" + }, + "style": { + "description": "Sets whether a font should be styled with a normal or italic face from its family.", + "dflt": "normal", + "editType": "calc", + "valType": "enumerated", + "values": [ + "normal", + "italic" + ] + }, + "textcase": { + "description": "Sets capitalization of text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized.", + "dflt": "normal", + "editType": "calc", + "valType": "enumerated", + "values": [ + "normal", + "word caps", + "upper", + "lower" + ] + }, + "variant": { + "description": "Sets the variant of the font.", + "dflt": "normal", + "editType": "calc", + "valType": "enumerated", + "values": [ + "normal", + "small-caps", + "all-small-caps", + "all-petite-caps", + "petite-caps", + "unicase" + ] + }, + "weight": { + "description": "Sets the weight (or boldness) of the font.", + "dflt": "normal", + "editType": "calc", + "extras": [ + "normal", + "bold" + ], + "max": 1000, + "min": 1, + "valType": "integer" + } + }, + "role": "object", + "side": { + "description": "Determines the location of color bar's title with respect to the color bar. Defaults to *top* when `orientation` is *v* and defaults to *right* when `orientation` is *h*.", + "editType": "calc", + "valType": "enumerated", + "values": [ + "right", + "top", + "bottom" + ] + }, + "text": { + "description": "Sets the title of the color bar.", + "editType": "calc", + "valType": "string" + } + }, + "x": { + "description": "Sets the x position with respect to `xref` of the color bar (in plot fraction). When `xref` is *paper*, defaults to 1.02 when `orientation` is *v* and 0.5 when `orientation` is *h*. When `xref` is *container*, defaults to *1* when `orientation` is *v* and 0.5 when `orientation` is *h*. Must be between *0* and *1* if `xref` is *container* and between *-2* and *3* if `xref` is *paper*.", + "editType": "calc", + "valType": "number" + }, + "xanchor": { + "description": "Sets this color bar's horizontal position anchor. This anchor binds the `x` position to the *left*, *center* or *right* of the color bar. Defaults to *left* when `orientation` is *v* and *center* when `orientation` is *h*.", + "editType": "calc", + "valType": "enumerated", + "values": [ + "left", + "center", + "right" + ] + }, + "xpad": { + "description": "Sets the amount of padding (in px) along the x direction.", + "dflt": 10, + "editType": "calc", + "min": 0, + "valType": "number" + }, + "xref": { + "description": "Sets the container `x` refers to. *container* spans the entire `width` of the plot. *paper* refers to the width of the plotting area only.", + "dflt": "paper", + "editType": "calc", + "valType": "enumerated", + "values": [ + "container", + "paper" + ] + }, + "y": { + "description": "Sets the y position with respect to `yref` of the color bar (in plot fraction). When `yref` is *paper*, defaults to 0.5 when `orientation` is *v* and 1.02 when `orientation` is *h*. When `yref` is *container*, defaults to 0.5 when `orientation` is *v* and 1 when `orientation` is *h*. Must be between *0* and *1* if `yref` is *container* and between *-2* and *3* if `yref` is *paper*.", + "editType": "calc", + "valType": "number" + }, + "yanchor": { + "description": "Sets this color bar's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the color bar. Defaults to *middle* when `orientation` is *v* and *bottom* when `orientation` is *h*.", + "editType": "calc", + "valType": "enumerated", + "values": [ + "top", + "middle", + "bottom" + ] + }, + "ypad": { + "description": "Sets the amount of padding (in px) along the y direction.", + "dflt": 10, + "editType": "calc", + "min": 0, + "valType": "number" + }, + "yref": { + "description": "Sets the container `y` refers to. *container* spans the entire `height` of the plot. *paper* refers to the height of the plotting area only.", + "dflt": "paper", + "editType": "calc", + "valType": "enumerated", + "values": [ + "container", + "paper" + ] + } + }, + "colorscale": { + "description": "Sets the colorscale. Has an effect only if in `marker.color` is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsla, hwb, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use `marker.cmin` and `marker.cmax`. Alternatively, `colorscale` may be a palette name string of the following list: Blackbody,Bluered,Blues,Cividis,Earth,Electric,Greens,Greys,Hot,Jet,Picnic,Portland,Rainbow,RdBu,Reds,Viridis,YlGnBu,YlOrRd.", + "dflt": null, + "editType": "calc", + "impliedEdits": { + "autocolorscale": false + }, + "valType": "colorscale" + }, + "editType": "calc", + "line": { + "autocolorscale": { + "description": "Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.line.colorscale`. Has an effect only if in `marker.line.color` is set to a numerical array. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", + "dflt": true, + "editType": "calc", + "impliedEdits": {}, + "valType": "boolean" + }, + "cauto": { + "description": "Determines whether or not the color domain is computed with respect to the input data (here in `marker.line.color`) or the bounds set in `marker.line.cmin` and `marker.line.cmax` Has an effect only if in `marker.line.color` is set to a numerical array. Defaults to `false` when `marker.line.cmin` and `marker.line.cmax` are set by the user.", + "dflt": true, + "editType": "calc", + "impliedEdits": {}, + "valType": "boolean" + }, + "cmax": { + "description": "Sets the upper bound of the color domain. Has an effect only if in `marker.line.color` is set to a numerical array. Value should have the same units as in `marker.line.color` and if set, `marker.line.cmin` must be set as well.", + "dflt": null, + "editType": "calc", + "impliedEdits": { + "cauto": false + }, + "valType": "number" + }, + "cmid": { + "description": "Sets the mid-point of the color domain by scaling `marker.line.cmin` and/or `marker.line.cmax` to be equidistant to this point. Has an effect only if in `marker.line.color` is set to a numerical array. Value should have the same units as in `marker.line.color`. Has no effect when `marker.line.cauto` is `false`.", + "dflt": null, + "editType": "calc", + "impliedEdits": {}, + "valType": "number" + }, + "cmin": { + "description": "Sets the lower bound of the color domain. Has an effect only if in `marker.line.color` is set to a numerical array. Value should have the same units as in `marker.line.color` and if set, `marker.line.cmax` must be set as well.", + "dflt": null, + "editType": "calc", + "impliedEdits": { + "cauto": false + }, + "valType": "number" + }, + "color": { + "arrayOk": true, + "description": "Sets the marker.line color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.line.cmin` and `marker.line.cmax` if set.", + "editType": "calc", + "valType": "color" + }, + "coloraxis": { + "description": "Sets a reference to a shared color axis. References to these shared color axes are *coloraxis*, *coloraxis2*, *coloraxis3*, etc. Settings for these shared color axes are set in the layout, under `layout.coloraxis`, `layout.coloraxis2`, etc. Note that multiple color scales can be linked to the same color axis.", + "dflt": null, + "editType": "calc", + "regex": "/^coloraxis([2-9]|[1-9][0-9]+)?$/", + "valType": "subplotid" + }, + "colorscale": { + "description": "Sets the colorscale. Has an effect only if in `marker.line.color` is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsla, hwb, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use `marker.line.cmin` and `marker.line.cmax`. Alternatively, `colorscale` may be a palette name string of the following list: Blackbody,Bluered,Blues,Cividis,Earth,Electric,Greens,Greys,Hot,Jet,Picnic,Portland,Rainbow,RdBu,Reds,Viridis,YlGnBu,YlOrRd.", + "dflt": null, + "editType": "calc", + "impliedEdits": { + "autocolorscale": false + }, + "valType": "colorscale" + }, + "editType": "calc", + "reversescale": { + "description": "Reverses the color mapping if true. Has an effect only if in `marker.line.color` is set to a numerical array. If true, `marker.line.cmin` will correspond to the last color in the array and `marker.line.cmax` will correspond to the first color.", + "dflt": false, + "editType": "calc", + "valType": "boolean" + }, + "role": "object", + "width": { + "arrayOk": true, + "description": "Sets the width (in px) of the lines bounding the marker points.", + "editType": "calc", + "min": 0, + "valType": "number" + } + }, + "opacity": { + "arrayOk": true, + "description": "Sets the marker opacity.", + "editType": "calc", + "max": 1, + "min": 0, + "valType": "number" + }, + "reversescale": { + "description": "Reverses the color mapping if true. Has an effect only if in `marker.color` is set to a numerical array. If true, `marker.cmin` will correspond to the last color in the array and `marker.cmax` will correspond to the first color.", + "dflt": false, + "editType": "calc", + "valType": "boolean" + }, + "role": "object", + "showscale": { + "description": "Determines whether or not a colorbar is displayed for this trace. Has an effect only if in `marker.color` is set to a numerical array.", + "dflt": false, + "editType": "calc", + "valType": "boolean" + }, + "size": { + "arrayOk": true, + "description": "Sets the marker size (in px).", + "dflt": 6, + "editType": "calc", + "min": 0, + "valType": "number" + }, + "sizemin": { + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the minimum size (in px) of the rendered marker points.", + "dflt": 0, + "editType": "calc", + "min": 0, + "valType": "number" + }, + "sizemode": { + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the rule for which the data in `size` is converted to pixels.", + "dflt": "diameter", + "editType": "calc", + "valType": "enumerated", + "values": [ + "diameter", + "area" + ] + }, + "sizeref": { + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the scale factor used to determine the rendered size of marker points. Use with `sizemin` and `sizemode`.", + "dflt": 1, + "editType": "calc", + "valType": "number" + }, + "symbol": { + "arrayOk": true, + "description": "Sets the marker symbol type. Adding 100 is equivalent to appending *-open* to a symbol name. Adding 200 is equivalent to appending *-dot* to a symbol name. Adding 300 is equivalent to appending *-open-dot* or *dot-open* to a symbol name.", + "dflt": "circle", + "editType": "calc", + "valType": "enumerated", + "values": [ + 0, + "0", + "circle", + 100, + "100", + "circle-open", + 200, + "200", + "circle-dot", + 300, + "300", + "circle-open-dot", + 1, + "1", + "square", + 101, + "101", + "square-open", + 201, + "201", + "square-dot", + 301, + "301", + "square-open-dot", + 2, + "2", + "diamond", + 102, + "102", + "diamond-open", + 202, + "202", + "diamond-dot", + 302, + "302", + "diamond-open-dot", + 3, + "3", + "cross", + 103, + "103", + "cross-open", + 203, + "203", + "cross-dot", + 303, + "303", + "cross-open-dot", + 4, + "4", + "x", + 104, + "104", + "x-open", + 204, + "204", + "x-dot", + 304, + "304", + "x-open-dot", + 5, + "5", + "triangle-up", + 105, + "105", + "triangle-up-open", + 205, + "205", + "triangle-up-dot", + 305, + "305", + "triangle-up-open-dot", + 6, + "6", + "triangle-down", + 106, + "106", + "triangle-down-open", + 206, + "206", + "triangle-down-dot", + 306, + "306", + "triangle-down-open-dot", + 7, + "7", + "triangle-left", + 107, + "107", + "triangle-left-open", + 207, + "207", + "triangle-left-dot", + 307, + "307", + "triangle-left-open-dot", + 8, + "8", + "triangle-right", + 108, + "108", + "triangle-right-open", + 208, + "208", + "triangle-right-dot", + 308, + "308", + "triangle-right-open-dot", + 9, + "9", + "triangle-ne", + 109, + "109", + "triangle-ne-open", + 209, + "209", + "triangle-ne-dot", + 309, + "309", + "triangle-ne-open-dot", + 10, + "10", + "triangle-se", + 110, + "110", + "triangle-se-open", + 210, + "210", + "triangle-se-dot", + 310, + "310", + "triangle-se-open-dot", + 11, + "11", + "triangle-sw", + 111, + "111", + "triangle-sw-open", + 211, + "211", + "triangle-sw-dot", + 311, + "311", + "triangle-sw-open-dot", + 12, + "12", + "triangle-nw", + 112, + "112", + "triangle-nw-open", + 212, + "212", + "triangle-nw-dot", + 312, + "312", + "triangle-nw-open-dot", + 13, + "13", + "pentagon", + 113, + "113", + "pentagon-open", + 213, + "213", + "pentagon-dot", + 313, + "313", + "pentagon-open-dot", + 14, + "14", + "hexagon", + 114, + "114", + "hexagon-open", + 214, + "214", + "hexagon-dot", + 314, + "314", + "hexagon-open-dot", + 15, + "15", + "hexagon2", + 115, + "115", + "hexagon2-open", + 215, + "215", + "hexagon2-dot", + 315, + "315", + "hexagon2-open-dot", + 16, + "16", + "octagon", + 116, + "116", + "octagon-open", + 216, + "216", + "octagon-dot", + 316, + "316", + "octagon-open-dot", + 17, + "17", + "star", + 117, + "117", + "star-open", + 217, + "217", + "star-dot", + 317, + "317", + "star-open-dot", + 18, + "18", + "hexagram", + 118, + "118", + "hexagram-open", + 218, + "218", + "hexagram-dot", + 318, + "318", + "hexagram-open-dot", + 19, + "19", + "star-triangle-up", + 119, + "119", + "star-triangle-up-open", + 219, + "219", + "star-triangle-up-dot", + 319, + "319", + "star-triangle-up-open-dot", + 20, + "20", + "star-triangle-down", + 120, + "120", + "star-triangle-down-open", + 220, + "220", + "star-triangle-down-dot", + 320, + "320", + "star-triangle-down-open-dot", + 21, + "21", + "star-square", + 121, + "121", + "star-square-open", + 221, + "221", + "star-square-dot", + 321, + "321", + "star-square-open-dot", + 22, + "22", + "star-diamond", + 122, + "122", + "star-diamond-open", + 222, + "222", + "star-diamond-dot", + 322, + "322", + "star-diamond-open-dot", + 23, + "23", + "diamond-tall", + 123, + "123", + "diamond-tall-open", + 223, + "223", + "diamond-tall-dot", + 323, + "323", + "diamond-tall-open-dot", + 24, + "24", + "diamond-wide", + 124, + "124", + "diamond-wide-open", + 224, + "224", + "diamond-wide-dot", + 324, + "324", + "diamond-wide-open-dot", + 25, + "25", + "hourglass", + 125, + "125", + "hourglass-open", + 26, + "26", + "bowtie", + 126, + "126", + "bowtie-open", + 27, + "27", + "circle-cross", + 127, + "127", + "circle-cross-open", + 28, + "28", + "circle-x", + 128, + "128", + "circle-x-open", + 29, + "29", + "square-cross", + 129, + "129", + "square-cross-open", + 30, + "30", + "square-x", + 130, + "130", + "square-x-open", + 31, + "31", + "diamond-cross", + 131, + "131", + "diamond-cross-open", + 32, + "32", + "diamond-x", + 132, + "132", + "diamond-x-open", + 33, + "33", + "cross-thin", + 133, + "133", + "cross-thin-open", + 34, + "34", + "x-thin", + 134, + "134", + "x-thin-open", + 35, + "35", + "asterisk", + 135, + "135", + "asterisk-open", + 36, + "36", + "hash", + 136, + "136", + "hash-open", + 236, + "236", + "hash-dot", + 336, + "336", + "hash-open-dot", + 37, + "37", + "y-up", + 137, + "137", + "y-up-open", + 38, + "38", + "y-down", + 138, + "138", + "y-down-open", + 39, + "39", + "y-left", + 139, + "139", + "y-left-open", + 40, + "40", + "y-right", + 140, + "140", + "y-right-open", + 41, + "41", + "line-ew", + 141, + "141", + "line-ew-open", + 42, + "42", + "line-ns", + 142, + "142", + "line-ns-open", + 43, + "43", + "line-ne", + 143, + "143", + "line-ne-open", + 44, + "44", + "line-nw", + 144, + "144", + "line-nw-open", + 45, + "45", + "arrow-up", + 145, + "145", + "arrow-up-open", + 46, + "46", + "arrow-down", + 146, + "146", + "arrow-down-open", + 47, + "47", + "arrow-left", + 147, + "147", + "arrow-left-open", + 48, + "48", + "arrow-right", + 148, + "148", + "arrow-right-open", + 49, + "49", + "arrow-bar-up", + 149, + "149", + "arrow-bar-up-open", + 50, + "50", + "arrow-bar-down", + 150, + "150", + "arrow-bar-down-open", + 51, + "51", + "arrow-bar-left", + 151, + "151", + "arrow-bar-left-open", + 52, + "52", + "arrow-bar-right", + 152, + "152", + "arrow-bar-right-open", + 53, + "53", + "arrow", + 153, + "153", + "arrow-open", + 54, + "54", + "arrow-wide", + 154, + "154", + "arrow-wide-open" + ] + } + }, + "meta": { + "arrayOk": true, + "description": "Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index.", + "editType": "plot", + "valType": "any" + }, + "mode": { + "description": "Determines the drawing mode for this scatter trace. If the provided `mode` includes *text* then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover. If there are less than 20 points and the trace is not stacked then the default is *lines+markers*. Otherwise, *lines*.", + "dflt": "markers", + "editType": "calc", + "extras": [ + "none" + ], + "flags": [ + "lines", + "markers", + "text" + ], + "valType": "flaglist" + }, + "name": { + "description": "Sets the trace name. The trace name appears as the legend item and on hover.", + "editType": "style", + "valType": "string" + }, + "opacity": { + "description": "Sets the opacity of the trace.", + "dflt": 1, + "editType": "style", + "max": 1, + "min": 0, + "valType": "number" + }, + "selected": { + "editType": "calc", + "marker": { + "color": { + "description": "Sets the marker color of selected points.", + "editType": "calc", + "valType": "color" + }, + "editType": "calc", + "opacity": { + "description": "Sets the marker opacity of selected points.", + "editType": "calc", + "max": 1, + "min": 0, + "valType": "number" + }, + "role": "object", + "size": { + "description": "Sets the marker size of selected points.", + "editType": "calc", + "min": 0, + "valType": "number" + } + }, + "role": "object", + "textfont": { + "color": { + "description": "Sets the text font color of selected points.", + "editType": "calc", + "valType": "color" + }, + "editType": "calc", + "role": "object" + } + }, + "selectedpoints": { + "description": "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect.", + "editType": "calc", + "valType": "any" + }, + "showlegend": { + "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", + "dflt": true, + "editType": "style", + "valType": "boolean" + }, + "subplot": { + "description": "Sets a reference between this trace's data coordinates and a ternary subplot. If *ternary* (the default value), the data refer to `layout.ternary`. If *ternary2*, the data refer to `layout.ternary2`, and so on.", + "dflt": "ternary", + "editType": "calc", + "valType": "subplotid" + }, + "sum": { + "description": "The number each triplet should sum to, if only two of `a`, `b`, and `c` are provided. This overrides `ternary.sum` to normalize this specific trace, but does not affect the values displayed on the axes. 0 (or missing) means to use ternary.sum", + "dflt": 0, + "editType": "calc", + "min": 0, + "valType": "number" + }, + "text": { + "arrayOk": true, + "description": "Sets text elements associated with each (a,b,c) point. If a single string, the same string appears over all the data points. If an array of strings, the items are mapped in order to the data points in (a,b,c). If trace `hoverinfo` contains a *text* flag and *hovertext* is not set, these elements will be seen in the hover labels.", + "dflt": "", + "editType": "calc", + "valType": "string" + }, + "textfont": { + "color": { + "arrayOk": true, + "editType": "calc", + "valType": "color" + }, + "description": "Sets the text font.", + "editType": "calc", + "family": { + "arrayOk": true, + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.", + "editType": "calc", + "noBlank": true, + "strict": true, + "valType": "string" + }, + "role": "object", + "size": { + "arrayOk": true, + "editType": "calc", + "min": 1, + "valType": "number" + }, + "style": { + "arrayOk": true, + "description": "Sets whether a font should be styled with a normal or italic face from its family.", + "dflt": "normal", + "editType": "calc", + "valType": "enumerated", + "values": [ + "normal", + "italic" + ] + }, + "variant": { + "arrayOk": true, + "description": "Sets the variant of the font.", + "dflt": "normal", + "editType": "calc", + "valType": "enumerated", + "values": [ + "normal", + "small-caps" + ] + }, + "weight": { + "arrayOk": true, + "description": "Sets the weight (or boldness) of the font.", + "dflt": "normal", + "editType": "calc", + "valType": "enumerated", + "values": [ + "normal", + "bold" + ] + } + }, + "textposition": { + "arrayOk": true, + "description": "Sets the positions of the `text` elements with respects to the (x,y) coordinates.", + "dflt": "middle center", + "editType": "calc", + "valType": "enumerated", + "values": [ + "top left", + "top center", + "top right", + "middle left", + "middle center", + "middle right", + "bottom left", + "bottom center", + "bottom right" + ] + }, + "texttemplate": { + "arrayOk": true, + "description": "Template string used for rendering the information text that appears on points. Note that this will override `textinfo`. Variables are inserted using %{variable}, for example \"y: %{y}\". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. Variables that can't be found will be replaced with the specifier. For example, a template of \"data: %{x}, %{y}\" will result in a value of \"data: 1, %{y}\" if x is 1 and y is missing. Variables with an undefined value will be replaced with the fallback value. All attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. Finally, the template string has access to variables `a`, `b`, `c` and `text`.", + "dflt": "", + "editType": "plot", + "valType": "string" + }, + "texttemplatefallback": { + "description": "Fallback string that's displayed when a variable referenced in a template is missing. If the boolean value 'false' is passed in, the specifier with the missing variable will be displayed.", + "dflt": "-", + "editType": "plot", + "valType": "any" + }, + "type": "scatterternarygl", + "uid": { + "description": "Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.", + "editType": "plot", + "valType": "string" + }, + "uirevision": { + "description": "Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves.", + "editType": "none", + "valType": "any" + }, + "unselected": { + "editType": "calc", + "marker": { + "color": { + "description": "Sets the marker color of unselected points, applied only when a selection exists.", + "editType": "calc", + "valType": "color" + }, + "editType": "calc", + "opacity": { + "description": "Sets the marker opacity of unselected points, applied only when a selection exists.", + "editType": "calc", + "max": 1, + "min": 0, + "valType": "number" + }, + "role": "object", + "size": { + "description": "Sets the marker size of unselected points, applied only when a selection exists.", + "editType": "calc", + "min": 0, + "valType": "number" + } + }, + "role": "object", + "textfont": { + "color": { + "description": "Sets the text font color of unselected points, applied only when a selection exists.", + "editType": "calc", + "valType": "color" + }, + "editType": "calc", + "role": "object" + } + }, + "visible": { + "description": "Determines whether or not this trace is visible. If *legendonly*, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).", + "dflt": true, + "editType": "calc", + "valType": "enumerated", + "values": [ + true, + false, + "legendonly" + ] + } + }, + "categories": [ + "gl", + "regl", + "ternary", + "symbols", + "showLegend", + "scatter-like" + ], + "meta": { + "description": "Provides similar functionality to the *scatter* type but on a ternary phase diagram using the WebGL plotting engine. The data is provided by at least two arrays out of `a`, `b`, `c` triplets.", + "hrName": "scatter_ternary_gl" + }, + "type": "scatterternarygl" + }, "splom": { "animatable": false, "attributes": {