@@ -11,9 +11,9 @@ import { mat4, vec4 } from 'gl-matrix';
1111import createPubSub from 'pub-sub-es' ;
1212import 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
1818import BG_FS from './bg.fs' ;
1919import BG_VS from './bg.vs' ;
@@ -23,7 +23,7 @@ import POINT_UPDATE_VS from './point-update.vs';
2323import POINT_FS from './point.fs' ;
2424import createVertexShader from './point.vs' ;
2525
26- import createSplineCurve from './spline-curve' ;
26+ import createSplineCurve from './spline-curve.js ' ;
2727
2828import {
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
126126import {
127127 checkReglExtensions as checkSupport ,
@@ -149,7 +149,7 @@ import {
149149 rgbBrightness ,
150150 toArrayOrientedPoints ,
151151 toRgba ,
152- } from './utils' ;
152+ } from './utils.js ' ;
153153
154154import { 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
0 commit comments