@deck.gl/layers
Advanced tools
Comparing version 7.0.0-alpha.5 to 7.0.0-alpha.6
@@ -44,12 +44,12 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "GridCellLayer", { | ||
Object.defineProperty(exports, "ColumnLayer", { | ||
enumerable: true, | ||
get: function get() { | ||
return _gridCellLayer.default; | ||
return _columnLayer.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "HexagonCellLayer", { | ||
Object.defineProperty(exports, "GridCellLayer", { | ||
enumerable: true, | ||
get: function get() { | ||
return _hexagonCellLayer.default; | ||
return _gridCellLayer.default; | ||
} | ||
@@ -106,5 +106,5 @@ }); | ||
var _gridCellLayer = _interopRequireDefault(require("./grid-cell-layer/grid-cell-layer")); | ||
var _columnLayer = _interopRequireDefault(require("./column-layer/column-layer")); | ||
var _hexagonCellLayer = _interopRequireDefault(require("./hexagon-cell-layer/hexagon-cell-layer")); | ||
var _gridCellLayer = _interopRequireDefault(require("./column-layer/grid-cell-layer")); | ||
@@ -111,0 +111,0 @@ var _pathLayer = _interopRequireDefault(require("./path-layer/path-layer")); |
@@ -7,4 +7,4 @@ "use strict"; | ||
exports.default = void 0; | ||
var _default = "#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * instanceWidths / 2.0;\n vec2 offset_clipspace = project_pixel_to_clipspace(offset_screenspace).xy;\n\n return offset_clipspace;\n}\n\nvoid main(void) {\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.));\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.));\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n vec2 offset = getExtrusionOffset(target.xy - source.xy, positions.y);\n gl_Position = p + vec4(offset, 0.0, 0.0);\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n picking_setPickingColor(instancePickingColors);\n}\n"; | ||
var _default = "#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0;\n vec2 offset_clipspace = project_pixel_to_clipspace(offset_screenspace).xy;\n\n return offset_clipspace;\n}\n\nvoid main(void) {\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.));\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.));\n float width = clamp(\n project_scale(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n vec2 offset = getExtrusionOffset(target.xy - source.xy, positions.y, width);\n gl_Position = p + vec4(offset, 0.0, 0.0);\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n picking_setPickingColor(instancePickingColors);\n}\n"; | ||
exports.default = _default; | ||
//# sourceMappingURL=line-layer-vertex.glsl.js.map |
@@ -52,8 +52,23 @@ "use strict"; | ||
}, | ||
getStrokeWidth: { | ||
getWidth: { | ||
type: 'accessor', | ||
value: 1 | ||
}, | ||
strokeWidth: { | ||
deprecatedFor: 'getStrokeWidth' | ||
widthScale: { | ||
type: 'number', | ||
value: 1, | ||
min: 0 | ||
}, | ||
widthMinPixels: { | ||
type: 'number', | ||
value: 1, | ||
min: 0 | ||
}, | ||
widthMaxPixels: { | ||
type: 'number', | ||
value: Number.MAX_SAFE_INTEGER, | ||
min: 0 | ||
}, | ||
getStrokeWidth: { | ||
deprecatedFor: 'getWidth' | ||
} | ||
@@ -110,3 +125,3 @@ }; | ||
transition: true, | ||
accessor: 'getStrokeWidth', | ||
accessor: 'getWidth', | ||
defaultValue: 1 | ||
@@ -140,2 +155,8 @@ } | ||
} | ||
this.state.model.setUniforms({ | ||
widthScale: props.widthScale, | ||
widthMinPixels: props.widthMinPixels, | ||
widthMaxPixels: props.widthMaxPixels | ||
}); | ||
} | ||
@@ -173,4 +194,3 @@ }, { | ||
getTargetPosition = _this$props.getTargetPosition; | ||
var value = attribute.value, | ||
size = attribute.size; | ||
var value = attribute.value; | ||
var i = 0; | ||
@@ -192,7 +212,6 @@ | ||
var targetPosition = getTargetPosition(object, objectInfo); | ||
value[i + 0] = fp64LowPart(sourcePosition[0]); | ||
value[i + 1] = fp64LowPart(sourcePosition[1]); | ||
value[i + 2] = fp64LowPart(targetPosition[0]); | ||
value[i + 3] = fp64LowPart(targetPosition[1]); | ||
i += size; | ||
value[i++] = fp64LowPart(sourcePosition[0]); | ||
value[i++] = fp64LowPart(sourcePosition[1]); | ||
value[i++] = fp64LowPart(targetPosition[0]); | ||
value[i++] = fp64LowPart(targetPosition[1]); | ||
} | ||
@@ -199,0 +218,0 @@ } catch (err) { |
@@ -7,4 +7,4 @@ export { default as ArcLayer } from './arc-layer/arc-layer'; | ||
export { default as ScatterplotLayer } from './scatterplot-layer/scatterplot-layer'; | ||
export { default as GridCellLayer } from './grid-cell-layer/grid-cell-layer'; | ||
export { default as HexagonCellLayer } from './hexagon-cell-layer/hexagon-cell-layer'; | ||
export { default as ColumnLayer } from './column-layer/column-layer'; | ||
export { default as GridCellLayer } from './column-layer/grid-cell-layer'; | ||
export { default as PathLayer } from './path-layer/path-layer'; | ||
@@ -11,0 +11,0 @@ export { default as PolygonLayer } from './polygon-layer/polygon-layer'; |
@@ -13,2 +13,5 @@ export default `\ | ||
uniform float opacity; | ||
uniform float widthScale; | ||
uniform float widthMinPixels; | ||
uniform float widthMaxPixels; | ||
@@ -19,3 +22,3 @@ varying vec4 vColor; | ||
// offset_direction is -1 (left) or 1 (right) | ||
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) { | ||
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) { | ||
// normalized direction of the line | ||
@@ -26,3 +29,3 @@ vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize); | ||
vec2 offset_screenspace = dir_screenspace * offset_direction * instanceWidths / 2.0; | ||
vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0; | ||
vec2 offset_clipspace = project_pixel_to_clipspace(offset_screenspace).xy; | ||
@@ -38,2 +41,9 @@ | ||
// Multiply out width and clamp to limits | ||
// mercator pixels are interpreted as screen pixels | ||
float width = clamp( | ||
project_scale(instanceWidths * widthScale), | ||
widthMinPixels, widthMaxPixels | ||
); | ||
// linear interpolation of source & target to pick right coord | ||
@@ -44,3 +54,3 @@ float segmentIndex = positions.x; | ||
// extrude | ||
vec2 offset = getExtrusionOffset(target.xy - source.xy, positions.y); | ||
vec2 offset = getExtrusionOffset(target.xy - source.xy, positions.y, width); | ||
gl_Position = p + vec4(offset, 0.0, 0.0); | ||
@@ -47,0 +57,0 @@ |
@@ -22,8 +22,23 @@ import { Layer, createIterable } from '@deck.gl/core'; | ||
}, | ||
getStrokeWidth: { | ||
getWidth: { | ||
type: 'accessor', | ||
value: 1 | ||
}, | ||
strokeWidth: { | ||
deprecatedFor: 'getStrokeWidth' | ||
widthScale: { | ||
type: 'number', | ||
value: 1, | ||
min: 0 | ||
}, | ||
widthMinPixels: { | ||
type: 'number', | ||
value: 1, | ||
min: 0 | ||
}, | ||
widthMaxPixels: { | ||
type: 'number', | ||
value: Number.MAX_SAFE_INTEGER, | ||
min: 0 | ||
}, | ||
getStrokeWidth: { | ||
deprecatedFor: 'getWidth' | ||
} | ||
@@ -69,3 +84,3 @@ }; | ||
transition: true, | ||
accessor: 'getStrokeWidth', | ||
accessor: 'getWidth', | ||
defaultValue: 1 | ||
@@ -98,2 +113,8 @@ } | ||
} | ||
this.state.model.setUniforms({ | ||
widthScale: props.widthScale, | ||
widthMinPixels: props.widthMinPixels, | ||
widthMaxPixels: props.widthMaxPixels | ||
}); | ||
} | ||
@@ -129,4 +150,3 @@ | ||
getTargetPosition = _this$props.getTargetPosition; | ||
const value = attribute.value, | ||
size = attribute.size; | ||
const value = attribute.value; | ||
let i = 0; | ||
@@ -142,7 +162,6 @@ | ||
const targetPosition = getTargetPosition(object, objectInfo); | ||
value[i + 0] = fp64LowPart(sourcePosition[0]); | ||
value[i + 1] = fp64LowPart(sourcePosition[1]); | ||
value[i + 2] = fp64LowPart(targetPosition[0]); | ||
value[i + 3] = fp64LowPart(targetPosition[1]); | ||
i += size; | ||
value[i++] = fp64LowPart(sourcePosition[0]); | ||
value[i++] = fp64LowPart(sourcePosition[1]); | ||
value[i++] = fp64LowPart(targetPosition[0]); | ||
value[i++] = fp64LowPart(targetPosition[1]); | ||
} | ||
@@ -149,0 +168,0 @@ } |
@@ -7,4 +7,4 @@ export { default as ArcLayer } from './arc-layer/arc-layer'; | ||
export { default as ScatterplotLayer } from './scatterplot-layer/scatterplot-layer'; | ||
export { default as GridCellLayer } from './grid-cell-layer/grid-cell-layer'; | ||
export { default as HexagonCellLayer } from './hexagon-cell-layer/hexagon-cell-layer'; | ||
export { default as ColumnLayer } from './column-layer/column-layer'; | ||
export { default as GridCellLayer } from './column-layer/grid-cell-layer'; | ||
export { default as PathLayer } from './path-layer/path-layer'; | ||
@@ -11,0 +11,0 @@ export { default as PolygonLayer } from './polygon-layer/polygon-layer'; |
@@ -1,2 +0,2 @@ | ||
export default "#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * instanceWidths / 2.0;\n vec2 offset_clipspace = project_pixel_to_clipspace(offset_screenspace).xy;\n\n return offset_clipspace;\n}\n\nvoid main(void) {\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.));\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.));\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n vec2 offset = getExtrusionOffset(target.xy - source.xy, positions.y);\n gl_Position = p + vec4(offset, 0.0, 0.0);\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n picking_setPickingColor(instancePickingColors);\n}\n"; | ||
export default "#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0;\n vec2 offset_clipspace = project_pixel_to_clipspace(offset_screenspace).xy;\n\n return offset_clipspace;\n}\n\nvoid main(void) {\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.));\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.));\n float width = clamp(\n project_scale(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n vec2 offset = getExtrusionOffset(target.xy - source.xy, positions.y, width);\n gl_Position = p + vec4(offset, 0.0, 0.0);\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n picking_setPickingColor(instancePickingColors);\n}\n"; | ||
//# sourceMappingURL=line-layer-vertex.glsl.js.map |
@@ -32,8 +32,23 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
}, | ||
getStrokeWidth: { | ||
getWidth: { | ||
type: 'accessor', | ||
value: 1 | ||
}, | ||
strokeWidth: { | ||
deprecatedFor: 'getStrokeWidth' | ||
widthScale: { | ||
type: 'number', | ||
value: 1, | ||
min: 0 | ||
}, | ||
widthMinPixels: { | ||
type: 'number', | ||
value: 1, | ||
min: 0 | ||
}, | ||
widthMaxPixels: { | ||
type: 'number', | ||
value: Number.MAX_SAFE_INTEGER, | ||
min: 0 | ||
}, | ||
getStrokeWidth: { | ||
deprecatedFor: 'getWidth' | ||
} | ||
@@ -91,3 +106,3 @@ }; | ||
transition: true, | ||
accessor: 'getStrokeWidth', | ||
accessor: 'getWidth', | ||
defaultValue: 1 | ||
@@ -122,2 +137,8 @@ } | ||
} | ||
this.state.model.setUniforms({ | ||
widthScale: props.widthScale, | ||
widthMinPixels: props.widthMinPixels, | ||
widthMaxPixels: props.widthMaxPixels | ||
}); | ||
} | ||
@@ -155,4 +176,3 @@ }, { | ||
getTargetPosition = _this$props.getTargetPosition; | ||
var value = attribute.value, | ||
size = attribute.size; | ||
var value = attribute.value; | ||
var i = 0; | ||
@@ -174,7 +194,6 @@ | ||
var targetPosition = getTargetPosition(object, objectInfo); | ||
value[i + 0] = fp64LowPart(sourcePosition[0]); | ||
value[i + 1] = fp64LowPart(sourcePosition[1]); | ||
value[i + 2] = fp64LowPart(targetPosition[0]); | ||
value[i + 3] = fp64LowPart(targetPosition[1]); | ||
i += size; | ||
value[i++] = fp64LowPart(sourcePosition[0]); | ||
value[i++] = fp64LowPart(sourcePosition[1]); | ||
value[i++] = fp64LowPart(targetPosition[0]); | ||
value[i++] = fp64LowPart(targetPosition[1]); | ||
} | ||
@@ -181,0 +200,0 @@ } catch (err) { |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "7.0.0-alpha.5", | ||
"version": "7.0.0-alpha.6", | ||
"publishConfig": { | ||
@@ -8,0 +8,0 @@ "access": "public" |
@@ -29,4 +29,4 @@ // Copyright (c) 2015 - 2017 Uber Technologies, Inc. | ||
export {default as ScatterplotLayer} from './scatterplot-layer/scatterplot-layer'; | ||
export {default as GridCellLayer} from './grid-cell-layer/grid-cell-layer'; | ||
export {default as HexagonCellLayer} from './hexagon-cell-layer/hexagon-cell-layer'; | ||
export {default as ColumnLayer} from './column-layer/column-layer'; | ||
export {default as GridCellLayer} from './column-layer/grid-cell-layer'; | ||
export {default as PathLayer} from './path-layer/path-layer'; | ||
@@ -33,0 +33,0 @@ export {default as PolygonLayer} from './polygon-layer/polygon-layer'; |
@@ -33,2 +33,5 @@ // Copyright (c) 2015 - 2017 Uber Technologies, Inc. | ||
uniform float opacity; | ||
uniform float widthScale; | ||
uniform float widthMinPixels; | ||
uniform float widthMaxPixels; | ||
@@ -39,3 +42,3 @@ varying vec4 vColor; | ||
// offset_direction is -1 (left) or 1 (right) | ||
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) { | ||
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) { | ||
// normalized direction of the line | ||
@@ -46,3 +49,3 @@ vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize); | ||
vec2 offset_screenspace = dir_screenspace * offset_direction * instanceWidths / 2.0; | ||
vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0; | ||
vec2 offset_clipspace = project_pixel_to_clipspace(offset_screenspace).xy; | ||
@@ -58,2 +61,9 @@ | ||
// Multiply out width and clamp to limits | ||
// mercator pixels are interpreted as screen pixels | ||
float width = clamp( | ||
project_scale(instanceWidths * widthScale), | ||
widthMinPixels, widthMaxPixels | ||
); | ||
// linear interpolation of source & target to pick right coord | ||
@@ -64,3 +74,3 @@ float segmentIndex = positions.x; | ||
// extrude | ||
vec2 offset = getExtrusionOffset(target.xy - source.xy, positions.y); | ||
vec2 offset = getExtrusionOffset(target.xy - source.xy, positions.y, width); | ||
gl_Position = p + vec4(offset, 0.0, 0.0); | ||
@@ -67,0 +77,0 @@ |
@@ -37,6 +37,9 @@ // Copyright (c) 2015 - 2017 Uber Technologies, Inc. | ||
getColor: {type: 'accessor', value: DEFAULT_COLOR}, | ||
getStrokeWidth: {type: 'accessor', value: 1}, | ||
getWidth: {type: 'accessor', value: 1}, | ||
widthScale: {type: 'number', value: 1, min: 0}, | ||
widthMinPixels: {type: 'number', value: 1, min: 0}, | ||
widthMaxPixels: {type: 'number', value: Number.MAX_SAFE_INTEGER, min: 0}, | ||
// deprecated | ||
strokeWidth: {deprecatedFor: 'getStrokeWidth'} | ||
getStrokeWidth: {deprecatedFor: 'getWidth'} | ||
}; | ||
@@ -80,3 +83,3 @@ | ||
transition: true, | ||
accessor: 'getStrokeWidth', | ||
accessor: 'getWidth', | ||
defaultValue: 1 | ||
@@ -99,2 +102,8 @@ } | ||
} | ||
this.state.model.setUniforms({ | ||
widthScale: props.widthScale, | ||
widthMinPixels: props.widthMinPixels, | ||
widthMaxPixels: props.widthMaxPixels | ||
}); | ||
} | ||
@@ -138,3 +147,3 @@ | ||
const {data, getSourcePosition, getTargetPosition} = this.props; | ||
const {value, size} = attribute; | ||
const {value} = attribute; | ||
let i = 0; | ||
@@ -146,7 +155,6 @@ const {iterable, objectInfo} = createIterable(data); | ||
const targetPosition = getTargetPosition(object, objectInfo); | ||
value[i + 0] = fp64LowPart(sourcePosition[0]); | ||
value[i + 1] = fp64LowPart(sourcePosition[1]); | ||
value[i + 2] = fp64LowPart(targetPosition[0]); | ||
value[i + 3] = fp64LowPart(targetPosition[1]); | ||
i += size; | ||
value[i++] = fp64LowPart(sourcePosition[0]); | ||
value[i++] = fp64LowPart(sourcePosition[1]); | ||
value[i++] = fp64LowPart(targetPosition[0]); | ||
value[i++] = fp64LowPart(targetPosition[1]); | ||
} | ||
@@ -153,0 +161,0 @@ } |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
14
2454450
333
32278
4