Skip to content

Commit

Permalink
Merge pull request #51 from CentML/fix-warnings-in-react-ui
Browse files Browse the repository at this point in the history
Fixed warnings in react ui so it can compile
  • Loading branch information
jimgao1 authored Mar 24, 2023
2 parents 955300d + 86d5914 commit b36c64e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion skyline-vscode/react-ui/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function App() {
const [analysisState, setAnalysisState] = useState();
const [textChanged, setTextChanged] = useState(false);
const [timeBreakDown, setTimeBreakdown] = useState([]);

// eslint-disable-next-line
const [vscodeApi, setVscodeApi] = useState(acquireApi());
const [errorText, setErrorText] = useState();
const [connectionStatus, setConnectionStatus] = useState(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default {
NONE: 'none',
INCREASING: 'increasing',
Expand Down
1 change: 1 addition & 0 deletions skyline-vscode/react-ui/src/components/ScatterGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export const HabitatScatterGraph = ({ habitatData, height }) => {
};

const renderCustomizedLabel = (props) => {
// eslint-disable-next-line no-unused-vars
const { x, y, width, height, value } = props;
const y_offset = 5;
return (
Expand Down
1 change: 1 addition & 0 deletions skyline-vscode/react-ui/src/components/StackedBarGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
} from "recharts";

const renderCustomizedLabel = (props) => {
// eslint-disable-next-line no-unused-vars
const { x, y, width, height, value } = props;
const Y_OFFSET = 10;

Expand Down
8 changes: 4 additions & 4 deletions skyline-vscode/react-ui/src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function toReadableByteSize(sizeBytes) {
}
size /= 1024;
}
if (index == BYTE_UNITS.length) {
if (index === BYTE_UNITS.length) {
index--;
}

Expand Down Expand Up @@ -139,11 +139,11 @@ export function getTraceByLevel(tree) {
tree[0]["depth"] = 0;
tree_size(0);

let coarseDecomposition = tree.filter(node => { return node["depth"] == 1; });
let coarseDecomposition = tree.filter(node => { return node["depth"] === 1; });
for (let fineLevel = 1; ; fineLevel ++) {
let fineDecomposition = tree.filter(node => { return node["depth"] == fineLevel; });
let fineDecomposition = tree.filter(node => { return node["depth"] === fineLevel; });
console.log(`fineLevel: ${fineLevel}, length: ${fineDecomposition.length}`);
if (fineDecomposition.length == 0) return { coarse: coarseDecomposition, fine: coarseDecomposition };
if (fineDecomposition.length === 0) return { coarse: coarseDecomposition, fine: coarseDecomposition };
if (fineDecomposition.length >= 7) return { coarse: coarseDecomposition, fine: fineDecomposition };
}
}
Expand Down

0 comments on commit b36c64e

Please sign in to comment.