Skip to content

Commit 90059b5

Browse files
authored
chore: update third party libs (#198)
* chore: bump tape-run from `v10` to `v11` * chore: bump 3rd party libs and fix Biome warnings
1 parent 4e66e08 commit 90059b5

11 files changed

Lines changed: 1418 additions & 1523 deletions

package-lock.json

Lines changed: 1363 additions & 1478 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,33 +48,33 @@
4848
"regl": "~2.1.0"
4949
},
5050
"devDependencies": {
51-
"@babel/core": "^7.25.2",
52-
"@babel/plugin-transform-regenerator": "^7.24.7",
51+
"@babel/core": "^7.26.0",
52+
"@babel/plugin-transform-regenerator": "^7.25.9",
5353
"@babel/polyfill": "^7.12.1",
54-
"@babel/preset-env": "^7.25.3",
55-
"@biomejs/biome": "^1.8.3",
54+
"@babel/preset-env": "^7.26.0",
55+
"@biomejs/biome": "^1.9.4",
5656
"@rollup/plugin-babel": "^6.0.3",
57-
"@rollup/plugin-commonjs": "^26.0.1",
57+
"@rollup/plugin-commonjs": "^28.0.1",
5858
"@rollup/plugin-json": "^6.0.0",
59-
"@rollup/plugin-node-resolve": "^15.1.0",
59+
"@rollup/plugin-node-resolve": "^15.3.0",
6060
"@rollup/plugin-terser": "^0.4.3",
6161
"@types/d3-scale": "^4.0.6",
62-
"@types/node": "^22.3.0",
63-
"apache-arrow": "^17.0.0",
62+
"@types/node": "^22.9.0",
63+
"apache-arrow": "^18.0.0",
6464
"browser-env": "^3.3.0",
6565
"d3-axis": "^3.0.0",
6666
"d3-random": "^3.0.1",
6767
"d3-scale": "^4.0.2",
6868
"d3-selection": "^3.0.0",
6969
"esm": "^3.2.25",
70-
"gh-pages": "^6.1.1",
70+
"gh-pages": "^6.2.0",
7171
"merge": "^2.1.1",
72-
"rollup": "^4.20.0",
72+
"rollup": "^4.25.0",
7373
"rollup-plugin-filesize": "^10.0.0",
7474
"tap-spec": "^5.0.0",
75-
"tape-run": "^10.0.0",
76-
"typescript": "~5.5.4",
77-
"vite": "^5.4.0",
75+
"tape-run": "^11.0.0",
76+
"typescript": "~5.6.3",
77+
"vite": "^5.4.11",
7878
"vite-plugin-virtual-html-template": "^1.1.0",
7979
"zora": "^4.1.0"
8080
},

src/index.js

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import { mat4, vec4 } from 'gl-matrix';
1111
import createPubSub from 'pub-sub-es';
1212
import createLine from 'regl-line';
1313

14-
import createKdbush from './kdbush';
15-
import createLassoManager from './lasso-manager';
16-
import createRenderer from './renderer';
14+
import createKdbush from './kdbush.js';
15+
import createLassoManager from './lasso-manager/index.js';
16+
import createRenderer from './renderer.js';
1717

1818
import BG_FS from './bg.fs';
1919
import BG_VS from './bg.vs';
@@ -23,7 +23,7 @@ import POINT_UPDATE_VS from './point-update.vs';
2323
import POINT_FS from './point.fs';
2424
import createVertexShader from './point.vs';
2525

26-
import createSplineCurve from './spline-curve';
26+
import createSplineCurve from './spline-curve.js';
2727

2828
import {
2929
AUTO,
@@ -121,7 +121,7 @@ import {
121121
VALUE_ZW_DATA_TYPES,
122122
W_NAMES,
123123
Z_NAMES,
124-
} from './constants';
124+
} from './constants.js';
125125

126126
import {
127127
checkReglExtensions as checkSupport,
@@ -149,7 +149,7 @@ import {
149149
rgbBrightness,
150150
toArrayOrientedPoints,
151151
toRgba,
152-
} from './utils';
152+
} from './utils.js';
153153

