Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deck.gl

Package Overview
Dependencies
Maintainers
3
Versions
674
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deck.gl - npm Package Compare versions

Comparing version 3.0.0-beta7 to 3.0.0-beta8

51

dist/attribute-manager.js

@@ -60,4 +60,3 @@ 'use strict';

// Returns attributes in a format suitable for use with Luma.gl objects
//
// Returns attributes in a format suitable for use with Luma.gl Model/Program

@@ -70,2 +69,5 @@

}
// Returns the redraw flag
}, {

@@ -82,2 +84,5 @@ key: 'getNeedsRedraw',

}
// Adds a static attribute (that is not auto updated)
}, {

@@ -87,5 +92,7 @@ key: 'add',

var newAttributes = this._add(attributes, updaters, {});
// and instancedAttributes (for updating when data changes)
Object.assign(this.attributes, newAttributes);
}
// Adds a dynamic attribute, that is autoupdated
}, {

@@ -97,5 +104,7 @@ key: 'addDynamic',

});
// and instancedAttributes (for updating when data changes)
Object.assign(this.attributes, newAttributes);
}
// Adds an instanced attribute that is autoupdated
}, {

@@ -109,35 +118,5 @@ key: 'addInstanced',

Object.assign(this.attributes, newAttributes);
// and instancedAttributes (for updating when data changes)
Object.assign(this.instancedAttributes, newAttributes);
}
}, {
key: 'addVertices',
value: function addVertices(vertexArray) {
(0, _assert2.default)(vertexArray instanceof Float32Array);
this.add({
vertices: { value: vertexArray, size: 3, '0': 'x', '1': 'y', '2': 'z' }
});
}
}, {
key: 'addNormals',
value: function addNormals(normalArray) {
(0, _assert2.default)(normalArray instanceof Float32Array);
this.add({
normals: { value: normalArray, size: 3, '0': 'x', '1': 'y', '2': 'z' }
});
}
}, {
key: 'addIndices',
value: function addIndices(indexArray, gl) {
(0, _assert2.default)(indexArray instanceof Uint16Array);
(0, _assert2.default)(gl);
this.add({
indices: {
value: indexArray,
size: 1,
bufferType: gl.ELEMENT_ARRAY_BUFFER,
drawMode: gl.STATIC_DRAW,
'0': 'index'
}
});
}

@@ -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gICAgfVxuXG4gICAgLy8gQ2hlY2sgdGhlIHVwZGF0ZXJcbiAgICBhc3NlcnQoIXVwZGF0ZXIgfHwgdHlwZW9mIHVwZGF0ZXIudXBkYXRlID09PSAnZnVuY3Rpb24nLFxuICAgICAgYEF0dHJpYnV0ZSB1cGRhdGVyIGZvciAke2F0dHJpYnV0ZU5hbWV9IG1pc3NpbmcgdXBkYXRlIG1ldGhvZGApO1xuICB9XG5cbn1cbiJdfQ==

@@ -92,2 +92,4 @@ 'use strict';

var DEFAULT_PIXEL_RATIO = typeof window !== 'undefined' ? window.devicePixelRatio : 1;
var PROP_TYPES = {

@@ -100,3 +102,5 @@ width: _react.PropTypes.number.isRequired,

// TODO - replace with actual map view state props, build matrix from those
projectionMatrix: _react.PropTypes.any
projectionMatrix: _react.PropTypes.any,
pixelRatio: _react.PropTypes.number,
onWebGLInitialized: _react.PropTypes.func
};

@@ -107,3 +111,5 @@

camera: null,
projectionMatrix: null
projectionMatrix: null,
pixelRatio: DEFAULT_PIXEL_RATIO,
onWebGLInitialized: function onWebGLInitialized() {}
};

@@ -199,2 +205,3 @@

