export declare const heatmapVertexShaderSource = "\n precision mediump float;\n \n attribute vec2 a_position;\n attribute vec2 a_center;\n attribute vec4 a_color;\n attribute float a_saturation;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n\n uniform vec2 u_dimensions;\n uniform vec2 u_resolution;\n // https://tsev.dev/posts/2020-06-19-colour-correction-with-webgl/\n vec3 adjust_saturation(vec3 color, float value) {\n // https://www.w3.org/TR/WCAG22/#dfn-relative-luminance\n const vec3 luminosityFactor = vec3(0.2126, 0.7152, 0.0722);\n vec3 grayscale = vec3(dot(color, luminosityFactor));\n\n return mix(grayscale, color, 1.0 + value);\n }\n\n void main() {\n // Convert from pixels to clip space (-1 to 1)\n vec2 position = a_center + a_position * u_dimensions / 2.0;\n vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0;\n gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n\n v_color = vec4(adjust_saturation(a_color.rgb, a_saturation), 1.0);\n v_pos = a_position * u_dimensions / 2.0;\n }\n "; export declare const heatmapFragmentShaderSourceNoBorderRadius = "\n precision mediump float;\n\n varying vec4 v_color;\n\n void main() {\n gl_FragColor = v_color;\n }\n "; export declare const heatmapFragmentShaderSourceWithBorderRadius = "\n precision mediump float;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n\n uniform vec2 u_dimensions;\n uniform float u_borderRadius;\n\n \n float roundedBoxSDF(vec2 pos, vec2 halfSize, vec4 r) {\n float radius;\n if (pos.x < 0.0) {\n radius = pos.y < 0.0 ? r.x : r.w;\n } else {\n radius = pos.y < 0.0 ? r.y : r.z;\n }\n\n vec2 q = abs(pos) - halfSize + radius;\n return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;\n }\n \n\n void main() {\n // Calculate distance from rounded rectangle edge\n float dist = roundedBoxSDF(v_pos, u_dimensions / 2.0, vec4(u_borderRadius));\n\n // Create smooth alpha based on distance\n float alpha = 1.0 - smoothstep(-0.5, 0.5, dist);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * alpha);\n }\n ";