@@ -52,6 +52,16 @@ class Array1DRenderer extends Array2DRenderer {
5252 this . toggleZoom ( true ) ;
5353
5454 this . maxStackDepth = 0 ;
55+ // XXX prototype stuff for insertion sort where we can have
56+ // the array to sort then a gap then the tmp variable and do
57+ // tweening for the moving of values around. Need to define
58+ // setColumnGapAt here and in the controller use the last array
59+ // element as tmp and set the previous element as the gap.
60+ // Best change the color of the indexAfterGap also so it's the same
61+ // as other variables.
62+ this . columnGapAt = undefined ; // set to a number for a gap in array
63+ // this.columnGapAt = 10; // for testing
64+ this . indexAfterGap = 'tmp' ;
5565 }
5666
5767 // XXX "Warning: Each child in a list should have a unique "key" prop.
@@ -141,7 +151,8 @@ class Array1DRenderer extends Array2DRenderer {
141151 } }
142152 /* eslint-disable-next-line react/jsx-props-no-multi-spaces */
143153 className = { classes (
144- styles . col ,
154+ ( j === this . columnGapAt ? styles . columnGap : styles . col ) ,
155+ // styles.col,
145156 col . faded && styles . faded ,
146157 col . selected && styles . selected ,
147158 col . selected1 && styles . selected1 ,
@@ -161,7 +172,8 @@ class Array1DRenderer extends Array2DRenderer {
161172 col . style && col . style . textStyle ,
162173 ) }
163174 >
164- { this . toString ( col . value ) }
175+ { ( j == this . columnGapAt ? ' '
176+ : this . toString ( col . value ) ) }
165177 </ motion . span >
166178 { ( ALGOS_USING_FLOAT_BOX . includes ( algo ) && (
167179 < div
@@ -202,7 +214,12 @@ class Array1DRenderer extends Array2DRenderer {
202214
203215 return (
204216 < div className = { classes ( styles . col , styles . index ) } key = { i } >
205- < span className = { styles . value } > { i } </ span >
217+ < span className = { styles . value } >
218+ { ( i - 1 == this . columnGapAt ? ' '
219+ : i - 1 == this . columnGapAt + 1 ? this . indexAfterGap
220+ : i
221+ ) }
222+ </ span >
206223 </ div >
207224 ) ;
208225 } ) }
0 commit comments