-
Notifications
You must be signed in to change notification settings - Fork 0
/
rubrowser.html
640 lines (554 loc) · 50.6 KB
/
rubrowser.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
<!DOCTYPE html>
<html>
<head>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
<title>Rubrowser</title>
<link media='all' rel='stylesheet'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<style>html, body, .dependency_graph, .dependency_graph svg{
width: 100%;
height: 100%;
padding: 0px;
margin: 0px;
font-size: 13px;
overflow: hidden;
}
.link {
fill: none;
stroke: #666;
stroke-width: 1.5px;
}
circle {
fill: #fff;
stroke: #333;
stroke-width: 1.5px;
}
.circular {
stroke: #FF0000;
}
.fixed circle {
stroke-width: 3px;
}
text {
font: 10px sans-serif;
pointer-events: none;
text-shadow: 0 1px 0 #fff, 1px 0 0 #fff, 0 -1px 0 #fff, -1px 0 0 #fff;
}
text.type{
font: 7px sans-serif;
}
.downlighted {
opacity: 0.1;
}
.ignored{
display: none;
}
.running circle{
stroke: #18b738;
fill: #7dea93;
}
.highlighted,
.highlighted_by_namespace,
.highlighted_by_path,
.highlighted_by_type{
fill: #008ef3;
}
.highlighted circle,
.highlighted_by_namespace circle,
.highlighted_by_path circle,
.highlighted_by_type circle{
stroke: #008ef3;
}
.hide_namespace .namespace, .link.hide_relation{
display: none;
}
/* ============================ */
/* Toolbox style */
/* ============================ */
.toolbox{
position: fixed;
top: 0px;
left: 0px;
max-height: 100%;
width: 250px;
background: white;
overflow: auto;
}
ul, ol{
list-style-position: inside;
white-space: nowrap;
margin: 0px;
padding-left: 0px;
overflow: auto;
}
#information_panel{
position: fixed;
bottom: 0px;
left: 0px;
height: 5rem;
background: rgba(255,255,255,0.8);
width: 100%;
margin-left: 250px;
padding-right: 250px;
}
#information_panel div{
margin: 1rem;
display: inline-block;
}
#information_panel:hover{
height: 33%;
overflow: auto;
}
</style>
</head>
<body>
<div class='dependency_graph'>
<svg></svg>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src='https://unpkg.com/lodash@4.17.4/lodash.min.js' type='text/javascript'></script>
<script src='https://unpkg.com/d3@4.13.0/build/d3.min.js' type='text/javascript'></script>
<script type='text/javascript'>
var data = {"definitions":[{"type":"Class","namespace":"ViewDriver","circular":false,"file":"/home/jorg/projects/jj/messy_app/spec/app/view_driver.rb","line":4,"lines":52},{"type":"Class","namespace":"View","circular":true,"file":"/home/jorg/projects/jj/messy_app/lib/view.rb","line":3,"lines":23},{"type":"Class","namespace":"User","circular":false,"file":"/home/jorg/projects/jj/messy_app/app/models/user.rb","line":3,"lines":6},{"type":"Class","namespace":"StockApi","circular":false,"file":"/home/jorg/projects/jj/messy_app/app/apis/stock_api.rb","line":3,"lines":16},{"type":"Class","namespace":"SignupResultView","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/views/signup_result_view.rb","line":3,"lines":19},{"type":"Class","namespace":"Security","circular":false,"file":"/home/jorg/projects/jj/messy_app/app/models/security.rb","line":3,"lines":3},{"type":"Class","namespace":"ProfileView","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/views/profile_view.rb","line":3,"lines":34},{"type":"Class","namespace":"ProfileController","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/controllers/profile_controller.rb","line":3,"lines":37},{"type":"Class","namespace":"PortfolioView","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/views/portfolio_view.rb","line":3,"lines":38},{"type":"Module","namespace":"PortfolioValueSupport","circular":false,"file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_value_support.rb","line":3,"lines":8},{"type":"Class","namespace":"PortfolioController","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_controller.rb","line":3,"lines":36},{"type":"Class","namespace":"PersonAttribute","circular":false,"file":"/home/jorg/projects/jj/messy_app/app/models/person_attribute.rb","line":3,"lines":2},{"type":"Class","namespace":"Person","circular":false,"file":"/home/jorg/projects/jj/messy_app/app/models/person.rb","line":3,"lines":5},{"type":"Class","namespace":"PasscodeView","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/views/passcode_view.rb","line":3,"lines":8},{"type":"Class","namespace":"Passcode","circular":false,"file":"/home/jorg/projects/jj/messy_app/app/models/passcode.rb","line":3,"lines":2},{"type":"Class","namespace":"NotFoundView","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/views/not_found_view.rb","line":3,"lines":5},{"type":"Class","namespace":"LoginView","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/views/login_view.rb","line":3,"lines":23},{"type":"Class","namespace":"LoginController","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/controllers/login_controller.rb","line":3,"lines":53},{"type":"Class","namespace":"InvestmentNewsView","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/views/investment_news_view.rb","line":3,"lines":8},{"type":"Class","namespace":"InvestmentNewsController","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/controllers/investment_news_controller.rb","line":3,"lines":9},{"type":"Class","namespace":"InvestmentNewsBuilder","circular":false,"file":"/home/jorg/projects/jj/messy_app/app/builders/investment_news_builder.rb","line":3,"lines":13},{"type":"Class","namespace":"InvestmentFeesView","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/views/investment_fees_view.rb","line":3,"lines":18},{"type":"Class","namespace":"InvestmentFeesController","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/controllers/investment_fees_controller.rb","line":3,"lines":11},{"type":"Class","namespace":"CurrencyHelper","circular":false,"file":"/home/jorg/projects/jj/messy_app/app/apis/currency_helper.rb","line":3,"lines":18},{"type":"Class","namespace":"CurrencyExchangeApi","circular":false,"file":"/home/jorg/projects/jj/messy_app/app/apis/currency_exchange_api.rb","line":3,"lines":20},{"type":"Class","namespace":"CreateModels","circular":false,"file":"/home/jorg/projects/jj/messy_app/db/migrate/20230915080533_create_models.rb","line":3,"lines":37},{"type":"Class","namespace":"Controller","circular":false,"file":"/home/jorg/projects/jj/messy_app/lib/controller.rb","line":3,"lines":19},{"type":"Module","namespace":"Constants","circular":false,"file":"/home/jorg/projects/jj/messy_app/app/controllers/constants.rb","line":3,"lines":4},{"type":"Class","namespace":"ApplicationController","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/controllers/application_controller.rb","line":3,"lines":13},{"type":"Class","namespace":"Application","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/application.rb","line":20,"lines":29},{"type":"Class","namespace":"AdminView","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/views/admin_view.rb","line":3,"lines":29},{"type":"Class","namespace":"AdminController","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/controllers/admin_controller.rb","line":3,"lines":19},{"type":"Class","namespace":"AddressAttribute","circular":false,"file":"/home/jorg/projects/jj/messy_app/app/models/address_attribute.rb","line":3,"lines":3},{"type":"Class","namespace":"Address","circular":false,"file":"/home/jorg/projects/jj/messy_app/app/models/address.rb","line":3,"lines":4},{"type":"Class","namespace":"AddHistory","circular":false,"file":"/home/jorg/projects/jj/messy_app/db/migrate/20230915103031_add_history.rb","line":3,"lines":27},{"type":"Class","namespace":"AccountingView","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/views/accounting_view.rb","line":3,"lines":12},{"type":"Class","namespace":"AccountingController","circular":true,"file":"/home/jorg/projects/jj/messy_app/app/controllers/accounting_controller.rb","line":3,"lines":26}],"relations":[{"type":"Base","namespace":"Date","resolved_namespace":"Date","caller":"CurrencyHelper","file":"/home/jorg/projects/jj/messy_app/app/apis/currency_helper.rb","circular":false,"line":6},{"type":"Base","namespace":"Zeitwerk::Loader","resolved_namespace":"Zeitwerk::Loader","caller":"","file":"/home/jorg/projects/jj/messy_app/app/application.rb","circular":false,"line":10},{"type":"Base","namespace":"LoginController","resolved_namespace":"LoginController","caller":"Application","file":"/home/jorg/projects/jj/messy_app/app/application.rb","circular":true,"line":31},{"type":"Base","namespace":"User","resolved_namespace":"User","caller":"Application","file":"/home/jorg/projects/jj/messy_app/app/application.rb","circular":false,"line":36},{"type":"Base","namespace":"CurrencyHelper","resolved_namespace":"CurrencyHelper","caller":"InvestmentNewsBuilder","file":"/home/jorg/projects/jj/messy_app/app/builders/investment_news_builder.rb","circular":false,"line":11},{"type":"Base","namespace":"CurrencyExchangeApi","resolved_namespace":"CurrencyExchangeApi","caller":"InvestmentNewsBuilder","file":"/home/jorg/projects/jj/messy_app/app/builders/investment_news_builder.rb","circular":false,"line":12},{"type":"Base","namespace":"Date","resolved_namespace":"Date","caller":"InvestmentNewsBuilder","file":"/home/jorg/projects/jj/messy_app/app/builders/investment_news_builder.rb","circular":false,"line":12},{"type":"Base","namespace":"ApplicationController","resolved_namespace":"ApplicationController","caller":"AccountingController","file":"/home/jorg/projects/jj/messy_app/app/controllers/accounting_controller.rb","circular":true,"line":3},{"type":"Base","namespace":"Security","resolved_namespace":"Security","caller":"AccountingController","file":"/home/jorg/projects/jj/messy_app/app/controllers/accounting_controller.rb","circular":false,"line":5},{"type":"Base","namespace":"StockApi","resolved_namespace":"StockApi","caller":"AccountingController","file":"/home/jorg/projects/jj/messy_app/app/controllers/accounting_controller.rb","circular":false,"line":10},{"type":"Base","namespace":"Date","resolved_namespace":"Date","caller":"AccountingController","file":"/home/jorg/projects/jj/messy_app/app/controllers/accounting_controller.rb","circular":false,"line":10},{"type":"Base","namespace":"Constants::FEE_RATE","resolved_namespace":"Constants::FEE_RATE","caller":"AccountingController","file":"/home/jorg/projects/jj/messy_app/app/controllers/accounting_controller.rb","circular":false,"line":10},{"type":"Base","namespace":"AddressAttribute","resolved_namespace":"AddressAttribute","caller":"AccountingController","file":"/home/jorg/projects/jj/messy_app/app/controllers/accounting_controller.rb","circular":false,"line":12},{"type":"Base","namespace":"CurrencyHelper","resolved_namespace":"CurrencyHelper","caller":"AccountingController","file":"/home/jorg/projects/jj/messy_app/app/controllers/accounting_controller.rb","circular":false,"line":13},{"type":"Base","namespace":"CurrencyExchangeApi","resolved_namespace":"CurrencyExchangeApi","caller":"AccountingController","file":"/home/jorg/projects/jj/messy_app/app/controllers/accounting_controller.rb","circular":false,"line":14},{"type":"Base","namespace":"Date","resolved_namespace":"Date","caller":"AccountingController","file":"/home/jorg/projects/jj/messy_app/app/controllers/accounting_controller.rb","circular":false,"line":14},{"type":"Base","namespace":"AccountingView","resolved_namespace":"AccountingView","caller":"AccountingController","file":"/home/jorg/projects/jj/messy_app/app/controllers/accounting_controller.rb","circular":true,"line":26},{"type":"Base","namespace":"ApplicationController","resolved_namespace":"ApplicationController","caller":"AdminController","file":"/home/jorg/projects/jj/messy_app/app/controllers/admin_controller.rb","circular":true,"line":3},{"type":"Base","namespace":"User","resolved_namespace":"User","caller":"AdminController","file":"/home/jorg/projects/jj/messy_app/app/controllers/admin_controller.rb","circular":false,"line":5},{"type":"Base","namespace":"AdminView","resolved_namespace":"AdminView","caller":"AdminController","file":"/home/jorg/projects/jj/messy_app/app/controllers/admin_controller.rb","circular":true,"line":6},{"type":"Base","namespace":"Passcode","resolved_namespace":"Passcode","caller":"AdminController","file":"/home/jorg/projects/jj/messy_app/app/controllers/admin_controller.rb","circular":false,"line":13},{"type":"Base","namespace":"PasscodeView","resolved_namespace":"PasscodeView","caller":"AdminController","file":"/home/jorg/projects/jj/messy_app/app/controllers/admin_controller.rb","circular":true,"line":15},{"type":"Base","namespace":"AccountingController","resolved_namespace":"AccountingController","caller":"AdminController","file":"/home/jorg/projects/jj/messy_app/app/controllers/admin_controller.rb","circular":true,"line":19},{"type":"Base","namespace":"Controller","resolved_namespace":"Controller","caller":"ApplicationController","file":"/home/jorg/projects/jj/messy_app/app/controllers/application_controller.rb","circular":false,"line":3},{"type":"Base","namespace":"LoginController","resolved_namespace":"LoginController","caller":"ApplicationController","file":"/home/jorg/projects/jj/messy_app/app/controllers/application_controller.rb","circular":true,"line":9},{"type":"Base","namespace":"Application","resolved_namespace":"Application","caller":"ApplicationController","file":"/home/jorg/projects/jj/messy_app/app/controllers/application_controller.rb","circular":true,"line":14},{"type":"Base","namespace":"ApplicationController","resolved_namespace":"ApplicationController","caller":"InvestmentFeesController","file":"/home/jorg/projects/jj/messy_app/app/controllers/investment_fees_controller.rb","circular":true,"line":3},{"type":"Base","namespace":"PortfolioValueSupport","resolved_namespace":"PortfolioValueSupport","caller":"InvestmentFeesController","file":"/home/jorg/projects/jj/messy_app/app/controllers/investment_fees_controller.rb","circular":false,"line":4},{"type":"Base","namespace":"User","resolved_namespace":"User","caller":"InvestmentFeesController","file":"/home/jorg/projects/jj/messy_app/app/controllers/investment_fees_controller.rb","circular":false,"line":7},{"type":"Base","namespace":"Constants::FEE_RATE","resolved_namespace":"Constants::FEE_RATE","caller":"InvestmentFeesController","file":"/home/jorg/projects/jj/messy_app/app/controllers/investment_fees_controller.rb","circular":false,"line":9},{"type":"Base","namespace":"InvestmentFeesView","resolved_namespace":"InvestmentFeesView","caller":"InvestmentFeesController","file":"/home/jorg/projects/jj/messy_app/app/controllers/investment_fees_controller.rb","circular":true,"line":11},{"type":"Base","namespace":"ApplicationController","resolved_namespace":"ApplicationController","caller":"InvestmentNewsController","file":"/home/jorg/projects/jj/messy_app/app/controllers/investment_news_controller.rb","circular":true,"line":3},{"type":"Base","namespace":"User","resolved_namespace":"User","caller":"InvestmentNewsController","file":"/home/jorg/projects/jj/messy_app/app/controllers/investment_news_controller.rb","circular":false,"line":5},{"type":"Base","namespace":"InvestmentNewsBuilder","resolved_namespace":"InvestmentNewsBuilder","caller":"InvestmentNewsController","file":"/home/jorg/projects/jj/messy_app/app/controllers/investment_news_controller.rb","circular":false,"line":7},{"type":"Base","namespace":"InvestmentNewsView","resolved_namespace":"InvestmentNewsView","caller":"InvestmentNewsController","file":"/home/jorg/projects/jj/messy_app/app/controllers/investment_news_controller.rb","circular":true,"line":9},{"type":"Base","namespace":"ApplicationController","resolved_namespace":"ApplicationController","caller":"LoginController","file":"/home/jorg/projects/jj/messy_app/app/controllers/login_controller.rb","circular":true,"line":3},{"type":"Base","namespace":"LoginView","resolved_namespace":"LoginView","caller":"LoginController","file":"/home/jorg/projects/jj/messy_app/app/controllers/login_controller.rb","circular":true,"line":5},{"type":"Base","namespace":"User","resolved_namespace":"User","caller":"LoginController","file":"/home/jorg/projects/jj/messy_app/app/controllers/login_controller.rb","circular":false,"line":9},{"type":"Base","namespace":"LoginView","resolved_namespace":"LoginView","caller":"LoginController","file":"/home/jorg/projects/jj/messy_app/app/controllers/login_controller.rb","circular":true,"line":14},{"type":"Base","namespace":"Date","resolved_namespace":"Date","caller":"LoginController","file":"/home/jorg/projects/jj/messy_app/app/controllers/login_controller.rb","circular":false,"line":19},{"type":"Base","namespace":"Address","resolved_namespace":"Address","caller":"LoginController","file":"/home/jorg/projects/jj/messy_app/app/controllers/login_controller.rb","circular":false,"line":20},{"type":"Base","namespace":"Person","resolved_namespace":"Person","caller":"LoginController","file":"/home/jorg/projects/jj/messy_app/app/controllers/login_controller.rb","circular":false,"line":22},{"type":"Base","namespace":"User","resolved_namespace":"User","caller":"LoginController","file":"/home/jorg/projects/jj/messy_app/app/controllers/login_controller.rb","circular":false,"line":24},{"type":"Base","namespace":"Passcode","resolved_namespace":"Passcode","caller":"LoginController","file":"/home/jorg/projects/jj/messy_app/app/controllers/login_controller.rb","circular":false,"line":27},{"type":"Base","namespace":"SignupResultView","resolved_namespace":"SignupResultView","caller":"LoginController","file":"/home/jorg/projects/jj/messy_app/app/controllers/login_controller.rb","circular":true,"line":39},{"type":"Base","namespace":"ProfileController","resolved_namespace":"ProfileController","caller":"LoginController","file":"/home/jorg/projects/jj/messy_app/app/controllers/login_controller.rb","circular":true,"line":43},{"type":"Base","namespace":"AdminController","resolved_namespace":"AdminController","caller":"LoginController","file":"/home/jorg/projects/jj/messy_app/app/controllers/login_controller.rb","circular":true,"line":50},{"type":"Base","namespace":"PortfolioController","resolved_namespace":"PortfolioController","caller":"LoginController","file":"/home/jorg/projects/jj/messy_app/app/controllers/login_controller.rb","circular":true,"line":52},{"type":"Base","namespace":"ApplicationController","resolved_namespace":"ApplicationController","caller":"PortfolioController","file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_controller.rb","circular":true,"line":3},{"type":"Base","namespace":"PortfolioValueSupport","resolved_namespace":"PortfolioValueSupport","caller":"PortfolioController","file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_controller.rb","circular":false,"line":4},{"type":"Base","namespace":"User","resolved_namespace":"User","caller":"PortfolioController","file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_controller.rb","circular":false,"line":7},{"type":"Base","namespace":"PortfolioView","resolved_namespace":"PortfolioView","caller":"PortfolioController","file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_controller.rb","circular":true,"line":10},{"type":"Base","namespace":"User","resolved_namespace":"User","caller":"PortfolioController","file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_controller.rb","circular":false,"line":14},{"type":"Base","namespace":"Security","resolved_namespace":"Security","caller":"PortfolioController","file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_controller.rb","circular":false,"line":16},{"type":"Base","namespace":"PortfolioView","resolved_namespace":"PortfolioView","caller":"PortfolioController","file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_controller.rb","circular":true,"line":20},{"type":"Base","namespace":"ProfileController","resolved_namespace":"ProfileController","caller":"PortfolioController","file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_controller.rb","circular":true,"line":24},{"type":"Base","namespace":"InvestmentNewsController","resolved_namespace":"InvestmentNewsController","caller":"PortfolioController","file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_controller.rb","circular":true,"line":28},{"type":"Base","namespace":"InvestmentFeesController","resolved_namespace":"InvestmentFeesController","caller":"PortfolioController","file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_controller.rb","circular":true,"line":32},{"type":"Base","namespace":"NotFoundView","resolved_namespace":"NotFoundView","caller":"PortfolioController","file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_controller.rb","circular":true,"line":36},{"type":"Base","namespace":"StockApi","resolved_namespace":"StockApi","caller":"PortfolioValueSupport","file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_value_support.rb","circular":false,"line":6},{"type":"Base","namespace":"Date","resolved_namespace":"Date","caller":"PortfolioValueSupport","file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_value_support.rb","circular":false,"line":6},{"type":"Base","namespace":"CurrencyExchangeApi","resolved_namespace":"CurrencyExchangeApi","caller":"PortfolioValueSupport","file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_value_support.rb","circular":false,"line":7},{"type":"Base","namespace":"CurrencyHelper","resolved_namespace":"CurrencyHelper","caller":"PortfolioValueSupport","file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_value_support.rb","circular":false,"line":7},{"type":"Base","namespace":"Date","resolved_namespace":"Date","caller":"PortfolioValueSupport","file":"/home/jorg/projects/jj/messy_app/app/controllers/portfolio_value_support.rb","circular":false,"line":7},{"type":"Base","namespace":"ApplicationController","resolved_namespace":"ApplicationController","caller":"ProfileController","file":"/home/jorg/projects/jj/messy_app/app/controllers/profile_controller.rb","circular":true,"line":3},{"type":"Base","namespace":"User","resolved_namespace":"User","caller":"ProfileController","file":"/home/jorg/projects/jj/messy_app/app/controllers/profile_controller.rb","circular":false,"line":5},{"type":"Base","namespace":"ProfileView","resolved_namespace":"ProfileView","caller":"ProfileController","file":"/home/jorg/projects/jj/messy_app/app/controllers/profile_controller.rb","circular":true,"line":7},{"type":"Base","namespace":"User","resolved_namespace":"User","caller":"ProfileController","file":"/home/jorg/projects/jj/messy_app/app/controllers/profile_controller.rb","circular":false,"line":11},{"type":"Base","namespace":"ProfileView","resolved_namespace":"ProfileView","caller":"ProfileController","file":"/home/jorg/projects/jj/messy_app/app/controllers/profile_controller.rb","circular":true,"line":16},{"type":"Base","namespace":"User","resolved_namespace":"User","caller":"ProfileController","file":"/home/jorg/projects/jj/messy_app/app/controllers/profile_controller.rb","circular":false,"line":20},{"type":"Base","namespace":"ProfileView","resolved_namespace":"ProfileView","caller":"ProfileController","file":"/home/jorg/projects/jj/messy_app/app/controllers/profile_controller.rb","circular":true,"line":25},{"type":"Base","namespace":"PortfolioController","resolved_namespace":"PortfolioController","caller":"ProfileController","file":"/home/jorg/projects/jj/messy_app/app/controllers/profile_controller.rb","circular":true,"line":29},{"type":"Base","namespace":"InvestmentNewsController","resolved_namespace":"InvestmentNewsController","caller":"ProfileController","file":"/home/jorg/projects/jj/messy_app/app/controllers/profile_controller.rb","circular":true,"line":33},{"type":"Base","namespace":"InvestmentFeesController","resolved_namespace":"InvestmentFeesController","caller":"ProfileController","file":"/home/jorg/projects/jj/messy_app/app/controllers/profile_controller.rb","circular":true,"line":37},{"type":"Base","namespace":"ActiveRecord::Base","resolved_namespace":"ActiveRecord::Base","caller":"Address","file":"/home/jorg/projects/jj/messy_app/app/models/address.rb","circular":false,"line":3},{"type":"Base","namespace":"ActiveRecord::Base","resolved_namespace":"ActiveRecord::Base","caller":"AddressAttribute","file":"/home/jorg/projects/jj/messy_app/app/models/address_attribute.rb","circular":false,"line":3},{"type":"Base","namespace":"ActiveRecord::Base","resolved_namespace":"ActiveRecord::Base","caller":"Passcode","file":"/home/jorg/projects/jj/messy_app/app/models/passcode.rb","circular":false,"line":3},{"type":"Base","namespace":"ActiveRecord::Base","resolved_namespace":"ActiveRecord::Base","caller":"Person","file":"/home/jorg/projects/jj/messy_app/app/models/person.rb","circular":false,"line":3},{"type":"Base","namespace":"ActiveRecord::Base","resolved_namespace":"ActiveRecord::Base","caller":"PersonAttribute","file":"/home/jorg/projects/jj/messy_app/app/models/person_attribute.rb","circular":false,"line":3},{"type":"Base","namespace":"ActiveRecord::Base","resolved_namespace":"ActiveRecord::Base","caller":"Security","file":"/home/jorg/projects/jj/messy_app/app/models/security.rb","circular":false,"line":3},{"type":"Base","namespace":"ActiveRecord::Base","resolved_namespace":"ActiveRecord::Base","caller":"User","file":"/home/jorg/projects/jj/messy_app/app/models/user.rb","circular":false,"line":3},{"type":"Base","namespace":"View","resolved_namespace":"View","caller":"AccountingView","file":"/home/jorg/projects/jj/messy_app/app/views/accounting_view.rb","circular":true,"line":3},{"type":"Base","namespace":"View","resolved_namespace":"View","caller":"AdminView","file":"/home/jorg/projects/jj/messy_app/app/views/admin_view.rb","circular":true,"line":3},{"type":"Base","namespace":"View","resolved_namespace":"View","caller":"InvestmentFeesView","file":"/home/jorg/projects/jj/messy_app/app/views/investment_fees_view.rb","circular":true,"line":3},{"type":"Base","namespace":"Date","resolved_namespace":"Date","caller":"InvestmentFeesView","file":"/home/jorg/projects/jj/messy_app/app/views/investment_fees_view.rb","circular":false,"line":5},{"type":"Base","namespace":"CurrencyHelper","resolved_namespace":"CurrencyHelper","caller":"InvestmentFeesView","file":"/home/jorg/projects/jj/messy_app/app/views/investment_fees_view.rb","circular":false,"line":19},{"type":"Base","namespace":"View","resolved_namespace":"View","caller":"InvestmentNewsView","file":"/home/jorg/projects/jj/messy_app/app/views/investment_news_view.rb","circular":true,"line":3},{"type":"Base","namespace":"Date","resolved_namespace":"Date","caller":"InvestmentNewsView","file":"/home/jorg/projects/jj/messy_app/app/views/investment_news_view.rb","circular":false,"line":5},{"type":"Base","namespace":"View","resolved_namespace":"View","caller":"LoginView","file":"/home/jorg/projects/jj/messy_app/app/views/login_view.rb","circular":true,"line":3},{"type":"Base","namespace":"View","resolved_namespace":"View","caller":"NotFoundView","file":"/home/jorg/projects/jj/messy_app/app/views/not_found_view.rb","circular":true,"line":3},{"type":"Base","namespace":"View","resolved_namespace":"View","caller":"PasscodeView","file":"/home/jorg/projects/jj/messy_app/app/views/passcode_view.rb","circular":true,"line":3},{"type":"Base","namespace":"View","resolved_namespace":"View","caller":"PortfolioView","file":"/home/jorg/projects/jj/messy_app/app/views/portfolio_view.rb","circular":true,"line":3},{"type":"Base","namespace":"CurrencyHelper","resolved_namespace":"CurrencyHelper","caller":"PortfolioView","file":"/home/jorg/projects/jj/messy_app/app/views/portfolio_view.rb","circular":false,"line":8},{"type":"Base","namespace":"Date","resolved_namespace":"Date","caller":"PortfolioView","file":"/home/jorg/projects/jj/messy_app/app/views/portfolio_view.rb","circular":false,"line":39},{"type":"Base","namespace":"View","resolved_namespace":"View","caller":"ProfileView","file":"/home/jorg/projects/jj/messy_app/app/views/profile_view.rb","circular":true,"line":3},{"type":"Base","namespace":"View","resolved_namespace":"View","caller":"SignupResultView","file":"/home/jorg/projects/jj/messy_app/app/views/signup_result_view.rb","circular":true,"line":3},{"type":"Base","namespace":"ActiveRecord::Migration","resolved_namespace":"ActiveRecord::Migration","caller":"CreateModels","file":"/home/jorg/projects/jj/messy_app/db/migrate/20230915080533_create_models.rb","circular":false,"line":3},{"type":"Base","namespace":"ActiveRecord::Migration","resolved_namespace":"ActiveRecord::Migration","caller":"AddHistory","file":"/home/jorg/projects/jj/messy_app/db/migrate/20230915103031_add_history.rb","circular":false,"line":3},{"type":"Base","namespace":"ActiveRecord::Schema","resolved_namespace":"ActiveRecord::Schema","caller":"","file":"/home/jorg/projects/jj/messy_app/db/schema.rb","circular":false,"line":13},{"type":"Base","namespace":"Application","resolved_namespace":"Application","caller":"View","file":"/home/jorg/projects/jj/messy_app/lib/view.rb","circular":true,"line":13},{"type":"Base","namespace":"ViewDriver","resolved_namespace":"ViewDriver","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_accounting_spec.rb","circular":false,"line":6},{"type":"Base","namespace":"Application","resolved_namespace":"Application","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_accounting_spec.rb","circular":false,"line":6},{"type":"Base","namespace":"ViewDriver","resolved_namespace":"ViewDriver","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_admin_spec.rb","circular":false,"line":6},{"type":"Base","namespace":"Application","resolved_namespace":"Application","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_admin_spec.rb","circular":false,"line":6},{"type":"Base","namespace":"Date","resolved_namespace":"Date","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_admin_spec.rb","circular":false,"line":7},{"type":"Base","namespace":"Timecop","resolved_namespace":"Timecop","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_admin_spec.rb","circular":false,"line":11},{"type":"Base","namespace":"Regexp","resolved_namespace":"Regexp","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_admin_spec.rb","circular":false,"line":74},{"type":"Base","namespace":"ViewDriver","resolved_namespace":"ViewDriver","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_securities_spec.rb","circular":false,"line":6},{"type":"Base","namespace":"Application","resolved_namespace":"Application","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_securities_spec.rb","circular":false,"line":6},{"type":"Base","namespace":"Date","resolved_namespace":"Date","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_securities_spec.rb","circular":false,"line":8},{"type":"Base","namespace":"Timecop","resolved_namespace":"Timecop","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_securities_spec.rb","circular":false,"line":13},{"type":"Base","namespace":"Timecop","resolved_namespace":"Timecop","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_securities_spec.rb","circular":false,"line":54},{"type":"Base","namespace":"Timecop","resolved_namespace":"Timecop","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_securities_spec.rb","circular":false,"line":64},{"type":"Base","namespace":"Timecop","resolved_namespace":"Timecop","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_securities_spec.rb","circular":false,"line":83},{"type":"Base","namespace":"Timecop","resolved_namespace":"Timecop","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_securities_spec.rb","circular":false,"line":93},{"type":"Base","namespace":"Timecop","resolved_namespace":"Timecop","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_securities_spec.rb","circular":false,"line":137},{"type":"Base","namespace":"Timecop","resolved_namespace":"Timecop","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_securities_spec.rb","circular":false,"line":147},{"type":"Base","namespace":"Timecop","resolved_namespace":"Timecop","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_securities_spec.rb","circular":false,"line":166},{"type":"Base","namespace":"Timecop","resolved_namespace":"Timecop","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_securities_spec.rb","circular":false,"line":176},{"type":"Base","namespace":"Timecop","resolved_namespace":"Timecop","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_securities_spec.rb","circular":false,"line":232},{"type":"Base","namespace":"Timecop","resolved_namespace":"Timecop","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_securities_spec.rb","circular":false,"line":242},{"type":"Base","namespace":"Timecop","resolved_namespace":"Timecop","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_securities_spec.rb","circular":false,"line":261},{"type":"Base","namespace":"Timecop","resolved_namespace":"Timecop","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/app/application_securities_spec.rb","circular":false,"line":271},{"type":"Base","namespace":"DEFAULT_PWD","resolved_namespace":"DEFAULT_PWD","caller":"ViewDriver","file":"/home/jorg/projects/jj/messy_app/spec/app/view_driver.rb","circular":false,"line":26},{"type":"Base","namespace":"DEFAULT_EMAIL","resolved_namespace":"DEFAULT_EMAIL","caller":"ViewDriver","file":"/home/jorg/projects/jj/messy_app/spec/app/view_driver.rb","circular":false,"line":30},{"type":"Base","namespace":"DEFAULT_PWD","resolved_namespace":"DEFAULT_PWD","caller":"ViewDriver","file":"/home/jorg/projects/jj/messy_app/spec/app/view_driver.rb","circular":false,"line":37},{"type":"Base","namespace":"DEFAULT_PWD","resolved_namespace":"DEFAULT_PWD","caller":"ViewDriver","file":"/home/jorg/projects/jj/messy_app/spec/app/view_driver.rb","circular":false,"line":41},{"type":"Base","namespace":"DEFAULT_EMAIL","resolved_namespace":"DEFAULT_EMAIL","caller":"ViewDriver","file":"/home/jorg/projects/jj/messy_app/spec/app/view_driver.rb","circular":false,"line":42},{"type":"Base","namespace":"DEFAULT_PWD","resolved_namespace":"DEFAULT_PWD","caller":"ViewDriver","file":"/home/jorg/projects/jj/messy_app/spec/app/view_driver.rb","circular":false,"line":52},{"type":"Base","namespace":"RSpec","resolved_namespace":"RSpec","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/spec_helper.rb","circular":false,"line":23},{"type":"Base","namespace":"ActiveRecord::Base","resolved_namespace":"ActiveRecord::Base","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/spec_helper.rb","circular":false,"line":105},{"type":"Base","namespace":"Application","resolved_namespace":"Application","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/spec_helper.rb","circular":false,"line":112},{"type":"Base","namespace":"ActiveRecord::Base","resolved_namespace":"ActiveRecord::Base","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/spec_helper.rb","circular":false,"line":116},{"type":"Base","namespace":"ActiveRecord::Rollback","resolved_namespace":"ActiveRecord::Rollback","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/spec_helper.rb","circular":false,"line":118},{"type":"Base","namespace":"ActiveRecord::Base","resolved_namespace":"ActiveRecord::Base","caller":"","file":"/home/jorg/projects/jj/messy_app/spec/spec_helper.rb","circular":false,"line":123}]};
var layout = null;
</script>
<script type='text/javascript'>var classForCircular = function(d) {
return d.circular ? 'circular' : '';
};
var svg = d3.select(".dependency_graph svg"),
$svg = $('.dependency_graph svg'),
width = $svg.width(),
height = $svg.height(),
drag = d3.drag()
.on("start", dragstarted)
.on("drag", dragged)
.on("end", dragended),
dup_definitions = data.definitions.map(function(d){
return {
id: d.namespace,
file: d.file,
type: d.type,
lines: d.lines,
circular: d.circular
};
}),
definitions = _(dup_definitions).groupBy('id').map(function(group) {
return {
id: group[0].id,
type: group[0].type,
lines: _(group).sumBy('lines'),
circular: group[0].circular,
files: group.map(function(d){ return d.file; })
};
}).value(),
namespaces = definitions.map(function(d){ return d.id; }),
relations = data.relations.map(function(d){ return {source: d.caller, target: d.resolved_namespace, circular: d.circular}; }),
max_lines = _.maxBy(definitions, 'lines').lines,
max_circle_r = 50;
relations = relations.filter(function(d){
return namespaces.indexOf(d.source) >= 0 && namespaces.indexOf(d.target) >= 0;
});
relations = _.uniqWith(relations, _.isEqual);
var zoom = d3.zoom()
.on("zoom", function () {
container.attr("transform", d3.event.transform);
});
svg.call(zoom)
.on("dblclick.zoom", null);
var container = svg.append('g'),
simulation = d3.forceSimulation()
.force("link", d3.forceLink().id(function(d) { return d.id; }))
.force("charge", d3.forceManyBody())
.force("center", d3.forceCenter(width / 2, height / 2))
.force("forceCollide", d3.forceCollide(80));
simulation
.nodes(definitions)
.on("tick", ticked);
simulation.force("link")
.links(relations);
var link = container.append("g")
.attr("class", "links")
.selectAll("path")
.data(relations)
.enter().append("path")
.attr("class", function(d) { return 'link ' + classForCircular(d); })
.attr("marker-end", function(d){ return "url(#" + d.target.id + ")"; }),
node = container.append("g")
.attr("class", "nodes")
.selectAll("g")
.data(definitions)
.enter().append("g")
.call(drag)
.on("dblclick", dblclick),
circle = node
.append("circle")
.attr("r", function(d) { return d.lines / max_lines * max_circle_r + 6; })
.attr("class", function (d) { return classForCircular(d) ; }),
type = node
.append("text")
.attr("class", "type")
.attr("x", "-0.4em")
.attr("y", "0.4em")
.text(function(d) { return d.type[0]; }),
text = node
.append("text")
.attr("class", "namespace")
.attr("x", function(d) { return d.lines / max_lines * max_circle_r + 8; })
.attr("y", ".31em")
.text(function(d) { return d.id; });
container.append("defs").selectAll("marker")
.data(definitions)
.enter().append("marker")
.attr("id", function(d) { return d.id; })
.attr("viewBox", "0 -5 10 10")
.attr("refX", function(d){ return d.lines / max_lines * max_circle_r + 20; })
.attr("refY", 0)
.attr("markerWidth", 6)
.attr("markerHeight", 6)
.attr("orient", "auto")
.append("path")
.attr("d", "M0,-5L10,0L0,5");
function ticked() {
link.attr("d", linkArc);
node.attr("transform", transform);
}
function linkArc(d) {
var dx = d.target.x - d.source.x,
dy = d.target.y - d.source.y,
dr = 0;
return "M" + d.source.x + "," + d.source.y + "A" + dr + "," + dr + " 0 0,1 " + d.target.x + "," + d.target.y;
}
function dragstarted(d) {
if (!d3.event.active) simulation.alphaTarget(0.3).restart();
d3.select(this).classed("fixed", true);
d.fx = d.x;
d.fy = d.y;
}
function dragged(d) {
d.fx = d3.event.x;
d.fy = d3.event.y;
}
function dragended(d) {
if (!d3.event.active) simulation.alphaTarget(0);
}
function dblclick(d) {
d3.select(this).classed("fixed", false);
d.fx = null;
d.fy = null;
}
function transform(d) {
return "translate(" + d.x + "," + d.y + ")";
}
var state = {
get: function(){
var positions = [];
rubrowser.definitions.forEach(function(elem){
if( elem.fx !== undefined && elem.fy !== undefined) {
positions.push({
id: elem.id,
x: elem.fx,
y: elem.fy
});
}
});
return positions;
},
set: function(layout){
if ( !layout ) { return; }
layout.forEach(function(pos) {
var definition = node.filter(function(e) { return e.id == pos.id; })
definition.classed("fixed", true);
var datum = definition.data()[0]
if( datum ) {
datum.fx = pos.x
datum.fy = pos.y
}
});
}
}
node.on('mouseover', function(d) {
var relatives = [];
link.classed('downlighted', function(l) {
if (d === l.source || d === l.target){
relatives.push(l.source);
relatives.push(l.target);
return false;
}else{
return true;
}
});
node.classed('downlighted', function(n) {
return !(n == d || relatives.indexOf(n) > -1);
});
});
node.on('mouseout', function() {
link.classed('downlighted', false);
node.classed('downlighted', false);
});
window.rubrowser = {
data: data,
definitions: definitions,
relations: relations,
simulation: simulation,
node: node,
link: link,
state: state
};
rubrowser.state.set(layout);
</script>
<div class="toolbox">
<div class="card ml-2 mt-2">
<div class="card-header">Search</div>
<div class="card-body">
<label class="form-label">Namespace</label>
<textarea id="highlight_by_namespace" class="form-control" rows="5"></textarea>
</div>
<div class="card-body">
<label class="form-label">File Path</label>
<textarea id="highlight_by_file_path" class="form-control" rows="5"></textarea>
</div>
<div class="card-body">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="highlight_modules"/>
<label class="form-check-label">Modules</label>
</div>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="highlight_classes"/>
<label class="form-check-label">Classes</label>
</div>
</div>
</div>
<div class="card ml-2 mt-2">
<div class="card-header">Ignore</div>
<div class="card-body">
<label>Namespace</label>
<textarea id="ignore_by_namespace" class="form-control" rows="5"></textarea>
</div>
<div class="card-body">
<label>File Path</label>
<textarea id="ignore_by_file_path" class="form-control" rows="5"></textarea>
</div>
<div class="card-body">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="ignore_modules"/>
<label class="form-check-label">Modules</label>
</div>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="ignore_classes"/>
<label class="form-check-label">Classes</label>
</div>
</div>
</div>
<div class="card ml-2 mt-2">
<div class="card-header">Display</div>
<div class="card-body">
<button type="button" id="download_layout" class="btn btn-secondary btn-block">Download layout</button>
<button type="button" id="pause_simulation" class="btn btn-secondary btn-block">Pause animation</button>
<button type="button" id="fix_all" class="btn btn-secondary btn-block">Fix all</button>
<button type="button" id="release_all" class="btn btn-secondary btn-block">Release all</button>
</div>
<div class="card-body">
<label class="form-label">Force Collide</label>
<input id="force_collide" class="form-control" type="range" value="80" min="0" max="500"/>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="hide_namespaces"/>
<label class="form-check-label">Hide namespaces</label>
</div>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="hide_relations"/>
<label class="form-check-label">Hide relations</label>
</div>
</div>
</div>
</div>
<div id="information_panel" class="card"></div>
<script type='text/javascript'>$(document).on('click', '.card-header', function(){
$(this).siblings().toggle();
});
// --------------------------------
// Details Panel
// --------------------------------
rubrowser.node.on('click', function(d){
var namespace = d.id;
var lines = d.lines;
var dependents = rubrowser.relations.filter(function(i){ return i.target.id == namespace; });
var dependencies = rubrowser.relations.filter(function(i){ return i.source.id == namespace; });
var definitions = rubrowser.data.definitions.filter(function(i){ return i.namespace == namespace; });
var relations = rubrowser.data.relations.filter(function(i){ return i.resolved_namespace == namespace || i.caller == namespace; });
var content = $('<div>');
content.append('<label><strong>'+namespace+' ('+d.lines+' Lines)</strong></label>');
content.append('<strong>Defined in:</strong>');
var definitions_ol = $("<ol>");
for(var i=0; i<definitions.length; i++){
definitions_ol.append("<li>"+definitions[i].file+":"+definitions[i].line.toString()+"</li>");
}
content.append(definitions_ol);
if( dependents.length > 0 ){
content.append('<strong>Dependents:</strong>');
var dependents_ol = $("<ol>");
for(var i=0; i<dependents.length; i++){
dependents_ol.append("<li>"+dependents[i].source.id+"</li>");
}
content.append(dependents_ol);
}
if( dependencies.length > 0 ){
content.append('<strong>Dependencies:</strong>');
var dependencies_ol = $("<ol>");
for(var i=0; i<dependencies.length; i++){
dependencies_ol.append("<li>"+dependencies[i].target.id+"</li>");
}
content.append(dependencies_ol);
}
$('#information_panel').html(content);
return true;
});
// --------------------------------
// Search Panel
// --------------------------------
$(document).on('change', '#highlight_by_namespace', function(){
var highlights_entries = $(this).val().trim();
var highlights = _(highlights_entries.split("\n"));
rubrowser.node.classed('highlighted_by_namespace', function(d){
if(highlights_entries.length == 0){ return false; }
return highlights.some(function(i){ return d.id.indexOf(i) > -1; });
});
});
$(document).on('change', '#highlight_by_file_path', function(){
var highlights_entries = $(this).val().trim();
var highlights = _(highlights_entries.split("\n"));
rubrowser.node.classed('highlighted_by_path', function(d){
if(highlights_entries.length == 0){ return false; }
return highlights.some(function(i){
return _(d.files).some(function(f) {
return f.indexOf(i) > -1;
});
});
});
});
$(document).on('change', '#highlight_modules, #highlight_classes', function(){
var modules_highlighted = $('#highlight_modules').is(':checked'),
classes_highlighted = $('#highlight_classes').is(':checked');
rubrowser.node.classed('highlighted_by_type', function(d){
return (d.type == 'Module' && modules_highlighted) || (d.type == 'Class' && classes_highlighted);
});
});
// --------------------------------
// Ignore Panel
// --------------------------------
var ignoring_functions = {};
function updateNodes() {
function ignoreNode(d) {
return _(ignoring_functions).some(function(ignoring_function) {
return ignoring_function(d);
});
}
function notIgnoreNode(d){
return !ignoreNode(d);
}
function ignoreRelation(r){
return ignoreNode(r.source) || ignoreNode(r.target);
}
function notIgnoreRelation(r){
return !ignoreRelation(r);
}
var filtered_definitions = rubrowser.definitions.filter(notIgnoreNode);
rubrowser.simulation.nodes(filtered_definitions);
rubrowser.node.classed('ignored', ignoreNode);
var filtered_relations = rubrowser.relations.filter(notIgnoreRelation);
rubrowser.simulation.force("link").links(filtered_relations);
rubrowser.link.classed('ignored', ignoreRelation);
}
$(document).on('change', '#ignore_by_namespace', function(){
var ignores_entries = $(this).val().trim();
var ignores = ignores_entries.split("\n");
if(ignores_entries.length == 0){
delete ignoring_functions["ignore_by_name"];
}else{
ignoring_functions["ignore_by_name"] = function(d){
return ignores.some(function(i){ return d.id.indexOf(i) > -1; });
}
}
updateNodes();
});
$(document).on('change', '#ignore_by_file_path', function(){
var ignores_entries = $(this).val().trim();
var ignores = ignores_entries.split("\n");
if(ignores_entries.length == 0){
delete ignoring_functions["ignore_by_file_path"];
}else{
ignoring_functions["ignore_by_file_path"] = function(d){
return ignores.some(function(i){
return _(d.files).every(function(f){
return f.indexOf(i) > -1;
});
});
}
}
updateNodes();
});
$(document).on('change', '#ignore_modules, #ignore_classes', function(){
var modules_ignored = $('#ignore_modules').is(':checked'),
classes_ignored = $('#ignore_classes').is(':checked');
if( modules_ignored ){
ignoring_functions["ignore_modules"] = function(d) {
return d.type == 'Module';
}
}else{
delete ignoring_functions["ignore_modules"];
}
if( classes_ignored ){
ignoring_functions["ignore_classes"] = function(d) {
return d.type == 'Class';
}
}else{
delete ignoring_functions["ignore_classes"];
}
updateNodes();
});
// --------------------------------
// Display Panel
// --------------------------------
$(document).on('change', "#force_collide", function(){
var new_value = $(this).val();
rubrowser.simulation.force("forceCollide", d3.forceCollide(new_value));
});
$(document).on('change', "#hide_relations", function(){
var hide_relations = $('#hide_relations').is(':checked');
rubrowser.link.classed("hide_relation", hide_relations);
});
$(document).on('change', "#hide_namespaces", function(){
var hide_namespaces = $('#hide_namespaces').is(':checked');
rubrowser.node.classed("hide_namespace", hide_namespaces);
});
$(document).on('click', "#pause_simulation", function(){
rubrowser.simulation.stop();
});
$(document).on('click', "#fix_all", function(){
rubrowser.node.classed("fixed", true);
rubrowser.node.each(function(d){
d.fx = d.x;
d.fy = d.y;
});
});
$(document).on('click', "#release_all", function(){
rubrowser.node.classed("fixed", false);
rubrowser.node.each(function(d){
delete d["fx"];
delete d["fy"];
});
});
$(document).on('click', "#download_layout", function(){
var json = JSON.stringify(rubrowser.state.get());
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(json));
element.setAttribute('download', 'layout.json');
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
});
</script>
</body>
</html>