sigma
Version:
A JavaScript library dedicated to graph drawing.
1 lines • 1.06 kB
JavaScript
(()=>{"use strict";var o={d:(n,t)=>{for(var e in t)o.o(t,e)&&!o.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:t[e]})},o:(o,n)=>Object.prototype.hasOwnProperty.call(o,n),r:o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})}},n={};o.r(n),o.d(n,{default:()=>t});const t="attribute vec2 a_position;\n// attribute float a_thickness;\nattribute vec4 a_color;\nattribute vec2 a_coord;\n\nuniform vec2 u_resolution;\nuniform float u_ratio;\nuniform mat3 u_matrix;\nuniform float u_scale;\n\nvarying vec4 v_color;\nvarying vec2 v_coord;\nvarying float v_dist;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n\n // Scale from [[-1 1] [-1 1]] to the container:\n vec2 position = (u_matrix * vec3(a_position, 1)).xy;\n\n // Applying\n gl_Position = vec4(position, 0, 1);\n\n v_coord = a_coord;\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n\n v_dist = length(position) / u_resolution.x;\n}\n";module.exports=n})();