154154
import { version } from '../package.json';
155155

@@ -164,6 +164,7 @@ const checkDeprecations = (properties) => {
164164
);
165165

166166
for (const prop of deprecatedProps) {
167+
// biome-ignore lint/suspicious/noConsole: This is a legitimately useful warning
167168
console.warn(
168169
`regl-scatterplot: the "${prop}" property is deprecated. Please use "${deprecations[prop]}" instead.`,
169170
);
@@ -727,7 +728,7 @@ const createScatterplot = (
727728
if (lassoClearEvent === LASSO_CLEAR_ON_DESELECT) {
728729
lassoClear();
729730
}
730-
if (selectedPoints.length) {
731+
if (selectedPoints.length > 0) {
731732
if (!preventEvent) {
732733
pubSub.publish('deselect');
733734
}
@@ -758,7 +759,7 @@ const createScatterplot = (
758759
}
759760
} else {
760761
// Unset previously highlight point connections
761-
if (selectedPoints?.length) {
762+
if (selectedPoints?.length > 0) {
762763
setPointConnectionColorState(selectedPoints, 0);
763764
}
764765
if (currSelectedPoints.length > 0 && newSelectedPoints.length === 0) {
@@ -1008,7 +1009,7 @@ const createScatterplot = (
10081009
const clostestPoint = raycast();
10091010
if (clostestPoint >= 0) {
10101011
if (
1011-
selectedPoints.length &&
1012+
selectedPoints.length > 0 &&
10121013
lassoClearEvent === LASSO_CLEAR_ON_DESELECT
10131014
) {
10141015
// Special case where we silently "deselect" the previous points by
@@ -1211,7 +1212,7 @@ const createScatterplot = (
12111212
};
12121213

12131214
const setColors = (getter, setter) => (newColors) => {
1214-
if (!newColors?.length) {
1215+
if (!newColors || newColors.length === 0) {
12151216
return;
12161217
}
12171218

@@ -1229,6 +1230,7 @@ const createScatterplot = (
12291230
setter(tmpColors);
12301231
colorTex = createColorTexture();
12311232
} catch (_error) {
1233+
// biome-ignore lint/suspicious/noConsole: This is a legitimately useful warning
12321234
console.error('Invalid colors. Switching back to default colors.');
12331235
setter(prevColors);
12341236
colorTex = createColorTexture();
@@ -2037,7 +2039,7 @@ const createScatterplot = (
20372039
);
20382040
}
20392041

2040-
return Array(pointConnectionMap.length).fill(0);
2042+
return new Array(pointConnectionMap.length).fill(0);
20412043
};
20422044

20432045
const getPointConnectionOpacities = () => {
@@ -2146,7 +2148,7 @@ const createScatterplot = (
21462148
const setPointConnections = (newPoints) =>
21472149
new Promise((resolve) => {
21482150
pointConnections.setPoints([]);
2149-
if (newPoints?.length) {
2151+
if (newPoints?.length > 0) {
21502152
computingPointConnectionCurves = true;
21512153
createSplineCurve(newPoints, {
21522154
maxIntPointsPerSegment: pointConnectionMaxIntPointsPerSegment,
@@ -2417,6 +2419,7 @@ const createScatterplot = (
24172419
w: wDataType,
24182420
});
24192421
} else {
2422+
// biome-ignore lint/suspicious/noConsole: This is a legitimately useful warning
24202423
console.warn(
24212424
'Cannot transition! The number of points between the previous and current draw call must be identical.',
24222425
);
@@ -2879,6 +2882,7 @@ const createScatterplot = (
28792882
pubSub.publish('backgroundImageReady');
28802883
})
28812884
.catch(() => {
2885+
// biome-ignore lint/suspicious/noConsole: This is a legitimately useful error log
28822886
console.error(`Count not create texture from ${newBackgroundImage}`);
28832887
backgroundImage = null;
28842888
});
@@ -4129,7 +4133,7 @@ const createScatterplot = (
41294133
drawHoveredPoint();
41304134
}
41314135

4132-
if (selectedPoints.length) {
4136+
if (selectedPoints.length > 0) {
41334137
drawSelectedPoints();
41344138
}
41354139

src/kdbush-worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default () => {
22
addEventListener('message', (event) => {
33
const points = event.data.points;
44

5-
if (!points.length) {
5+
if (points.length === 0) {
66
self.postMessage({ error: new Error('Invalid point data') });
77
}
88

src/kdbush.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// biome-ignore lint/style/useNamingConvention: KDBush is a library name
2-
import createKDBushClass from './kdbush-class';
3-
import workerFn from './kdbush-worker';
2+
import createKDBushClass from './kdbush-class.js';
3+
import workerFn from './kdbush-worker.js';
44

55
// biome-ignore lint/style/useNamingConvention: KDBush is a library name
66
const KDBush = createKDBushClass();

src/lasso-manager/create-long-press-animations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
DEFAULT_LASSO_LONG_PRESS_EFFECT_DELAY,
44
DEFAULT_LASSO_LONG_PRESS_REVERT_EFFECT_TIME,
55
DEFAULT_LASSO_LONG_PRESS_TIME,
6-
} from '../constants';
6+
} from '../constants.js';
77

88
const getInTime = (p, time, extraTime) => (1 - p) * time + extraTime;
99

src/lasso-manager/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ import {
1515
DEFAULT_LASSO_START_INITIATOR_SHOW,
1616
LASSO_HIDE_START_INITIATOR_TIME,
1717
LASSO_SHOW_START_INITIATOR_TIME,
18-
} from './constants';
18+
} from './constants.js';
1919

2020
import {
2121
DEFAULT_LASSO_LONG_PRESS_AFTER_EFFECT_TIME,
2222
DEFAULT_LASSO_LONG_PRESS_EFFECT_DELAY,
2323
DEFAULT_LASSO_LONG_PRESS_REVERT_EFFECT_TIME,
2424
DEFAULT_LASSO_LONG_PRESS_TIME,
25-
} from '../constants';
25+
} from '../constants.js';
2626

2727
import {
2828
createLongPressInAnimations,
2929
createLongPressOutAnimations,
30-
} from './create-long-press-animations';
31-
import createLongPressElements from './create-long-press-elements';
30+
} from './create-long-press-animations.js';
31+
import createLongPressElements from './create-long-press-elements.js';
3232

3333
const ifNotNull = (v, alternative = null) => (v === null ? alternative : v);
3434

@@ -512,7 +512,7 @@ export const createLasso = (
512512
clear();
513513

514514
// When `currLassoPos` is empty the user didn't actually lasso
515-
if (currLassoPos.length) {
515+
if (currLassoPos.length > 0) {
516516
onEnd(currLassoPos, currLassoPosFlat, { merge });
517517
}
518518

src/renderer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { CLEAR_OPTIONS, DEFAULT_GAMMA } from './constants';
2-
import { checkReglExtensions, createRegl } from './utils';
1+
import { CLEAR_OPTIONS, DEFAULT_GAMMA } from './constants.js';
2+
import { checkReglExtensions, createRegl } from './utils.js';
33

44
export const createRenderer = (
55
/** @type {Partial<import('./types').RendererOptions>} */ options = {},

src/spline-curve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createWorker } from '@flekschas/utils';
2-
import workerFn from './spline-curve-worker';
2+
import workerFn from './spline-curve-worker.js';
33

44
const createSplineCurve = (
55
points,

src/types.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ type CameraOptions = {
8282
view: Float32Array;
8383
};
8484

85+
// biome-ignore lint/correctness/noUnusedVariables: Imported from ./index.js
8586
type Rect = {
8687
x: number;
8788
y: number;
@@ -126,6 +127,7 @@ interface AnnotationPolygon extends BaseAnnotation {
126127
vertices: [number, number][];
127128
}
128129

130+
// biome-ignore lint/correctness/noUnusedVariables: Imported from ./index.js
129131
type Annotation =
130132
| AnnotationHLine
131133
| AnnotationVLine

0 commit comments

Comments
 (0)