Skip to content

Commit d89322f

Browse files
committed
Tidy
1 parent cabe02b commit d89322f

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

modules/carto/src/layers/trajectory-tile-layer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ function getLineColorFromFillColor(getFillColor: TrajectoryTileLayerProps['getFi
5959
const endIndex = data.startIndices[index + 1];
6060
const nVertices = endIndex - startIndex;
6161
const colors = new Array(nVertices).fill(0).map((_, i) => {
62-
const index = startIndex + i;
63-
const properties = createBinaryProxy(data, index);
64-
const d = {properties} as any;
62+
const vertexIndex = startIndex + i;
63+
const properties = createBinaryProxy(data, vertexIndex);
64+
const vertex = {properties} as any;
6565
return typeof getFillColor === 'function'
66-
? getFillColor(d, {index, data, target})
66+
? getFillColor(vertex, {index: vertexIndex, data, target})
6767
: getFillColor;
6868
});
6969

modules/carto/src/layers/trajectory-utils.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ export function rebuildGeometry(
201201
const newNumericProps: NumericProps = {};
202202
const numericPropKeys = Object.keys(numericProps);
203203
for (const prop of numericPropKeys) {
204-
const size = numericProps[prop].size || 1;
205-
newNumericProps[prop] = {value: new Float32Array(newN), size};
204+
const propSize = numericProps[prop].size || 1;
205+
newNumericProps[prop] = {value: new Float32Array(newN), size: propSize};
206206
}
207207

208208
// Properties are per-line.
@@ -224,9 +224,12 @@ export function rebuildGeometry(
224224

225225
for (const prop of numericPropKeys) {
226226
const {value: originalValue} = originalGeometry.numericProps[prop];
227-
const {value, size} = newNumericProps[prop];
228-
const dataSlice = originalValue.subarray(srcIndex * size, (srcIndex + numVertices) * size);
229-
value.set(dataSlice, dst * size);
227+
const {value, size: propSize} = newNumericProps[prop];
228+
const dataSlice = originalValue.subarray(
229+
srcIndex * propSize,
230+
(srcIndex + numVertices) * propSize
231+
);
232+
value.set(dataSlice, dst * propSize);
230233
}
231234
dst += numVertices;
232235
}
@@ -266,7 +269,7 @@ export function transformTrajectoryData(
266269
}
267270

268271
// Step 1: Extract trajectory and timestamp data
269-
const {tripIds, timestamps, properties} = extractTrajectoryData(
272+
const {tripIds, timestamps} = extractTrajectoryData(
270273
geometry,
271274
trajectoryIdColumn,
272275
timestampColumn,

0 commit comments

Comments
 (0)