Skip to content

Commit 74f4600

Browse files
committed
useless imports removed & cleanup
1 parent d1f7897 commit 74f4600

7 files changed

Lines changed: 5 additions & 16 deletions

File tree

‎src/components/Canvas/InputField.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Strategy } from '../Strategy/Strategy.js';
55
import { Options } from './options/Options.js';
66
import { ReactComponent as Play } from '../../img/play.svg'
77
import { ReactComponent as Replay } from '../../img/replay.svg'
8-
import { ReactComponent as Arrow } from '../../img/arrowDown.svg'
98
import { MergeSort } from '../Strategy/Algorithms/MergeSort.js';
109
import { RadixSortLSD } from '../Strategy/Algorithms/RadixSortLSD.js';
1110

‎src/components/Canvas/options/Options.js‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import SlideBar from './SlideBar';
22
import './style.css'
33
import React, { Component } from 'react'
4-
import { ReactComponent as ArrowDown } from '../../../img/arrowDown.svg'
54
import { ReactComponent as CPU } from '../../../img/cpu.svg'
65
import { ReactComponent as UnsortedBars } from '../../../img/unsortedBars.svg'
76
import { ReactComponent as SortedBars } from '../../../img/sortedBars.svg'
@@ -26,10 +25,8 @@ class Options extends Component {
2625
}
2726
render() {
2827
const {showProcessingColor, showDefaultBarColor, showSortedBarColor, showMinBarColor, showDelay } = this.state;
29-
const style = {
30-
height: 400
31-
};
3228
const { algorithm } = this.props;
29+
3330
return (
3431
<div className="rounded-md z-10">
3532

‎src/components/InputHandler/InputHandler.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class InputHandler {
4242
let currentIndex = array.length, randomIndex;
4343

4444
// While there remain elements to shuffle.
45-
while (currentIndex != 0) {
45+
while (currentIndex !== 0) {
4646

4747
// Pick a remaining element.
4848
randomIndex = Math.floor(Math.random() * currentIndex);

‎src/components/Strategy/Algorithms/MergeSort.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React, { Component } from 'react'
21
import { Animation } from '../../Animation/Animation';
32

43
class MergeSort {

‎src/components/Strategy/Algorithms/RadixSortLSD.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ class RadixSortLSD {
7171
const oldValue = array[i]; // value being sorted to a new index
7272
const oldIndex = this.getIndexDOM(oldValue, DOM); // index of old value
7373
const sortedIndex = counts[Math.floor(array[i] / exp) % 100] - 1;
74-
const valueInOldArray = array[sortedIndex];
7574

7675
Animation.swap(oldIndex, sortedIndex); // SG 07/10/2022 22:35 swap animation
7776

‎src/components/Strategy/Algorithms/SelectionSort.js‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import React, { Component } from 'react'
2-
import { Strategy } from '../Strategy';
31
import { Animation } from '../../Animation/Animation';
42

5-
63
export default class SelectionSort {
74

85
constructor() {
@@ -19,14 +16,14 @@ export default class SelectionSort {
1916
const PROCESSING = options.processingColor;
2017
const SORTAED = options.sortedBarColor;
2118
const CURRENT_MIN = options.currentMinBarColor;
22-
const DELAY = 4;
19+
const DELAY = options.delay;
2320
let unSortedBars = document.querySelectorAll('.array-bars');
2421
let minBarIndex = 0;
2522

2623
for(var i = 0; i < unSortedBars.length; i++) {
2724
if(Animation.stop) break;
2825
// SG 07/08/2022 15:01 animation for i iterationå
29-
await Animation.getAnimation(options.delay);
26+
await Animation.getAnimation(DELAY);
3027

3128
minBarIndex = i;
3229
for(var j = i + 1; j < unSortedBars.length; j++) {
@@ -37,7 +34,7 @@ export default class SelectionSort {
3734

3835
// SG 07/08/2022 15:01 animation for j iteration - can be removed for faster animation
3936
if(!options.skipJ) {
40-
await Animation.getAnimation(options.delay);
37+
await Animation.getAnimation(DELAY);
4138
}
4239

4340
var currentMinBar = parseInt(unSortedBars[minBarIndex].id);

‎src/components/Strategy/Strategy.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import React, {Component} from 'react';
2-
31
class Strategy {
42
static targetArray = [];
53

0 commit comments

Comments
 (0)