You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
6.2 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[60],{431:function(t,e,n){"use strict";n.r(e);var i=n(97),o=n(3),a=n(63),r=n(10),s=n(2),u=n(19),l=n(221),d=n(12),f=n(13),_=n(34),v=n(38),c="blur",g="gradient",h="radius",p=["#00f","#0ff","#0f0","#ff0","#f00"];var x=function(t){function e(e){var n=e||{},i=Object(d.a)({},n);delete i.gradient,delete i.radius,delete i.blur,delete i.weight,t.call(this,i),this.gradient_=null,this.addEventListener(Object(v.b)(g),this.handleGradientChanged_),this.setGradient(n.gradient?n.gradient:p),this.setBlur(void 0!==n.blur?n.blur:15),this.setRadius(void 0!==n.radius?n.radius:8);var o=n.weight?n.weight:"weight";this.weightFunction_="string"==typeof o?function(t){return t.get(o)}:o,this.setRenderOrder(null)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getBlur=function(){return this.get(c)},e.prototype.getGradient=function(){return this.get(g)},e.prototype.getRadius=function(){return this.get(h)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=1,n=256,i=Object(_.a)(e,n),o=i.createLinearGradient(0,0,e,n),a=1/(t.length-1),r=0,s=t.length;r<s;++r)o.addColorStop(r*a,t[r]);return i.fillStyle=o,i.fillRect(0,0,e,n),i.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(c,t)},e.prototype.setGradient=function(t){this.set(g,t)},e.prototype.setRadius=function(t){this.set(h,t)},e.prototype.createRenderer=function(){return new l.a(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(t){var e=this.weightFunction_(t);return void 0!==e?Object(f.a)(e,0,1):1}.bind(this)}],vertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_weight = a_weight;\n }",fragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n }",hitVertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n attribute vec4 a_hitColor;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_
//# sourceMappingURL=heatmap-earthquakes.js.map