this.props.onWebGLInitialized(gl);
this.setState({

@@ -293,4 +300,5 @@ gl: gl,

var projectionMatrix = _props.projectionMatrix;
var pixelRatio = _props.pixelRatio;
var otherProps = _objectWithoutProperties(_props, ['width', 'height', 'layers', 'blending', 'projectionMatrix']);
var otherProps = _objectWithoutProperties(_props, ['width', 'height', 'layers', 'blending', 'projectionMatrix', 'pixelRatio']);

@@ -337,3 +345,3 @@ var camera = this.props.camera;

blending: blending,
pixelRatio: window.devicePixelRatio,
pixelRatio: pixelRatio,

@@ -350,2 +358,2 @@ onRendererInitialized: this._onRendererInitialized,

exports.default = DeckGLOverlay;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWNrZ2wtb3ZlcmxheS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs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G4gICAgcmV0dXJuIChcbiAgICAgIDxXZWJHTFJlbmRlcmVyXG4gICAgICAgIHsgLi4ub3RoZXJQcm9wcyB9XG5cbiAgICAgICAgd2lkdGg9eyB3aWR0aCB9XG4gICAgICAgIGhlaWdodD17IGhlaWdodCB9XG5cbiAgICAgICAgdmlld3BvcnQ9eyB2aWV3cG9ydCB9XG4gICAgICAgIGNhbWVyYT17IGNhbWVyYSB9XG4gICAgICAgIHNjZW5lPXsgc2NlbmUgfVxuICAgICAgICBibGVuZGluZz17IGJsZW5kaW5nIH1cbiAgICAgICAgcGl4ZWxSYXRpbz17IHBpeGVsUmF0aW8gfVxuXG4gICAgICAgIG9uUmVuZGVyZXJJbml0aWFsaXplZD17IHRoaXMuX29uUmVuZGVyZXJJbml0aWFsaXplZCB9XG4gICAgICAgIG9uTmVlZFJlZHJhdz17IHRoaXMuX2NoZWNrSWZOZWVkUmVkcmF3IH1cbiAgICAgICAgb25Nb3VzZU1vdmU9eyB0aGlzLl9vbk1vdXNlTW92ZSB9XG4gICAgICAgIG9uQ2xpY2s9eyB0aGlzLl9vbkNsaWNrIH0vPlxuICAgICk7XG4gIH1cblxufVxuIl19

@@ -94,3 +94,3 @@ 'use strict';

var ATTRIBUTES = {
pickingColors: { size: 3, '0': 'pickRed', '1': 'pickGreen', '2': 'pickBlue' }
instancePickingColors: { size: 3, '0': 'pickRed', '1': 'pickGreen', '2': 'pickBlue' }
};

@@ -420,7 +420,7 @@

var attributeManager = this.state.attributeManager;
// All instanced layers get pickingColors attribute by default
// All instanced layers get instancePickingColors attribute by default
// Their shaders can use it to render a picking scene
attributeManager.addInstanced(ATTRIBUTES, {
pickingColors: { update: this.calculatePickingColors }
instancePickingColors: { update: this.calculateInstancePickingColors }
});

@@ -484,4 +484,4 @@

}, {
key: 'calculatePickingColors',
value: function calculatePickingColors(attribute, numInstances) {
key: 'calculateInstancePickingColors',
value: function calculateInstancePickingColors(attribute, numInstances) {
var value = attribute.value;

@@ -529,4 +529,5 @@ var size = attribute.size;

info.index = this.decodePickingColor(color);
if (Array.isArray(this.data)) {
info.object = this.data[info.index];
// If props.data is an indexable array, get the object
if (Array.isArray(this.props.data)) {
info.object = this.props.data[info.index];
}

@@ -542,2 +543,3 @@ info.geoCoords = this.unproject({ x: info.x, y: info.y });

var selectedPickingColor = new Float32Array(3);

@@ -598,8 +600,3 @@ selectedPickingColor[0] = color[0];

this.setState({
viewport: {
x: 0,
y: 0,
width: width,
height: height
},
viewport: { x: 0, y: 0, width: width, height: height },
mercator: (0, _viewportMercatorProject2.default)({

@@ -659,2 +656,2 @@ width: width, height: height, latitude: latitude, longitude: longitude, zoom: zoom,

exports.default = Layer;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9sYXllci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBcUJBOzs7O0FBQ0E7O0FBRUE7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7Ozs7Ozs7Ozs7Ozs7Ozs7QUFVQSxJQUFNLGdCQUFnQjtBQUNwQixPQUFLLENBRGU7QUFFcEIsV0FBUyxHQUZXO0FBR3BCLGdCQUFjLFNBSE07QUFJcEIsUUFBTSxFQUpjO0FBS3BCLGNBQVksS0FMUTtBQU1wQixlQUFhLEtBTk87QUFPcEIsWUFBVTtBQUFBLFdBQUssQ0FBTDtBQUFBLEdBUFU7QUFRcEIsV0FBUyxtQkFBTSxDQUFFLENBUkc7QUFTcEIsV0FBUyxtQkFBTSxDQUFFLENBVEc7Ozs7Ozs7Ozs7QUFtQnBCLGtCQUFnQjtBQW5CSSxDQUF0Qjs7QUFzQkEsSUFBTSxhQUFhO0FBQ2pCLGlCQUFlLEVBQUMsTUFBTSxDQUFQLEVBQVUsS0FBSyxTQUFmLEVBQTBCLEtBQUssV0FBL0IsRUFBNEMsS0FBSyxV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IHl9O1xuICB9XG5cbiAgdW5wcm9qZWN0KHh5KSB7XG4gICAgY29uc3Qge21lcmNhdG9yfSA9IHRoaXMuc3RhdGU7XG4gICAgY29uc3QgW2xvbiwgbGF0XSA9IEFycmF5LmlzQXJyYXkoeHkpID9cbiAgICAgIG1lcmNhdG9yLnVucHJvamVjdCh4eSkgOlxuICAgICAgbWVyY2F0b3IudW5wcm9qZWN0KFt4eS54LCB4eS55XSk7XG4gICAgcmV0dXJuIHtsYXQsIGxvbn07XG4gIH1cbn1cbiJdfQ==

@@ -24,2 +24,4 @@ 'use strict';

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -52,3 +54,3 @@

var ATTRIBUTES = {
positions: { size: 4, '0': 'x0', '1': 'y0', '2': 'x1', '3': 'y1' }
instancePositions: { size: 4, '0': 'x0', '1': 'y0', '2': 'x1', '3': 'y1' }
};

@@ -67,7 +69,20 @@

function ArcLayer(opts) {
function ArcLayer() {
var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var _ref$strokeWidth = _ref.strokeWidth;
var strokeWidth = _ref$strokeWidth === undefined ? 1 : _ref$strokeWidth;
var _ref$color = _ref.color0;
var color0 = _ref$color === undefined ? [255, 0, 0] : _ref$color;
var _ref$color2 = _ref.color1;
var color1 = _ref$color2 === undefined ? [0, 0, 255] : _ref$color2;
var opts = _objectWithoutProperties(_ref, ['strokeWidth', 'color0', 'color1']);
_classCallCheck(this, ArcLayer);
return _possibleConstructorReturn(this, Object.getPrototypeOf(ArcLayer).call(this, _extends({
strokeWidth: 1
strokeWidth: strokeWidth,
color0: color0,
color1: color1
}, opts)));

@@ -89,3 +104,3 @@ }

attributeManager.addInstanced(ATTRIBUTES, {
positions: { update: this.calculatePositions }
instancePositions: { update: this.calculateInstancePositions }
});

@@ -98,6 +113,4 @@

value: function willReceiveProps(oldProps, nextProps) {
_get(Object.getPrototypeOf(ArcLayer.prototype), 'willReceiveProps', this).call(this, oldProps, nextProps);
this.state.model.userData.strokeWidth = nextProps.strokeWidth;
this.updateColors();

@@ -108,6 +121,6 @@ }

value: function createModel(gl) {
var vertices = [];
var positions = [];
var NUM_SEGMENTS = 50;
for (var i = 0; i < NUM_SEGMENTS; i++) {
vertices = [].concat(_toConsumableArray(vertices), [i, i, i]);
positions = [].concat(_toConsumableArray(positions), [i, i, i]);
}

@@ -117,4 +130,4 @@

program: new _luma.Program(gl, {
vs: '#define GLSLIFY 1\n// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* vertex shader for the arc-layer */\n#define SHADER_NAME arc-layer-vs\n\n// viewport: [x, y, width, height]\nconst float TILE_SIZE_1540259130 = 512.0;\nconst float PI = 3.1415926536;\n\n// non-linear projection: lnglats => zoom level depdendent projected coords\nvec2 mercatorProject(vec2 lnglat, float zoom) {\n // Note: Could be precomputed, at the expense of less simple API\n float scale = pow(2.0, zoom) * TILE_SIZE_1540259130 / (PI * 2.0);\n\n float longitude = lnglat.x;\n float latitude = lnglat.y;\n\n float lamda = radians(longitude);\n float phi = radians(latitude);\n\n float x = scale * (lamda + PI);\n float y = scale * (PI - log(tan(PI * 0.25 + phi * 0.5)));\n\n return vec2(x, y);\n}\n\nuniform float mercatorZoom;\n\nconst float N = 49.0;\n\nattribute vec3 vertices;\nattribute vec4 positions;\n\nuniform mat4 worldMatrix;\nuniform mat4 projectionMatrix;\n\nvarying float ratio;\n\nfloat paraboloid(vec2 source, vec2 target, float index) {\n float ratio = index / N;\n\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvoid main(void) {\n vec2 source = mercatorProject(positions.xy, mercatorZoom);\n vec2 target = mercatorProject(positions.zw, mercatorZoom);\n\n float segmentIndex = vertices.x;\n vec3 p = vec3(\n // xy: linear interpolation of source & target\n mix(source, target, segmentIndex / N),\n // z: paraboloid interpolate of source & target\n sqrt(paraboloid(source, target, segmentIndex))\n );\n\n gl_Position = projectionMatrix * worldMatrix * vec4(p, 1.0);\n\n // map arc distance to color in fragment shader\n ratio = clamp(distance(source, target) / 1000.0, 0.0, 1.0);\n}\n',
fs: '// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* fragment shader for the arc-layer */\n#define SHADER_NAME arc-layer-fs\n\n#ifdef GL_ES\nprecision highp float;\n#define GLSLIFY 1\n#endif\n\nuniform vec3 color0;\nuniform vec3 color1;\nuniform float opacity;\n\nvarying float ratio;\n\nvoid main(void) {\n gl_FragColor = vec4(mix(color0 / 255.0, color1 / 255.0, ratio), opacity);\n}\n',
vs: '#define GLSLIFY 1\n// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* vertex shader for the arc-layer */\n#define SHADER_NAME arc-layer-vs\n\n// viewport: [x, y, width, height]\nconst float TILE_SIZE_1540259130 = 512.0;\nconst float PI = 3.1415926536;\n\n// non-linear projection: lnglats => zoom level depdendent projected coords\nvec2 mercatorProject(vec2 lnglat, float zoom) {\n // Note: Could be precomputed, at the expense of less simple API\n float scale = pow(2.0, zoom) * TILE_SIZE_1540259130 / (PI * 2.0);\n\n float longitude = lnglat.x;\n float latitude = lnglat.y;\n\n float lamda = radians(longitude);\n float phi = radians(latitude);\n\n float x = scale * (lamda + PI);\n float y = scale * (PI - log(tan(PI * 0.25 + phi * 0.5)));\n\n return vec2(x, y);\n}\n\nuniform float mercatorZoom;\n\nconst float N = 49.0;\n\nattribute vec3 vertices;\nattribute vec4 instancePositions;\nattribute vec3 instancePickingColors;\n\nuniform mat4 worldMatrix;\nuniform mat4 projectionMatrix;\n\nvarying float ratio;\nvarying vec3 pickingColor;\n\nfloat paraboloid(vec2 source, vec2 target, float index) {\n float ratio = index / N;\n\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvoid main(void) {\n vec2 source = mercatorProject(instancePositions.xy, mercatorZoom);\n vec2 target = mercatorProject(instancePositions.zw, mercatorZoom);\n\n // TODO - are we only using x coordinate?\n float segmentIndex = vertices.x;\n vec3 p = vec3(\n // xy: linear interpolation of source & target\n mix(source, target, segmentIndex / N),\n // z: paraboloid interpolate of source & target\n sqrt(paraboloid(source, target, segmentIndex))\n );\n\n gl_Position = projectionMatrix * worldMatrix * vec4(p, 1.0);\n\n // map arc distance to color in fragment shader\n ratio = clamp(distance(source, target) / 1000.0, 0.0, 1.0);\n pickingColor = instancePickingColors;\n}\n',
fs: '// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* fragment shader for the arc-layer */\n#define SHADER_NAME arc-layer-fs\n\n#ifdef GL_ES\nprecision highp float;\n#define GLSLIFY 1\n#endif\n\nuniform vec3 color0;\nuniform vec3 color1;\nuniform float opacity;\nuniform float renderPickingBuffer;\n\nvarying float ratio;\nvarying vec3 pickingColor;\n\nvoid main(void) {\n vec4 color = vec4(mix(color0 / 255.0, color1 / 255.0, ratio), opacity);\n gl_FragColor = mix(color, vec4(pickingColor / 255., 1.), renderPickingBuffer);\n}\n',
id: 'arc'

@@ -125,15 +138,11 @@ }),

drawMode: 'LINE_STRIP',
vertices: new Float32Array(vertices)
vertices: new Float32Array(positions)
}),
instanced: true,
onBeforeRender: function onBeforeRender() {
var gl = this.program.gl;
this.userData.oldStrokeWidth = gl.getParameter(gl.LINE_WIDTH);
gl.lineWidth(this.userData.strokeWidth || 1);
this.program.gl.lineWidth(this.userData.strokeWidth || 1);
},
onAfterRender: function onAfterRender() {
var gl = this.program.gl;
gl.lineWidth(this.userData.oldStrokeWidth || 1);
this.program.gl.lineWidth(this.userData.oldStrokeWidth || 1);
}

@@ -145,14 +154,10 @@ });

value: function updateColors() {
// Get colors from first object
var object = this.getFirstObject();
if (object) {
this.setUniforms({
color0: object.colors.c0,
color1: object.colors.c1
});
}
this.setUniforms({
color0: this.props.color0,
color1: this.props.color1
});
}
}, {
key: 'calculatePositions',
value: function calculatePositions(attribute) {
key: 'calculateInstancePositions',
value: function calculateInstancePositions(attribute) {
var data = this.props.data;

@@ -198,2 +203,2 @@ var value = attribute.value;

exports.default = ArcLayer;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9sYXllcnMvYXJjLWxheWVyL2FyYy1sYXllci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7O0FBb0JBOzs7O0FBQ0E7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUNBLElBQU0sVUFBVSxRQUFRLFNBQVIsQ0FBaEI7O0FBRUEsSUFBTSxhQUFhO0FBQ2pCLGFBQVcsRUFBQyxNQUFNLENBQVAsRUFBVSxLQUFLLElBQWYsRUFBcUIsS0FBSyxJQUExQixFQUFnQyxLQUFLLElBQXJDLEVBQTJDLEtBQUssSUFBaEQ7QUFETSxDQUFuQjs7SUFJcUIsUTs7Ozs7Ozs7Ozs7QUFRbkIsb0JBQVksSUFBWixFQUFrQjtBQUFBOztBQUFBO0FBRWQsbUJBQWE7QUFGQyxPQUdYLElBSFc7QUFLakI7Ozs7c0NBRWlCO0FBQUEsbUJBQ2UsS0FBSyxLQURwQjtBQUFBLFVBQ1QsRUFEUyxVQUNULEVBRFM7QUFBQSxVQUNMLGdCQURLLFVBQ0wsZ0JBREs7OztBQUdoQixVQUFNLFFBQVEsS0FBSyxXQUFMLENBQWlCLEVBQWpCLENBQWQ7QUFDQSxZQUFNLFFBQU4sQ0FBZSxXQUFmLEdBQTZCLEtBQU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xuICAgICAgdmFsdWVbaSArIDBdID0gYXJjLnBvc2l0aW9uLngwO1xuICAgICAgdmFsdWVbaSArIDFdID0gYXJjLnBvc2l0aW9uLnkwO1xuICAgICAgdmFsdWVbaSArIDJdID0gYXJjLnBvc2l0aW9uLngxO1xuICAgICAgdmFsdWVbaSArIDNdID0gYXJjLnBvc2l0aW9uLnkxO1xuICAgICAgaSArPSBzaXplO1xuICAgIH1cbiAgfVxuXG59XG4iXX0=

@@ -63,4 +63,4 @@ 'use strict';

var ATTRIBUTES = {
vertices: { size: 3, '0': 'x', '1': 'y', '2': 'unused' },
indices: { size: 1, '0': 'index' },
positions: { size: 3, '0': 'x', '1': 'y', '2': 'unused' },
colors: { size: 3, '0': 'red', '1': 'green', '2': 'blue' },

@@ -106,3 +106,3 @@ // Override picking colors to prevent auto allocation

indices: { update: this.calculateIndices },
vertices: { update: this.calculateVertices },
positions: { update: this.calculatePositions },
colors: { update: this.calculateColors },

@@ -145,3 +145,3 @@ // Instanced attributes

program: new _luma.Program(gl, {
vs: '#define GLSLIFY 1\n// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* vertex shader for the choropleth-layer */\n#define SHADER_NAME choropleth-layer-vertex-shader\n\n// viewport: [x, y, width, height]\nconst float TILE_SIZE_1540259130 = 512.0;\nconst float PI = 3.1415926536;\n\n// non-linear projection: lnglats => zoom level depdendent projected coords\nvec2 mercatorProject(vec2 lnglat, float zoom) {\n // Note: Could be precomputed, at the expense of less simple API\n float scale = pow(2.0, zoom) * TILE_SIZE_1540259130 / (PI * 2.0);\n\n float longitude = lnglat.x;\n float latitude = lnglat.y;\n\n float lamda = radians(longitude);\n float phi = radians(latitude);\n\n float x = scale * (lamda + PI);\n float y = scale * (PI - log(tan(PI * 0.25 + phi * 0.5)));\n\n return vec2(x, y);\n}\n\nuniform float mercatorZoom;\n\nattribute vec3 vertices;\nattribute vec3 colors;\nattribute vec3 pickingColors;\n\nuniform mat4 projectionMatrix;\nuniform mat4 worldMatrix;\n\nuniform float opacity;\nuniform float renderPickingBuffer;\nuniform vec3 selectedPickingColor;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n vec2 pos = mercatorProject(vertices.xy, mercatorZoom);\n vec3 p = vec3(pos.xy, vertices.z);\n gl_Position = projectionMatrix * worldMatrix * vec4(p, 1.0);\n\n float alpha = pickingColors == selectedPickingColor ? 0.5 : opacity;\n vColor = vec4(mix(colors / 255., pickingColors / 255., renderPickingBuffer), alpha);\n}\n',
vs: '#define GLSLIFY 1\n// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* vertex shader for the choropleth-layer */\n#define SHADER_NAME choropleth-layer-vertex-shader\n\n// viewport: [x, y, width, height]\nconst float TILE_SIZE_1540259130 = 512.0;\nconst float PI = 3.1415926536;\n\n// non-linear projection: lnglats => zoom level depdendent projected coords\nvec2 mercatorProject(vec2 lnglat, float zoom) {\n // Note: Could be precomputed, at the expense of less simple API\n float scale = pow(2.0, zoom) * TILE_SIZE_1540259130 / (PI * 2.0);\n\n float longitude = lnglat.x;\n float latitude = lnglat.y;\n\n float lamda = radians(longitude);\n float phi = radians(latitude);\n\n float x = scale * (lamda + PI);\n float y = scale * (PI - log(tan(PI * 0.25 + phi * 0.5)));\n\n return vec2(x, y);\n}\n\nuniform float mercatorZoom;\n\nattribute vec3 positions;\nattribute vec3 colors;\nattribute vec3 pickingColors;\n\nuniform mat4 projectionMatrix;\nuniform mat4 worldMatrix;\n\nuniform float opacity;\nuniform float renderPickingBuffer;\nuniform vec3 selectedPickingColor;\n\nvarying vec4 vColor;\n\nvec4 getColor(vec4 color, float opacity, vec3 pickingColor, float renderPickingBuffer) {\n vec4 color4 = vec4(color.xyz / 255., color.w / 255. * opacity);\n vec4 pickingColor4 = vec4(pickingColor / 255., 1.);\n return mix(color4, pickingColor4, renderPickingBuffer);\n}\n\nvoid main(void) {\n vec2 pos = mercatorProject(positions.xy, mercatorZoom);\n vec3 p = vec3(pos.xy, positions.z);\n gl_Position = projectionMatrix * worldMatrix * vec4(p, 1.);\n\n vec4 color = vec4(colors / 255., opacity);\n vec4 pickingColor = vec4(pickingColors / 255., 1.);\n vColor = mix(color, pickingColor, renderPickingBuffer);\n\n // float alpha = pickingColors == selectedPickingColor ? 0.5 : opacity;\n // vColor = vec4(mix(colors / 255., pickingColors / 255., renderPickingBuffer), alpha);\n}\n',
fs: '// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* fragment shader for the choropleth-layer */\n\n#ifdef GL_ES\nprecision highp float;\n#define GLSLIFY 1\n#endif\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n}\n',

@@ -159,4 +159,4 @@ id: 'choropleth'

}, {
key: 'calculateVertices',
value: function calculateVertices(attribute) {
key: 'calculatePositions',
value: function calculatePositions(attribute) {
var vertices = (0, _lodash2.default)(this.state.groupedVertices);

@@ -281,2 +281,2 @@ attribute.value = new Float32Array(vertices);

exports.default = ChoroplethLayer;
//# sour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9wcy5vbkNsaWNrKHsuLi5pbmZvLCBmZWF0dXJlfSk7XG4gIH1cblxufVxuIl19

@@ -51,4 +51,4 @@ 'use strict';

var ATTRIBUTES = {
positions: { size: 3, '0': 'x', '1': 'y', '2': 'unused' },
colors: { size: 4, '0': 'red', '1': 'green', '2': 'blue', '3': 'alpha' }
instancePositions: { size: 3, '0': 'x', '1': 'y', '2': 'unused' },
instanceColors: { size: 4, '0': 'red', '1': 'green', '2': 'blue', '3': 'alpha' }
};

@@ -99,4 +99,4 @@

attributeManager.addInstanced(ATTRIBUTES, {
positions: { update: this.calculatePositions },
colors: { update: this.calculateColors }
instancePositions: { update: this.calculateInstancePositions },
instanceColors: { update: this.calculateInstanceColors }
});

@@ -122,3 +122,3 @@

program: new _luma.Program(gl, {
vs: '#define GLSLIFY 1\n// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* vertex shader for the grid-layer */\n#define SHADER_NAME grid-layer-vs\n\nattribute vec3 vertices;\nattribute vec3 positions;\nattribute vec4 colors;\nattribute vec3 pickingColors;\n\nuniform float maxCount;\nuniform float opacity;\nuniform float renderPickingBuffer;\nuniform vec3 scale;\nuniform vec3 selectedPickingColor;\n\nuniform mat4 worldMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n float alpha = pickingColors == selectedPickingColor ? 1.5 * colors.w : colors.w;\n vColor = vec4(mix(colors.xyz / maxCount, pickingColors / 255., renderPickingBuffer), alpha);\n\n vec3 p = positions + vertices * scale;\n gl_Position = projectionMatrix * worldMatrix * vec4(p, 1.0);\n}\n',
vs: '#define GLSLIFY 1\n// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* vertex shader for the grid-layer */\n#define SHADER_NAME grid-layer-vs\n\nattribute vec3 vertices;\nattribute vec3 instancePositions;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\n\nuniform float maxCount;\nuniform float opacity;\nuniform float renderPickingBuffer;\nuniform vec3 scale;\nuniform vec3 selectedPickingColor;\n\nuniform mat4 worldMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n float alpha = instancePickingColors == selectedPickingColor ? 1.5 * instanceColors.w : instanceColors.w;\n vColor = vec4(mix(instanceColors.xyz / maxCount, instancePickingColors / 255., renderPickingBuffer), alpha);\n\n vec3 p = instancePositions + vertices * scale;\n gl_Position = projectionMatrix * worldMatrix * vec4(p, 1.0);\n}\n',
fs: '// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* fragment shader for the grid-layer */\n#define SHADER_NAME grid-layer-fs\n\n#ifdef GL_ES\nprecision highp float;\n#define GLSLIFY 1\n#endif\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n}\n',

@@ -162,4 +162,4 @@ id: 'grid'

}, {
key: 'calculatePositions',
value: function calculatePositions(attribute, numInstances) {
key: 'calculateInstancePositions',
value: function calculateInstancePositions(attribute, numInstances) {
var _props2 = this.props;

@@ -184,4 +184,4 @@ var unitWidth = _props2.unitWidth;

}, {
key: 'calculateColors',
value: function calculateColors(attribute) {
key: 'calculateInstanceColors',
value: function calculateInstanceColors(attribute) {
var _props3 = this.props;

@@ -243,2 +243,2 @@ var data = _props3.data;

exports.default = GridLayer;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9sYXllcnMvZ3JpZC1sYXllci9ncmlkLWxheWVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7QUFvQkE7Ozs7QUFDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQ0EsSUFBTSxVQUFVLFFBQVEsU0FBUixDQUFoQjs7QUFFQSxJQUFNLGFBQWE7QUFDakIsYUFBVyxFQUFDLE1BQU0sQ0FBUCxFQUFVLEtBQUssR0FBZixFQUFvQixLQUFLLEdBQXpCLEVBQThCLEtBQUssUUFBbkMsRUFETTtBQUVqQixVQUFRLEVBQUMsTUFBTSxDQUFQLEVBQVUsS0FBSyxLQUFmLEVBQXNCLEtBQUssT0FBM0IsRUFBb0MsS0FBSyxNQUF6QyxFQUFpRCxLQUFLLE9BQXREO0FBRlMsQ0FBbkI7O0lBS3FCLFM7Ozs7O3dCQUVLO0FBQ3RCLGFBQU8sVUFBUDtBQUNEOzs7Ozs7Ozs7Ozs7OztBQVdELHFCQUFZLElBQVosRUFBa0I7QUFBQTs7QUFBQTtBQUVkLGlCQUFXLEdBRkc7QUFHZCxrQkFBWTtBQUhFLE9BSVgsSUFKVztBQU1qQjs7OztzQ0FFaUI7QUFBQSxtQkFDZSxLQUFLLEtBRHBCO0FBQUEsVUFDVCxFQURTLFVBQ1QsRUFEUztBQUFBLFVBQ0wsZ0JBREssVUFDTCxnQkFESzs7O0FBR2hCLFdBQUssUUFBTCxDQUFjO0FBQ1osZUFBT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9IDU7XG4gICAgICAgIHZhbHVlW2k0ICsgM10gPSAwLjY7XG4gICAgICB9XG4gICAgfVxuXG4gICAgdGhpcy5zZXRVbmlmb3Jtcyh7bWF4Q291bnQ6IE1hdGgubWF4KC4uLnZhbHVlKX0pO1xuICB9XG5cbn1cbiJdfQ==

@@ -22,4 +22,2 @@ 'use strict';

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -52,4 +50,5 @@

var ATTRIBUTES = {
positions: { size: 3, '0': 'x', '1': 'y', '2': 'unused' },
colors: { size: 3, '0': 'red', '1': 'green', '2': 'blue' }
instancePositions: { size: 2, '0': 'x', '1': 'y' },
instanceElevations: { size: 1, '0': 'z' },
instanceColors: { size: 3, '0': 'red', '1': 'green', '2': 'blue' }
};

@@ -79,3 +78,3 @@

dotRadius: 10,
elevation: 0
elevation: 100
}, opts)));

@@ -97,4 +96,5 @@ }

attributeManager.addInstanced(ATTRIBUTES, {
positions: { update: this.calculatePositions },
colors: { update: this.calculateColors }
instancePositions: { update: this.calculateInstancePositions },
instanceElevations: { update: this.calculateInstanceElevations },
instanceColors: { update: this.calculateInstanceColors }
});

@@ -116,7 +116,6 @@

if (dataChanged || viewportChanged) {
attributeManager.invalidate('positions');
this.calculateRadiusAndAngle();
}
if (dataChanged) {
attributeManager.invalidate('colors');
attributeManager.invalidateAll();
}

@@ -127,27 +126,47 @@ }

value: function getModel(gl) {
var NUM_SEGMENTS = 6;
var PI2 = Math.PI * 2;
var geometry = new _luma.CylinderGeometry({
id: this.props.id,
radius: 1,
topRadius: 1,
bottomRadius: 1,
topCap: true,
bottomCap: true,
height: 1,
nradial: 6,
nvertical: 1
});
var vertices = [];
for (var i = 0; i < NUM_SEGMENTS; i++) {
vertices = [].concat(_toConsumableArray(vertices), [Math.cos(PI2 * i / NUM_SEGMENTS), Math.sin(PI2 * i / NUM_SEGMENTS), 0]);
}
// const NUM_SEGMENTS = 6;
// const PI2 = Math.PI * 2;
// let vertices = [];
// for (let i = 0; i < NUM_SEGMENTS; i++) {
// vertices = [
// ...vertices,
// Math.cos(PI2 * i / NUM_SEGMENTS),
// Math.sin(PI2 * i / NUM_SEGMENTS),
// 0
// ];
// }
// const geometry = new Geometry({
// id: this.props.id,
// drawMode: 'TRIANGLE_FAN',
// vertices: new Float32Array(vertices)
// });
return new _luma.Model({
program: new _luma.Program(gl, {
vs: '#define GLSLIFY 1\n// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* fragment shader for the hexagon-layer */\n#define SHADER_NAME hexagon-layer-vs\n\n// viewport: [x, y, width, height]\nconst float TILE_SIZE_1540259130 = 512.0;\nconst float PI = 3.1415926536;\n\n// non-linear projection: lnglats => zoom level depdendent projected coords\nvec2 mercatorProject(vec2 lnglat, float zoom) {\n // Note: Could be precomputed, at the expense of less simple API\n float scale = pow(2.0, zoom) * TILE_SIZE_1540259130 / (PI * 2.0);\n\n float longitude = lnglat.x;\n float latitude = lnglat.y;\n\n float lamda = radians(longitude);\n float phi = radians(latitude);\n\n float x = scale * (lamda + PI);\n float y = scale * (PI - log(tan(PI * 0.25 + phi * 0.5)));\n\n return vec2(x, y);\n}\n\nuniform float mercatorZoom;\n\nattribute vec3 vertices;\nattribute vec3 positions;\nattribute vec3 colors;\nattribute vec3 pickingColors;\n\nuniform mat4 projectionMatrix;\nuniform mat4 worldMatrix;\n\nuniform float radius;\nuniform float opacity;\nuniform float angle;\n\nuniform float renderPickingBuffer;\nuniform vec3 selected;\nvarying vec4 vColor;\n\nvoid main(void) {\n mat2 rotationMatrix = mat2(cos(angle), -sin(angle), sin(angle), cos(angle));\n vec3 rotatedVertices = vec3(rotationMatrix * vertices.xy * radius, vertices.z);\n vec4 verticesPositions = worldMatrix * vec4(rotatedVertices, 1.0);\n\n vec2 pos = mercatorProject(positions.xy, mercatorZoom);\n\n vec4 centroidPositions = worldMatrix * vec4(pos.xy, positions.z, 0.0);\n vec3 p = centroidPositions.xyz + verticesPositions.xyz;\n gl_Position = projectionMatrix * vec4(p, 1.0);\n\n float alpha = pickingColors == selected ? 0.5 : opacity;\n vColor = vec4(mix(colors / 255., pickingColors / 255., renderPickingBuffer), alpha);\n}\n',
vs: '#define GLSLIFY 1\n// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* fragment shader for the hexagon-layer */\n#define SHADER_NAME hexagon-layer-vs\n\n// viewport: [x, y, width, height]\nconst float TILE_SIZE_1540259130 = 512.0;\nconst float PI = 3.1415926536;\n\n// non-linear projection: lnglats => zoom level depdendent projected coords\nvec2 mercatorProject(vec2 lnglat, float zoom) {\n // Note: Could be precomputed, at the expense of less simple API\n float scale = pow(2.0, zoom) * TILE_SIZE_1540259130 / (PI * 2.0);\n\n float longitude = lnglat.x;\n float latitude = lnglat.y;\n\n float lamda = radians(longitude);\n float phi = radians(latitude);\n\n float x = scale * (lamda + PI);\n float y = scale * (PI - log(tan(PI * 0.25 + phi * 0.5)));\n\n return vec2(x, y);\n}\n\nuniform float mercatorZoom;\n\nattribute vec3 vertices;\n\nattribute vec2 instancePositions;\nattribute float instanceElevations;\nattribute vec3 instanceColors;\nattribute vec3 instancePickingColors;\n\nuniform mat4 worldMatrix;\nuniform mat4 projectionMatrix;\n\nuniform float radius;\nuniform float opacity;\nuniform float angle;\nuniform float elevation;\n\nuniform float renderPickingBuffer;\nuniform vec3 selected;\nvarying vec4 vColor;\n\nvoid main(void) {\n mat2 rotationMatrix = mat2(cos(angle), -sin(angle), sin(angle), cos(angle));\n vec3 rotatedVertices = vec3(rotationMatrix * vertices.xz * radius, vertices.y * elevation);\n vec4 verticesPositions = worldMatrix * vec4(rotatedVertices, 1.0);\n\n vec2 pos = mercatorProject(instancePositions.xy, mercatorZoom);\n\n vec4 centroidPositions = worldMatrix * vec4(pos.xy, instanceElevations, 0.0);\n vec3 p = centroidPositions.xyz + verticesPositions.xyz;\n gl_Position = projectionMatrix * vec4(p, 1.0);\n\n vec4 color = vec4(instanceColors / 255.0, opacity);\n vec4 pickingColor = vec4(instancePickingColors / 255.0, 1.);\n vColor = mix(color, pickingColor, renderPickingBuffer);\n\n // mat2 rotationMatrix = mat2(cos(angle), -sin(angle), sin(angle), cos(angle));\n // vec3 rotatedPosition = vec3(rotationMatrix * vertices.xy * radius, vertices.z * elevation);\n // vec4 verticesPositions = worldMatrix * vec4(rotatedPosition, 1.0);\n\n // vec2 pos = mercatorProject(instancePositions.xy + verticesPositions.xy, mercatorZoom);\n // vec3 p = vec3(pos.xy, instanceElevations + verticesPositions.z);\n // gl_Position = projectionMatrix * vec4(p, 1.0);\n\n // vec2 pos = mercatorProject(vertexPosition.xy, mercatorZoom);\n // vec4 centroidPositions = worldMatrix * vec4(pos.xy, positions.z, 0.0);\n // vec3 p = centroidPositions.xyz + verticesPositions.xyz;\n // vec3 elevatedPos = vec3(p.xy, max(0.01, positions.z * elevation));\n // gl_Position = projectionMatrix * vec4(elevatedPos, 1.0);\n}\n',
fs: '// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* fragment shader for the hexagon-layer */\n#define SHADER_NAME hexagon-layer-fs\n\n#ifdef GL_ES\nprecision highp float;\n#define GLSLIFY 1\n#endif\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n}\n',
id: 'hexagon'
}),
geometry: new _luma.Geometry({
id: this.props.id,
drawMode: 'TRIANGLE_FAN',
vertices: new Float32Array(vertices)
}),
geometry: geometry,
instanced: true
// indexed: true
});
}
}, {
key: 'calculatePositions',
value: function calculatePositions(attribute) {
key: 'calculateInstancePositions',
value: function calculateInstancePositions(attribute) {
var data = this.props.data;

@@ -168,3 +187,2 @@ var value = attribute.value;

value[i + 1] = hexagon.centroid.y;
value[i + 2] = 0;
i += size;

@@ -188,6 +206,7 @@ }

}, {
key: 'calculateColors',
value: function calculateColors(attribute) {
key: 'calculateInstanceElevations',
value: function calculateInstanceElevations(attribute) {
var data = this.props.data;
var value = attribute.value;
var size = attribute.size;

@@ -203,6 +222,4 @@ var i = 0;

value[i + 0] = hexagon.color[0];
value[i + 1] = hexagon.color[1];
value[i + 2] = hexagon.color[2];
i += 3;
value[i + 0] = hexagon.elevation || 0;
i += size;
}

@@ -224,3 +241,38 @@ } catch (err) {

}
}, {
key: 'calculateInstanceColors',
value: function calculateInstanceColors(attribute) {
var data = this.props.data;
var value = attribute.value;
var i = 0;
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
try {
for (var _iterator3 = data[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var hexagon = _step3.value;
value[i + 0] = hexagon.color[0];
value[i + 1] = hexagon.color[1];
value[i + 2] = hexagon.color[2];
i += 3;
}
} catch (err) {
_didIteratorError3 = true;
_iteratorError3 = err;
} finally {
try {
if (!_iteratorNormalCompletion3 && _iterator3.return) {
_iterator3.return();
}
} finally {
if (_didIteratorError3) {
throw _iteratorError3;
}
}
}
}
// TODO this is the only place that uses hexagon vertices

@@ -253,5 +305,6 @@ // consider move radius and angle calculation to the shader

// Calculate angle that the perpendicular hexagon vertex axis is tilted
angle: Math.acos(dx / dxy) * -Math.sign(dy),
angle: Math.acos(dx / dxy) * -Math.sign(dy) + Math.PI / 2,
// Allow user to fine tune radius
radius: dxy / 2 * Math.min(1, this.props.dotRadius)
radius: dxy / 2 * Math.min(1, this.props.dotRadius),
elevation: this.props.elevation
});

@@ -265,2 +318,2 @@ }

exports.default = HexagonLayer;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9sYXllcnMvaGV4YWdvbi1sYXllci9oZXhhZ29uLWxheWVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7QUFvQkE7Ozs7QUFDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQ0EsSUFBTSxVQUFVLFFBQVEsU0FBUixDQUFoQjs7QUFFQSxJQUFNLGFBQWE7QUFDakIsYUFBVyxFQUFDLE1BQU0sQ0FBUCxFQUFVLEtBQUssR0FBZixFQUFvQixLQUFLLEdBQXpCLEVBQThCLEtBQUssUUFBbkMsRUFETTtBQUVqQixVQUFRLEVBQUMsTUFBTSxDQUFQLEVBQVUsS0FBSyxLQUFmLEVBQXNCLEtBQUssT0FBM0IsRUFBb0MsS0FBSyxNQUF6QztBQUZTLENBQW5COztJQUtxQixZOzs7Ozs7Ozs7Ozs7Ozs7OztBQWNuQix3QkFBWSxJQUFaLEVBQWtCO0FBQUE7O0FBQUE7QUFFZCxpQkFBVyxFQUZHO0FBR2QsaUJBQVc7QUFIRyxPQUlYLElBSlc7QUFNakI7Ozs7c0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Gguc3FydChkeCAqIGR4ICsgZHkgKiBkeSk7XG5cbiAgICB0aGlzLnNldFVuaWZvcm1zKHtcbiAgICAgIC8vIENhbGN1bGF0ZSBhbmdsZSB0aGF0IHRoZSBwZXJwZW5kaWN1bGFyIGhleGFnb24gdmVydGV4IGF4aXMgaXMgdGlsdGVkXG4gICAgICBhbmdsZTogTWF0aC5hY29zKGR4IC8gZHh5KSAqIC1NYXRoLnNpZ24oZHkpICsgTWF0aC5QSSAvIDIsXG4gICAgICAvLyBBbGxvdyB1c2VyIHRvIGZpbmUgdHVuZSByYWRpdXNcbiAgICAgIHJhZGl1czogZHh5IC8gMiAqIE1hdGgubWluKDEsIHRoaXMucHJvcHMuZG90UmFkaXVzKSxcbiAgICAgIGVsZXZhdGlvbjogdGhpcy5wcm9wcy5lbGV2YXRpb25cbiAgICB9KTtcblxuICB9XG5cbn1cbiJdfQ==

@@ -49,4 +49,4 @@ 'use strict';

var ATTRIBUTES = {
positions: { size: 3, '0': 'x', '1': 'y', '2': 'unused' },
colors: { size: 3, '0': 'red', '1': 'green', '2': 'blue' }
instancePositions: { size: 3, '0': 'x', '1': 'y', '2': 'unused' },
instanceColors: { size: 3, '0': 'red', '1': 'green', '2': 'blue' }
};

@@ -92,4 +92,4 @@

attributeManager.addInstanced(ATTRIBUTES, {
positions: { update: this.calculatePositions },
colors: { update: this.calculateColors }
instancePositions: { update: this.calculateInstancePositions },
instanceColors: { update: this.calculateInstanceColors }
});

@@ -121,4 +121,4 @@ }

program: new _luma.Program(gl, {
vs: '#define GLSLIFY 1\n// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* vertex shader for the scatterplot-layer */\n#define SHADER_NAME scatterplot-layer-vs\n\n// viewport: [x, y, width, height]\nconst float TILE_SIZE_1540259130 = 512.0;\nconst float PI = 3.1415926536;\n\n// non-linear projection: lnglats => zoom level depdendent projected coords\nvec2 mercatorProject(vec2 lnglat, float zoom) {\n // Note: Could be precomputed, at the expense of less simple API\n float scale = pow(2.0, zoom) * TILE_SIZE_1540259130 / (PI * 2.0);\n\n float longitude = lnglat.x;\n float latitude = lnglat.y;\n\n float lamda = radians(longitude);\n float phi = radians(latitude);\n\n float x = scale * (lamda + PI);\n float y = scale * (PI - log(tan(PI * 0.25 + phi * 0.5)));\n\n return vec2(x, y);\n}\n\nuniform float mercatorZoom;\n\nattribute vec3 vertices;\nattribute vec3 positions;\nattribute vec3 colors;\n\nuniform float radius;\n\nuniform mat4 worldMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec3 vColor;\nattribute vec3 pickingColors;\nuniform float renderPickingBuffer;\n\nvoid main(void) {\n vColor = mix(colors / 255.0, pickingColors / 255.0, renderPickingBuffer);\n\n // vec2 pos = mercatorProjectViewport(positions.xy, mercatorZoom, mercatorCenter, viewport);\n vec2 pos = mercatorProject(positions.xy, mercatorZoom);\n vec3 p = vec3(pos, positions.z) + vertices * radius;\n gl_Position = projectionMatrix * worldMatrix * vec4(p, 1.0);\n}\n',
fs: '// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* fragment shader for the scatterplot-layer */\n#define SHADER_NAME scatterplot-layer-fs\n\n#ifdef GL_ES\nprecision highp float;\n#define GLSLIFY 1\n#endif\n\nvarying vec3 vColor;\nuniform float opacity;\n\nvoid main(void) {\n gl_FragColor = vec4(vColor, opacity);\n}\n',
vs: '#define GLSLIFY 1\n// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* vertex shader for the scatterplot-layer */\n#define SHADER_NAME scatterplot-layer-vs\n\n// viewport: [x, y, width, height]\nconst float TILE_SIZE_1540259130 = 512.0;\nconst float PI = 3.1415926536;\n\n// non-linear projection: lnglats => zoom level depdendent projected coords\nvec2 mercatorProject(vec2 lnglat, float zoom) {\n // Note: Could be precomputed, at the expense of less simple API\n float scale = pow(2.0, zoom) * TILE_SIZE_1540259130 / (PI * 2.0);\n\n float longitude = lnglat.x;\n float latitude = lnglat.y;\n\n float lamda = radians(longitude);\n float phi = radians(latitude);\n\n float x = scale * (lamda + PI);\n float y = scale * (PI - log(tan(PI * 0.25 + phi * 0.5)));\n\n return vec2(x, y);\n}\n\nuniform float mercatorZoom;\n\nattribute vec3 vertices;\nattribute vec3 instancePositions;\nattribute vec3 instanceColors;\nattribute vec3 instancePickingColors;\n\nuniform float radius;\nuniform float opacity;\n\nuniform mat4 worldMatrix;\nuniform mat4 projectionMatrix;\n\nvarying vec4 vColor;\nuniform float renderPickingBuffer;\n\nvoid main(void) {\n vec2 pos = mercatorProject(instancePositions.xy, mercatorZoom);\n vec3 p = vec3(pos, instancePositions.z) + vertices * radius;\n gl_Position = projectionMatrix * worldMatrix * vec4(p, 1.0);\n\n vec4 color = vec4(instanceColors / 255.0, 1.);\n vec4 pickingColor = vec4(instancePickingColors / 255.0, 1.);\n vColor = mix(color, pickingColor, renderPickingBuffer);\n}\n',
fs: '// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* fragment shader for the scatterplot-layer */\n#define SHADER_NAME scatterplot-layer-fs\n\n#ifdef GL_ES\nprecision highp float;\n#define GLSLIFY 1\n#endif\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n}\n',
id: 'scatterplot'

@@ -144,4 +144,4 @@ }),

}, {
key: 'calculatePositions',
value: function calculatePositions(attribute) {
key: 'calculateInstancePositions',
value: function calculateInstancePositions(attribute) {
var data = this.props.data;

@@ -181,4 +181,4 @@ var value = attribute.value;

}, {
key: 'calculateColors',
value: function calculateColors(attribute) {
key: 'calculateInstanceColors',
value: function calculateInstanceColors(attribute) {
var data = this.props.data;

@@ -240,2 +240,2 @@ var value = attribute.value;

exports.default = ScatterplotLayer;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9sYXllcnMvc2NhdHRlcnBsb3QtbGF5ZXIvc2NhdHRlcnBsb3QtbGF5ZXIuanMiXSwibmFtZXMiOltdL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ZhbHVlW2kgKyAyXSA9IHBvaW50LmNvbG9yWzJdO1xuICAgICAgaSArPSBzaXplO1xuICAgIH1cbiAgfVxuXG4gIGNhbGN1bGF0ZVJhZGl1cygpIHtcbiAgICAvLyB1c2UgcmFkaXVzIGlmIHNwZWNpZmllZFxuICAgIGlmICh0aGlzLnByb3BzLnJhZGl1cykge1xuICAgICAgdGhpcy5zdGF0ZS5yYWRpdXMgPSB0aGlzLnByb3BzLnJhZGl1cztcbiAgICAgIHJldHVybjtcbiAgICB9XG5cbiAgICBjb25zdCBwaXhlbDAgPSB0aGlzLnByb2plY3Qoe2xvbjogLTEyMiwgbGF0OiAzNy41fSk7XG4gICAgY29uc3QgcGl4ZWwxID0gdGhpcy5wcm9qZWN0KHtsb246IC0xMjIsIGxhdDogMzcuNTAwMn0pO1xuXG4gICAgY29uc3QgZHggPSBwaXhlbDAueCAtIHBpeGVsMS54O1xuICAgIGNvbnN0IGR5ID0gcGl4ZWwwLnkgLSBwaXhlbDEueTtcblxuICAgIHRoaXMuc3RhdGUucmFkaXVzID0gTWF0aC5tYXgoTWF0aC5zcXJ0KGR4ICogZHggKyBkeSAqIGR5KSwgMi4wKTtcbiAgfVxuXG59XG4iXX0=

@@ -195,3 +195,3 @@ 'use strict';

try {
gl = (0, _luma.createGLContext)(canvas);
gl = (0, _luma.createGLContext)(canvas, { preserveDrawingBuffer: true });
} catch (error) {

@@ -227,3 +227,3 @@ this.props.onInitializationFailed(error);

var pickedModels = scene.pickModels(gl, { camera: camera, x: x, y: y });
var pickedModels = scene.pickModels(gl, { camera: camera, x: x * 2, y: y * 2 });

@@ -329,2 +329,2 @@ return pickedModels;

exports.default = WebGLRenderer;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy93ZWJnbC1yZW5kZXJlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7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gICAgc2NlbmUucmVuZGVyKHtjYW1lcmF9KTtcbiAgICBvbkFmdGVyUmVuZGVyRnJhbWUoKTtcbiAgfVxuXG4gIC8qKlxuICAgKiBNYWluIFdlYkdMIGFuaW1hdGlvbiBsb29wXG4gICAqL1xuICBAYXV0b2JpbmRcbiAgX2FuaW1hdGlvbkxvb3AoKSB7XG4gICAgdGhpcy5fcmVuZGVyRnJhbWUoKTtcbiAgICAvLyBLZWVwIHJlZ2lzdGVyaW5nIG91cnNlbHZlcyBmb3IgdGhlIG5leHQgYW5pbWF0aW9uIGZyYW1lXG4gICAgRngucmVxdWVzdEFuaW1hdGlvbkZyYW1lKHRoaXMuX2FuaW1hdGlvbkxvb3ApO1xuICB9XG5cbiAgcmVuZGVyKCkge1xuICAgIGNvbnN0IHtpZCwgd2lkdGgsIGhlaWdodCwgcGl4ZWxSYXRpb30gPSB0aGlzLnByb3BzO1xuICAgIHJldHVybiAoXG4gICAgICA8Y2FudmFzXG4gICAgICAgIHJlZj17ICdvdmVybGF5JyB9XG4gICAgICAgIGlkPXsgaWQgfVxuICAgICAgICB3aWR0aD17IHdpZHRoICogcGl4ZWxSYXRpbyB8fCAxIH1cbiAgICAgICAgaGVpZ2h0PXsgaGVpZ2h0ICogcGl4ZWxSYXRpbyB8fCAxIH1cbiAgICAgICAgc3R5bGU9eyB7d2lkdGgsIGhlaWdodH0gfS8+XG4gICAgKTtcbiAgfVxuXG59XG4iXX0=

@@ -5,3 +5,3 @@ {

"license": "MIT",
"version": "3.0.0-beta7",
"version": "3.0.0-beta8",
"keywords": [

@@ -99,6 +99,6 @@ "webgl",

"test-node": "babel-node --only=luma.gl,deck.gl/src,deck.gl/test test/node.js | faucet",
"test-browser": "budo test/browser.js:build/test-bundle.js --dir test -t babelify --live --open --port 3001 --watch-glob '**/*.{html,css,scss,js}' -- -t babelify -t glslify",
"test-browser": "budo test/browser.js:build/test-bundle.js --dir test --live --open --port 3001 --watch-glob '**/*.{html,css,scss,js,glsl}' -- -t babelify",
"test-electron": "browserify test/electron.js | testron | faucet",
"start": "budo example/main.js:example/bundle.js --live --open --port 3000 --watch-glob '**/*.{html,css,js}' -- -t babelify -t glslify -t envify"
"start": "budo example/main.js:example/bundle.js --live --open --port 3000 --css example/main.css --title 'deck.gl' --watch-glob '**/*.{html,css,js,glsl}' -- -t babelify -t envify"
}
}

@@ -247,3 +247,3 @@ # deck.gl

**Note:** The application can provide some buffers and let others be managed
by the layer. As an example management of the `pickingColors` buffer is
by the layer. As an example management of the `instancePickingColors` buffer is
normally left to the layer.

@@ -250,0 +250,0 @@

@@ -31,4 +31,3 @@ /* eslint-disable guard-for-in */

// Returns attributes in a format suitable for use with Luma.gl objects
//
// Returns attributes in a format suitable for use with Luma.gl Model/Program
getAttributes() {

@@ -38,2 +37,3 @@ return this.attributes;

// Returns the redraw flag
getNeedsRedraw({clearFlag}) {

@@ -47,8 +47,9 @@ const needsRedraw = this.needsRedraw;

// Adds a static attribute (that is not auto updated)
add(attributes, updaters) {
const newAttributes = this._add(attributes, updaters, {});
// and instancedAttributes (for updating when data changes)
Object.assign(this.attributes, newAttributes);
}
// Adds a dynamic attribute, that is autoupdated
addDynamic(attributes, updaters) {

@@ -58,6 +59,6 @@ const newAttributes = this._add(attributes, updaters, {

});
// and instancedAttributes (for updating when data changes)
Object.assign(this.attributes, newAttributes);
}
// Adds an instanced attribute that is autoupdated
addInstanced(attributes, updaters) {

@@ -69,33 +70,6 @@ const newAttributes = this._add(attributes, updaters, {

Object.assign(this.attributes, newAttributes);
// and instancedAttributes (for updating when data changes)
Object.assign(this.instancedAttributes, newAttributes);
}
addVertices(vertexArray) {
assert(vertexArray instanceof Float32Array);
this.add({
vertices: {value: vertexArray, size: 3, '0': 'x', '1': 'y', '2': 'z'}
});
}
addNormals(normalArray) {
assert(normalArray instanceof Float32Array);
this.add({
normals: {value: normalArray, size: 3, '0': 'x', '1': 'y', '2': 'z'}
});
}
addIndices(indexArray, gl) {
assert(indexArray instanceof Uint16Array);
assert(gl);
this.add({
indices: {
value: indexArray,
size: 1,
bufferType: gl.ELEMENT_ARRAY_BUFFER,
drawMode: gl.STATIC_DRAW,
'0': 'index'
}
});
}
// Marks an attribute for update

@@ -102,0 +76,0 @@ invalidate(attributeName) {

@@ -34,2 +34,4 @@ // Copyright (c) 2015 Uber Technologies, Inc.

const DEFAULT_PIXEL_RATIO = typeof window !== 'undefined' ? window.devicePixelRatio : 1;
const PROP_TYPES = {

@@ -42,3 +44,5 @@ width: PropTypes.number.isRequired,

// TODO - replace with actual map view state props, build matrix from those
projectionMatrix: PropTypes.any
projectionMatrix: PropTypes.any,
pixelRatio: PropTypes.number,
onWebGLInitialized: PropTypes.func
};

@@ -49,3 +53,5 @@

camera: null,
projectionMatrix: null
projectionMatrix: null,
pixelRatio: DEFAULT_PIXEL_RATIO,
onWebGLInitialized: () => {}
};

@@ -103,2 +109,3 @@

_onRendererInitialized({gl}) {
this.props.onWebGLInitialized(gl);
this.setState({

@@ -144,3 +151,3 @@ gl,

const {
width, height, layers, blending, projectionMatrix, ...otherProps
width, height, layers, blending, projectionMatrix, pixelRatio, ...otherProps
} = this.props;

@@ -188,3 +195,3 @@ let {camera} = this.props;

blending={ blending }
pixelRatio={ window.devicePixelRatio }
pixelRatio={ pixelRatio }

@@ -191,0 +198,0 @@ onRendererInitialized={ this._onRendererInitialized }

@@ -61,3 +61,4 @@ // Copyright (c) 2015 Uber Technologies, Inc.

const ATTRIBUTES = {
pickingColors: {size: 3, '0': 'pickRed', '1': 'pickGreen', '2': 'pickBlue'}
instancePickingColors:
{size: 3, '0': 'pickRed', '1': 'pickGreen', '2': 'pickBlue'}
};

@@ -323,6 +324,6 @@

const {attributeManager} = this.state;
// All instanced layers get pickingColors attribute by default
// All instanced layers get instancePickingColors attribute by default
// Their shaders can use it to render a picking scene
attributeManager.addInstanced(ATTRIBUTES, {
pickingColors: {update: this.calculatePickingColors}
instancePickingColors: {update: this.calculateInstancePickingColors}
});

@@ -380,3 +381,3 @@

calculatePickingColors(attribute, numInstances) {
calculateInstancePickingColors(attribute, numInstances) {
const {value, size} = attribute;

@@ -414,4 +415,5 @@ // add 1 to index to seperate from no selection

info.index = this.decodePickingColor(color);
if (Array.isArray(this.data)) {
info.object = this.data[info.index];
// If props.data is an indexable array, get the object
if (Array.isArray(this.props.data)) {
info.object = this.props.data[info.index];
}

@@ -424,2 +426,3 @@ info.geoCoords = this.unproject({x: info.x, y: info.y});

const {color} = info;
const selectedPickingColor = new Float32Array(3);

@@ -462,8 +465,3 @@ selectedPickingColor[0] = color[0];

this.setState({
viewport: {
x: 0,
y: 0,
width,
height
},
viewport: {x: 0, y: 0, width, height},
mercator: ViewportMercator({

@@ -470,0 +468,0 @@ width, height, latitude, longitude, zoom,

@@ -26,3 +26,3 @@ // Copyright (c) 2015 Uber Technologies, Inc.

const ATTRIBUTES = {
positions: {size: 4, '0': 'x0', '1': 'y0', '2': 'x1', '3': 'y1'}
instancePositions: {size: 4, '0': 'x0', '1': 'y0', '2': 'x1', '3': 'y1'}
};

@@ -38,5 +38,12 @@

*/
constructor(opts) {
constructor({
strokeWidth = 1,
color0 = [255, 0, 0],
color1 = [0, 0, 255],
...opts
} = {}) {
super({
strokeWidth: 1,
strokeWidth,
color0,
color1,
...opts

@@ -54,3 +61,3 @@ });

attributeManager.addInstanced(ATTRIBUTES, {
positions: {update: this.calculatePositions}
instancePositions: {update: this.calculateInstancePositions}
});

@@ -62,6 +69,4 @@

willReceiveProps(oldProps, nextProps) {
super.willReceiveProps(oldProps, nextProps);
this.state.model.userData.strokeWidth = nextProps.strokeWidth;
this.updateColors();

@@ -71,6 +76,6 @@ }

createModel(gl) {
let vertices = [];
let positions = [];
const NUM_SEGMENTS = 50;
for (let i = 0; i < NUM_SEGMENTS; i++) {
vertices = [...vertices, i, i, i];
positions = [...positions, i, i, i];
}

@@ -87,13 +92,11 @@

drawMode: 'LINE_STRIP',
vertices: new Float32Array(vertices)
vertices: new Float32Array(positions)
}),
instanced: true,
onBeforeRender() {
const {gl} = this.program;
this.userData.oldStrokeWidth = gl.getParameter(gl.LINE_WIDTH);
gl.lineWidth(this.userData.strokeWidth || 1);
this.program.gl.lineWidth(this.userData.strokeWidth || 1);
},
onAfterRender() {
const {gl} = this.program;
gl.lineWidth(this.userData.oldStrokeWidth || 1);
this.program.gl.lineWidth(this.userData.oldStrokeWidth || 1);
}

@@ -104,13 +107,9 @@ });

updateColors() {
// Get colors from first object
const object = this.getFirstObject();
if (object) {
this.setUniforms({
color0: object.colors.c0,
color1: object.colors.c1
});
}
this.setUniforms({
color0: this.props.color0,
color1: this.props.color1
});
}
calculatePositions(attribute) {
calculateInstancePositions(attribute) {
const {data} = this.props;

@@ -117,0 +116,0 @@ const {value, size} = attribute;

@@ -29,4 +29,4 @@ // Copyright (c) 2015 Uber Technologies, Inc.

const ATTRIBUTES = {
vertices: {size: 3, '0': 'x', '1': 'y', '2': 'unused'},
indices: {size: 1, '0': 'index'},
positions: {size: 3, '0': 'x', '1': 'y', '2': 'unused'},
colors: {size: 3, '0': 'red', '1': 'green', '2': 'blue'},

@@ -63,3 +63,3 @@ // Override picking colors to prevent auto allocation

indices: {update: this.calculateIndices},
vertices: {update: this.calculateVertices},
positions: {update: this.calculatePositions},
colors: {update: this.calculateColors},

@@ -110,3 +110,3 @@ // Instanced attributes

calculateVertices(attribute) {
calculatePositions(attribute) {
const vertices = flattenDeep(this.state.groupedVertices);

@@ -113,0 +113,0 @@ attribute.value = new Float32Array(vertices);

@@ -26,4 +26,4 @@ // Copyright (c) 2015 Uber Technologies, Inc.

const ATTRIBUTES = {
positions: {size: 3, '0': 'x', '1': 'y', '2': 'unused'},
colors: {size: 4, '0': 'red', '1': 'green', '2': 'blue', '3': 'alpha'}
instancePositions: {size: 3, '0': 'x', '1': 'y', '2': 'unused'},
instanceColors: {size: 4, '0': 'red', '1': 'green', '2': 'blue', '3': 'alpha'}
};

@@ -62,4 +62,4 @@

attributeManager.addInstanced(ATTRIBUTES, {
positions: {update: this.calculatePositions},
colors: {update: this.calculateColors}
instancePositions: {update: this.calculateInstancePositions},
instanceColors: {update: this.calculateInstanceColors}
});

@@ -122,3 +122,3 @@

calculatePositions(attribute, numInstances) {
calculateInstancePositions(attribute, numInstances) {
const {unitWidth, unitHeight, width, height} = this.props;

@@ -137,3 +137,3 @@ const {numCol} = this.state;

calculateColors(attribute) {
calculateInstanceColors(attribute) {
const {data, unitWidth, unitHeight, width, height} = this.props;

@@ -140,0 +140,0 @@ const {numCol, numRow} = this.state;

@@ -22,8 +22,9 @@ // Copyright (c) 2015 Uber Technologies, Inc.

import Layer from '../../layer';
import {Model, Program, Geometry} from 'luma.gl';
import {Model, Program, Geometry, CylinderGeometry} from 'luma.gl';
const glslify = require('glslify');
const ATTRIBUTES = {
positions: {size: 3, '0': 'x', '1': 'y', '2': 'unused'},
colors: {size: 3, '0': 'red', '1': 'green', '2': 'blue'}
instancePositions: {size: 2, '0': 'x', '1': 'y'},
instanceElevations: {size: 1, '0': 'z'},
instanceColors: {size: 3, '0': 'red', '1': 'green', '2': 'blue'}
};

@@ -48,3 +49,3 @@

dotRadius: 10,
elevation: 0,
elevation: 100,
...opts

@@ -62,4 +63,5 @@ });

attributeManager.addInstanced(ATTRIBUTES, {
positions: {update: this.calculatePositions},
colors: {update: this.calculateColors}
instancePositions: {update: this.calculateInstancePositions},
instanceElevations: {update: this.calculateInstanceElevations},
instanceColors: {update: this.calculateInstanceColors}
});

@@ -76,7 +78,6 @@

if (dataChanged || viewportChanged) {
attributeManager.invalidate('positions');
this.calculateRadiusAndAngle();
}
if (dataChanged) {
attributeManager.invalidate('colors');
attributeManager.invalidateAll();
}

@@ -86,15 +87,33 @@ }

getModel(gl) {
const NUM_SEGMENTS = 6;
const PI2 = Math.PI * 2;
const geometry = new CylinderGeometry({
id: this.props.id,
radius: 1,
topRadius: 1,
bottomRadius: 1,
topCap: true,
bottomCap: true,
height: 1,
nradial: 6,
nvertical: 1
});
let vertices = [];
for (let i = 0; i < NUM_SEGMENTS; i++) {
vertices = [
...vertices,
Math.cos(PI2 * i / NUM_SEGMENTS),
Math.sin(PI2 * i / NUM_SEGMENTS),
0
];
}
// const NUM_SEGMENTS = 6;
// const PI2 = Math.PI * 2;
// let vertices = [];
// for (let i = 0; i < NUM_SEGMENTS; i++) {
// vertices = [
// ...vertices,
// Math.cos(PI2 * i / NUM_SEGMENTS),
// Math.sin(PI2 * i / NUM_SEGMENTS),
// 0
// ];
// }
// const geometry = new Geometry({
// id: this.props.id,
// drawMode: 'TRIANGLE_FAN',
// vertices: new Float32Array(vertices)
// });
return new Model({

@@ -106,12 +125,9 @@ program: new Program(gl, {

}),
geometry: new Geometry({
id: this.props.id,
drawMode: 'TRIANGLE_FAN',
vertices: new Float32Array(vertices)
}),
geometry,
instanced: true
// indexed: true
});
}
calculatePositions(attribute) {
calculateInstancePositions(attribute) {
const {data} = this.props;

@@ -123,3 +139,2 @@ const {value, size} = attribute;

value[i + 1] = hexagon.centroid.y;
value[i + 2] = 0;
i += size;

@@ -129,4 +144,14 @@ }

calculateColors(attribute) {
calculateInstanceElevations(attribute) {
const {data} = this.props;
const {value, size} = attribute;
let i = 0;
for (const hexagon of data) {
value[i + 0] = hexagon.elevation || 0;
i += size;
}
}
calculateInstanceColors(attribute) {
const {data} = this.props;
const {value} = attribute;

@@ -165,5 +190,6 @@ let i = 0;

// Calculate angle that the perpendicular hexagon vertex axis is tilted
angle: Math.acos(dx / dxy) * -Math.sign(dy),
angle: Math.acos(dx / dxy) * -Math.sign(dy) + Math.PI / 2,
// Allow user to fine tune radius
radius: dxy / 2 * Math.min(1, this.props.dotRadius)
radius: dxy / 2 * Math.min(1, this.props.dotRadius),
elevation: this.props.elevation
});

@@ -170,0 +196,0 @@

@@ -26,4 +26,4 @@ // Copyright (c) 2015 Uber Technologies, Inc.

const ATTRIBUTES = {
positions: {size: 3, '0': 'x', '1': 'y', '2': 'unused'},
colors: {size: 3, '0': 'red', '1': 'green', '2': 'blue'}
instancePositions: {size: 3, '0': 'x', '1': 'y', '2': 'unused'},
instanceColors: {size: 3, '0': 'red', '1': 'green', '2': 'blue'}
};

@@ -58,4 +58,4 @@

attributeManager.addInstanced(ATTRIBUTES, {
positions: {update: this.calculatePositions},
colors: {update: this.calculateColors}
instancePositions: {update: this.calculateInstancePositions},
instanceColors: {update: this.calculateInstanceColors}
});

@@ -109,3 +109,3 @@ }

calculatePositions(attribute) {
calculateInstancePositions(attribute) {
const {data} = this.props;

@@ -122,3 +122,3 @@ const {value, size} = attribute;

calculateColors(attribute) {
calculateInstanceColors(attribute) {
const {data} = this.props;

@@ -125,0 +125,0 @@ const {value, size} = attribute;

@@ -114,3 +114,3 @@ // Copyright (c) 2015 Uber Technologies, Inc.

try {
gl = createGLContext(canvas);
gl = createGLContext(canvas, {preserveDrawingBuffer: true});
} catch (error) {

@@ -140,3 +140,3 @@ this.props.onInitializationFailed(error);

const pickedModels = scene.pickModels(gl, {camera, x, y});
const pickedModels = scene.pickModels(gl, {camera, x: x * 2, y: y * 2});

@@ -143,0 +143,0 @@ return pickedModels;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc