Skip to content

Commit

Permalink
Merge pull request #16 from nswamy14/master
Browse files Browse the repository at this point in the history
Update gh-pages as per master
  • Loading branch information
nswamy14 authored Jun 16, 2023
2 parents 63eea52 + 54d036c commit 51c62df
Show file tree
Hide file tree
Showing 10 changed files with 2,513 additions and 32 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Visual-Heatmap Js
# Visual-Heatmap Js [![npm](https://img.shields.io/npm/v/visual-heatmap.svg)](https://www.npmjs.com/package/visual-heatmap) [![Downloads](https://img.shields.io/npm/dm/visual-heatmap.svg)](https://www.npmjs.com/package/visual-heatmap)
Open source javascript module for rendering high performance, large scale heatmap.

Visual Heatmap is based on advanced graphical rendering context - WebGL/Shaders. It can render 500,000+ data points with a good framerate.
Expand Down
6 changes: 3 additions & 3 deletions dist/visualHeatmap.esm.browser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Heatmap v1.0.3
* (c) 2019 Narayana Swamy ([email protected])
* Heatmap v1.0.5
* (c) 2023 Narayana Swamy ([email protected])
* @license BSD-3-Clause
*/
function getPixlRatio (ctx) {
Expand Down Expand Up @@ -59,7 +59,7 @@ var GradvertexShader = `
var ColorfragmentShader = `
precision mediump float;
varying vec2 v_texCoord;
uniform sampler2D u_framebuffer; uniform vec4 u_colorArr[100]; uniform float u_colorCount; uniform float u_opacity; uniform float u_offset[100];
uniform sampler2D u_framebuffer; uniform vec4 u_colorArr[11]; uniform float u_colorCount; uniform float u_opacity; uniform float u_offset[11];
float remap ( float minval, float maxval, float curval ) {
return ( curval - minval ) / ( maxval - minval );
Expand Down
2 changes: 1 addition & 1 deletion dist/visualHeatmap.esm.browser.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/visualHeatmap.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Heatmap v1.0.3
* (c) 2019 Narayana Swamy ([email protected])
* Heatmap v1.0.5
* (c) 2023 Narayana Swamy ([email protected])
* @license BSD-3-Clause
*/
(function (global, factory) {
Expand Down Expand Up @@ -65,7 +65,7 @@
var ColorfragmentShader = `
precision mediump float;
varying vec2 v_texCoord;
uniform sampler2D u_framebuffer; uniform vec4 u_colorArr[100]; uniform float u_colorCount; uniform float u_opacity; uniform float u_offset[100];
uniform sampler2D u_framebuffer; uniform vec4 u_colorArr[11]; uniform float u_colorCount; uniform float u_opacity; uniform float u_offset[11];
float remap ( float minval, float maxval, float curval ) {
return ( curval - minval ) / ( maxval - minval );
Expand Down
6 changes: 3 additions & 3 deletions dist/visualHeatmap.legacy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Heatmap v1.0.3
* (c) 2019 Narayana Swamy ([email protected])
* Heatmap v1.0.5
* (c) 2023 Narayana Swamy ([email protected])
* @license BSD-3-Clause
*/
(function (global, factory) {
Expand All @@ -24,7 +24,7 @@

var GradvertexShader = "\n\tattribute vec2 a_position;\n\tattribute float a_intensity;\n\tuniform float u_size;\n\tuniform vec2 u_resolution;\n\tuniform vec2 u_translate; \n\tuniform float u_zoom; \n\tuniform float u_angle; \n\tuniform float u_density;\n\tvarying float v_i;\n\n\tvec2 rotation(vec2 v, float a) {\n\t\tfloat s = sin(a); float c = cos(a); mat2 m = mat2(c, -s, s, c); \n\t\treturn m * v;\n\t}\n\n\tvoid main() {\n\t\tvec2 zeroToOne = (a_position * u_density + u_translate * u_density) / (u_resolution);\n\t\tvec2 zeroToTwo = zeroToOne * 2.0 - 1.0;\n\t\tzeroToTwo = zeroToTwo / u_zoom;\n\t\tif (u_angle != 0.0) {\n\t\t\tzeroToTwo = rotation(zeroToTwo, u_angle);\n\t\t}\n\t\tgl_Position = vec4(zeroToTwo , 0, 1);\n\t\tgl_PointSize = u_size * u_density;\n\t\tv_i = a_intensity;\n\t}";

var ColorfragmentShader = "\n\tprecision mediump float;\n\tvarying vec2 v_texCoord;\n\tuniform sampler2D u_framebuffer; uniform vec4 u_colorArr[100]; uniform float u_colorCount; uniform float u_opacity; uniform float u_offset[100];\n\n\tfloat remap ( float minval, float maxval, float curval ) {\n\t\treturn ( curval - minval ) / ( maxval - minval );\n\t}\n\n\tvoid main() {\n\t\tfloat alpha = texture2D(u_framebuffer, v_texCoord.xy).a;\n\t\tif (alpha > 0.0 && alpha <= 1.0) {\n\t\t\tvec4 color_;\n\t\t\tif (alpha <= u_offset[0]) {\n\t\t\t\tcolor_ = u_colorArr[0];\n\t\t\t} else if (alpha <= u_offset[1]) {\n\t\t\t\tcolor_ = mix( u_colorArr[0], u_colorArr[1], remap( u_offset[0], u_offset[1], alpha ) );\n\t\t\t} else if (alpha <= u_offset[2]) {\n\t\t\t\tcolor_ = mix( u_colorArr[1], u_colorArr[2], remap( u_offset[1], u_offset[2], alpha ) );\n\t\t\t} else if (alpha <= u_offset[3]) {\n\t\t\t\tcolor_ = mix( u_colorArr[2], u_colorArr[3], remap( u_offset[2], u_offset[3], alpha ) );\n\t\t\t} else if (alpha <= u_offset[4]) {\n\t\t\t\tcolor_ = mix( u_colorArr[3], u_colorArr[4], remap( u_offset[3], u_offset[4], alpha ) );\n\t\t\t} else if (alpha <= u_offset[5]) {\n\t\t\t\tcolor_ = mix( u_colorArr[4], u_colorArr[5], remap( u_offset[4], u_offset[5], alpha ) );\n\t\t\t} else if (alpha <= u_offset[6]) {\n\t\t\t\tcolor_ = mix( u_colorArr[5], u_colorArr[6], remap( u_offset[5], u_offset[6], alpha ) );\n\t\t\t} else if (alpha <= u_offset[7]) {\n\t\t\t\tcolor_ = mix( u_colorArr[6], u_colorArr[7], remap( u_offset[6], u_offset[7], alpha ) );\n\t\t\t} else if (alpha <= u_offset[8]) {\n\t\t\t\tcolor_ = mix( u_colorArr[7], u_colorArr[8], remap( u_offset[7], u_offset[8], alpha ) );\n\t\t\t} else if (alpha <= u_offset[9]) {\n\t\t\t\tcolor_ = mix( u_colorArr[8], u_colorArr[9], remap( u_offset[8], u_offset[9], alpha ) );\n\t\t\t} else if (alpha <= u_offset[10]) {\n\t\t\t\tcolor_ = mix( u_colorArr[9], u_colorArr[10], remap( u_offset[9], u_offset[10], alpha ) );\n\t\t\t} else {\n\t\t\t\tcolor_ = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t\t}\n\t\t\tcolor_.a = color_.a - (1.0 - u_opacity);\n\t\t\tif (color_.a < 0.0) {\n\t\t\t\tcolor_.a = 0.0;\n\t\t\t}\n\t\t\tgl_FragColor = color_;\n\t\t}\n\t}";
var ColorfragmentShader = "\n\tprecision mediump float;\n\tvarying vec2 v_texCoord;\n\tuniform sampler2D u_framebuffer; uniform vec4 u_colorArr[11]; uniform float u_colorCount; uniform float u_opacity; uniform float u_offset[11];\n\n\tfloat remap ( float minval, float maxval, float curval ) {\n\t\treturn ( curval - minval ) / ( maxval - minval );\n\t}\n\n\tvoid main() {\n\t\tfloat alpha = texture2D(u_framebuffer, v_texCoord.xy).a;\n\t\tif (alpha > 0.0 && alpha <= 1.0) {\n\t\t\tvec4 color_;\n\t\t\tif (alpha <= u_offset[0]) {\n\t\t\t\tcolor_ = u_colorArr[0];\n\t\t\t} else if (alpha <= u_offset[1]) {\n\t\t\t\tcolor_ = mix( u_colorArr[0], u_colorArr[1], remap( u_offset[0], u_offset[1], alpha ) );\n\t\t\t} else if (alpha <= u_offset[2]) {\n\t\t\t\tcolor_ = mix( u_colorArr[1], u_colorArr[2], remap( u_offset[1], u_offset[2], alpha ) );\n\t\t\t} else if (alpha <= u_offset[3]) {\n\t\t\t\tcolor_ = mix( u_colorArr[2], u_colorArr[3], remap( u_offset[2], u_offset[3], alpha ) );\n\t\t\t} else if (alpha <= u_offset[4]) {\n\t\t\t\tcolor_ = mix( u_colorArr[3], u_colorArr[4], remap( u_offset[3], u_offset[4], alpha ) );\n\t\t\t} else if (alpha <= u_offset[5]) {\n\t\t\t\tcolor_ = mix( u_colorArr[4], u_colorArr[5], remap( u_offset[4], u_offset[5], alpha ) );\n\t\t\t} else if (alpha <= u_offset[6]) {\n\t\t\t\tcolor_ = mix( u_colorArr[5], u_colorArr[6], remap( u_offset[5], u_offset[6], alpha ) );\n\t\t\t} else if (alpha <= u_offset[7]) {\n\t\t\t\tcolor_ = mix( u_colorArr[6], u_colorArr[7], remap( u_offset[6], u_offset[7], alpha ) );\n\t\t\t} else if (alpha <= u_offset[8]) {\n\t\t\t\tcolor_ = mix( u_colorArr[7], u_colorArr[8], remap( u_offset[7], u_offset[8], alpha ) );\n\t\t\t} else if (alpha <= u_offset[9]) {\n\t\t\t\tcolor_ = mix( u_colorArr[8], u_colorArr[9], remap( u_offset[8], u_offset[9], alpha ) );\n\t\t\t} else if (alpha <= u_offset[10]) {\n\t\t\t\tcolor_ = mix( u_colorArr[9], u_colorArr[10], remap( u_offset[9], u_offset[10], alpha ) );\n\t\t\t} else {\n\t\t\t\tcolor_ = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t\t}\n\t\t\tcolor_.a = color_.a - (1.0 - u_opacity);\n\t\t\tif (color_.a < 0.0) {\n\t\t\t\tcolor_.a = 0.0;\n\t\t\t}\n\t\t\tgl_FragColor = color_;\n\t\t}\n\t}";

var ColorvertexShader = "\n\tattribute vec2 a_texCoord;\n\tvarying vec2 v_texCoord;\n\tvoid main() {\n\t\tvec2 clipSpace = a_texCoord * 2.0 - 1.0;\n\t\tgl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n\t\tv_texCoord = a_texCoord;\n\t}";

Expand Down
2 changes: 1 addition & 1 deletion dist/visualHeatmap.legacy.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/visualHeatmap.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var GradvertexShader = `
var ColorfragmentShader = `
precision mediump float;
varying vec2 v_texCoord;
uniform sampler2D u_framebuffer; uniform vec4 u_colorArr[100]; uniform float u_colorCount; uniform float u_opacity; uniform float u_offset[100];
uniform sampler2D u_framebuffer; uniform vec4 u_colorArr[11]; uniform float u_colorCount; uniform float u_opacity; uniform float u_offset[11];
float remap ( float minval, float maxval, float curval ) {
return ( curval - minval ) / ( maxval - minval );
Expand Down
Loading

0 comments on commit 51c62df

Please sign in to comment.