Skip to content

Commit 5fdcf30

Browse files
committed
optimized performance of StateRoute
1 parent b45c466 commit 5fdcf30

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/app/components/History.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ function History(props: Record<string, unknown>) {
154154
dispatch(changeSlider(index));
155155
dispatch(changeView(index));
156156
})
157+
// think about how I can convert this any to typescript
157158
.on('mouseout', function (d: any) {
158159
d3.select(this).transition().duration(300).attr('r', 13);
159160
});
@@ -198,7 +199,7 @@ function History(props: Record<string, unknown>) {
198199
.scaleExtent([0, 0.9]) // [zoomOut, zoomIn]
199200
.on('zoom', zoomed)
200201
);
201-
// helper function that allows for zooming
202+
// helper function that allows for zooming ( think about how I can convert this any to typescript)
202203
function zoomed(d: any) {
203204
g.attr('transform', d3.event.transform);
204205
}

src/app/components/StateRoute.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ import {
1111
NavLink,
1212
Switch,
1313
} from 'react-router-dom';
14+
import { ParentSize } from '@visx/responsive';
1415
import Tree from './Tree';
1516
import ComponentMap from './ComponentMap';
1617
import { changeView, changeSlider } from '../actions/actions';
1718
import { useStoreContext } from '../store';
1819
import PerformanceVisx from './PerformanceVisx';
1920
import Legend from './AtomsRelationshipLegend';
20-
import { ParentSize } from '@visx/responsive';
2121
import AtomsRelationship from './AtomsRelationship';
2222

2323
const History = require('./History').default;

0 commit comments

Comments
 (0)