@sigma/edge-curve
Advanced tools
Comparing version 3.0.0-beta.4 to 3.0.0-beta.5
@@ -344,3 +344,3 @@ 'use strict'; | ||
// language=GLSL | ||
var VERTEX_SHADER_SOURCE = /*glsl*/"\nattribute vec4 a_id;\nattribute vec4 a_color;\nattribute float a_direction;\nattribute float a_thickness;\nattribute vec2 a_source;\nattribute vec2 a_target;\nattribute float a_current;\nattribute float a_curvature;\n\nuniform mat3 u_matrix;\nuniform float u_sizeRatio;\nuniform float u_pixelRatio;\nuniform vec2 u_dimensions;\n\nvarying vec4 v_color;\nvarying float v_thickness;\nvarying vec2 v_cpA;\nvarying vec2 v_cpB;\nvarying vec2 v_cpC;\n\nconst float bias = 255.0 / 254.0;\nconst float epsilon = 0.7;\nconst float minThickness = 0.3;\n\nvec2 clipspaceToViewport(vec2 pos, vec2 dimensions) {\n return vec2(\n (pos.x + 1.0) * dimensions.x / 2.0,\n (pos.y + 1.0) * dimensions.y / 2.0\n );\n}\n\nvec2 viewportToClipspace(vec2 pos, vec2 dimensions) {\n return vec2(\n pos.x / dimensions.x * 2.0 - 1.0,\n pos.y / dimensions.y * 2.0 - 1.0\n );\n}\n\nvoid main() {\n // Selecting the correct position\n // Branchless \"position = a_source if a_current == 1.0 else a_target\"\n vec2 position = a_source * max(0.0, a_current) + a_target * max(0.0, 1.0 - a_current);\n position = (u_matrix * vec3(position, 1)).xy;\n\n vec2 source = (u_matrix * vec3(a_source, 1)).xy;\n vec2 target = (u_matrix * vec3(a_target, 1)).xy;\n\n vec2 viewportPosition = clipspaceToViewport(position, u_dimensions);\n vec2 viewportSource = clipspaceToViewport(source, u_dimensions);\n vec2 viewportTarget = clipspaceToViewport(target, u_dimensions);\n\n vec2 delta = viewportTarget.xy - viewportSource.xy;\n float len = length(delta);\n vec2 normal = vec2(-delta.y, delta.x) * a_direction;\n vec2 unitNormal = normal / len;\n float boundingBoxThickness = len * a_curvature;\n float curveThickness = max(minThickness, a_thickness / 2.0 / u_sizeRatio * u_pixelRatio);\n\n v_thickness = curveThickness;\n\n v_cpA = viewportSource;\n v_cpB = 0.5 * (viewportSource + viewportTarget) + unitNormal * a_direction * boundingBoxThickness;\n v_cpC = viewportTarget;\n\n vec2 viewportOffsetPosition = (\n viewportPosition +\n unitNormal * (boundingBoxThickness / 2.0 + curveThickness + epsilon) *\n max(0.0, a_direction) // NOTE: cutting the bounding box in half to avoid overdraw\n );\n\n position = viewportToClipspace(viewportOffsetPosition, u_dimensions);\n gl_Position = vec4(position, 0, 1);\n\n #ifdef PICKING_MODE\n // For picking mode, we use the ID as the color:\n v_color = a_id;\n #else\n // For normal mode, we use the color:\n v_color = a_color;\n #endif\n \n v_color.a *= bias;\n}\n"; | ||
var VERTEX_SHADER_SOURCE = /*glsl*/"\nattribute vec4 a_id;\nattribute vec4 a_color;\nattribute float a_direction;\nattribute float a_thickness;\nattribute vec2 a_source;\nattribute vec2 a_target;\nattribute float a_current;\nattribute float a_curvature;\n\nuniform mat3 u_matrix;\nuniform float u_sizeRatio;\nuniform float u_pixelRatio;\nuniform vec2 u_dimensions;\n\nvarying vec4 v_color;\nvarying float v_thickness;\nvarying vec2 v_cpA;\nvarying vec2 v_cpB;\nvarying vec2 v_cpC;\n\nconst float bias = 255.0 / 254.0;\nconst float epsilon = 0.7;\nconst float minThickness = 0.3;\n\nvec2 clipspaceToViewport(vec2 pos, vec2 dimensions) {\n return vec2(\n (pos.x + 1.0) * dimensions.x / 2.0,\n (pos.y + 1.0) * dimensions.y / 2.0\n );\n}\n\nvec2 viewportToClipspace(vec2 pos, vec2 dimensions) {\n return vec2(\n pos.x / dimensions.x * 2.0 - 1.0,\n pos.y / dimensions.y * 2.0 - 1.0\n );\n}\n\nvoid main() {\n // Selecting the correct position\n // Branchless \"position = a_source if a_current == 1.0 else a_target\"\n vec2 position = a_source * max(0.0, a_current) + a_target * max(0.0, 1.0 - a_current);\n position = (u_matrix * vec3(position, 1)).xy;\n\n vec2 source = (u_matrix * vec3(a_source, 1)).xy;\n vec2 target = (u_matrix * vec3(a_target, 1)).xy;\n\n vec2 viewportPosition = clipspaceToViewport(position, u_dimensions);\n vec2 viewportSource = clipspaceToViewport(source, u_dimensions);\n vec2 viewportTarget = clipspaceToViewport(target, u_dimensions);\n\n vec2 delta = viewportTarget.xy - viewportSource.xy;\n float len = length(delta);\n vec2 normal = vec2(-delta.y, delta.x) * a_direction;\n vec2 unitNormal = normal / len;\n float boundingBoxThickness = len * a_curvature;\n float curveThickness = max(minThickness, a_thickness / 2.0 / u_sizeRatio * u_pixelRatio);\n\n v_thickness = curveThickness;\n\n v_cpA = viewportSource;\n v_cpB = 0.5 * (viewportSource + viewportTarget) + unitNormal * a_direction * boundingBoxThickness;\n v_cpC = viewportTarget;\n\n vec2 viewportOffsetPosition = (\n viewportPosition +\n unitNormal * (boundingBoxThickness / 2.0 + curveThickness + epsilon) *\n max(0.0, a_direction) // NOTE: cutting the bounding box in half to avoid overdraw\n );\n\n position = viewportToClipspace(viewportOffsetPosition, u_dimensions);\n gl_Position = vec4(position, 0, 1);\n\n #ifdef PICKING_MODE\n // For picking mode, we use the ID as the color:\n v_color = a_id;\n #else\n // For normal mode, we use the color:\n v_color = a_color;\n #endif\n\n v_color.a *= bias;\n}\n"; | ||
var VERTEX_SHADER_SOURCE$1 = VERTEX_SHADER_SOURCE; | ||
@@ -347,0 +347,0 @@ |
@@ -344,3 +344,3 @@ 'use strict'; | ||
// language=GLSL | ||
var VERTEX_SHADER_SOURCE = /*glsl*/"\nattribute vec4 a_id;\nattribute vec4 a_color;\nattribute float a_direction;\nattribute float a_thickness;\nattribute vec2 a_source;\nattribute vec2 a_target;\nattribute float a_current;\nattribute float a_curvature;\n\nuniform mat3 u_matrix;\nuniform float u_sizeRatio;\nuniform float u_pixelRatio;\nuniform vec2 u_dimensions;\n\nvarying vec4 v_color;\nvarying float v_thickness;\nvarying vec2 v_cpA;\nvarying vec2 v_cpB;\nvarying vec2 v_cpC;\n\nconst float bias = 255.0 / 254.0;\nconst float epsilon = 0.7;\nconst float minThickness = 0.3;\n\nvec2 clipspaceToViewport(vec2 pos, vec2 dimensions) {\n return vec2(\n (pos.x + 1.0) * dimensions.x / 2.0,\n (pos.y + 1.0) * dimensions.y / 2.0\n );\n}\n\nvec2 viewportToClipspace(vec2 pos, vec2 dimensions) {\n return vec2(\n pos.x / dimensions.x * 2.0 - 1.0,\n pos.y / dimensions.y * 2.0 - 1.0\n );\n}\n\nvoid main() {\n // Selecting the correct position\n // Branchless \"position = a_source if a_current == 1.0 else a_target\"\n vec2 position = a_source * max(0.0, a_current) + a_target * max(0.0, 1.0 - a_current);\n position = (u_matrix * vec3(position, 1)).xy;\n\n vec2 source = (u_matrix * vec3(a_source, 1)).xy;\n vec2 target = (u_matrix * vec3(a_target, 1)).xy;\n\n vec2 viewportPosition = clipspaceToViewport(position, u_dimensions);\n vec2 viewportSource = clipspaceToViewport(source, u_dimensions);\n vec2 viewportTarget = clipspaceToViewport(target, u_dimensions);\n\n vec2 delta = viewportTarget.xy - viewportSource.xy;\n float len = length(delta);\n vec2 normal = vec2(-delta.y, delta.x) * a_direction;\n vec2 unitNormal = normal / len;\n float boundingBoxThickness = len * a_curvature;\n float curveThickness = max(minThickness, a_thickness / 2.0 / u_sizeRatio * u_pixelRatio);\n\n v_thickness = curveThickness;\n\n v_cpA = viewportSource;\n v_cpB = 0.5 * (viewportSource + viewportTarget) + unitNormal * a_direction * boundingBoxThickness;\n v_cpC = viewportTarget;\n\n vec2 viewportOffsetPosition = (\n viewportPosition +\n unitNormal * (boundingBoxThickness / 2.0 + curveThickness + epsilon) *\n max(0.0, a_direction) // NOTE: cutting the bounding box in half to avoid overdraw\n );\n\n position = viewportToClipspace(viewportOffsetPosition, u_dimensions);\n gl_Position = vec4(position, 0, 1);\n\n #ifdef PICKING_MODE\n // For picking mode, we use the ID as the color:\n v_color = a_id;\n #else\n // For normal mode, we use the color:\n v_color = a_color;\n #endif\n \n v_color.a *= bias;\n}\n"; | ||
var VERTEX_SHADER_SOURCE = /*glsl*/"\nattribute vec4 a_id;\nattribute vec4 a_color;\nattribute float a_direction;\nattribute float a_thickness;\nattribute vec2 a_source;\nattribute vec2 a_target;\nattribute float a_current;\nattribute float a_curvature;\n\nuniform mat3 u_matrix;\nuniform float u_sizeRatio;\nuniform float u_pixelRatio;\nuniform vec2 u_dimensions;\n\nvarying vec4 v_color;\nvarying float v_thickness;\nvarying vec2 v_cpA;\nvarying vec2 v_cpB;\nvarying vec2 v_cpC;\n\nconst float bias = 255.0 / 254.0;\nconst float epsilon = 0.7;\nconst float minThickness = 0.3;\n\nvec2 clipspaceToViewport(vec2 pos, vec2 dimensions) {\n return vec2(\n (pos.x + 1.0) * dimensions.x / 2.0,\n (pos.y + 1.0) * dimensions.y / 2.0\n );\n}\n\nvec2 viewportToClipspace(vec2 pos, vec2 dimensions) {\n return vec2(\n pos.x / dimensions.x * 2.0 - 1.0,\n pos.y / dimensions.y * 2.0 - 1.0\n );\n}\n\nvoid main() {\n // Selecting the correct position\n // Branchless \"position = a_source if a_current == 1.0 else a_target\"\n vec2 position = a_source * max(0.0, a_current) + a_target * max(0.0, 1.0 - a_current);\n position = (u_matrix * vec3(position, 1)).xy;\n\n vec2 source = (u_matrix * vec3(a_source, 1)).xy;\n vec2 target = (u_matrix * vec3(a_target, 1)).xy;\n\n vec2 viewportPosition = clipspaceToViewport(position, u_dimensions);\n vec2 viewportSource = clipspaceToViewport(source, u_dimensions);\n vec2 viewportTarget = clipspaceToViewport(target, u_dimensions);\n\n vec2 delta = viewportTarget.xy - viewportSource.xy;\n float len = length(delta);\n vec2 normal = vec2(-delta.y, delta.x) * a_direction;\n vec2 unitNormal = normal / len;\n float boundingBoxThickness = len * a_curvature;\n float curveThickness = max(minThickness, a_thickness / 2.0 / u_sizeRatio * u_pixelRatio);\n\n v_thickness = curveThickness;\n\n v_cpA = viewportSource;\n v_cpB = 0.5 * (viewportSource + viewportTarget) + unitNormal * a_direction * boundingBoxThickness;\n v_cpC = viewportTarget;\n\n vec2 viewportOffsetPosition = (\n viewportPosition +\n unitNormal * (boundingBoxThickness / 2.0 + curveThickness + epsilon) *\n max(0.0, a_direction) // NOTE: cutting the bounding box in half to avoid overdraw\n );\n\n position = viewportToClipspace(viewportOffsetPosition, u_dimensions);\n gl_Position = vec4(position, 0, 1);\n\n #ifdef PICKING_MODE\n // For picking mode, we use the ID as the color:\n v_color = a_id;\n #else\n // For normal mode, we use the color:\n v_color = a_color;\n #endif\n\n v_color.a *= bias;\n}\n"; | ||
var VERTEX_SHADER_SOURCE$1 = VERTEX_SHADER_SOURCE; | ||
@@ -347,0 +347,0 @@ |
@@ -340,3 +340,3 @@ import { EdgeProgram } from 'sigma/rendering'; | ||
// language=GLSL | ||
var VERTEX_SHADER_SOURCE = /*glsl*/"\nattribute vec4 a_id;\nattribute vec4 a_color;\nattribute float a_direction;\nattribute float a_thickness;\nattribute vec2 a_source;\nattribute vec2 a_target;\nattribute float a_current;\nattribute float a_curvature;\n\nuniform mat3 u_matrix;\nuniform float u_sizeRatio;\nuniform float u_pixelRatio;\nuniform vec2 u_dimensions;\n\nvarying vec4 v_color;\nvarying float v_thickness;\nvarying vec2 v_cpA;\nvarying vec2 v_cpB;\nvarying vec2 v_cpC;\n\nconst float bias = 255.0 / 254.0;\nconst float epsilon = 0.7;\nconst float minThickness = 0.3;\n\nvec2 clipspaceToViewport(vec2 pos, vec2 dimensions) {\n return vec2(\n (pos.x + 1.0) * dimensions.x / 2.0,\n (pos.y + 1.0) * dimensions.y / 2.0\n );\n}\n\nvec2 viewportToClipspace(vec2 pos, vec2 dimensions) {\n return vec2(\n pos.x / dimensions.x * 2.0 - 1.0,\n pos.y / dimensions.y * 2.0 - 1.0\n );\n}\n\nvoid main() {\n // Selecting the correct position\n // Branchless \"position = a_source if a_current == 1.0 else a_target\"\n vec2 position = a_source * max(0.0, a_current) + a_target * max(0.0, 1.0 - a_current);\n position = (u_matrix * vec3(position, 1)).xy;\n\n vec2 source = (u_matrix * vec3(a_source, 1)).xy;\n vec2 target = (u_matrix * vec3(a_target, 1)).xy;\n\n vec2 viewportPosition = clipspaceToViewport(position, u_dimensions);\n vec2 viewportSource = clipspaceToViewport(source, u_dimensions);\n vec2 viewportTarget = clipspaceToViewport(target, u_dimensions);\n\n vec2 delta = viewportTarget.xy - viewportSource.xy;\n float len = length(delta);\n vec2 normal = vec2(-delta.y, delta.x) * a_direction;\n vec2 unitNormal = normal / len;\n float boundingBoxThickness = len * a_curvature;\n float curveThickness = max(minThickness, a_thickness / 2.0 / u_sizeRatio * u_pixelRatio);\n\n v_thickness = curveThickness;\n\n v_cpA = viewportSource;\n v_cpB = 0.5 * (viewportSource + viewportTarget) + unitNormal * a_direction * boundingBoxThickness;\n v_cpC = viewportTarget;\n\n vec2 viewportOffsetPosition = (\n viewportPosition +\n unitNormal * (boundingBoxThickness / 2.0 + curveThickness + epsilon) *\n max(0.0, a_direction) // NOTE: cutting the bounding box in half to avoid overdraw\n );\n\n position = viewportToClipspace(viewportOffsetPosition, u_dimensions);\n gl_Position = vec4(position, 0, 1);\n\n #ifdef PICKING_MODE\n // For picking mode, we use the ID as the color:\n v_color = a_id;\n #else\n // For normal mode, we use the color:\n v_color = a_color;\n #endif\n \n v_color.a *= bias;\n}\n"; | ||
var VERTEX_SHADER_SOURCE = /*glsl*/"\nattribute vec4 a_id;\nattribute vec4 a_color;\nattribute float a_direction;\nattribute float a_thickness;\nattribute vec2 a_source;\nattribute vec2 a_target;\nattribute float a_current;\nattribute float a_curvature;\n\nuniform mat3 u_matrix;\nuniform float u_sizeRatio;\nuniform float u_pixelRatio;\nuniform vec2 u_dimensions;\n\nvarying vec4 v_color;\nvarying float v_thickness;\nvarying vec2 v_cpA;\nvarying vec2 v_cpB;\nvarying vec2 v_cpC;\n\nconst float bias = 255.0 / 254.0;\nconst float epsilon = 0.7;\nconst float minThickness = 0.3;\n\nvec2 clipspaceToViewport(vec2 pos, vec2 dimensions) {\n return vec2(\n (pos.x + 1.0) * dimensions.x / 2.0,\n (pos.y + 1.0) * dimensions.y / 2.0\n );\n}\n\nvec2 viewportToClipspace(vec2 pos, vec2 dimensions) {\n return vec2(\n pos.x / dimensions.x * 2.0 - 1.0,\n pos.y / dimensions.y * 2.0 - 1.0\n );\n}\n\nvoid main() {\n // Selecting the correct position\n // Branchless \"position = a_source if a_current == 1.0 else a_target\"\n vec2 position = a_source * max(0.0, a_current) + a_target * max(0.0, 1.0 - a_current);\n position = (u_matrix * vec3(position, 1)).xy;\n\n vec2 source = (u_matrix * vec3(a_source, 1)).xy;\n vec2 target = (u_matrix * vec3(a_target, 1)).xy;\n\n vec2 viewportPosition = clipspaceToViewport(position, u_dimensions);\n vec2 viewportSource = clipspaceToViewport(source, u_dimensions);\n vec2 viewportTarget = clipspaceToViewport(target, u_dimensions);\n\n vec2 delta = viewportTarget.xy - viewportSource.xy;\n float len = length(delta);\n vec2 normal = vec2(-delta.y, delta.x) * a_direction;\n vec2 unitNormal = normal / len;\n float boundingBoxThickness = len * a_curvature;\n float curveThickness = max(minThickness, a_thickness / 2.0 / u_sizeRatio * u_pixelRatio);\n\n v_thickness = curveThickness;\n\n v_cpA = viewportSource;\n v_cpB = 0.5 * (viewportSource + viewportTarget) + unitNormal * a_direction * boundingBoxThickness;\n v_cpC = viewportTarget;\n\n vec2 viewportOffsetPosition = (\n viewportPosition +\n unitNormal * (boundingBoxThickness / 2.0 + curveThickness + epsilon) *\n max(0.0, a_direction) // NOTE: cutting the bounding box in half to avoid overdraw\n );\n\n position = viewportToClipspace(viewportOffsetPosition, u_dimensions);\n gl_Position = vec4(position, 0, 1);\n\n #ifdef PICKING_MODE\n // For picking mode, we use the ID as the color:\n v_color = a_id;\n #else\n // For normal mode, we use the color:\n v_color = a_color;\n #endif\n\n v_color.a *= bias;\n}\n"; | ||
var VERTEX_SHADER_SOURCE$1 = VERTEX_SHADER_SOURCE; | ||
@@ -343,0 +343,0 @@ |
{ | ||
"name": "@sigma/edge-curve", | ||
"version": "3.0.0-beta.4", | ||
"version": "3.0.0-beta.5", | ||
"description": "An edge program that renders edges as curves for sigma.js", | ||
@@ -50,3 +50,3 @@ "main": "dist/sigma-edge-curve.cjs.js", | ||
}, | ||
"gitHead": "5780a74090917f8c51a993371c261f18f23d55f5" | ||
"gitHead": "89a1be9953dd3488546fabc880dac262d5019c67" | ||
} |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
64670