Skip to content

Commit 9c90abd

Browse files
committed
chore: update readme
1 parent b8986bb commit 9c90abd

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ASIMOV Network Widget
22

3-
A React component for visualizing network graphs in ASIMOV Protocol applications with customizable styling to match the ASIMOV design system.
3+
A React component for visualizing network graphs in ASIMOV Protocol applications with customizable styling and dynamic data simulation capabilities.
44

55
<img width="805" alt="ASIMOV Network Widget" src="https://github.com/user-attachments/assets/c753407e-e2e4-4da9-9504-b1a4b6dcb1d0" />
66

examples/App.tsx

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,28 @@ function App() {
192192
// Handle network initialization
193193
const handleNetworkInit = useCallback((network: Network) => {
194194
networkRef.current = network;
195+
// Set initial zoom level to zoom out
196+
setTimeout(() => {
197+
if (network) {
198+
// First fit the network, then zoom out
199+
network.fit({
200+
animation: {
201+
duration: 500,
202+
easingFunction: 'easeInOutQuad'
203+
}
204+
});
205+
// Then zoom out
206+
setTimeout(() => {
207+
network.moveTo({
208+
scale: 0.6, // Zoom out to 60% of current scale
209+
animation: {
210+
duration: 800,
211+
easingFunction: 'easeInOutQuad'
212+
}
213+
});
214+
}, 600);
215+
}
216+
}, 100);
195217
}, []);
196218

197219
// Handle node selection
@@ -218,16 +240,18 @@ function App() {
218240
physics: {
219241
stabilization: false,
220242
barnesHut: {
221-
gravitationalConstant: -8000,
243+
gravitationalConstant: -4000, // Reduced from -8000 for less attraction
222244
springConstant: 0.001,
223-
springLength: 200,
245+
springLength: 350, // Increased from 200 for more spacing
224246
},
225247
},
226248
interaction: {
227249
hover: true,
228250
tooltipDelay: 200,
229251
navigationButtons: true,
230252
keyboard: true,
253+
zoomView: true,
254+
dragView: true,
231255
},
232256
};
233257

0 commit comments

Comments
 (0)