New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@streetscape.gl/layers

Package Overview
Dependencies
Maintainers
6
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@streetscape.gl/layers - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

56

dist/es6/imagery-layer/grid-geometry.js

@@ -5,5 +5,4 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";

export default class GridGeometry extends Geometry {
constructor() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
{
constructor(_ref = {}) {
let {
id = uid('grid-geometry'),

@@ -33,26 +32,24 @@ uCount = 1,

}
var uidCounters = {};
const uidCounters = {};
function uid() {
var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'id';
function uid(id = 'id') {
uidCounters[id] = uidCounters[id] || 1;
var count = uidCounters[id]++;
const count = uidCounters[id]++;
return "".concat(id, "-").concat(count);
}
function calculateIndices(_ref2) {
var {
uCount,
vCount
} = _ref2;
var indicesCount = uCount * vCount * 2 * 3;
var indices = new Uint32Array(indicesCount);
var i = 0;
function calculateIndices({
uCount,
vCount
}) {
const indicesCount = uCount * vCount * 2 * 3;
const indices = new Uint32Array(indicesCount);
let i = 0;
for (var uIndex = 0; uIndex < uCount; uIndex++) {
for (var vIndex = 0; vIndex < vCount; vIndex++) {
var i0 = vIndex * (uCount + 1) + uIndex;
var i1 = i0 + 1;
var i2 = i0 + uCount + 1;
var i3 = i2 + 1;
for (let uIndex = 0; uIndex < uCount; uIndex++) {
for (let vIndex = 0; vIndex < vCount; vIndex++) {
const i0 = vIndex * (uCount + 1) + uIndex;
const i1 = i0 + 1;
const i2 = i0 + uCount + 1;
const i3 = i2 + 1;
indices[i++] = i0;

@@ -70,12 +67,11 @@ indices[i++] = i2;

function calculateTexCoords(_ref3) {
var {
uCount,
vCount
} = _ref3;
var texCoords = new Float32Array((uCount + 1) * (vCount + 1) * 2);
var i = 0;
function calculateTexCoords({
uCount,
vCount
}) {
const texCoords = new Float32Array((uCount + 1) * (vCount + 1) * 2);
let i = 0;
for (var vIndex = 0; vIndex <= vCount; vIndex++) {
for (var uIndex = 0; uIndex <= uCount; uIndex++) {
for (let vIndex = 0; vIndex <= vCount; vIndex++) {
for (let uIndex = 0; uIndex <= uCount; uIndex++) {
texCoords[i++] = uIndex / uCount;

@@ -82,0 +78,0 @@ texCoords[i++] = vIndex / vCount;

@@ -34,3 +34,3 @@ import { Layer } from '@deck.gl/core';

var defaultProps = {
const defaultProps = {
heightMap: null,

@@ -80,3 +80,3 @@ heightMapBounds: {

initializeState() {
var {
const {
gl

@@ -90,15 +90,14 @@ } = this.context;

updateState(_ref) {
var {
props,
oldProps,
changeFlags
} = _ref;
var {
updateState({
props,
oldProps,
changeFlags
}) {
const {
gl
} = this.context;
var {
const {
model
} = this.state;
var {
const {
heightMap,

@@ -134,3 +133,3 @@ imagery,

if (uCount !== oldProps.uCount || vCount !== oldProps.vCount) {
var geometry = new GridGeometry({
const geometry = new GridGeometry({
uCount,

@@ -143,3 +142,3 @@ vCount

if (changeFlags.propsChanged) {
var {
const {
heightMapBounds,

@@ -146,0 +145,0 @@ heightRange,

@@ -6,3 +6,3 @@ import _objectSpread2 from "@babel/runtime/helpers/esm/objectSpread";

var defaultProps = _objectSpread2({}, PathLayer.defaultProps, {
const defaultProps = _objectSpread2({}, PathLayer.defaultProps, {
highPrecisionDash: false,

@@ -25,3 +25,3 @@ getColor2: {

getShaders() {
var shaders = super.getShaders();
const shaders = super.getShaders();
shaders.vs = shaders.vs.replace('attribute float instanceStrokeWidths', 'attribute vec3 instanceStrokeWidths').replace('attribute vec2 instanceDashArrays', 'attribute vec4 instanceDashArrays').replace('varying vec2 vDashArray', 'varying vec4 vDashArray').replace('instanceStrokeWidths * widthScale', '(instanceStrokeWidths.x + instanceStrokeWidths.y + instanceStrokeWidths.z) * widthScale');

@@ -69,6 +69,6 @@ shaders.fs = shaders.fs.replace(/bool dash_isFragInGap[\s\S]*?\n\}/, "\nbool dash_isFragInGap() {\n float solid1 = vDashArray.x;\n float gap1 = solid1 + vDashArray.y;\n float solid2 = gap1 + vDashArray.z;\n float unitLength = solid2 + vDashArray.w;\n\n if (unitLength == 0.0 || vDashArray.y == 0.0) {\n return false;\n }\n\n unitLength = mix(\n unitLength,\n vPathLength / round(vPathLength / unitLength),\n alignMode\n );\n\n float offset = mix(vPathOffset, vDashArray.x / 2.0, alignMode);\n float unitPosition = mod2(vPathPosition.y + offset, unitLength);\n\n return unitPosition > solid1 && unitPosition < gap1 || unitPosition > solid2;\n}\n").replace('varying vec2 vDashArray', 'varying vec4 vDashArray');

draw(params) {
var {
const {
model
} = this.state;
var attributes = this.getAttributeManager().getAttributes();
const attributes = this.getAttributeManager().getAttributes();
model.setUniforms({

@@ -99,9 +99,9 @@ strokeIndex: 0

var {
const {
numInstances
} = this.state;
var {
const {
viewport
} = this.context;
var {
let {
startPositions,

@@ -114,8 +114,8 @@ endPositions,

instanceTypes = instanceTypes.value;
var target = attribute.value;
var startPoint = new Vector3();
var endPoint = new Vector3();
var totalLength = 0;
const target = attribute.value;
const startPoint = new Vector3();
const endPoint = new Vector3();
let totalLength = 0;
for (var i = 0; i < numInstances; i++) {
for (let i = 0; i < numInstances; i++) {
startPoint.set(startPositions[i * 3 + 3], startPositions[i * 3 + 4], startPositions[i * 3 + 5]);

@@ -125,3 +125,3 @@ endPoint.set(endPoint[0] = endPositions[i * 3], endPoint[1] = endPositions[i * 3 + 1], endPoint[2] = endPositions[i * 3 + 2]);

endPoint.copy(viewport.projectPosition(endPoint));
var segmentLength = startPoint.distance(endPoint);
const segmentLength = startPoint.distance(endPoint);
target[i] = segmentLength ? totalLength / segmentLength : 0;

@@ -128,0 +128,0 @@

@@ -6,3 +6,3 @@ import _objectSpread2 from "@babel/runtime/helpers/esm/objectSpread";

var defaultProps = _objectSpread2({}, IconLayer.defaultProps, {
const defaultProps = _objectSpread2({}, IconLayer.defaultProps, {
sizeUnits: 'meters',

@@ -13,8 +13,7 @@ render3D: true

export default class SignLayer extends IconLayer {
updateState(_ref) {
var {
oldProps,
props,
changeFlags
} = _ref;
updateState({
oldProps,
props,
changeFlags
}) {
super.updateState({

@@ -21,0 +20,0 @@ props,

import _objectSpread2 from "@babel/runtime/helpers/esm/objectSpread";
import { Layer } from '@deck.gl/core';
import { CubeGeometry, SphereGeometry, Model, PhongMaterial, fp64 } from '@luma.gl/core';
var {
const {
fp64LowPart

@@ -11,3 +11,3 @@ } = fp64;

import { makeLightShapeTexture } from './traffic-light-utils';
var LIGHT_COLOR = {
const LIGHT_COLOR = {
invalid: [0, 0, 0],

@@ -18,3 +18,3 @@ green: [0, 255, 128],

};
var LIGHT_SHAPE = {
const LIGHT_SHAPE = {
circular: 0,

@@ -24,3 +24,3 @@ left_arrow: 1,

};
var defaultProps = {
const defaultProps = {
getPosition: {

@@ -67,7 +67,7 @@ type: 'accessor',

initializeState() {
var {
const {
gl
} = this.context;
var modelsByName = this._getModels(gl);
const modelsByName = this._getModels(gl);

@@ -78,3 +78,3 @@ this.setState({

});
var attributeManager = this.getAttributeManager();
const attributeManager = this.getAttributeManager();
attributeManager.addInstanced({

@@ -114,10 +114,9 @@ instancePositions: {

draw(_ref) {
var {
uniforms
} = _ref;
var {
draw({
uniforms
}) {
const {
sizeScale
} = this.props;
var {
const {
modelsByName

@@ -134,4 +133,4 @@ } = this.state;

_getModels(gl) {
var shaders = this.getShaders();
var box = new Model(gl, _objectSpread2({
const shaders = this.getShaders();
const box = new Model(gl, _objectSpread2({
id: "".concat(this.props.id, "-box")

@@ -147,3 +146,3 @@ }, shaders, {

}));
var lights = new Model(gl, _objectSpread2({
const lights = new Model(gl, _objectSpread2({
id: "".concat(this.props.id, "-light")

@@ -169,3 +168,3 @@ }, shaders, {

for (var model of this.getModels()) {
for (const model of this.getModels()) {
model.setInstanceCount(this.props.data.length);

@@ -177,3 +176,3 @@ model.setAttributes(changedAttributes);

calculateInstancePositions64xyLow(attribute) {
var isFP64 = this.use64bitPositions();
const isFP64 = this.use64bitPositions();
attribute.constant = !isFP64;

@@ -186,13 +185,13 @@

var {
const {
data,
getPosition
} = this.props;
var {
const {
value
} = attribute;
var i = 0;
let i = 0;
for (var point of data) {
var position = getPosition(point);
for (const point of data) {
const position = getPosition(point);
value[i++] = fp64LowPart(position[0]);

@@ -204,13 +203,13 @@ value[i++] = fp64LowPart(position[1]);

calculateInstanceColors(attribute) {
var {
const {
data,
getColor
} = this.props;
var {
const {
value
} = attribute;
var i = 0;
let i = 0;
for (var point of data) {
var color = LIGHT_COLOR[getColor(point)] || LIGHT_COLOR.invalid;
for (const point of data) {
const color = LIGHT_COLOR[getColor(point)] || LIGHT_COLOR.invalid;
value[i++] = color[0];

@@ -223,12 +222,12 @@ value[i++] = color[1];

calculateInstanceShapes(attribute) {
var {
const {
data,
getShape
} = this.props;
var {
const {
value
} = attribute;
var i = 0;
let i = 0;
for (var point of data) {
for (const point of data) {
value[i++] = LIGHT_SHAPE[getShape(point)] || 0;

@@ -235,0 +234,0 @@ }

import { Texture2D } from '@luma.gl/core';
var CANVAS_SIZE = 256;
const CANVAS_SIZE = 256;
function drawArrow(ctx, _ref) {
var {
x,
y,
size,
strokeWidth,
scaleX = 1
} = _ref;
var halfSize = size / 2;
var headSize = size / 4;
function drawArrow(ctx, {
x,
y,
size,
strokeWidth,
scaleX = 1
}) {
const halfSize = size / 2;
const headSize = size / 4;
var getX = px => (halfSize - px) * scaleX + x + halfSize;
const getX = px => (halfSize - px) * scaleX + x + halfSize;
var getY = py => py + y;
const getY = py => py + y;

@@ -31,4 +30,4 @@ ctx.lineWidth = strokeWidth;

export function makeLightShapeTexture(gl) {
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
canvas.width = CANVAS_SIZE * 4;

@@ -35,0 +34,0 @@ canvas.height = CANVAS_SIZE;

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

"license": "MIT",
"version": "1.0.1",
"version": "1.0.2",
"repository": {

@@ -23,3 +23,3 @@ "type": "git",

},
"gitHead": "7431f99c5fcb1e58e54df4feb06414cebc97fcb6"
"gitHead": "bc2b01156560d5f7dbc29f769a7a1b58d4d4acad"
}

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