From f6efa0fb2798b143015b62be092d6a8614f9817d Mon Sep 17 00:00:00 2001 From: Ashutosh-1304 Date: Thu, 23 Jul 2026 14:24:01 +0530 Subject: [PATCH 1/2] chore: fix JavaScript lint errors --- .../@stdlib/plot/sparklines/unicode/line/lib/render.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/plot/sparklines/unicode/line/lib/render.js b/lib/node_modules/@stdlib/plot/sparklines/unicode/line/lib/render.js index dd3a6173048c..c949b518a571 100644 --- a/lib/node_modules/@stdlib/plot/sparklines/unicode/line/lib/render.js +++ b/lib/node_modules/@stdlib/plot/sparklines/unicode/line/lib/render.js @@ -85,13 +85,14 @@ function render() { glyphs = UNICODE_BRAILLE_ELEMENTS; } // Assign each datum to a bin... - idx = new Array( len ); - FLG = new Array( len ); + idx = []; + FLG = []; n = glyphs.length - 1; for ( i = 0; i < len; i++ ) { d = this._data[ i ]; if ( !this._isDefined( d, i ) || d === PINF || d === NINF ) { - FLG[ i ] = true; + idx.push( void 0 ); + FLG.push( true ); continue; } // Normalize the datum (aka feature scaling): @@ -107,7 +108,8 @@ function render() { } else if ( j > n ) { j = n; } - idx[ i ] = j; + idx.push( j ); + FLG.push( false ); } // TODO: color encoding: one color for both pos and neg or two colors for separate colors From 03ff0d6a35176a7c90d6360009cb4ce54584d3ec Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 24 Jul 2026 14:46:08 -0700 Subject: [PATCH 2/2] refactor: use array utils Signed-off-by: Athan --- .../plot/sparklines/unicode/line/lib/render.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/plot/sparklines/unicode/line/lib/render.js b/lib/node_modules/@stdlib/plot/sparklines/unicode/line/lib/render.js index c949b518a571..1dfbf8b325ad 100644 --- a/lib/node_modules/@stdlib/plot/sparklines/unicode/line/lib/render.js +++ b/lib/node_modules/@stdlib/plot/sparklines/unicode/line/lib/render.js @@ -20,6 +20,8 @@ // MODULES // +var falses = require( '@stdlib/array/base/falses' ); +var zeros = require( '@stdlib/array/base/zeros' ); var abs = require( '@stdlib/math/base/special/abs' ); var round = require( '@stdlib/math/base/special/round' ); var PINF = require( '@stdlib/constants/float64/pinf' ); @@ -85,14 +87,13 @@ function render() { glyphs = UNICODE_BRAILLE_ELEMENTS; } // Assign each datum to a bin... - idx = []; - FLG = []; + idx = zeros( len ); + FLG = falses( len ); n = glyphs.length - 1; for ( i = 0; i < len; i++ ) { d = this._data[ i ]; if ( !this._isDefined( d, i ) || d === PINF || d === NINF ) { - idx.push( void 0 ); - FLG.push( true ); + FLG[ i ] = true; continue; } // Normalize the datum (aka feature scaling): @@ -108,8 +109,7 @@ function render() { } else if ( j > n ) { j = n; } - idx.push( j ); - FLG.push( false ); + idx[ i ] = j; } // TODO: color encoding: one color for both pos and neg or two colors for separate colors