File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 1
1
# ASIMOV Network Widget
2
2
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 .
4
4
5
5
<img width =" 805 " alt =" ASIMOV Network Widget " src =" https://github.com/user-attachments/assets/c753407e-e2e4-4da9-9504-b1a4b6dcb1d0 " />
6
6
Original file line number Diff line number Diff line change @@ -192,6 +192,28 @@ function App() {
192
192
// Handle network initialization
193
193
const handleNetworkInit = useCallback ( ( network : Network ) => {
194
194
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 ) ;
195
217
} , [ ] ) ;
196
218
197
219
// Handle node selection
@@ -218,16 +240,18 @@ function App() {
218
240
physics : {
219
241
stabilization : false ,
220
242
barnesHut : {
221
- gravitationalConstant : - 8000 ,
243
+ gravitationalConstant : - 4000 , // Reduced from -8000 for less attraction
222
244
springConstant : 0.001 ,
223
- springLength : 200 ,
245
+ springLength : 350 , // Increased from 200 for more spacing
224
246
} ,
225
247
} ,
226
248
interaction : {
227
249
hover : true ,
228
250
tooltipDelay : 200 ,
229
251
navigationButtons : true ,
230
252
keyboard : true ,
253
+ zoomView : true ,
254
+ dragView : true ,
231
255
} ,
232
256
} ;
233
257
You can’t perform that action at this time.
0 commit comments