Skip to content

Commit 0cac6ef

Browse files
committed
Successfully added ParentSize which allows for automatic resizing of the Atoms Relationship container
1 parent 65152b9 commit 0cac6ef

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/app/components/AtomsRelationship.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const background = '#306c90';
1515
// interface NodeShape {
1616
// name: string;
1717
// children?: NodeShape[];
18-
// }
18+
//
1919

2020
const clusterData = {
2121
name: '$',

src/app/components/StateRoute.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import ComponentMap from './ComponentMap';
1616
import PerfView from './PerfView';
1717
import AtomsRelationship from './AtomsRelationship.jsx';
1818
import Example from './AtomsRelationship.jsx';
19-
import ParentSize from '@visx/responsive';
19+
import { ParentSize } from '@visx/responsive'
2020

2121
const History = require('./History').default;
2222

@@ -83,9 +83,12 @@ const StateRoute = (props: StateRouteProps) => {
8383
};
8484

8585
const renderAtomsRelationship = () => (
86-
<Example
87-
width={500}
88-
height={500} />
86+
87+
<ParentSize>{({ width, height }) =>
88+
<Example
89+
width={width}
90+
height={height} />}
91+
</ParentSize>
8992

9093
// atomsComponents={snapshot.atomsComponents}
9194
// atomSelectors={snapshot.atomSelectors}

0 commit comments

Comments
 (0)