@hpcc-js/tree 2.42.0 → 2.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2020 -2852
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +2 -0
- package/dist/index.umd.cjs.map +1 -0
- package/package.json +33 -35
- package/src/CirclePacking.ts +12 -8
- package/src/Dendrogram.ts +32 -20
- package/src/DirectoryTree.ts +25 -29
- package/src/Indented.ts +20 -13
- package/src/SunburstPartition.ts +14 -8
- package/src/Treemap.ts +59 -33
- package/src/__package__.ts +2 -2
- package/src/index.ts +7 -7
- package/types/CirclePacking.d.ts +7 -6
- package/types/Dendrogram.d.ts +20 -35
- package/types/DirectoryTree.d.ts +11 -16
- package/types/Indented.d.ts +11 -16
- package/types/SunburstPartition.d.ts +8 -5
- package/types/Treemap.d.ts +51 -96
- package/types/__package__.d.ts +2 -3
- package/types/index.d.ts +7 -8
- package/dist/index.es6.js +0 -2836
- package/dist/index.es6.js.map +0 -1
- package/dist/index.min.js +0 -2
- package/dist/index.min.js.map +0 -1
- package/types/CirclePacking.d.ts.map +0 -1
- package/types/Dendrogram.d.ts.map +0 -1
- package/types/DirectoryTree.d.ts.map +0 -1
- package/types/Indented.d.ts.map +0 -1
- package/types/SunburstPartition.d.ts.map +0 -1
- package/types/Treemap.d.ts.map +0 -1
- package/types/__package__.d.ts.map +0 -1
- package/types/index.d.ts.map +0 -1
- package/types-3.4/CirclePacking.d.ts +0 -32
- package/types-3.4/Dendrogram.d.ts +0 -60
- package/types-3.4/DirectoryTree.d.ts +0 -62
- package/types-3.4/Indented.d.ts +0 -46
- package/types-3.4/SunburstPartition.d.ts +0 -23
- package/types-3.4/Treemap.d.ts +0 -125
- package/types-3.4/__package__.d.ts +0 -4
- package/types-3.4/index.d.ts +0 -8
package/dist/index.js
CHANGED
|
@@ -1,2852 +1,2020 @@
|
|
|
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
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
Indented.prototype.publish("mappings", [], "propertyArray", "Source Columns", null, { autoExpand: IndentedColumn, disable: function (w) { return w.xmlColumn_exists(); } });
|
|
2022
|
-
Indented.prototype.publish("barHeight", 16, "number", "Bar height");
|
|
2023
|
-
function xmlToJson(xml, id) {
|
|
2024
|
-
if (id === void 0) { id = ""; }
|
|
2025
|
-
var retVal = {
|
|
2026
|
-
id: id,
|
|
2027
|
-
label: "",
|
|
2028
|
-
attributes: {},
|
|
2029
|
-
children: []
|
|
2030
|
-
};
|
|
2031
|
-
retVal.label = xml.nodeName;
|
|
2032
|
-
if (xml.nodeType === 1) { // element
|
|
2033
|
-
if (xml.attributes.length > 0) {
|
|
2034
|
-
for (var j = 0; j < xml.attributes.length; j++) {
|
|
2035
|
-
var attribute = xml.attributes.item(j);
|
|
2036
|
-
retVal.attributes[attribute.nodeName] = attribute.nodeValue;
|
|
2037
|
-
}
|
|
2038
|
-
}
|
|
2039
|
-
}
|
|
2040
|
-
else if (xml.nodeType === 3) { // text
|
|
2041
|
-
retVal.label = xml.nodeValue;
|
|
2042
|
-
}
|
|
2043
|
-
if (xml.hasChildNodes()) {
|
|
2044
|
-
for (var i = 0; i < xml.childNodes.length; i++) {
|
|
2045
|
-
var item = xml.childNodes.item(i);
|
|
2046
|
-
var child = xmlToJson(item, id + "[" + retVal.children.length + "]");
|
|
2047
|
-
retVal.children.push(child);
|
|
2048
|
-
}
|
|
2049
|
-
}
|
|
2050
|
-
return retVal;
|
|
2051
|
-
}
|
|
2052
|
-
|
|
2053
|
-
var pi$1 = Math.PI,
|
|
2054
|
-
tau$1 = 2 * pi$1,
|
|
2055
|
-
epsilon$1 = 1e-6,
|
|
2056
|
-
tauEpsilon = tau$1 - epsilon$1;
|
|
2057
|
-
|
|
2058
|
-
function Path() {
|
|
2059
|
-
this._x0 = this._y0 = // start of current subpath
|
|
2060
|
-
this._x1 = this._y1 = null; // end of current subpath
|
|
2061
|
-
this._ = "";
|
|
2062
|
-
}
|
|
2063
|
-
|
|
2064
|
-
function path() {
|
|
2065
|
-
return new Path;
|
|
2066
|
-
}
|
|
2067
|
-
|
|
2068
|
-
Path.prototype = path.prototype = {
|
|
2069
|
-
constructor: Path,
|
|
2070
|
-
moveTo: function(x, y) {
|
|
2071
|
-
this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y);
|
|
2072
|
-
},
|
|
2073
|
-
closePath: function() {
|
|
2074
|
-
if (this._x1 !== null) {
|
|
2075
|
-
this._x1 = this._x0, this._y1 = this._y0;
|
|
2076
|
-
this._ += "Z";
|
|
2077
|
-
}
|
|
2078
|
-
},
|
|
2079
|
-
lineTo: function(x, y) {
|
|
2080
|
-
this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y);
|
|
2081
|
-
},
|
|
2082
|
-
quadraticCurveTo: function(x1, y1, x, y) {
|
|
2083
|
-
this._ += "Q" + (+x1) + "," + (+y1) + "," + (this._x1 = +x) + "," + (this._y1 = +y);
|
|
2084
|
-
},
|
|
2085
|
-
bezierCurveTo: function(x1, y1, x2, y2, x, y) {
|
|
2086
|
-
this._ += "C" + (+x1) + "," + (+y1) + "," + (+x2) + "," + (+y2) + "," + (this._x1 = +x) + "," + (this._y1 = +y);
|
|
2087
|
-
},
|
|
2088
|
-
arcTo: function(x1, y1, x2, y2, r) {
|
|
2089
|
-
x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
|
|
2090
|
-
var x0 = this._x1,
|
|
2091
|
-
y0 = this._y1,
|
|
2092
|
-
x21 = x2 - x1,
|
|
2093
|
-
y21 = y2 - y1,
|
|
2094
|
-
x01 = x0 - x1,
|
|
2095
|
-
y01 = y0 - y1,
|
|
2096
|
-
l01_2 = x01 * x01 + y01 * y01;
|
|
2097
|
-
|
|
2098
|
-
// Is the radius negative? Error.
|
|
2099
|
-
if (r < 0) throw new Error("negative radius: " + r);
|
|
2100
|
-
|
|
2101
|
-
// Is this path empty? Move to (x1,y1).
|
|
2102
|
-
if (this._x1 === null) {
|
|
2103
|
-
this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1);
|
|
2104
|
-
}
|
|
2105
|
-
|
|
2106
|
-
// Or, is (x1,y1) coincident with (x0,y0)? Do nothing.
|
|
2107
|
-
else if (!(l01_2 > epsilon$1));
|
|
2108
|
-
|
|
2109
|
-
// Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?
|
|
2110
|
-
// Equivalently, is (x1,y1) coincident with (x2,y2)?
|
|
2111
|
-
// Or, is the radius zero? Line to (x1,y1).
|
|
2112
|
-
else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon$1) || !r) {
|
|
2113
|
-
this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1);
|
|
2114
|
-
}
|
|
2115
|
-
|
|
2116
|
-
// Otherwise, draw an arc!
|
|
2117
|
-
else {
|
|
2118
|
-
var x20 = x2 - x0,
|
|
2119
|
-
y20 = y2 - y0,
|
|
2120
|
-
l21_2 = x21 * x21 + y21 * y21,
|
|
2121
|
-
l20_2 = x20 * x20 + y20 * y20,
|
|
2122
|
-
l21 = Math.sqrt(l21_2),
|
|
2123
|
-
l01 = Math.sqrt(l01_2),
|
|
2124
|
-
l = r * Math.tan((pi$1 - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),
|
|
2125
|
-
t01 = l / l01,
|
|
2126
|
-
t21 = l / l21;
|
|
2127
|
-
|
|
2128
|
-
// If the start tangent is not coincident with (x0,y0), line to.
|
|
2129
|
-
if (Math.abs(t01 - 1) > epsilon$1) {
|
|
2130
|
-
this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01);
|
|
2131
|
-
}
|
|
2132
|
-
|
|
2133
|
-
this._ += "A" + r + "," + r + ",0,0," + (+(y01 * x20 > x01 * y20)) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21);
|
|
2134
|
-
}
|
|
2135
|
-
},
|
|
2136
|
-
arc: function(x, y, r, a0, a1, ccw) {
|
|
2137
|
-
x = +x, y = +y, r = +r, ccw = !!ccw;
|
|
2138
|
-
var dx = r * Math.cos(a0),
|
|
2139
|
-
dy = r * Math.sin(a0),
|
|
2140
|
-
x0 = x + dx,
|
|
2141
|
-
y0 = y + dy,
|
|
2142
|
-
cw = 1 ^ ccw,
|
|
2143
|
-
da = ccw ? a0 - a1 : a1 - a0;
|
|
2144
|
-
|
|
2145
|
-
// Is the radius negative? Error.
|
|
2146
|
-
if (r < 0) throw new Error("negative radius: " + r);
|
|
2147
|
-
|
|
2148
|
-
// Is this path empty? Move to (x0,y0).
|
|
2149
|
-
if (this._x1 === null) {
|
|
2150
|
-
this._ += "M" + x0 + "," + y0;
|
|
2151
|
-
}
|
|
2152
|
-
|
|
2153
|
-
// Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).
|
|
2154
|
-
else if (Math.abs(this._x1 - x0) > epsilon$1 || Math.abs(this._y1 - y0) > epsilon$1) {
|
|
2155
|
-
this._ += "L" + x0 + "," + y0;
|
|
2156
|
-
}
|
|
2157
|
-
|
|
2158
|
-
// Is this arc empty? We’re done.
|
|
2159
|
-
if (!r) return;
|
|
2160
|
-
|
|
2161
|
-
// Does the angle go the wrong way? Flip the direction.
|
|
2162
|
-
if (da < 0) da = da % tau$1 + tau$1;
|
|
2163
|
-
|
|
2164
|
-
// Is this a complete circle? Draw two arcs to complete the circle.
|
|
2165
|
-
if (da > tauEpsilon) {
|
|
2166
|
-
this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0);
|
|
2167
|
-
}
|
|
2168
|
-
|
|
2169
|
-
// Is this arc non-empty? Draw an arc!
|
|
2170
|
-
else if (da > epsilon$1) {
|
|
2171
|
-
this._ += "A" + r + "," + r + ",0," + (+(da >= pi$1)) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1));
|
|
2172
|
-
}
|
|
2173
|
-
},
|
|
2174
|
-
rect: function(x, y, w, h) {
|
|
2175
|
-
this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + (+w) + "v" + (+h) + "h" + (-w) + "Z";
|
|
2176
|
-
},
|
|
2177
|
-
toString: function() {
|
|
2178
|
-
return this._;
|
|
2179
|
-
}
|
|
2180
|
-
};
|
|
2181
|
-
|
|
2182
|
-
function constant(x) {
|
|
2183
|
-
return function constant() {
|
|
2184
|
-
return x;
|
|
2185
|
-
};
|
|
2186
|
-
}
|
|
2187
|
-
|
|
2188
|
-
var abs = Math.abs;
|
|
2189
|
-
var atan2 = Math.atan2;
|
|
2190
|
-
var cos = Math.cos;
|
|
2191
|
-
var max = Math.max;
|
|
2192
|
-
var min = Math.min;
|
|
2193
|
-
var sin = Math.sin;
|
|
2194
|
-
var sqrt = Math.sqrt;
|
|
2195
|
-
|
|
2196
|
-
var epsilon = 1e-12;
|
|
2197
|
-
var pi = Math.PI;
|
|
2198
|
-
var halfPi = pi / 2;
|
|
2199
|
-
var tau = 2 * pi;
|
|
2200
|
-
|
|
2201
|
-
function acos(x) {
|
|
2202
|
-
return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);
|
|
2203
|
-
}
|
|
2204
|
-
|
|
2205
|
-
function asin(x) {
|
|
2206
|
-
return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);
|
|
2207
|
-
}
|
|
2208
|
-
|
|
2209
|
-
function arcInnerRadius(d) {
|
|
2210
|
-
return d.innerRadius;
|
|
2211
|
-
}
|
|
2212
|
-
|
|
2213
|
-
function arcOuterRadius(d) {
|
|
2214
|
-
return d.outerRadius;
|
|
2215
|
-
}
|
|
2216
|
-
|
|
2217
|
-
function arcStartAngle(d) {
|
|
2218
|
-
return d.startAngle;
|
|
2219
|
-
}
|
|
2220
|
-
|
|
2221
|
-
function arcEndAngle(d) {
|
|
2222
|
-
return d.endAngle;
|
|
2223
|
-
}
|
|
2224
|
-
|
|
2225
|
-
function arcPadAngle(d) {
|
|
2226
|
-
return d && d.padAngle; // Note: optional!
|
|
2227
|
-
}
|
|
2228
|
-
|
|
2229
|
-
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
|
|
2230
|
-
var x10 = x1 - x0, y10 = y1 - y0,
|
|
2231
|
-
x32 = x3 - x2, y32 = y3 - y2,
|
|
2232
|
-
t = y32 * x10 - x32 * y10;
|
|
2233
|
-
if (t * t < epsilon) return;
|
|
2234
|
-
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
|
|
2235
|
-
return [x0 + t * x10, y0 + t * y10];
|
|
2236
|
-
}
|
|
2237
|
-
|
|
2238
|
-
// Compute perpendicular offset line of length rc.
|
|
2239
|
-
// http://mathworld.wolfram.com/Circle-LineIntersection.html
|
|
2240
|
-
function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
2241
|
-
var x01 = x0 - x1,
|
|
2242
|
-
y01 = y0 - y1,
|
|
2243
|
-
lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),
|
|
2244
|
-
ox = lo * y01,
|
|
2245
|
-
oy = -lo * x01,
|
|
2246
|
-
x11 = x0 + ox,
|
|
2247
|
-
y11 = y0 + oy,
|
|
2248
|
-
x10 = x1 + ox,
|
|
2249
|
-
y10 = y1 + oy,
|
|
2250
|
-
x00 = (x11 + x10) / 2,
|
|
2251
|
-
y00 = (y11 + y10) / 2,
|
|
2252
|
-
dx = x10 - x11,
|
|
2253
|
-
dy = y10 - y11,
|
|
2254
|
-
d2 = dx * dx + dy * dy,
|
|
2255
|
-
r = r1 - rc,
|
|
2256
|
-
D = x11 * y10 - x10 * y11,
|
|
2257
|
-
d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),
|
|
2258
|
-
cx0 = (D * dy - dx * d) / d2,
|
|
2259
|
-
cy0 = (-D * dx - dy * d) / d2,
|
|
2260
|
-
cx1 = (D * dy + dx * d) / d2,
|
|
2261
|
-
cy1 = (-D * dx + dy * d) / d2,
|
|
2262
|
-
dx0 = cx0 - x00,
|
|
2263
|
-
dy0 = cy0 - y00,
|
|
2264
|
-
dx1 = cx1 - x00,
|
|
2265
|
-
dy1 = cy1 - y00;
|
|
2266
|
-
|
|
2267
|
-
// Pick the closer of the two intersection points.
|
|
2268
|
-
// TODO Is there a faster way to determine which intersection to use?
|
|
2269
|
-
if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
|
|
2270
|
-
|
|
2271
|
-
return {
|
|
2272
|
-
cx: cx0,
|
|
2273
|
-
cy: cy0,
|
|
2274
|
-
x01: -ox,
|
|
2275
|
-
y01: -oy,
|
|
2276
|
-
x11: cx0 * (r1 / r - 1),
|
|
2277
|
-
y11: cy0 * (r1 / r - 1)
|
|
2278
|
-
};
|
|
2279
|
-
}
|
|
2280
|
-
|
|
2281
|
-
function d3Arc() {
|
|
2282
|
-
var innerRadius = arcInnerRadius,
|
|
2283
|
-
outerRadius = arcOuterRadius,
|
|
2284
|
-
cornerRadius = constant(0),
|
|
2285
|
-
padRadius = null,
|
|
2286
|
-
startAngle = arcStartAngle,
|
|
2287
|
-
endAngle = arcEndAngle,
|
|
2288
|
-
padAngle = arcPadAngle,
|
|
2289
|
-
context = null;
|
|
2290
|
-
|
|
2291
|
-
function arc() {
|
|
2292
|
-
var buffer,
|
|
2293
|
-
r,
|
|
2294
|
-
r0 = +innerRadius.apply(this, arguments),
|
|
2295
|
-
r1 = +outerRadius.apply(this, arguments),
|
|
2296
|
-
a0 = startAngle.apply(this, arguments) - halfPi,
|
|
2297
|
-
a1 = endAngle.apply(this, arguments) - halfPi,
|
|
2298
|
-
da = abs(a1 - a0),
|
|
2299
|
-
cw = a1 > a0;
|
|
2300
|
-
|
|
2301
|
-
if (!context) context = buffer = path();
|
|
2302
|
-
|
|
2303
|
-
// Ensure that the outer radius is always larger than the inner radius.
|
|
2304
|
-
if (r1 < r0) r = r1, r1 = r0, r0 = r;
|
|
2305
|
-
|
|
2306
|
-
// Is it a point?
|
|
2307
|
-
if (!(r1 > epsilon)) context.moveTo(0, 0);
|
|
2308
|
-
|
|
2309
|
-
// Or is it a circle or annulus?
|
|
2310
|
-
else if (da > tau - epsilon) {
|
|
2311
|
-
context.moveTo(r1 * cos(a0), r1 * sin(a0));
|
|
2312
|
-
context.arc(0, 0, r1, a0, a1, !cw);
|
|
2313
|
-
if (r0 > epsilon) {
|
|
2314
|
-
context.moveTo(r0 * cos(a1), r0 * sin(a1));
|
|
2315
|
-
context.arc(0, 0, r0, a1, a0, cw);
|
|
2316
|
-
}
|
|
2317
|
-
}
|
|
2318
|
-
|
|
2319
|
-
// Or is it a circular or annular sector?
|
|
2320
|
-
else {
|
|
2321
|
-
var a01 = a0,
|
|
2322
|
-
a11 = a1,
|
|
2323
|
-
a00 = a0,
|
|
2324
|
-
a10 = a1,
|
|
2325
|
-
da0 = da,
|
|
2326
|
-
da1 = da,
|
|
2327
|
-
ap = padAngle.apply(this, arguments) / 2,
|
|
2328
|
-
rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),
|
|
2329
|
-
rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),
|
|
2330
|
-
rc0 = rc,
|
|
2331
|
-
rc1 = rc,
|
|
2332
|
-
t0,
|
|
2333
|
-
t1;
|
|
2334
|
-
|
|
2335
|
-
// Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.
|
|
2336
|
-
if (rp > epsilon) {
|
|
2337
|
-
var p0 = asin(rp / r0 * sin(ap)),
|
|
2338
|
-
p1 = asin(rp / r1 * sin(ap));
|
|
2339
|
-
if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;
|
|
2340
|
-
else da0 = 0, a00 = a10 = (a0 + a1) / 2;
|
|
2341
|
-
if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;
|
|
2342
|
-
else da1 = 0, a01 = a11 = (a0 + a1) / 2;
|
|
2343
|
-
}
|
|
2344
|
-
|
|
2345
|
-
var x01 = r1 * cos(a01),
|
|
2346
|
-
y01 = r1 * sin(a01),
|
|
2347
|
-
x10 = r0 * cos(a10),
|
|
2348
|
-
y10 = r0 * sin(a10);
|
|
2349
|
-
|
|
2350
|
-
// Apply rounded corners?
|
|
2351
|
-
if (rc > epsilon) {
|
|
2352
|
-
var x11 = r1 * cos(a11),
|
|
2353
|
-
y11 = r1 * sin(a11),
|
|
2354
|
-
x00 = r0 * cos(a00),
|
|
2355
|
-
y00 = r0 * sin(a00),
|
|
2356
|
-
oc;
|
|
2357
|
-
|
|
2358
|
-
// Restrict the corner radius according to the sector angle.
|
|
2359
|
-
if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {
|
|
2360
|
-
var ax = x01 - oc[0],
|
|
2361
|
-
ay = y01 - oc[1],
|
|
2362
|
-
bx = x11 - oc[0],
|
|
2363
|
-
by = y11 - oc[1],
|
|
2364
|
-
kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),
|
|
2365
|
-
lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
|
|
2366
|
-
rc0 = min(rc, (r0 - lc) / (kc - 1));
|
|
2367
|
-
rc1 = min(rc, (r1 - lc) / (kc + 1));
|
|
2368
|
-
}
|
|
2369
|
-
}
|
|
2370
|
-
|
|
2371
|
-
// Is the sector collapsed to a line?
|
|
2372
|
-
if (!(da1 > epsilon)) context.moveTo(x01, y01);
|
|
2373
|
-
|
|
2374
|
-
// Does the sector’s outer ring have rounded corners?
|
|
2375
|
-
else if (rc1 > epsilon) {
|
|
2376
|
-
t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
|
|
2377
|
-
t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
|
|
2378
|
-
|
|
2379
|
-
context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
|
2380
|
-
|
|
2381
|
-
// Have the corners merged?
|
|
2382
|
-
if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
|
|
2383
|
-
|
|
2384
|
-
// Otherwise, draw the two corners and the ring.
|
|
2385
|
-
else {
|
|
2386
|
-
context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
|
|
2387
|
-
context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
|
|
2388
|
-
context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
|
|
2389
|
-
}
|
|
2390
|
-
}
|
|
2391
|
-
|
|
2392
|
-
// Or is the outer ring just a circular arc?
|
|
2393
|
-
else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
|
|
2394
|
-
|
|
2395
|
-
// Is there no inner ring, and it’s a circular sector?
|
|
2396
|
-
// Or perhaps it’s an annular sector collapsed due to padding?
|
|
2397
|
-
if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);
|
|
2398
|
-
|
|
2399
|
-
// Does the sector’s inner ring (or point) have rounded corners?
|
|
2400
|
-
else if (rc0 > epsilon) {
|
|
2401
|
-
t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
|
|
2402
|
-
t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
|
|
2403
|
-
|
|
2404
|
-
context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
|
2405
|
-
|
|
2406
|
-
// Have the corners merged?
|
|
2407
|
-
if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
|
|
2408
|
-
|
|
2409
|
-
// Otherwise, draw the two corners and the ring.
|
|
2410
|
-
else {
|
|
2411
|
-
context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
|
|
2412
|
-
context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);
|
|
2413
|
-
context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
|
|
2414
|
-
}
|
|
2415
|
-
}
|
|
2416
|
-
|
|
2417
|
-
// Or is the inner ring just a circular arc?
|
|
2418
|
-
else context.arc(0, 0, r0, a10, a00, cw);
|
|
2419
|
-
}
|
|
2420
|
-
|
|
2421
|
-
context.closePath();
|
|
2422
|
-
|
|
2423
|
-
if (buffer) return context = null, buffer + "" || null;
|
|
2424
|
-
}
|
|
2425
|
-
|
|
2426
|
-
arc.centroid = function() {
|
|
2427
|
-
var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,
|
|
2428
|
-
a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;
|
|
2429
|
-
return [cos(a) * r, sin(a) * r];
|
|
2430
|
-
};
|
|
2431
|
-
|
|
2432
|
-
arc.innerRadius = function(_) {
|
|
2433
|
-
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant(+_), arc) : innerRadius;
|
|
2434
|
-
};
|
|
2435
|
-
|
|
2436
|
-
arc.outerRadius = function(_) {
|
|
2437
|
-
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant(+_), arc) : outerRadius;
|
|
2438
|
-
};
|
|
2439
|
-
|
|
2440
|
-
arc.cornerRadius = function(_) {
|
|
2441
|
-
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant(+_), arc) : cornerRadius;
|
|
2442
|
-
};
|
|
2443
|
-
|
|
2444
|
-
arc.padRadius = function(_) {
|
|
2445
|
-
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant(+_), arc) : padRadius;
|
|
2446
|
-
};
|
|
2447
|
-
|
|
2448
|
-
arc.startAngle = function(_) {
|
|
2449
|
-
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), arc) : startAngle;
|
|
2450
|
-
};
|
|
2451
|
-
|
|
2452
|
-
arc.endAngle = function(_) {
|
|
2453
|
-
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), arc) : endAngle;
|
|
2454
|
-
};
|
|
2455
|
-
|
|
2456
|
-
arc.padAngle = function(_) {
|
|
2457
|
-
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), arc) : padAngle;
|
|
2458
|
-
};
|
|
2459
|
-
|
|
2460
|
-
arc.context = function(_) {
|
|
2461
|
-
return arguments.length ? ((context = _ == null ? null : _), arc) : context;
|
|
2462
|
-
};
|
|
2463
|
-
|
|
2464
|
-
return arc;
|
|
2465
|
-
}
|
|
2466
|
-
|
|
2467
|
-
var css_248z$1 = ".tree_Sunburst path{stroke:#fff;stroke-width:.5px;fill-rule:evenodd}";
|
|
2468
|
-
styleInject(css_248z$1);
|
|
2469
|
-
|
|
2470
|
-
var SunburstPartition = /** @class */ (function (_super) {
|
|
2471
|
-
__extends(SunburstPartition, _super);
|
|
2472
|
-
function SunburstPartition() {
|
|
2473
|
-
var _this = _super.call(this) || this;
|
|
2474
|
-
api.ITree.call(_this);
|
|
2475
|
-
return _this;
|
|
2476
|
-
}
|
|
2477
|
-
SunburstPartition.prototype.data = function (_) {
|
|
2478
|
-
var retVal = common.SVGWidget.prototype.data.apply(this, arguments);
|
|
2479
|
-
if (arguments.length) {
|
|
2480
|
-
this._resetRoot = true;
|
|
2481
|
-
}
|
|
2482
|
-
return retVal;
|
|
2483
|
-
};
|
|
2484
|
-
SunburstPartition.prototype.enter = function (_domNode, element) {
|
|
2485
|
-
var context = this;
|
|
2486
|
-
this.radius = Math.min(this.width(), this.height()) / 2;
|
|
2487
|
-
this._xScale = common.scaleLinear()
|
|
2488
|
-
.range([0, 2 * Math.PI]);
|
|
2489
|
-
this._yScale = common.scaleSqrt()
|
|
2490
|
-
.range([0, this.radius]);
|
|
2491
|
-
this.partition = d3Parition();
|
|
2492
|
-
this.arc = d3Arc()
|
|
2493
|
-
.startAngle(function (d) {
|
|
2494
|
-
return Math.max(0, Math.min(2 * Math.PI, context._xScale(d.x0)));
|
|
2495
|
-
})
|
|
2496
|
-
.endAngle(function (d) {
|
|
2497
|
-
return Math.max(0, Math.min(2 * Math.PI, context._xScale(d.x1)));
|
|
2498
|
-
})
|
|
2499
|
-
.innerRadius(function (d) {
|
|
2500
|
-
return Math.max(0, context._yScale(d.y0));
|
|
2501
|
-
})
|
|
2502
|
-
.outerRadius(function (d) {
|
|
2503
|
-
return Math.max(0, context._yScale(d.y1));
|
|
2504
|
-
});
|
|
2505
|
-
this.svg = element.append("g");
|
|
2506
|
-
};
|
|
2507
|
-
SunburstPartition.prototype.update = function (_domNode, _element) {
|
|
2508
|
-
var context = this;
|
|
2509
|
-
this._palette = this._palette.switch(this.paletteID());
|
|
2510
|
-
if (this.useClonedPalette()) {
|
|
2511
|
-
this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id());
|
|
2512
|
-
}
|
|
2513
|
-
this.radius = Math.min(this.width(), this.height()) / 2;
|
|
2514
|
-
this._yScale.range([0, this.radius]);
|
|
2515
|
-
var root = hierarchy(this.data())
|
|
2516
|
-
.sum(function (d) {
|
|
2517
|
-
return d.size !== undefined ? d.size : 1;
|
|
2518
|
-
});
|
|
2519
|
-
var paths = this.svg.selectAll("path").data(this.partition(root).descendants(), function (d, i) {
|
|
2520
|
-
return d.data.label !== undefined ? d.data.label : i;
|
|
2521
|
-
});
|
|
2522
|
-
paths.enter().append("path")
|
|
2523
|
-
.on("click", function (d) { context.click(d.data, null, null); })
|
|
2524
|
-
.on("dblclick", function (d) {
|
|
2525
|
-
var event = common.d3Event();
|
|
2526
|
-
if (event) {
|
|
2527
|
-
event.stopPropagation();
|
|
2528
|
-
}
|
|
2529
|
-
context.zoomTo(d);
|
|
2530
|
-
})
|
|
2531
|
-
.each(function () {
|
|
2532
|
-
var element = common.select(this);
|
|
2533
|
-
element
|
|
2534
|
-
.append("title");
|
|
2535
|
-
})
|
|
2536
|
-
.merge(paths)
|
|
2537
|
-
.attr("d", this.arc)
|
|
2538
|
-
.style("fill", function (d) {
|
|
2539
|
-
return d.data.__viz_fill ? d.data.__viz_fill : context._palette(d.data.label);
|
|
2540
|
-
})
|
|
2541
|
-
.style("stroke", function (d) {
|
|
2542
|
-
return d.value > 16 ? "white" : "none";
|
|
2543
|
-
})
|
|
2544
|
-
.select("title")
|
|
2545
|
-
.text(function (d) {
|
|
2546
|
-
return d.data.label;
|
|
2547
|
-
});
|
|
2548
|
-
paths.exit().remove();
|
|
2549
|
-
if (this._resetRoot) {
|
|
2550
|
-
this._resetRoot = false;
|
|
2551
|
-
this.zoomTo(root);
|
|
2552
|
-
}
|
|
2553
|
-
};
|
|
2554
|
-
SunburstPartition.prototype.zoomTo = function (d) {
|
|
2555
|
-
var context = this;
|
|
2556
|
-
this.svg.transition()
|
|
2557
|
-
.duration(750)
|
|
2558
|
-
.tween("scale", function () {
|
|
2559
|
-
var xd = common.interpolate(context._xScale.domain(), [d.x0, d.x1]);
|
|
2560
|
-
var yd = common.interpolate(context._yScale.domain(), [d.y0, 1]);
|
|
2561
|
-
var yr = common.interpolate(context._yScale.range(), [d.y0 ? 20 : 0, context.radius]);
|
|
2562
|
-
return function (t) { context._xScale.domain(xd(t)); context._yScale.domain(yd(t)).range(yr(t)); };
|
|
2563
|
-
})
|
|
2564
|
-
.selectAll("path")
|
|
2565
|
-
.attrTween("d", function (d2) { return function () { return context.arc(d2); }; });
|
|
2566
|
-
};
|
|
2567
|
-
return SunburstPartition;
|
|
2568
|
-
}(common.SVGWidget));
|
|
2569
|
-
SunburstPartition.prototype._class += " tree_SunburstPartition";
|
|
2570
|
-
SunburstPartition.prototype.implements(api.ITree.prototype);
|
|
2571
|
-
SunburstPartition.prototype.publish("paletteID", "default", "set", "Color palette for this widget", SunburstPartition.prototype._palette.switch(), { tags: ["Basic", "Shared"] });
|
|
2572
|
-
SunburstPartition.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] });
|
|
2573
|
-
|
|
2574
|
-
var css_248z = ".tree_Treemap *{box-sizing:border-box}.tree_Treemap .node{border:1px solid #333;overflow:hidden;position:absolute;text-overflow:ellipsis}.tree_Treemap .node.selected{border-color:red}.tree_Treemap .node.over{border-color:orange}.tree_Treemap .node.selected.over{border-color:red}.tree_Treemap .node>span.treemap-parent-label{display:inline-block;font-weight:700;margin:4px 4px 0}.tree_Treemap .node>span.treemap-parent-value{font-style:italic;font-weight:400;margin:4px 0 0}.tree_Treemap .node>span.treemap-singleton-label{display:block;font-weight:400;margin:4px 0 0 4px}.tree_Treemap .node>span.treemap-singleton-value{display:block;font-style:italic;margin:0 0 0 4px}";
|
|
2575
|
-
styleInject(css_248z);
|
|
2576
|
-
|
|
2577
|
-
var TreemapColumn = /** @class */ (function (_super) {
|
|
2578
|
-
__extends(TreemapColumn, _super);
|
|
2579
|
-
function TreemapColumn() {
|
|
2580
|
-
return _super.call(this) || this;
|
|
2581
|
-
}
|
|
2582
|
-
TreemapColumn.prototype.owner = function (_) {
|
|
2583
|
-
if (!arguments.length)
|
|
2584
|
-
return this._owner;
|
|
2585
|
-
this._owner = _;
|
|
2586
|
-
return this;
|
|
2587
|
-
};
|
|
2588
|
-
TreemapColumn.prototype.valid = function () {
|
|
2589
|
-
return !!this.column();
|
|
2590
|
-
};
|
|
2591
|
-
return TreemapColumn;
|
|
2592
|
-
}(common.PropertyExt));
|
|
2593
|
-
TreemapColumn.prototype._class += " tree_Dendrogram.TreemapColumn";
|
|
2594
|
-
TreemapColumn.prototype.publish("column", null, "set", "Field", function () { return this._owner ? this._owner.columns() : []; }, { optional: true });
|
|
2595
|
-
// ===
|
|
2596
|
-
var Treemap = /** @class */ (function (_super) {
|
|
2597
|
-
__extends(Treemap, _super);
|
|
2598
|
-
function Treemap() {
|
|
2599
|
-
var _this = _super.call(this) || this;
|
|
2600
|
-
api.ITree.call(_this);
|
|
2601
|
-
common.Utility.SimpleSelectionMixin.call(_this, true);
|
|
2602
|
-
return _this;
|
|
2603
|
-
}
|
|
2604
|
-
Treemap.prototype.getTilingMethod = function () {
|
|
2605
|
-
switch (this.tilingMethod()) {
|
|
2606
|
-
case "treemapBinary":
|
|
2607
|
-
return d3treemapBinary;
|
|
2608
|
-
case "treemapDice":
|
|
2609
|
-
return d3treemapDice;
|
|
2610
|
-
case "treemapSlice":
|
|
2611
|
-
return d3treemapSlice;
|
|
2612
|
-
case "treemapSliceDice":
|
|
2613
|
-
return d3treemapSliceDice;
|
|
2614
|
-
case "treemapResquarify":
|
|
2615
|
-
return d3treemapResquarify;
|
|
2616
|
-
case "treemapSquarify":
|
|
2617
|
-
default:
|
|
2618
|
-
return d3treemapSquarify;
|
|
2619
|
-
}
|
|
2620
|
-
};
|
|
2621
|
-
Treemap.prototype.treemapData = function () {
|
|
2622
|
-
if (!this.mappings().filter(function (mapping) { return mapping.valid(); }).length) {
|
|
2623
|
-
return this.data();
|
|
2624
|
-
}
|
|
2625
|
-
var view = this._db.aggregateView(this.mappings().map(function (mapping) { return mapping.column(); }), this.aggrType(), this.aggrColumn());
|
|
2626
|
-
var retVal = {
|
|
2627
|
-
key: "root",
|
|
2628
|
-
values: view.entries()
|
|
2629
|
-
};
|
|
2630
|
-
return formatData(retVal);
|
|
2631
|
-
function formatData(node) {
|
|
2632
|
-
if (node.values instanceof Array) {
|
|
2633
|
-
var children = node.values.filter(function (value) {
|
|
2634
|
-
return !(value instanceof Array);
|
|
2635
|
-
}).map(function (value) {
|
|
2636
|
-
return formatData(value);
|
|
2637
|
-
});
|
|
2638
|
-
var retVal2 = {
|
|
2639
|
-
label: node.key
|
|
2640
|
-
};
|
|
2641
|
-
if (children.length) {
|
|
2642
|
-
retVal2.children = children;
|
|
2643
|
-
}
|
|
2644
|
-
else {
|
|
2645
|
-
retVal2.size = 22;
|
|
2646
|
-
}
|
|
2647
|
-
return retVal2;
|
|
2648
|
-
}
|
|
2649
|
-
return {
|
|
2650
|
-
label: node.key,
|
|
2651
|
-
size: node.values.aggregate,
|
|
2652
|
-
origRows: node.values
|
|
2653
|
-
};
|
|
2654
|
-
}
|
|
2655
|
-
};
|
|
2656
|
-
Treemap.prototype.enter = function (domNode, element) {
|
|
2657
|
-
_super.prototype.enter.call(this, domNode, element);
|
|
2658
|
-
this._d3Treemap = d3Treemap();
|
|
2659
|
-
this._elementDIV = element.append("div");
|
|
2660
|
-
this._selection.widgetElement(this._elementDIV);
|
|
2661
|
-
};
|
|
2662
|
-
Treemap.prototype.update = function (domNode, element) {
|
|
2663
|
-
_super.prototype.update.call(this, domNode, element);
|
|
2664
|
-
var context = this;
|
|
2665
|
-
this._palette = this._palette.switch(this.paletteID());
|
|
2666
|
-
if (this.useClonedPalette()) {
|
|
2667
|
-
this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id());
|
|
2668
|
-
}
|
|
2669
|
-
var root = hierarchy(this.treemapData())
|
|
2670
|
-
.sum(this.nodeWeight);
|
|
2671
|
-
this._d3Treemap
|
|
2672
|
-
.size([this.width(), this.height()])
|
|
2673
|
-
.paddingInner(this.paddingInner())
|
|
2674
|
-
.paddingOuter(this.paddingOuter())
|
|
2675
|
-
.paddingTop(this.paddingTop());
|
|
2676
|
-
if (["treemapSquarify", "treemapResquarify"].indexOf(this.tilingMethod()) !== -1) {
|
|
2677
|
-
this._d3Treemap.tile(this.getTilingMethod()["ratio"](this.squarifyRatio()));
|
|
2678
|
-
}
|
|
2679
|
-
else {
|
|
2680
|
-
this._d3Treemap.tile(this.getTilingMethod());
|
|
2681
|
-
}
|
|
2682
|
-
this._d3Treemap(root);
|
|
2683
|
-
this._elementDIV
|
|
2684
|
-
.style("font-size", this.fontSize_exists() ? this.fontSize() + "px" : null)
|
|
2685
|
-
.style("line-height", this.fontSize_exists() ? (this.fontSize() + 2) + "px" : null);
|
|
2686
|
-
var node = this._elementDIV.selectAll(".node").data(root.descendants());
|
|
2687
|
-
node.enter().append("div")
|
|
2688
|
-
.attr("class", "node")
|
|
2689
|
-
.call(this._selection.enter.bind(this._selection))
|
|
2690
|
-
.on("click", function (d) {
|
|
2691
|
-
if (d) {
|
|
2692
|
-
var columnLabel_1 = "";
|
|
2693
|
-
context.mappings().forEach(function (mapping) {
|
|
2694
|
-
if (mapping.column()) {
|
|
2695
|
-
columnLabel_1 = mapping.column();
|
|
2696
|
-
}
|
|
2697
|
-
});
|
|
2698
|
-
if (d.origRows) {
|
|
2699
|
-
context.click(context.rowToObj(d.origRows[0]), columnLabel_1, context._selection.selected(this));
|
|
2700
|
-
}
|
|
2701
|
-
else {
|
|
2702
|
-
context.click(d.data, columnLabel_1, context._selection.selected(this));
|
|
2703
|
-
}
|
|
2704
|
-
}
|
|
2705
|
-
})
|
|
2706
|
-
.on("dblclick", function (d) {
|
|
2707
|
-
if (d) {
|
|
2708
|
-
var columnLabel_2 = "";
|
|
2709
|
-
context.mappings().forEach(function (mapping) {
|
|
2710
|
-
if (mapping.column()) {
|
|
2711
|
-
columnLabel_2 = mapping.column();
|
|
2712
|
-
}
|
|
2713
|
-
});
|
|
2714
|
-
if (d.origRows) {
|
|
2715
|
-
context.dblclick(context.rowToObj(d.origRows[0]), columnLabel_2, context._selection.selected(this));
|
|
2716
|
-
}
|
|
2717
|
-
else {
|
|
2718
|
-
context.dblclick(d.data, columnLabel_2, context._selection.selected(this));
|
|
2719
|
-
}
|
|
2720
|
-
}
|
|
2721
|
-
})
|
|
2722
|
-
.merge(node)
|
|
2723
|
-
.style("left", function (d) { return (d.x0 + Math.max(0, d.x1 - d.x0) / 2) + "px"; })
|
|
2724
|
-
.style("top", function (d) { return (d.y0 + Math.max(0, d.y1 - d.y0) / 2) + "px"; })
|
|
2725
|
-
.style("width", function () { return 0 + "px"; })
|
|
2726
|
-
.style("height", function () { return 0 + "px"; })
|
|
2727
|
-
.style("font-size", function (d) { return (d.children ? context.parentFontSize() : context.leafFontSize()) + "px"; })
|
|
2728
|
-
.style("line-height", function (d) { return (d.children ? context.parentFontSize() : context.leafFontSize()) + "px"; })
|
|
2729
|
-
.attr("title", tooltip)
|
|
2730
|
-
.html(function (d) {
|
|
2731
|
-
if (!context.showRoot() && d.depth === 0) {
|
|
2732
|
-
return null;
|
|
2733
|
-
}
|
|
2734
|
-
if (d.children) {
|
|
2735
|
-
if (context.enableParentLabels()) {
|
|
2736
|
-
return context.parentWeightHTML(d);
|
|
2737
|
-
}
|
|
2738
|
-
else {
|
|
2739
|
-
return null;
|
|
2740
|
-
}
|
|
2741
|
-
}
|
|
2742
|
-
else {
|
|
2743
|
-
return context.leafWeightHTML(d);
|
|
2744
|
-
}
|
|
2745
|
-
})
|
|
2746
|
-
.style("background", function (d) {
|
|
2747
|
-
if (!context.showRoot() && d.depth === 0) {
|
|
2748
|
-
this.style.color = "transparent";
|
|
2749
|
-
return "transparent";
|
|
2750
|
-
}
|
|
2751
|
-
var light_dark = context.brighterLeafNodes() ? "brighter" : "darker";
|
|
2752
|
-
var _color;
|
|
2753
|
-
if (context.usePaletteOnParentNodes()) {
|
|
2754
|
-
_color = d.children ? context._palette(d.data.label) : common.rgb(context._palette(d.parent.data.label))[light_dark](1);
|
|
2755
|
-
}
|
|
2756
|
-
else {
|
|
2757
|
-
if (d.depth > context.depthColorLimit()) {
|
|
2758
|
-
_color = common.rgb(d.parent.color)[light_dark](1);
|
|
2759
|
-
}
|
|
2760
|
-
else {
|
|
2761
|
-
_color = context._palette(d.data.label);
|
|
2762
|
-
}
|
|
2763
|
-
d.color = _color;
|
|
2764
|
-
}
|
|
2765
|
-
this.style.color = common.Palette.textColor(_color);
|
|
2766
|
-
return _color;
|
|
2767
|
-
})
|
|
2768
|
-
.transition().duration(this.transitionDuration())
|
|
2769
|
-
.style("pointer-events", function (d) { return !context.showRoot() && d.depth === 0 ? "none" : "all"; })
|
|
2770
|
-
.style("opacity", function (d) { return d.children ? 1 : null; })
|
|
2771
|
-
.style("left", function (d) { return d.x0 + "px"; })
|
|
2772
|
-
.style("top", function (d) { return d.y0 + "px"; })
|
|
2773
|
-
.style("width", function (d) { return Math.max(0, d.x1 - d.x0) + "px"; })
|
|
2774
|
-
.style("height", function (d) { return Math.max(0, d.y1 - d.y0) + "px"; })
|
|
2775
|
-
.each(function (d) {
|
|
2776
|
-
if (d.depth === 0) {
|
|
2777
|
-
this.style.color = !context.showRoot() ? "transparent" : "";
|
|
2778
|
-
this.style.borderColor = !context.showRoot() ? "transparent" : "";
|
|
2779
|
-
}
|
|
2780
|
-
});
|
|
2781
|
-
node.exit().transition().duration(this.transitionDuration())
|
|
2782
|
-
.style("opacity", 0)
|
|
2783
|
-
.remove();
|
|
2784
|
-
function tooltip(d) {
|
|
2785
|
-
if (d.children && !context.enableParentTooltips()) {
|
|
2786
|
-
return null;
|
|
2787
|
-
}
|
|
2788
|
-
var retVal = d.data.label + " (" + d.value + ")";
|
|
2789
|
-
while (d.parent && d.parent.parent) {
|
|
2790
|
-
retVal = d.parent.data.label + " -> " + retVal;
|
|
2791
|
-
d = d.parent;
|
|
2792
|
-
}
|
|
2793
|
-
return retVal;
|
|
2794
|
-
}
|
|
2795
|
-
};
|
|
2796
|
-
Treemap.prototype.exit = function (domNode, element) {
|
|
2797
|
-
_super.prototype.exit.call(this, domNode, element);
|
|
2798
|
-
};
|
|
2799
|
-
Treemap.prototype.nodeWeight = function (d) {
|
|
2800
|
-
return d.size || 1;
|
|
2801
|
-
};
|
|
2802
|
-
Treemap.prototype.parentWeightHTML = function (d) {
|
|
2803
|
-
return this.showParentWeight() ? "<span class=\"treemap-parent-label\">".concat(d.data.label, "</span><span class=\"treemap-parent-value\">").concat(d.value).concat(this.weightSuffix(), "</span>") : "<span class=\"treemap-parent-label\">".concat(d.data.label, "</span>");
|
|
2804
|
-
};
|
|
2805
|
-
Treemap.prototype.leafWeightHTML = function (d) {
|
|
2806
|
-
return this.showLeafWeight() ? "<span class=\"treemap-leaf-label\">".concat(d.data.label, "</span><span class=\"treemap-leaf-value\">").concat(d.value).concat(this.weightSuffix(), "</span>") : "<span class=\"treemap-leaf-label\">".concat(d.data.label, "</span>");
|
|
2807
|
-
};
|
|
2808
|
-
return Treemap;
|
|
2809
|
-
}(common.HTMLWidget));
|
|
2810
|
-
Treemap.prototype._class += " tree_Treemap";
|
|
2811
|
-
Treemap.prototype.implements(api.ITree.prototype);
|
|
2812
|
-
Treemap.prototype.mixin(common.Utility.SimpleSelectionMixin);
|
|
2813
|
-
Treemap.prototype.Column = TreemapColumn;
|
|
2814
|
-
Treemap.prototype.publish("paletteID", "default", "set", "Color palette for this widget", Treemap.prototype._palette.switch(), { tags: ["Basic", "Shared"] });
|
|
2815
|
-
Treemap.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] });
|
|
2816
|
-
Treemap.prototype.publish("mappings", [], "propertyArray", "Source Columns", null, { autoExpand: TreemapColumn });
|
|
2817
|
-
Treemap.prototype.publish("aggrType", null, "set", "Aggregation Type", [null, "mean", "median", "sum", "min", "max"], { optional: true });
|
|
2818
|
-
Treemap.prototype.publish("aggrColumn", null, "set", "Aggregation Field", function () { return this.columns(); }, { optional: true, disable: function (w) { return !w.aggrType(); } });
|
|
2819
|
-
Treemap.prototype.publish("fontSize", null, "number", "Font Size", null, { optional: true });
|
|
2820
|
-
Treemap.prototype.publish("paddingInner", 18.6, "number", "Pixel spacing between each sibling node");
|
|
2821
|
-
Treemap.prototype.publish("paddingOuter", 30, "number", "Pixel padding of parent nodes");
|
|
2822
|
-
Treemap.prototype.publish("paddingTop", 41.4, "number", "Additional top pixel padding of parent nodes");
|
|
2823
|
-
Treemap.prototype.publish("showRoot", false, "boolean", "Show root element");
|
|
2824
|
-
Treemap.prototype.publish("parentFontSize", 18, "number", "Parent font-size");
|
|
2825
|
-
Treemap.prototype.publish("leafFontSize", 16, "number", "Leaf font-size");
|
|
2826
|
-
Treemap.prototype.publish("usePaletteOnParentNodes", false, "boolean", "Assign a color from the palette to every parent node");
|
|
2827
|
-
Treemap.prototype.publish("depthColorLimit", 1, "number", "Assign a color from the palette to node with depth lower than this value", null, { optional: true, disable: function (w) { return w.usePaletteOnParentNodes(); } });
|
|
2828
|
-
Treemap.prototype.publish("squarifyRatio", 1, "number", "Specifies the desired aspect ratio of the generated rectangles (must be >= 1)", null, { optional: true, disable: function (w) { return ["treemapSquarify", "treemapResquarify"].indexOf(w.tilingMethod()) === -1; } });
|
|
2829
|
-
Treemap.prototype.publish("showParentWeight", true, "boolean", "Show weight of parent nodes");
|
|
2830
|
-
Treemap.prototype.publish("showLeafWeight", true, "boolean", "Show weight of leaf nodes");
|
|
2831
|
-
Treemap.prototype.publish("weightSuffix", "", "string", "Weight suffix (ex: 'ms')");
|
|
2832
|
-
Treemap.prototype.publish("brighterLeafNodes", false, "boolean", "Brighter/darker leaf node color (false = darker)");
|
|
2833
|
-
Treemap.prototype.publish("enableParentLabels", true, "boolean", "Enable parent labels");
|
|
2834
|
-
Treemap.prototype.publish("enableParentTooltips", true, "boolean", "Enable parent tooltips");
|
|
2835
|
-
Treemap.prototype.publish("transitionDuration", 250, "number", "Transition Duration");
|
|
2836
|
-
Treemap.prototype.publish("tilingMethod", "treemapSquarify", "set", "Transition Duration", ["treemapBinary", "treemapDice", "treemapResquarify", "treemapSlice", "treemapSliceDice", "treemapSquarify"]);
|
|
2837
|
-
|
|
2838
|
-
exports.BUILD_VERSION = BUILD_VERSION;
|
|
2839
|
-
exports.CirclePacking = CirclePacking;
|
|
2840
|
-
exports.Dendrogram = Dendrogram;
|
|
2841
|
-
exports.DendrogramColumn = DendrogramColumn;
|
|
2842
|
-
exports.DirectoryTree = DirectoryTree;
|
|
2843
|
-
exports.Indented = Indented;
|
|
2844
|
-
exports.IndentedColumn = IndentedColumn;
|
|
2845
|
-
exports.PKG_NAME = PKG_NAME;
|
|
2846
|
-
exports.PKG_VERSION = PKG_VERSION;
|
|
2847
|
-
exports.SunburstPartition = SunburstPartition;
|
|
2848
|
-
exports.Treemap = Treemap;
|
|
2849
|
-
exports.TreemapColumn = TreemapColumn;
|
|
2850
|
-
|
|
2851
|
-
}));
|
|
2852
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { ITree } from "@hpcc-js/api";
|
|
2
|
+
import { HTMLWidget, Palette, Platform, PropertyExt, SVGWidget, SVGZoomWidget, Utility, d3Event, interpolate, interpolateZoom, max, rgb, scaleLinear, scaleSqrt, select } from "@hpcc-js/common";
|
|
3
|
+
|
|
4
|
+
//#region src/__package__.ts
|
|
5
|
+
const PKG_NAME = "@hpcc-js/tree";
|
|
6
|
+
const PKG_VERSION = "3.0.0";
|
|
7
|
+
const BUILD_VERSION = "3.2.1";
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region node_modules/d3-hierarchy/src/cluster.js
|
|
11
|
+
function defaultSeparation$1(a, b) {
|
|
12
|
+
return a.parent === b.parent ? 1 : 2;
|
|
13
|
+
}
|
|
14
|
+
function meanX(children) {
|
|
15
|
+
return children.reduce(meanXReduce, 0) / children.length;
|
|
16
|
+
}
|
|
17
|
+
function meanXReduce(x, c) {
|
|
18
|
+
return x + c.x;
|
|
19
|
+
}
|
|
20
|
+
function maxY(children) {
|
|
21
|
+
return 1 + children.reduce(maxYReduce, 0);
|
|
22
|
+
}
|
|
23
|
+
function maxYReduce(y, c) {
|
|
24
|
+
return Math.max(y, c.y);
|
|
25
|
+
}
|
|
26
|
+
function leafLeft(node) {
|
|
27
|
+
var children;
|
|
28
|
+
while (children = node.children) node = children[0];
|
|
29
|
+
return node;
|
|
30
|
+
}
|
|
31
|
+
function leafRight(node) {
|
|
32
|
+
var children;
|
|
33
|
+
while (children = node.children) node = children[children.length - 1];
|
|
34
|
+
return node;
|
|
35
|
+
}
|
|
36
|
+
function cluster_default() {
|
|
37
|
+
var separation = defaultSeparation$1, dx = 1, dy = 1, nodeSize = false;
|
|
38
|
+
function cluster(root) {
|
|
39
|
+
var previousNode, x = 0;
|
|
40
|
+
root.eachAfter(function(node) {
|
|
41
|
+
var children = node.children;
|
|
42
|
+
if (children) {
|
|
43
|
+
node.x = meanX(children);
|
|
44
|
+
node.y = maxY(children);
|
|
45
|
+
} else {
|
|
46
|
+
node.x = previousNode ? x += separation(node, previousNode) : 0;
|
|
47
|
+
node.y = 0;
|
|
48
|
+
previousNode = node;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
var left = leafLeft(root), right = leafRight(root), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2;
|
|
52
|
+
return root.eachAfter(nodeSize ? function(node) {
|
|
53
|
+
node.x = (node.x - root.x) * dx;
|
|
54
|
+
node.y = (root.y - node.y) * dy;
|
|
55
|
+
} : function(node) {
|
|
56
|
+
node.x = (node.x - x0) / (x1 - x0) * dx;
|
|
57
|
+
node.y = (1 - (root.y ? node.y / root.y : 1)) * dy;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
cluster.separation = function(x) {
|
|
61
|
+
return arguments.length ? (separation = x, cluster) : separation;
|
|
62
|
+
};
|
|
63
|
+
cluster.size = function(x) {
|
|
64
|
+
return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : nodeSize ? null : [dx, dy];
|
|
65
|
+
};
|
|
66
|
+
cluster.nodeSize = function(x) {
|
|
67
|
+
return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : nodeSize ? [dx, dy] : null;
|
|
68
|
+
};
|
|
69
|
+
return cluster;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region node_modules/d3-hierarchy/src/hierarchy/count.js
|
|
74
|
+
function count(node) {
|
|
75
|
+
var sum = 0, children = node.children, i = children && children.length;
|
|
76
|
+
if (!i) sum = 1;
|
|
77
|
+
else while (--i >= 0) sum += children[i].value;
|
|
78
|
+
node.value = sum;
|
|
79
|
+
}
|
|
80
|
+
function count_default() {
|
|
81
|
+
return this.eachAfter(count);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region node_modules/d3-hierarchy/src/hierarchy/each.js
|
|
86
|
+
function each_default(callback) {
|
|
87
|
+
var node = this, current, next = [node], children, i, n;
|
|
88
|
+
do {
|
|
89
|
+
current = next.reverse(), next = [];
|
|
90
|
+
while (node = current.pop()) {
|
|
91
|
+
callback(node), children = node.children;
|
|
92
|
+
if (children) for (i = 0, n = children.length; i < n; ++i) next.push(children[i]);
|
|
93
|
+
}
|
|
94
|
+
} while (next.length);
|
|
95
|
+
return this;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region node_modules/d3-hierarchy/src/hierarchy/eachBefore.js
|
|
100
|
+
function eachBefore_default(callback) {
|
|
101
|
+
var node = this, nodes = [node], children, i;
|
|
102
|
+
while (node = nodes.pop()) {
|
|
103
|
+
callback(node), children = node.children;
|
|
104
|
+
if (children) for (i = children.length - 1; i >= 0; --i) nodes.push(children[i]);
|
|
105
|
+
}
|
|
106
|
+
return this;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region node_modules/d3-hierarchy/src/hierarchy/eachAfter.js
|
|
111
|
+
function eachAfter_default(callback) {
|
|
112
|
+
var node = this, nodes = [node], next = [], children, i, n;
|
|
113
|
+
while (node = nodes.pop()) {
|
|
114
|
+
next.push(node), children = node.children;
|
|
115
|
+
if (children) for (i = 0, n = children.length; i < n; ++i) nodes.push(children[i]);
|
|
116
|
+
}
|
|
117
|
+
while (node = next.pop()) callback(node);
|
|
118
|
+
return this;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region node_modules/d3-hierarchy/src/hierarchy/sum.js
|
|
123
|
+
function sum_default(value) {
|
|
124
|
+
return this.eachAfter(function(node) {
|
|
125
|
+
var sum = +value(node.data) || 0, children = node.children, i = children && children.length;
|
|
126
|
+
while (--i >= 0) sum += children[i].value;
|
|
127
|
+
node.value = sum;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region node_modules/d3-hierarchy/src/hierarchy/sort.js
|
|
133
|
+
function sort_default(compare) {
|
|
134
|
+
return this.eachBefore(function(node) {
|
|
135
|
+
if (node.children) node.children.sort(compare);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region node_modules/d3-hierarchy/src/hierarchy/path.js
|
|
141
|
+
function path_default$1(end) {
|
|
142
|
+
var start = this, ancestor = leastCommonAncestor(start, end), nodes = [start];
|
|
143
|
+
while (start !== ancestor) {
|
|
144
|
+
start = start.parent;
|
|
145
|
+
nodes.push(start);
|
|
146
|
+
}
|
|
147
|
+
var k = nodes.length;
|
|
148
|
+
while (end !== ancestor) {
|
|
149
|
+
nodes.splice(k, 0, end);
|
|
150
|
+
end = end.parent;
|
|
151
|
+
}
|
|
152
|
+
return nodes;
|
|
153
|
+
}
|
|
154
|
+
function leastCommonAncestor(a, b) {
|
|
155
|
+
if (a === b) return a;
|
|
156
|
+
var aNodes = a.ancestors(), bNodes = b.ancestors(), c = null;
|
|
157
|
+
a = aNodes.pop();
|
|
158
|
+
b = bNodes.pop();
|
|
159
|
+
while (a === b) {
|
|
160
|
+
c = a;
|
|
161
|
+
a = aNodes.pop();
|
|
162
|
+
b = bNodes.pop();
|
|
163
|
+
}
|
|
164
|
+
return c;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region node_modules/d3-hierarchy/src/hierarchy/ancestors.js
|
|
169
|
+
function ancestors_default() {
|
|
170
|
+
var node = this, nodes = [node];
|
|
171
|
+
while (node = node.parent) nodes.push(node);
|
|
172
|
+
return nodes;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region node_modules/d3-hierarchy/src/hierarchy/descendants.js
|
|
177
|
+
function descendants_default() {
|
|
178
|
+
var nodes = [];
|
|
179
|
+
this.each(function(node) {
|
|
180
|
+
nodes.push(node);
|
|
181
|
+
});
|
|
182
|
+
return nodes;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region node_modules/d3-hierarchy/src/hierarchy/leaves.js
|
|
187
|
+
function leaves_default() {
|
|
188
|
+
var leaves = [];
|
|
189
|
+
this.eachBefore(function(node) {
|
|
190
|
+
if (!node.children) leaves.push(node);
|
|
191
|
+
});
|
|
192
|
+
return leaves;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region node_modules/d3-hierarchy/src/hierarchy/links.js
|
|
197
|
+
function links_default() {
|
|
198
|
+
var root = this, links = [];
|
|
199
|
+
root.each(function(node) {
|
|
200
|
+
if (node !== root) links.push({
|
|
201
|
+
source: node.parent,
|
|
202
|
+
target: node
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
return links;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region node_modules/d3-hierarchy/src/hierarchy/index.js
|
|
210
|
+
function hierarchy(data, children) {
|
|
211
|
+
var root = new Node(data), valued = +data.value && (root.value = data.value), node, nodes = [root], child, childs, i, n;
|
|
212
|
+
if (children == null) children = defaultChildren;
|
|
213
|
+
while (node = nodes.pop()) {
|
|
214
|
+
if (valued) node.value = +node.data.value;
|
|
215
|
+
if ((childs = children(node.data)) && (n = childs.length)) {
|
|
216
|
+
node.children = new Array(n);
|
|
217
|
+
for (i = n - 1; i >= 0; --i) {
|
|
218
|
+
nodes.push(child = node.children[i] = new Node(childs[i]));
|
|
219
|
+
child.parent = node;
|
|
220
|
+
child.depth = node.depth + 1;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return root.eachBefore(computeHeight);
|
|
225
|
+
}
|
|
226
|
+
function node_copy() {
|
|
227
|
+
return hierarchy(this).eachBefore(copyData);
|
|
228
|
+
}
|
|
229
|
+
function defaultChildren(d) {
|
|
230
|
+
return d.children;
|
|
231
|
+
}
|
|
232
|
+
function copyData(node) {
|
|
233
|
+
node.data = node.data.data;
|
|
234
|
+
}
|
|
235
|
+
function computeHeight(node) {
|
|
236
|
+
var height = 0;
|
|
237
|
+
do
|
|
238
|
+
node.height = height;
|
|
239
|
+
while ((node = node.parent) && node.height < ++height);
|
|
240
|
+
}
|
|
241
|
+
function Node(data) {
|
|
242
|
+
this.data = data;
|
|
243
|
+
this.depth = this.height = 0;
|
|
244
|
+
this.parent = null;
|
|
245
|
+
}
|
|
246
|
+
Node.prototype = hierarchy.prototype = {
|
|
247
|
+
constructor: Node,
|
|
248
|
+
count: count_default,
|
|
249
|
+
each: each_default,
|
|
250
|
+
eachAfter: eachAfter_default,
|
|
251
|
+
eachBefore: eachBefore_default,
|
|
252
|
+
sum: sum_default,
|
|
253
|
+
sort: sort_default,
|
|
254
|
+
path: path_default$1,
|
|
255
|
+
ancestors: ancestors_default,
|
|
256
|
+
descendants: descendants_default,
|
|
257
|
+
leaves: leaves_default,
|
|
258
|
+
links: links_default,
|
|
259
|
+
copy: node_copy
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region node_modules/d3-hierarchy/src/array.js
|
|
264
|
+
var slice = Array.prototype.slice;
|
|
265
|
+
function shuffle(array) {
|
|
266
|
+
var m = array.length, t, i;
|
|
267
|
+
while (m) {
|
|
268
|
+
i = Math.random() * m-- | 0;
|
|
269
|
+
t = array[m];
|
|
270
|
+
array[m] = array[i];
|
|
271
|
+
array[i] = t;
|
|
272
|
+
}
|
|
273
|
+
return array;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region node_modules/d3-hierarchy/src/pack/enclose.js
|
|
278
|
+
function enclose_default(circles) {
|
|
279
|
+
var i = 0, n = (circles = shuffle(slice.call(circles))).length, B = [], p, e;
|
|
280
|
+
while (i < n) {
|
|
281
|
+
p = circles[i];
|
|
282
|
+
if (e && enclosesWeak(e, p)) ++i;
|
|
283
|
+
else e = encloseBasis(B = extendBasis(B, p)), i = 0;
|
|
284
|
+
}
|
|
285
|
+
return e;
|
|
286
|
+
}
|
|
287
|
+
function extendBasis(B, p) {
|
|
288
|
+
var i, j;
|
|
289
|
+
if (enclosesWeakAll(p, B)) return [p];
|
|
290
|
+
for (i = 0; i < B.length; ++i) if (enclosesNot(p, B[i]) && enclosesWeakAll(encloseBasis2(B[i], p), B)) return [B[i], p];
|
|
291
|
+
for (i = 0; i < B.length - 1; ++i) for (j = i + 1; j < B.length; ++j) if (enclosesNot(encloseBasis2(B[i], B[j]), p) && enclosesNot(encloseBasis2(B[i], p), B[j]) && enclosesNot(encloseBasis2(B[j], p), B[i]) && enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) return [
|
|
292
|
+
B[i],
|
|
293
|
+
B[j],
|
|
294
|
+
p
|
|
295
|
+
];
|
|
296
|
+
throw new Error();
|
|
297
|
+
}
|
|
298
|
+
function enclosesNot(a, b) {
|
|
299
|
+
var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y;
|
|
300
|
+
return dr < 0 || dr * dr < dx * dx + dy * dy;
|
|
301
|
+
}
|
|
302
|
+
function enclosesWeak(a, b) {
|
|
303
|
+
var dr = a.r - b.r + 1e-6, dx = b.x - a.x, dy = b.y - a.y;
|
|
304
|
+
return dr > 0 && dr * dr > dx * dx + dy * dy;
|
|
305
|
+
}
|
|
306
|
+
function enclosesWeakAll(a, B) {
|
|
307
|
+
for (var i = 0; i < B.length; ++i) if (!enclosesWeak(a, B[i])) return false;
|
|
308
|
+
return true;
|
|
309
|
+
}
|
|
310
|
+
function encloseBasis(B) {
|
|
311
|
+
switch (B.length) {
|
|
312
|
+
case 1: return encloseBasis1(B[0]);
|
|
313
|
+
case 2: return encloseBasis2(B[0], B[1]);
|
|
314
|
+
case 3: return encloseBasis3(B[0], B[1], B[2]);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
function encloseBasis1(a) {
|
|
318
|
+
return {
|
|
319
|
+
x: a.x,
|
|
320
|
+
y: a.y,
|
|
321
|
+
r: a.r
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
function encloseBasis2(a, b) {
|
|
325
|
+
var x1 = a.x, y1 = a.y, r1 = a.r, x2 = b.x, y2 = b.y, r2 = b.r, x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1, l = Math.sqrt(x21 * x21 + y21 * y21);
|
|
326
|
+
return {
|
|
327
|
+
x: (x1 + x2 + x21 / l * r21) / 2,
|
|
328
|
+
y: (y1 + y2 + y21 / l * r21) / 2,
|
|
329
|
+
r: (l + r1 + r2) / 2
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
function encloseBasis3(a, b, c) {
|
|
333
|
+
var x1 = a.x, y1 = a.y, r1 = a.r, x2 = b.x, y2 = b.y, r2 = b.r, x3 = c.x, y3 = c.y, r3 = c.r, a2 = x1 - x2, a3 = x1 - x3, b2 = y1 - y2, b3 = y1 - y3, c2 = r2 - r1, c3 = r3 - r1, d1 = x1 * x1 + y1 * y1 - r1 * r1, d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2, d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3, ab = a3 * b2 - a2 * b3, xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1, xb = (b3 * c2 - b2 * c3) / ab, ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1, yb = (a2 * c3 - a3 * c2) / ab, A = xb * xb + yb * yb - 1, B = 2 * (r1 + xa * xb + ya * yb), C = xa * xa + ya * ya - r1 * r1, r = -(A ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B);
|
|
334
|
+
return {
|
|
335
|
+
x: x1 + xa + xb * r,
|
|
336
|
+
y: y1 + ya + yb * r,
|
|
337
|
+
r
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
//#endregion
|
|
342
|
+
//#region node_modules/d3-hierarchy/src/pack/siblings.js
|
|
343
|
+
function place(b, a, c) {
|
|
344
|
+
var dx = b.x - a.x, x, a2, dy = b.y - a.y, y, b2, d2 = dx * dx + dy * dy;
|
|
345
|
+
if (d2) {
|
|
346
|
+
a2 = a.r + c.r, a2 *= a2;
|
|
347
|
+
b2 = b.r + c.r, b2 *= b2;
|
|
348
|
+
if (a2 > b2) {
|
|
349
|
+
x = (d2 + b2 - a2) / (2 * d2);
|
|
350
|
+
y = Math.sqrt(Math.max(0, b2 / d2 - x * x));
|
|
351
|
+
c.x = b.x - x * dx - y * dy;
|
|
352
|
+
c.y = b.y - x * dy + y * dx;
|
|
353
|
+
} else {
|
|
354
|
+
x = (d2 + a2 - b2) / (2 * d2);
|
|
355
|
+
y = Math.sqrt(Math.max(0, a2 / d2 - x * x));
|
|
356
|
+
c.x = a.x + x * dx - y * dy;
|
|
357
|
+
c.y = a.y + x * dy + y * dx;
|
|
358
|
+
}
|
|
359
|
+
} else {
|
|
360
|
+
c.x = a.x + c.r;
|
|
361
|
+
c.y = a.y;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
function intersects(a, b) {
|
|
365
|
+
var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y;
|
|
366
|
+
return dr > 0 && dr * dr > dx * dx + dy * dy;
|
|
367
|
+
}
|
|
368
|
+
function score(node) {
|
|
369
|
+
var a = node._, b = node.next._, ab = a.r + b.r, dx = (a.x * b.r + b.x * a.r) / ab, dy = (a.y * b.r + b.y * a.r) / ab;
|
|
370
|
+
return dx * dx + dy * dy;
|
|
371
|
+
}
|
|
372
|
+
function Node$1(circle) {
|
|
373
|
+
this._ = circle;
|
|
374
|
+
this.next = null;
|
|
375
|
+
this.previous = null;
|
|
376
|
+
}
|
|
377
|
+
function packEnclose(circles) {
|
|
378
|
+
if (!(n = circles.length)) return 0;
|
|
379
|
+
var a = circles[0], b, c, n, aa, ca, i, j, k, sj, sk;
|
|
380
|
+
a.x = 0, a.y = 0;
|
|
381
|
+
if (!(n > 1)) return a.r;
|
|
382
|
+
b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0;
|
|
383
|
+
if (!(n > 2)) return a.r + b.r;
|
|
384
|
+
place(b, a, c = circles[2]);
|
|
385
|
+
a = new Node$1(a), b = new Node$1(b), c = new Node$1(c);
|
|
386
|
+
a.next = c.previous = b;
|
|
387
|
+
b.next = a.previous = c;
|
|
388
|
+
c.next = b.previous = a;
|
|
389
|
+
pack: for (i = 3; i < n; ++i) {
|
|
390
|
+
place(a._, b._, c = circles[i]), c = new Node$1(c);
|
|
391
|
+
j = b.next, k = a.previous, sj = b._.r, sk = a._.r;
|
|
392
|
+
do
|
|
393
|
+
if (sj <= sk) {
|
|
394
|
+
if (intersects(j._, c._)) {
|
|
395
|
+
b = j, a.next = b, b.previous = a, --i;
|
|
396
|
+
continue pack;
|
|
397
|
+
}
|
|
398
|
+
sj += j._.r, j = j.next;
|
|
399
|
+
} else {
|
|
400
|
+
if (intersects(k._, c._)) {
|
|
401
|
+
a = k, a.next = b, b.previous = a, --i;
|
|
402
|
+
continue pack;
|
|
403
|
+
}
|
|
404
|
+
sk += k._.r, k = k.previous;
|
|
405
|
+
}
|
|
406
|
+
while (j !== k.next);
|
|
407
|
+
c.previous = a, c.next = b, a.next = b.previous = b = c;
|
|
408
|
+
aa = score(a);
|
|
409
|
+
while ((c = c.next) !== b) if ((ca = score(c)) < aa) a = c, aa = ca;
|
|
410
|
+
b = a.next;
|
|
411
|
+
}
|
|
412
|
+
a = [b._], c = b;
|
|
413
|
+
while ((c = c.next) !== b) a.push(c._);
|
|
414
|
+
c = enclose_default(a);
|
|
415
|
+
for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y;
|
|
416
|
+
return c.r;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
//#endregion
|
|
420
|
+
//#region node_modules/d3-hierarchy/src/accessors.js
|
|
421
|
+
function optional(f) {
|
|
422
|
+
return f == null ? null : required(f);
|
|
423
|
+
}
|
|
424
|
+
function required(f) {
|
|
425
|
+
if (typeof f !== "function") throw new Error();
|
|
426
|
+
return f;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
//#endregion
|
|
430
|
+
//#region node_modules/d3-hierarchy/src/constant.js
|
|
431
|
+
function constantZero() {
|
|
432
|
+
return 0;
|
|
433
|
+
}
|
|
434
|
+
function constant_default$1(x) {
|
|
435
|
+
return function() {
|
|
436
|
+
return x;
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
//#endregion
|
|
441
|
+
//#region node_modules/d3-hierarchy/src/pack/index.js
|
|
442
|
+
function defaultRadius(d) {
|
|
443
|
+
return Math.sqrt(d.value);
|
|
444
|
+
}
|
|
445
|
+
function pack_default() {
|
|
446
|
+
var radius = null, dx = 1, dy = 1, padding = constantZero;
|
|
447
|
+
function pack(root) {
|
|
448
|
+
root.x = dx / 2, root.y = dy / 2;
|
|
449
|
+
if (radius) root.eachBefore(radiusLeaf(radius)).eachAfter(packChildren(padding, .5)).eachBefore(translateChild(1));
|
|
450
|
+
else root.eachBefore(radiusLeaf(defaultRadius)).eachAfter(packChildren(constantZero, 1)).eachAfter(packChildren(padding, root.r / Math.min(dx, dy))).eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r)));
|
|
451
|
+
return root;
|
|
452
|
+
}
|
|
453
|
+
pack.radius = function(x) {
|
|
454
|
+
return arguments.length ? (radius = optional(x), pack) : radius;
|
|
455
|
+
};
|
|
456
|
+
pack.size = function(x) {
|
|
457
|
+
return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy];
|
|
458
|
+
};
|
|
459
|
+
pack.padding = function(x) {
|
|
460
|
+
return arguments.length ? (padding = typeof x === "function" ? x : constant_default$1(+x), pack) : padding;
|
|
461
|
+
};
|
|
462
|
+
return pack;
|
|
463
|
+
}
|
|
464
|
+
function radiusLeaf(radius) {
|
|
465
|
+
return function(node) {
|
|
466
|
+
if (!node.children) node.r = Math.max(0, +radius(node) || 0);
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
function packChildren(padding, k) {
|
|
470
|
+
return function(node) {
|
|
471
|
+
if (children = node.children) {
|
|
472
|
+
var children, i, n = children.length, r = padding(node) * k || 0, e;
|
|
473
|
+
if (r) for (i = 0; i < n; ++i) children[i].r += r;
|
|
474
|
+
e = packEnclose(children);
|
|
475
|
+
if (r) for (i = 0; i < n; ++i) children[i].r -= r;
|
|
476
|
+
node.r = e + r;
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
function translateChild(k) {
|
|
481
|
+
return function(node) {
|
|
482
|
+
var parent = node.parent;
|
|
483
|
+
node.r *= k;
|
|
484
|
+
if (parent) {
|
|
485
|
+
node.x = parent.x + k * node.x;
|
|
486
|
+
node.y = parent.y + k * node.y;
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
//#endregion
|
|
492
|
+
//#region node_modules/d3-hierarchy/src/treemap/round.js
|
|
493
|
+
function round_default(node) {
|
|
494
|
+
node.x0 = Math.round(node.x0);
|
|
495
|
+
node.y0 = Math.round(node.y0);
|
|
496
|
+
node.x1 = Math.round(node.x1);
|
|
497
|
+
node.y1 = Math.round(node.y1);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region node_modules/d3-hierarchy/src/treemap/dice.js
|
|
502
|
+
function dice_default(parent, x0, y0, x1, y1) {
|
|
503
|
+
var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (x1 - x0) / parent.value;
|
|
504
|
+
while (++i < n) {
|
|
505
|
+
node = nodes[i], node.y0 = y0, node.y1 = y1;
|
|
506
|
+
node.x0 = x0, node.x1 = x0 += node.value * k;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
//#endregion
|
|
511
|
+
//#region node_modules/d3-hierarchy/src/partition.js
|
|
512
|
+
function partition_default() {
|
|
513
|
+
var dx = 1, dy = 1, padding = 0, round = false;
|
|
514
|
+
function partition(root) {
|
|
515
|
+
var n = root.height + 1;
|
|
516
|
+
root.x0 = root.y0 = padding;
|
|
517
|
+
root.x1 = dx;
|
|
518
|
+
root.y1 = dy / n;
|
|
519
|
+
root.eachBefore(positionNode(dy, n));
|
|
520
|
+
if (round) root.eachBefore(round_default);
|
|
521
|
+
return root;
|
|
522
|
+
}
|
|
523
|
+
function positionNode(dy$1, n) {
|
|
524
|
+
return function(node) {
|
|
525
|
+
if (node.children) dice_default(node, node.x0, dy$1 * (node.depth + 1) / n, node.x1, dy$1 * (node.depth + 2) / n);
|
|
526
|
+
var x0 = node.x0, y0 = node.y0, x1 = node.x1 - padding, y1 = node.y1 - padding;
|
|
527
|
+
if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
|
|
528
|
+
if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
|
|
529
|
+
node.x0 = x0;
|
|
530
|
+
node.y0 = y0;
|
|
531
|
+
node.x1 = x1;
|
|
532
|
+
node.y1 = y1;
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
partition.round = function(x) {
|
|
536
|
+
return arguments.length ? (round = !!x, partition) : round;
|
|
537
|
+
};
|
|
538
|
+
partition.size = function(x) {
|
|
539
|
+
return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy];
|
|
540
|
+
};
|
|
541
|
+
partition.padding = function(x) {
|
|
542
|
+
return arguments.length ? (padding = +x, partition) : padding;
|
|
543
|
+
};
|
|
544
|
+
return partition;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
//#endregion
|
|
548
|
+
//#region node_modules/d3-hierarchy/src/tree.js
|
|
549
|
+
function defaultSeparation(a, b) {
|
|
550
|
+
return a.parent === b.parent ? 1 : 2;
|
|
551
|
+
}
|
|
552
|
+
function nextLeft(v) {
|
|
553
|
+
var children = v.children;
|
|
554
|
+
return children ? children[0] : v.t;
|
|
555
|
+
}
|
|
556
|
+
function nextRight(v) {
|
|
557
|
+
var children = v.children;
|
|
558
|
+
return children ? children[children.length - 1] : v.t;
|
|
559
|
+
}
|
|
560
|
+
function moveSubtree(wm, wp, shift) {
|
|
561
|
+
var change = shift / (wp.i - wm.i);
|
|
562
|
+
wp.c -= change;
|
|
563
|
+
wp.s += shift;
|
|
564
|
+
wm.c += change;
|
|
565
|
+
wp.z += shift;
|
|
566
|
+
wp.m += shift;
|
|
567
|
+
}
|
|
568
|
+
function executeShifts(v) {
|
|
569
|
+
var shift = 0, change = 0, children = v.children, i = children.length, w;
|
|
570
|
+
while (--i >= 0) {
|
|
571
|
+
w = children[i];
|
|
572
|
+
w.z += shift;
|
|
573
|
+
w.m += shift;
|
|
574
|
+
shift += w.s + (change += w.c);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
function nextAncestor(vim, v, ancestor) {
|
|
578
|
+
return vim.a.parent === v.parent ? vim.a : ancestor;
|
|
579
|
+
}
|
|
580
|
+
function TreeNode(node, i) {
|
|
581
|
+
this._ = node;
|
|
582
|
+
this.parent = null;
|
|
583
|
+
this.children = null;
|
|
584
|
+
this.A = null;
|
|
585
|
+
this.a = this;
|
|
586
|
+
this.z = 0;
|
|
587
|
+
this.m = 0;
|
|
588
|
+
this.c = 0;
|
|
589
|
+
this.s = 0;
|
|
590
|
+
this.t = null;
|
|
591
|
+
this.i = i;
|
|
592
|
+
}
|
|
593
|
+
TreeNode.prototype = Object.create(Node.prototype);
|
|
594
|
+
function treeRoot(root) {
|
|
595
|
+
var tree = new TreeNode(root, 0), node, nodes = [tree], child, children, i, n;
|
|
596
|
+
while (node = nodes.pop()) if (children = node._.children) {
|
|
597
|
+
node.children = new Array(n = children.length);
|
|
598
|
+
for (i = n - 1; i >= 0; --i) {
|
|
599
|
+
nodes.push(child = node.children[i] = new TreeNode(children[i], i));
|
|
600
|
+
child.parent = node;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
(tree.parent = new TreeNode(null, 0)).children = [tree];
|
|
604
|
+
return tree;
|
|
605
|
+
}
|
|
606
|
+
function tree_default() {
|
|
607
|
+
var separation = defaultSeparation, dx = 1, dy = 1, nodeSize = null;
|
|
608
|
+
function tree(root) {
|
|
609
|
+
var t = treeRoot(root);
|
|
610
|
+
t.eachAfter(firstWalk), t.parent.m = -t.z;
|
|
611
|
+
t.eachBefore(secondWalk);
|
|
612
|
+
if (nodeSize) root.eachBefore(sizeNode);
|
|
613
|
+
else {
|
|
614
|
+
var left = root, right = root, bottom = root;
|
|
615
|
+
root.eachBefore(function(node) {
|
|
616
|
+
if (node.x < left.x) left = node;
|
|
617
|
+
if (node.x > right.x) right = node;
|
|
618
|
+
if (node.depth > bottom.depth) bottom = node;
|
|
619
|
+
});
|
|
620
|
+
var s = left === right ? 1 : separation(left, right) / 2, tx = s - left.x, kx = dx / (right.x + s + tx), ky = dy / (bottom.depth || 1);
|
|
621
|
+
root.eachBefore(function(node) {
|
|
622
|
+
node.x = (node.x + tx) * kx;
|
|
623
|
+
node.y = node.depth * ky;
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
return root;
|
|
627
|
+
}
|
|
628
|
+
function firstWalk(v) {
|
|
629
|
+
var children = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null;
|
|
630
|
+
if (children) {
|
|
631
|
+
executeShifts(v);
|
|
632
|
+
var midpoint = (children[0].z + children[children.length - 1].z) / 2;
|
|
633
|
+
if (w) {
|
|
634
|
+
v.z = w.z + separation(v._, w._);
|
|
635
|
+
v.m = v.z - midpoint;
|
|
636
|
+
} else v.z = midpoint;
|
|
637
|
+
} else if (w) v.z = w.z + separation(v._, w._);
|
|
638
|
+
v.parent.A = apportion(v, w, v.parent.A || siblings[0]);
|
|
639
|
+
}
|
|
640
|
+
function secondWalk(v) {
|
|
641
|
+
v._.x = v.z + v.parent.m;
|
|
642
|
+
v.m += v.parent.m;
|
|
643
|
+
}
|
|
644
|
+
function apportion(v, w, ancestor) {
|
|
645
|
+
if (w) {
|
|
646
|
+
var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift;
|
|
647
|
+
while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {
|
|
648
|
+
vom = nextLeft(vom);
|
|
649
|
+
vop = nextRight(vop);
|
|
650
|
+
vop.a = v;
|
|
651
|
+
shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);
|
|
652
|
+
if (shift > 0) {
|
|
653
|
+
moveSubtree(nextAncestor(vim, v, ancestor), v, shift);
|
|
654
|
+
sip += shift;
|
|
655
|
+
sop += shift;
|
|
656
|
+
}
|
|
657
|
+
sim += vim.m;
|
|
658
|
+
sip += vip.m;
|
|
659
|
+
som += vom.m;
|
|
660
|
+
sop += vop.m;
|
|
661
|
+
}
|
|
662
|
+
if (vim && !nextRight(vop)) {
|
|
663
|
+
vop.t = vim;
|
|
664
|
+
vop.m += sim - sop;
|
|
665
|
+
}
|
|
666
|
+
if (vip && !nextLeft(vom)) {
|
|
667
|
+
vom.t = vip;
|
|
668
|
+
vom.m += sip - som;
|
|
669
|
+
ancestor = v;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
return ancestor;
|
|
673
|
+
}
|
|
674
|
+
function sizeNode(node) {
|
|
675
|
+
node.x *= dx;
|
|
676
|
+
node.y = node.depth * dy;
|
|
677
|
+
}
|
|
678
|
+
tree.separation = function(x) {
|
|
679
|
+
return arguments.length ? (separation = x, tree) : separation;
|
|
680
|
+
};
|
|
681
|
+
tree.size = function(x) {
|
|
682
|
+
return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : nodeSize ? null : [dx, dy];
|
|
683
|
+
};
|
|
684
|
+
tree.nodeSize = function(x) {
|
|
685
|
+
return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : nodeSize ? [dx, dy] : null;
|
|
686
|
+
};
|
|
687
|
+
return tree;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
//#endregion
|
|
691
|
+
//#region node_modules/d3-hierarchy/src/treemap/slice.js
|
|
692
|
+
function slice_default(parent, x0, y0, x1, y1) {
|
|
693
|
+
var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (y1 - y0) / parent.value;
|
|
694
|
+
while (++i < n) {
|
|
695
|
+
node = nodes[i], node.x0 = x0, node.x1 = x1;
|
|
696
|
+
node.y0 = y0, node.y1 = y0 += node.value * k;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
//#endregion
|
|
701
|
+
//#region node_modules/d3-hierarchy/src/treemap/squarify.js
|
|
702
|
+
var phi = (1 + Math.sqrt(5)) / 2;
|
|
703
|
+
function squarifyRatio(ratio, parent, x0, y0, x1, y1) {
|
|
704
|
+
var rows = [], nodes = parent.children, row, nodeValue, i0 = 0, i1 = 0, n = nodes.length, dx, dy, value = parent.value, sumValue, minValue, maxValue, newRatio, minRatio, alpha, beta;
|
|
705
|
+
while (i0 < n) {
|
|
706
|
+
dx = x1 - x0, dy = y1 - y0;
|
|
707
|
+
do
|
|
708
|
+
sumValue = nodes[i1++].value;
|
|
709
|
+
while (!sumValue && i1 < n);
|
|
710
|
+
minValue = maxValue = sumValue;
|
|
711
|
+
alpha = Math.max(dy / dx, dx / dy) / (value * ratio);
|
|
712
|
+
beta = sumValue * sumValue * alpha;
|
|
713
|
+
minRatio = Math.max(maxValue / beta, beta / minValue);
|
|
714
|
+
for (; i1 < n; ++i1) {
|
|
715
|
+
sumValue += nodeValue = nodes[i1].value;
|
|
716
|
+
if (nodeValue < minValue) minValue = nodeValue;
|
|
717
|
+
if (nodeValue > maxValue) maxValue = nodeValue;
|
|
718
|
+
beta = sumValue * sumValue * alpha;
|
|
719
|
+
newRatio = Math.max(maxValue / beta, beta / minValue);
|
|
720
|
+
if (newRatio > minRatio) {
|
|
721
|
+
sumValue -= nodeValue;
|
|
722
|
+
break;
|
|
723
|
+
}
|
|
724
|
+
minRatio = newRatio;
|
|
725
|
+
}
|
|
726
|
+
rows.push(row = {
|
|
727
|
+
value: sumValue,
|
|
728
|
+
dice: dx < dy,
|
|
729
|
+
children: nodes.slice(i0, i1)
|
|
730
|
+
});
|
|
731
|
+
if (row.dice) dice_default(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);
|
|
732
|
+
else slice_default(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);
|
|
733
|
+
value -= sumValue, i0 = i1;
|
|
734
|
+
}
|
|
735
|
+
return rows;
|
|
736
|
+
}
|
|
737
|
+
var squarify_default = (function custom(ratio) {
|
|
738
|
+
function squarify(parent, x0, y0, x1, y1) {
|
|
739
|
+
squarifyRatio(ratio, parent, x0, y0, x1, y1);
|
|
740
|
+
}
|
|
741
|
+
squarify.ratio = function(x) {
|
|
742
|
+
return custom((x = +x) > 1 ? x : 1);
|
|
743
|
+
};
|
|
744
|
+
return squarify;
|
|
745
|
+
})(phi);
|
|
746
|
+
|
|
747
|
+
//#endregion
|
|
748
|
+
//#region node_modules/d3-hierarchy/src/treemap/index.js
|
|
749
|
+
function treemap_default() {
|
|
750
|
+
var tile = squarify_default, round = false, dx = 1, dy = 1, paddingStack = [0], paddingInner = constantZero, paddingTop = constantZero, paddingRight = constantZero, paddingBottom = constantZero, paddingLeft = constantZero;
|
|
751
|
+
function treemap(root) {
|
|
752
|
+
root.x0 = root.y0 = 0;
|
|
753
|
+
root.x1 = dx;
|
|
754
|
+
root.y1 = dy;
|
|
755
|
+
root.eachBefore(positionNode);
|
|
756
|
+
paddingStack = [0];
|
|
757
|
+
if (round) root.eachBefore(round_default);
|
|
758
|
+
return root;
|
|
759
|
+
}
|
|
760
|
+
function positionNode(node) {
|
|
761
|
+
var p = paddingStack[node.depth], x0 = node.x0 + p, y0 = node.y0 + p, x1 = node.x1 - p, y1 = node.y1 - p;
|
|
762
|
+
if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
|
|
763
|
+
if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
|
|
764
|
+
node.x0 = x0;
|
|
765
|
+
node.y0 = y0;
|
|
766
|
+
node.x1 = x1;
|
|
767
|
+
node.y1 = y1;
|
|
768
|
+
if (node.children) {
|
|
769
|
+
p = paddingStack[node.depth + 1] = paddingInner(node) / 2;
|
|
770
|
+
x0 += paddingLeft(node) - p;
|
|
771
|
+
y0 += paddingTop(node) - p;
|
|
772
|
+
x1 -= paddingRight(node) - p;
|
|
773
|
+
y1 -= paddingBottom(node) - p;
|
|
774
|
+
if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
|
|
775
|
+
if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
|
|
776
|
+
tile(node, x0, y0, x1, y1);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
treemap.round = function(x) {
|
|
780
|
+
return arguments.length ? (round = !!x, treemap) : round;
|
|
781
|
+
};
|
|
782
|
+
treemap.size = function(x) {
|
|
783
|
+
return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];
|
|
784
|
+
};
|
|
785
|
+
treemap.tile = function(x) {
|
|
786
|
+
return arguments.length ? (tile = required(x), treemap) : tile;
|
|
787
|
+
};
|
|
788
|
+
treemap.padding = function(x) {
|
|
789
|
+
return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();
|
|
790
|
+
};
|
|
791
|
+
treemap.paddingInner = function(x) {
|
|
792
|
+
return arguments.length ? (paddingInner = typeof x === "function" ? x : constant_default$1(+x), treemap) : paddingInner;
|
|
793
|
+
};
|
|
794
|
+
treemap.paddingOuter = function(x) {
|
|
795
|
+
return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();
|
|
796
|
+
};
|
|
797
|
+
treemap.paddingTop = function(x) {
|
|
798
|
+
return arguments.length ? (paddingTop = typeof x === "function" ? x : constant_default$1(+x), treemap) : paddingTop;
|
|
799
|
+
};
|
|
800
|
+
treemap.paddingRight = function(x) {
|
|
801
|
+
return arguments.length ? (paddingRight = typeof x === "function" ? x : constant_default$1(+x), treemap) : paddingRight;
|
|
802
|
+
};
|
|
803
|
+
treemap.paddingBottom = function(x) {
|
|
804
|
+
return arguments.length ? (paddingBottom = typeof x === "function" ? x : constant_default$1(+x), treemap) : paddingBottom;
|
|
805
|
+
};
|
|
806
|
+
treemap.paddingLeft = function(x) {
|
|
807
|
+
return arguments.length ? (paddingLeft = typeof x === "function" ? x : constant_default$1(+x), treemap) : paddingLeft;
|
|
808
|
+
};
|
|
809
|
+
return treemap;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
//#endregion
|
|
813
|
+
//#region node_modules/d3-hierarchy/src/treemap/binary.js
|
|
814
|
+
function binary_default(parent, x0, y0, x1, y1) {
|
|
815
|
+
var nodes = parent.children, i, n = nodes.length, sum, sums = new Array(n + 1);
|
|
816
|
+
for (sums[0] = sum = i = 0; i < n; ++i) sums[i + 1] = sum += nodes[i].value;
|
|
817
|
+
partition(0, n, parent.value, x0, y0, x1, y1);
|
|
818
|
+
function partition(i$1, j, value, x0$1, y0$1, x1$1, y1$1) {
|
|
819
|
+
if (i$1 >= j - 1) {
|
|
820
|
+
var node = nodes[i$1];
|
|
821
|
+
node.x0 = x0$1, node.y0 = y0$1;
|
|
822
|
+
node.x1 = x1$1, node.y1 = y1$1;
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
var valueOffset = sums[i$1], valueTarget = value / 2 + valueOffset, k = i$1 + 1, hi = j - 1;
|
|
826
|
+
while (k < hi) {
|
|
827
|
+
var mid = k + hi >>> 1;
|
|
828
|
+
if (sums[mid] < valueTarget) k = mid + 1;
|
|
829
|
+
else hi = mid;
|
|
830
|
+
}
|
|
831
|
+
if (valueTarget - sums[k - 1] < sums[k] - valueTarget && i$1 + 1 < k) --k;
|
|
832
|
+
var valueLeft = sums[k] - valueOffset, valueRight = value - valueLeft;
|
|
833
|
+
if (x1$1 - x0$1 > y1$1 - y0$1) {
|
|
834
|
+
var xk = (x0$1 * valueRight + x1$1 * valueLeft) / value;
|
|
835
|
+
partition(i$1, k, valueLeft, x0$1, y0$1, xk, y1$1);
|
|
836
|
+
partition(k, j, valueRight, xk, y0$1, x1$1, y1$1);
|
|
837
|
+
} else {
|
|
838
|
+
var yk = (y0$1 * valueRight + y1$1 * valueLeft) / value;
|
|
839
|
+
partition(i$1, k, valueLeft, x0$1, y0$1, x1$1, yk);
|
|
840
|
+
partition(k, j, valueRight, x0$1, yk, x1$1, y1$1);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
//#endregion
|
|
846
|
+
//#region node_modules/d3-hierarchy/src/treemap/sliceDice.js
|
|
847
|
+
function sliceDice_default(parent, x0, y0, x1, y1) {
|
|
848
|
+
(parent.depth & 1 ? slice_default : dice_default)(parent, x0, y0, x1, y1);
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
//#endregion
|
|
852
|
+
//#region node_modules/d3-hierarchy/src/treemap/resquarify.js
|
|
853
|
+
var resquarify_default = (function custom(ratio) {
|
|
854
|
+
function resquarify(parent, x0, y0, x1, y1) {
|
|
855
|
+
if ((rows = parent._squarify) && rows.ratio === ratio) {
|
|
856
|
+
var rows, row, nodes, i, j = -1, n, m = rows.length, value = parent.value;
|
|
857
|
+
while (++j < m) {
|
|
858
|
+
row = rows[j], nodes = row.children;
|
|
859
|
+
for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;
|
|
860
|
+
if (row.dice) dice_default(row, x0, y0, x1, y0 += (y1 - y0) * row.value / value);
|
|
861
|
+
else slice_default(row, x0, y0, x0 += (x1 - x0) * row.value / value, y1);
|
|
862
|
+
value -= row.value;
|
|
863
|
+
}
|
|
864
|
+
} else {
|
|
865
|
+
parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);
|
|
866
|
+
rows.ratio = ratio;
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
resquarify.ratio = function(x) {
|
|
870
|
+
return custom((x = +x) > 1 ? x : 1);
|
|
871
|
+
};
|
|
872
|
+
return resquarify;
|
|
873
|
+
})(phi);
|
|
874
|
+
|
|
875
|
+
//#endregion
|
|
876
|
+
//#region src/CirclePacking.ts
|
|
877
|
+
var CirclePacking = class extends SVGWidget {
|
|
878
|
+
diameter;
|
|
879
|
+
pack;
|
|
880
|
+
svg;
|
|
881
|
+
_focus;
|
|
882
|
+
circle;
|
|
883
|
+
view;
|
|
884
|
+
_node;
|
|
885
|
+
constructor() {
|
|
886
|
+
super();
|
|
887
|
+
ITree.call(this);
|
|
888
|
+
}
|
|
889
|
+
enter(_domNode, element) {
|
|
890
|
+
this.diameter = Math.min(this.width(), this.height());
|
|
891
|
+
this.pack = pack_default().size([this.diameter - 4, this.diameter - 4]).padding(1.5);
|
|
892
|
+
this.svg = element.append("g");
|
|
893
|
+
}
|
|
894
|
+
update(_domNode, _element) {
|
|
895
|
+
const context = this;
|
|
896
|
+
this.diameter = Math.min(this.width(), this.height());
|
|
897
|
+
this.pack.size([this.diameter - 4, this.diameter - 4]).padding(1.5);
|
|
898
|
+
this._palette = this._palette.switch(this.paletteID());
|
|
899
|
+
if (this.useClonedPalette()) this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id());
|
|
900
|
+
this.svg.selectAll("circle").remove();
|
|
901
|
+
this.svg.selectAll("text").remove();
|
|
902
|
+
const root = hierarchy(this.data()).sum(function(d) {
|
|
903
|
+
return d && d.size ? d.size : 1;
|
|
904
|
+
}).sort(function(a, b) {
|
|
905
|
+
return a.value < b.value ? -1 : a.value > b.value ? 1 : 0;
|
|
906
|
+
});
|
|
907
|
+
this._focus = root;
|
|
908
|
+
this.pack(root);
|
|
909
|
+
this.circle = this.svg.selectAll("circle").data(root.descendants()).enter().append("circle").attr("class", function(d) {
|
|
910
|
+
return d.parent ? d.children ? "node" : "node leaf" : "node root";
|
|
911
|
+
}).style("fill", function(d) {
|
|
912
|
+
d.color = context.paletteDepthLevel_exists() && d.depth > context.paletteDepthLevel() ? rgb(d.parent.color)[context.paletteDepthVariant()](1) : context._palette(d.data.label);
|
|
913
|
+
return d.color;
|
|
914
|
+
}).on("click", function(d) {
|
|
915
|
+
context.click(d.data, null, null);
|
|
916
|
+
}).on("dblclick", function(d) {
|
|
917
|
+
if (this._focus !== d) context.zoom(d);
|
|
918
|
+
d3Event().stopPropagation();
|
|
919
|
+
});
|
|
920
|
+
this.circle.append("title").text(function(d) {
|
|
921
|
+
return d.data.label;
|
|
922
|
+
});
|
|
923
|
+
this.svg.selectAll("text").data(root.descendants()).enter().append("text").attr("class", "label").style("fill-opacity", function(d) {
|
|
924
|
+
return d.parent === root ? 1 : 0;
|
|
925
|
+
}).style("display", function(d) {
|
|
926
|
+
return d.parent === root ? null : "none";
|
|
927
|
+
}).text(function(d) {
|
|
928
|
+
return d.data.label + (context.showSize() && typeof d.data.size !== "undefined" ? " " + d.data.size : "");
|
|
929
|
+
});
|
|
930
|
+
this._node = this.svg.selectAll("circle,text");
|
|
931
|
+
this.zoomTo([
|
|
932
|
+
root.x,
|
|
933
|
+
root.y,
|
|
934
|
+
root.r * 2
|
|
935
|
+
]);
|
|
936
|
+
}
|
|
937
|
+
zoom(newFocus) {
|
|
938
|
+
this._focus = newFocus;
|
|
939
|
+
const context = this;
|
|
940
|
+
const transition = this.svg.transition().duration(d3Event().altKey ? 7500 : 750).tween("zoom", function() {
|
|
941
|
+
const i = interpolateZoom(context.view, [
|
|
942
|
+
context._focus.x,
|
|
943
|
+
context._focus.y,
|
|
944
|
+
context._focus.r * 2
|
|
945
|
+
]);
|
|
946
|
+
return function(t) {
|
|
947
|
+
context.zoomTo(i(t));
|
|
948
|
+
};
|
|
949
|
+
});
|
|
950
|
+
function showText(d) {
|
|
951
|
+
return d === context._focus && !d.children || d.parent === context._focus;
|
|
952
|
+
}
|
|
953
|
+
transition.selectAll("text").filter(function(d) {
|
|
954
|
+
return showText(d) || this.style.display === "inline";
|
|
955
|
+
}).style("fill-opacity", function(d) {
|
|
956
|
+
return showText(d) ? 1 : 0;
|
|
957
|
+
}).on("start", function(d) {
|
|
958
|
+
if (showText(d)) this.style.display = "inline";
|
|
959
|
+
}).on("end", function(d) {
|
|
960
|
+
if (!showText(d)) this.style.display = "none";
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
zoomTo(v) {
|
|
964
|
+
const k = this.diameter / v[2];
|
|
965
|
+
this.view = v;
|
|
966
|
+
this._node.attr("transform", function(d) {
|
|
967
|
+
return "translate(" + (d.x - v[0]) * k + "," + (d.y - v[1]) * k + ")";
|
|
968
|
+
});
|
|
969
|
+
this.circle.attr("r", function(d) {
|
|
970
|
+
return d.r * k;
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
};
|
|
974
|
+
CirclePacking.prototype._class += " tree_CirclePacking";
|
|
975
|
+
CirclePacking.prototype.implements(ITree.prototype);
|
|
976
|
+
CirclePacking.prototype.publish("showSize", true, "boolean", "Show size along with label");
|
|
977
|
+
CirclePacking.prototype.publish("paletteDepthLevel", null, "number", "If not null then beyond this depth number the child node colors are based on parent", null, { optional: true });
|
|
978
|
+
CirclePacking.prototype.publish("paletteDepthVariant", "brighter", "set", "Determines paletteDepthLevel decendant color shade variant", ["brighter", "darker"], { disable: (w) => w.paletteDepthLevel_exists() });
|
|
979
|
+
CirclePacking.prototype.publish("paletteID", "default", "set", "Color palette for this widget", CirclePacking.prototype._palette.switch(), { tags: ["Basic", "Shared"] });
|
|
980
|
+
CirclePacking.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] });
|
|
981
|
+
|
|
982
|
+
//#endregion
|
|
983
|
+
//#region src/Dendrogram.ts
|
|
984
|
+
var DendrogramColumn = class extends PropertyExt {
|
|
985
|
+
_owner;
|
|
986
|
+
constructor() {
|
|
987
|
+
super();
|
|
988
|
+
}
|
|
989
|
+
owner(_) {
|
|
990
|
+
if (!arguments.length) return this._owner;
|
|
991
|
+
this._owner = _;
|
|
992
|
+
return this;
|
|
993
|
+
}
|
|
994
|
+
valid() {
|
|
995
|
+
return !!this.column();
|
|
996
|
+
}
|
|
997
|
+
column;
|
|
998
|
+
};
|
|
999
|
+
DendrogramColumn.prototype._class += " tree_Dendrogram.DendrogramColumn";
|
|
1000
|
+
DendrogramColumn.prototype.publish("column", null, "set", "Field", function() {
|
|
1001
|
+
return this._owner ? this._owner.columns() : [];
|
|
1002
|
+
}, { optional: true });
|
|
1003
|
+
var Dendrogram = class extends SVGZoomWidget {
|
|
1004
|
+
Column;
|
|
1005
|
+
_d3LayoutCluster;
|
|
1006
|
+
_d3LayoutTree;
|
|
1007
|
+
_d3Layout;
|
|
1008
|
+
constructor() {
|
|
1009
|
+
super();
|
|
1010
|
+
ITree.call(this);
|
|
1011
|
+
Utility.SimpleSelectionMixin.call(this);
|
|
1012
|
+
this._drawStartPos = "origin";
|
|
1013
|
+
this._d3LayoutCluster = cluster_default();
|
|
1014
|
+
this._d3LayoutTree = tree_default();
|
|
1015
|
+
}
|
|
1016
|
+
dendrogramData() {
|
|
1017
|
+
if (this.data().length === 0) return [];
|
|
1018
|
+
if (!this.mappings().filter((mapping) => mapping.valid()).length) return this.data();
|
|
1019
|
+
return formatData({
|
|
1020
|
+
key: "root",
|
|
1021
|
+
values: this._db.rollupView(this.mappings().map(function(mapping) {
|
|
1022
|
+
return mapping.column();
|
|
1023
|
+
})).entries()
|
|
1024
|
+
});
|
|
1025
|
+
function formatData(node) {
|
|
1026
|
+
return {
|
|
1027
|
+
label: node.key,
|
|
1028
|
+
children: node.values.filter(function(value) {
|
|
1029
|
+
return !(value instanceof Array);
|
|
1030
|
+
}).map(function(value) {
|
|
1031
|
+
return formatData(value);
|
|
1032
|
+
}),
|
|
1033
|
+
origRows: node.values
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
enter(domNode, element) {
|
|
1038
|
+
super.enter(domNode, element);
|
|
1039
|
+
this._renderElement.attr("opacity", 0).transition().duration(500).attr("opacity", 1);
|
|
1040
|
+
this._selection.widgetElement(this._renderElement);
|
|
1041
|
+
}
|
|
1042
|
+
update(domNode, element) {
|
|
1043
|
+
super.update(domNode, element);
|
|
1044
|
+
const context = this;
|
|
1045
|
+
const isVertical = this.orientation() === "vertical";
|
|
1046
|
+
this._palette = this._palette.switch(this.paletteID());
|
|
1047
|
+
if (this.useClonedPalette()) this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id());
|
|
1048
|
+
this._d3Layout = this.dendrogram() ? this._d3LayoutCluster : this._d3LayoutTree;
|
|
1049
|
+
if (this.radial()) {
|
|
1050
|
+
this._d3Layout.size([360, this.separation() * 2]);
|
|
1051
|
+
this._d3Layout.separation(function separation(a, b) {
|
|
1052
|
+
return (a.parent === b.parent ? 1 : 2) / a.depth;
|
|
1053
|
+
});
|
|
1054
|
+
} else {
|
|
1055
|
+
this._d3Layout.nodeSize([14, this.separation()]);
|
|
1056
|
+
this._d3Layout.separation(function separation(a, b) {
|
|
1057
|
+
return a.parent === b.parent ? 1 : 2;
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1060
|
+
const root = hierarchy(this.dendrogramData());
|
|
1061
|
+
this._d3Layout(root);
|
|
1062
|
+
const dataNodes = root.descendants();
|
|
1063
|
+
const links = root.descendants().slice(1);
|
|
1064
|
+
function linkVertical(d) {
|
|
1065
|
+
return "M" + d.parent.x + "," + d.parent.y + "C" + d.parent.x + "," + (d.parent.y + d.y) / 2 + " " + d.x + "," + (d.parent.y + d.y) / 2 + " " + d.x + "," + d.y;
|
|
1066
|
+
}
|
|
1067
|
+
function linkHorizontal(d) {
|
|
1068
|
+
return "M" + d.y + "," + d.x + "C" + (d.y + d.parent.y) / 2 + "," + d.x + " " + (d.y + d.parent.y) / 2 + "," + d.parent.x + " " + d.parent.y + "," + d.parent.x;
|
|
1069
|
+
}
|
|
1070
|
+
function diagonal(d) {
|
|
1071
|
+
return isVertical ? linkVertical(d) : linkHorizontal(d);
|
|
1072
|
+
}
|
|
1073
|
+
function project(x, y) {
|
|
1074
|
+
const angle = (x - 90) / 180 * Math.PI;
|
|
1075
|
+
const radius = y;
|
|
1076
|
+
return [radius * Math.cos(angle), radius * Math.sin(angle)];
|
|
1077
|
+
}
|
|
1078
|
+
function radialDiagonal(d) {
|
|
1079
|
+
return "M" + project(d.x, d.y) + "C" + project(d.x, (d.y + d.parent.y) / 2) + " " + project(d.parent.x, (d.y + d.parent.y) / 2) + " " + project(d.parent.x, d.parent.y);
|
|
1080
|
+
}
|
|
1081
|
+
const transitionDuration = this._renderCount ? 500 : 0;
|
|
1082
|
+
const lines = this._renderElement.selectAll(".link").data(links);
|
|
1083
|
+
lines.enter().append("path").attr("class", "link").attr("d", this.radial() ? radialDiagonal : diagonal);
|
|
1084
|
+
lines.transition().duration(transitionDuration).attr("d", this.radial() ? radialDiagonal : diagonal);
|
|
1085
|
+
lines.exit().remove();
|
|
1086
|
+
const textOffsetX = this.circleRadius() + 2;
|
|
1087
|
+
function nodeTransform(d) {
|
|
1088
|
+
if (context.radial()) return "rotate(" + (d.x - 90) + ")translate(" + d.y + ")";
|
|
1089
|
+
return context.orientation() === "horizontal" ? "translate(" + d.y + "," + d.x + ")" : "translate(" + d.x + "," + d.y + ")";
|
|
1090
|
+
}
|
|
1091
|
+
const nodes = this._renderElement.selectAll(".node").data(dataNodes);
|
|
1092
|
+
nodes.transition().duration(transitionDuration).attr("transform", nodeTransform);
|
|
1093
|
+
const enterNodes = nodes.enter().append("g").attr("class", "node").attr("transform", nodeTransform).call(this._selection.enter.bind(this._selection)).on("click", function(d) {
|
|
1094
|
+
let tmp = d;
|
|
1095
|
+
while (tmp.children) tmp = tmp.children[0];
|
|
1096
|
+
if (d.depth > 0) if (tmp.origRows) context.click(context.rowToObj(tmp.origRows[0]), context.mappings()[d.depth - 1].column(), true);
|
|
1097
|
+
else context.click(tmp.data, context.mappings()[d.depth - 1].column(), true);
|
|
1098
|
+
}).on("dblclick", function(d) {
|
|
1099
|
+
let tmp = d;
|
|
1100
|
+
while (tmp.children) tmp = tmp.children[0];
|
|
1101
|
+
if (d.depth > 0) if (tmp.origRows) context.dblclick(context.rowToObj(tmp.origRows[0]), context.mappings()[d.depth - 1].column(), true);
|
|
1102
|
+
else context.dblclick(tmp.data, context.mappings()[d.depth - 1].column(), true);
|
|
1103
|
+
}).each(function() {
|
|
1104
|
+
const e = select(this);
|
|
1105
|
+
e.append("circle");
|
|
1106
|
+
e.append("text");
|
|
1107
|
+
});
|
|
1108
|
+
enterNodes.merge(nodes).select("circle").attr("r", this.circleRadius()).style("fill", function(d) {
|
|
1109
|
+
return context._palette(d.data.label);
|
|
1110
|
+
}).append("title").text(function(d) {
|
|
1111
|
+
return d.data.label;
|
|
1112
|
+
});
|
|
1113
|
+
enterNodes.merge(nodes).select("text").attr("dx", function(d) {
|
|
1114
|
+
if (context.radial()) if (d.children) return d.x < 180 ? -textOffsetX : textOffsetX;
|
|
1115
|
+
else return d.x < 180 ? textOffsetX : -textOffsetX;
|
|
1116
|
+
else if (isVertical) return d.children ? textOffsetX : -textOffsetX;
|
|
1117
|
+
return d.children ? -textOffsetX : textOffsetX;
|
|
1118
|
+
}).attr("dy", "0.25em").style("text-anchor", function(d) {
|
|
1119
|
+
if (context.radial()) if (d.children) return d.x < 180 ? "end" : "start";
|
|
1120
|
+
else return d.x < 180 ? "start" : "end";
|
|
1121
|
+
else if (isVertical) return d.children ? "start" : "end";
|
|
1122
|
+
return d.children ? "end" : "start";
|
|
1123
|
+
}).attr("transform", function(d) {
|
|
1124
|
+
if (context.radial()) return d.x < 180 ? null : "rotate(180)";
|
|
1125
|
+
else if (isVertical) return "rotate(-66)";
|
|
1126
|
+
return null;
|
|
1127
|
+
}).text(function(d) {
|
|
1128
|
+
return d.data.label;
|
|
1129
|
+
});
|
|
1130
|
+
nodes.exit().remove();
|
|
1131
|
+
if (!this._renderCount) context.zoomToFit();
|
|
1132
|
+
}
|
|
1133
|
+
};
|
|
1134
|
+
Dendrogram.prototype._class += " tree_Dendrogram";
|
|
1135
|
+
Dendrogram.prototype.implements(ITree.prototype);
|
|
1136
|
+
Dendrogram.prototype.mixin(Utility.SimpleSelectionMixin);
|
|
1137
|
+
Dendrogram.prototype.Column = DendrogramColumn;
|
|
1138
|
+
Dendrogram.prototype.publish("paletteID", "default", "set", "Color palette for this widget", Dendrogram.prototype._palette.switch(), { tags: ["Basic", "Shared"] });
|
|
1139
|
+
Dendrogram.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] });
|
|
1140
|
+
Dendrogram.prototype.publish("mappings", [], "propertyArray", "Source Columns", null, { autoExpand: DendrogramColumn });
|
|
1141
|
+
Dendrogram.prototype.publish("circleRadius", 4.5, "number", "Text offset from circle");
|
|
1142
|
+
Dendrogram.prototype.publish("separation", 240, "number", "Leaf Separation");
|
|
1143
|
+
Dendrogram.prototype.publish("dendrogram", true, "boolean", "Dendrogram");
|
|
1144
|
+
Dendrogram.prototype.publish("radial", false, "boolean", "Radial");
|
|
1145
|
+
Dendrogram.prototype.publish("orientation", "horizontal", "set", "Orientation", ["horizontal", "vertical"], {
|
|
1146
|
+
tags: ["Private"],
|
|
1147
|
+
disable: (w) => w.radial()
|
|
1148
|
+
});
|
|
1149
|
+
|
|
1150
|
+
//#endregion
|
|
1151
|
+
//#region src/DirectoryTree.ts
|
|
1152
|
+
var DirectoryTree = class extends HTMLWidget {
|
|
1153
|
+
constructor() {
|
|
1154
|
+
super();
|
|
1155
|
+
}
|
|
1156
|
+
flattenData(json) {
|
|
1157
|
+
const context = this;
|
|
1158
|
+
const root = hierarchy(json);
|
|
1159
|
+
const ret = [];
|
|
1160
|
+
if (!this.omitRoot()) visitNode(root);
|
|
1161
|
+
else if (root.children) root.children.forEach(visitNode);
|
|
1162
|
+
return ret;
|
|
1163
|
+
function visitNode(node) {
|
|
1164
|
+
const weightValue = node.data.markers && node.data.markers.length ? node.data.markers.length : "";
|
|
1165
|
+
ret.push({
|
|
1166
|
+
label: node.data.label,
|
|
1167
|
+
depth: node.depth - (context.omitRoot() ? 1 : 0),
|
|
1168
|
+
content: node.data.content,
|
|
1169
|
+
isFolder: !!node.data.children,
|
|
1170
|
+
iconClass: node.data.iconClass,
|
|
1171
|
+
color: node.data.color,
|
|
1172
|
+
bold: node.data.bold,
|
|
1173
|
+
weightValue,
|
|
1174
|
+
markers: node.data.markers,
|
|
1175
|
+
selected: node.data.selected
|
|
1176
|
+
});
|
|
1177
|
+
if (node.children) node.children.forEach(visitNode);
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
iconClass(d) {
|
|
1181
|
+
if (d.label === "error") return "fa fa-exclamation";
|
|
1182
|
+
if (d.isFolder) return this.folderIconOpen();
|
|
1183
|
+
return this.textFileIcon();
|
|
1184
|
+
}
|
|
1185
|
+
calcRequiredWidth() {
|
|
1186
|
+
const flatData = this.flattenData(this.data());
|
|
1187
|
+
let widest = 0;
|
|
1188
|
+
const padding = this.rowItemPadding();
|
|
1189
|
+
const iconWidth = this.iconSize() + padding * 2;
|
|
1190
|
+
const scrollbarWidth = Platform.getScrollbarWidth();
|
|
1191
|
+
flatData.forEach((row) => {
|
|
1192
|
+
const offsetWidth = row.depth * iconWidth + padding * 2;
|
|
1193
|
+
const totalWidth = Utility.textSize(row.label, this.fontFamily(), this.fontSize(), !!row.bold).width + padding * 2 + iconWidth + offsetWidth + scrollbarWidth;
|
|
1194
|
+
if (widest < totalWidth) widest = totalWidth;
|
|
1195
|
+
});
|
|
1196
|
+
return widest;
|
|
1197
|
+
}
|
|
1198
|
+
rowClick(str, markers) {}
|
|
1199
|
+
enter(domNode, element) {
|
|
1200
|
+
super.enter(domNode, element);
|
|
1201
|
+
element.style("width", "100%").style("height", "100%");
|
|
1202
|
+
}
|
|
1203
|
+
update(domNode, element) {
|
|
1204
|
+
super.update(domNode, element);
|
|
1205
|
+
this._palette = this._palette.switch(this.paletteID());
|
|
1206
|
+
element.style("overflow-y", this.verticalScroll() ? "scroll" : null);
|
|
1207
|
+
const flatData = this.flattenData(this.data());
|
|
1208
|
+
const maxWeightValue = max(flatData, (n) => Number(n.weightValue));
|
|
1209
|
+
flatData.forEach((d) => {
|
|
1210
|
+
if (!d.weightValue) d.weightColor = "transparent";
|
|
1211
|
+
else d.weightColor = this._palette(d.weightValue, 1, maxWeightValue);
|
|
1212
|
+
});
|
|
1213
|
+
const context = this;
|
|
1214
|
+
const padding = this.rowItemPadding();
|
|
1215
|
+
const iconWidth = this.iconSize() + padding;
|
|
1216
|
+
const lineHeight = Math.max(context.iconSize(), context.fontSize());
|
|
1217
|
+
const rowSelection = element.selectAll(".directory-row").data(flatData);
|
|
1218
|
+
const fontFamily = this.fontFamily();
|
|
1219
|
+
const fontSize = this.fontSize();
|
|
1220
|
+
const maxWeightWidth = max(flatData, (d) => this.textSize(d.weightValue, fontFamily, fontSize).width);
|
|
1221
|
+
const rowItemPadding = `${padding}px ${padding}px ${padding / 2}px ${padding}px`;
|
|
1222
|
+
rowSelection.enter().append("div").attr("class", (d) => `directory-row directory-row-depth-${d.depth}`).style("display", "flex").style("cursor", "pointer").each(function(d) {
|
|
1223
|
+
const rowDiv = select(this);
|
|
1224
|
+
const fontColor = d.color ? d.color : context.fontColor();
|
|
1225
|
+
const weightColor = d.weightColor ? d.weightColor : "transparent";
|
|
1226
|
+
const weightFontColor = Palette.textColor(weightColor);
|
|
1227
|
+
const weightDiv = rowDiv.append("div").attr("class", "row-weight").style("padding", rowItemPadding).style("color", weightFontColor).style("box-shadow", `inset 0 0 100px ${weightColor}`).style("font-weight", d.bold ? "bold" : "normal").style("font-family", fontFamily).style("font-size", fontSize + "px").text(d.weightValue).attr("title", d.weightValue).style("overflow", "hidden").style("width", maxWeightWidth + padding * 2 + "px").style("text-overflow", "ellipsis").style("text-align", "right").style("line-height", lineHeight + "px");
|
|
1228
|
+
rowDiv.append("div").attr("class", "row-depth").style("width", context.depthSize() * d.depth + "px").style("opacity", 1).style("line-height", lineHeight + "px");
|
|
1229
|
+
const iconDiv = rowDiv.append("div").attr("class", "row-icon " + (d.iconClass ? d.iconClass : context.iconClass(d))).style("width", iconWidth + "px").style("height", lineHeight + "px").style("color", fontColor).style("background-color", d.selected ? context.selectionBackgroundColor() : "transparent").style("font-size", context.iconSize() + "px").style("padding", rowItemPadding).style("line-height", lineHeight + "px");
|
|
1230
|
+
const labelDiv = rowDiv.append("div").attr("class", "row-label").style("padding", rowItemPadding).style("color", fontColor).style("background-color", d.selected ? context.selectionBackgroundColor() : "transparent").style("font-weight", d.bold ? "bold" : "normal").style("font-family", context.fontFamily()).style("font-size", context.fontSize() + "px").text(d.label).attr("title", d.label).style("flex", 1).style("overflow", "hidden").style("text-overflow", "ellipsis").style("line-height", lineHeight + "px");
|
|
1231
|
+
rowDiv.on("mouseenter", () => {
|
|
1232
|
+
labelDiv.style("font-weight", "bold");
|
|
1233
|
+
}).on("mouseleave", () => {
|
|
1234
|
+
labelDiv.style("font-weight", d.bold ? "bold" : "normal");
|
|
1235
|
+
});
|
|
1236
|
+
weightDiv.on("mouseenter", () => {
|
|
1237
|
+
context.weight_mouseenter(d);
|
|
1238
|
+
}).on("mouseleave", () => {
|
|
1239
|
+
context.weight_mouseleave(d);
|
|
1240
|
+
});
|
|
1241
|
+
if (d.isFolder) rowDiv.on("click", function(d$1) {
|
|
1242
|
+
let next = this.nextSibling;
|
|
1243
|
+
const wasClosed = rowDiv.classed("folder-closed");
|
|
1244
|
+
if (wasClosed) {
|
|
1245
|
+
rowDiv.classed("folder-closed", false);
|
|
1246
|
+
rowDiv.classed("folder-open", true);
|
|
1247
|
+
iconDiv.attr("class", "row-icon " + context.folderIconOpen());
|
|
1248
|
+
} else {
|
|
1249
|
+
rowDiv.classed("folder-closed", true);
|
|
1250
|
+
rowDiv.classed("folder-open", false);
|
|
1251
|
+
iconDiv.attr("class", "row-icon " + context.folderIconClosed());
|
|
1252
|
+
}
|
|
1253
|
+
while (next !== null) if (select(next).datum().depth > d$1.depth) {
|
|
1254
|
+
next.style.display = wasClosed ? "flex" : "none";
|
|
1255
|
+
next = next.nextSibling;
|
|
1256
|
+
} else next = null;
|
|
1257
|
+
});
|
|
1258
|
+
else rowDiv.on("click", () => {
|
|
1259
|
+
element.selectAll(".row-label").style("background-color", "transparent");
|
|
1260
|
+
element.selectAll(".row-icon").style("background-color", "transparent");
|
|
1261
|
+
iconDiv.style("background-color", context.selectionBackgroundColor());
|
|
1262
|
+
labelDiv.style("background-color", context.selectionBackgroundColor());
|
|
1263
|
+
const ext = d.label.split(".").pop().toLowerCase();
|
|
1264
|
+
context.rowClick(ext === "json" ? JSON.stringify(JSON.parse(d.content), null, 4) : d.content, d.markers);
|
|
1265
|
+
});
|
|
1266
|
+
}).merge(rowSelection).style("background-color", context.backgroundColor());
|
|
1267
|
+
rowSelection.exit().remove();
|
|
1268
|
+
}
|
|
1269
|
+
weight_mouseenter(d) {}
|
|
1270
|
+
weight_mouseleave(d) {}
|
|
1271
|
+
};
|
|
1272
|
+
DirectoryTree.prototype._class += " tree_DirectoryTree";
|
|
1273
|
+
DirectoryTree.prototype._palette = Palette.rainbow("Blues");
|
|
1274
|
+
DirectoryTree.prototype.publish("depthSize", 14, "number", "Width of indentation per file or folder depth (pixels)");
|
|
1275
|
+
DirectoryTree.prototype.publish("paletteID", "Blues", "set", "Color palette for the weight backgrounds", DirectoryTree.prototype._palette.switch(), { tags: ["Basic"] });
|
|
1276
|
+
DirectoryTree.prototype.publish("omitRoot", false, "boolean", "If true, root node will not display");
|
|
1277
|
+
DirectoryTree.prototype.publish("rowItemPadding", 2, "number", "Top, bottom, left and right row item padding");
|
|
1278
|
+
DirectoryTree.prototype.publish("selectionBackgroundColor", "#CCC", "html-color", "Background color of selected directory rows");
|
|
1279
|
+
DirectoryTree.prototype.publish("backgroundColor", "#FFF", "html-color", "Directory item background color");
|
|
1280
|
+
DirectoryTree.prototype.publish("fontColor", "#000", "html-color", "Directory item font color");
|
|
1281
|
+
DirectoryTree.prototype.publish("fontFamily", "Arial", "string", "Directory item font family");
|
|
1282
|
+
DirectoryTree.prototype.publish("fontSize", 12, "number", "Directory item font size (pixels)");
|
|
1283
|
+
DirectoryTree.prototype.publish("iconSize", 12, "number", "Directory folder and file icon size (pixels)");
|
|
1284
|
+
DirectoryTree.prototype.publish("folderIconOpen", "fa fa-folder-open", "string", "Open folder icon class");
|
|
1285
|
+
DirectoryTree.prototype.publish("folderIconClosed", "fa fa-folder", "string", "Closed folder icon class");
|
|
1286
|
+
DirectoryTree.prototype.publish("textFileIcon", "fa fa-file-text-o", "string", "Text file icon class");
|
|
1287
|
+
DirectoryTree.prototype.publish("verticalScroll", true, "boolean", "If true, vertical scroll bar will be shown");
|
|
1288
|
+
|
|
1289
|
+
//#endregion
|
|
1290
|
+
//#region src/Indented.ts
|
|
1291
|
+
var IndentedColumn = class extends PropertyExt {
|
|
1292
|
+
_owner;
|
|
1293
|
+
constructor() {
|
|
1294
|
+
super();
|
|
1295
|
+
}
|
|
1296
|
+
owner(_) {
|
|
1297
|
+
if (!arguments.length) return this._owner;
|
|
1298
|
+
this._owner = _;
|
|
1299
|
+
return this;
|
|
1300
|
+
}
|
|
1301
|
+
valid() {
|
|
1302
|
+
return !!this.column();
|
|
1303
|
+
}
|
|
1304
|
+
column;
|
|
1305
|
+
};
|
|
1306
|
+
IndentedColumn.prototype._class += " tree_Dendrogram.IndentedColumn";
|
|
1307
|
+
IndentedColumn.prototype.publish("column", null, "set", "Field", function() {
|
|
1308
|
+
return this._owner ? this._owner.columns() : [];
|
|
1309
|
+
}, { optional: true });
|
|
1310
|
+
var Indented = class extends SVGZoomWidget {
|
|
1311
|
+
Column;
|
|
1312
|
+
_d3Tree;
|
|
1313
|
+
_xml;
|
|
1314
|
+
_svgLinks;
|
|
1315
|
+
_svgNodes;
|
|
1316
|
+
_treeData;
|
|
1317
|
+
_collapsed = {};
|
|
1318
|
+
constructor() {
|
|
1319
|
+
super();
|
|
1320
|
+
ITree.call(this);
|
|
1321
|
+
Utility.SimpleSelectionMixin.call(this);
|
|
1322
|
+
this._drawStartPos = "origin";
|
|
1323
|
+
this._d3Tree = tree_default();
|
|
1324
|
+
}
|
|
1325
|
+
xmlToData(xml, id = "") {
|
|
1326
|
+
if (DOMParser) return xmlToJson(new DOMParser().parseFromString(xml, "text/xml"), id).children[0];
|
|
1327
|
+
return [];
|
|
1328
|
+
}
|
|
1329
|
+
xml(_) {
|
|
1330
|
+
if (!arguments.length) return this._xml;
|
|
1331
|
+
this._xml = _;
|
|
1332
|
+
this.data(this.xmlToData(this._xml));
|
|
1333
|
+
return this;
|
|
1334
|
+
}
|
|
1335
|
+
IndentedData() {
|
|
1336
|
+
if (this.data().length === 0) return [];
|
|
1337
|
+
if (this.xmlColumn_exists()) {
|
|
1338
|
+
const cellIdx = this.columns().indexOf(this.xmlColumn());
|
|
1339
|
+
const retVal = {
|
|
1340
|
+
label: this.xmlColumn(),
|
|
1341
|
+
children: this.data().map(function(row, idx) {
|
|
1342
|
+
return this.xmlToData(row[cellIdx], "[" + idx + "]");
|
|
1343
|
+
}, this)
|
|
1344
|
+
};
|
|
1345
|
+
return retVal.children.length === 1 ? retVal.children[0] : retVal;
|
|
1346
|
+
} else {
|
|
1347
|
+
if (!this.mappings().filter((mapping) => mapping.valid()).length) return this.data();
|
|
1348
|
+
return formatData({
|
|
1349
|
+
key: "root",
|
|
1350
|
+
values: this._db.rollupView(this.mappings().map(function(mapping) {
|
|
1351
|
+
return mapping.column();
|
|
1352
|
+
})).entries()
|
|
1353
|
+
});
|
|
1354
|
+
}
|
|
1355
|
+
function formatData(node) {
|
|
1356
|
+
if (node.values instanceof Array) {
|
|
1357
|
+
const children = node.values.filter(function(value) {
|
|
1358
|
+
return !(value instanceof Array);
|
|
1359
|
+
}).map(function(value) {
|
|
1360
|
+
return formatData(value);
|
|
1361
|
+
});
|
|
1362
|
+
const retVal = { label: node.key };
|
|
1363
|
+
if (children.length) retVal.children = children;
|
|
1364
|
+
else retVal.size = 22;
|
|
1365
|
+
return retVal;
|
|
1366
|
+
}
|
|
1367
|
+
return {
|
|
1368
|
+
label: node.key,
|
|
1369
|
+
size: node.values.aggregate,
|
|
1370
|
+
origRows: node.values
|
|
1371
|
+
};
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
enter(domNode, element) {
|
|
1375
|
+
super.enter(domNode, element);
|
|
1376
|
+
this._svgLinks = this._renderElement.append("g");
|
|
1377
|
+
this._svgNodes = this._renderElement.append("g");
|
|
1378
|
+
this._selection.widgetElement(this._svgNodes);
|
|
1379
|
+
}
|
|
1380
|
+
_prevDataChecksum;
|
|
1381
|
+
update(domNode, _element) {
|
|
1382
|
+
super.update(domNode, _element);
|
|
1383
|
+
const context = this;
|
|
1384
|
+
this._d3Tree.nodeSize([0, this.barHeight()]);
|
|
1385
|
+
const dataChecksum = this._db.dataChecksum();
|
|
1386
|
+
if (this._prevDataChecksum !== dataChecksum) {
|
|
1387
|
+
this._treeData = this.IndentedData();
|
|
1388
|
+
this._prevDataChecksum = dataChecksum;
|
|
1389
|
+
}
|
|
1390
|
+
function getID(d) {
|
|
1391
|
+
return (d.parent ? getID(d.parent) + "." : "") + d.data.label;
|
|
1392
|
+
}
|
|
1393
|
+
const root = hierarchy(this.data()).sum(function(d) {
|
|
1394
|
+
return d.size || 50;
|
|
1395
|
+
}).each((d) => {
|
|
1396
|
+
if (this._collapsed[getID(d)]) delete d.children;
|
|
1397
|
+
});
|
|
1398
|
+
const dataNodes = this._d3Tree(root).descendants();
|
|
1399
|
+
const links = this._d3Tree(root).descendants().slice(1);
|
|
1400
|
+
let nodeIdx = 0;
|
|
1401
|
+
root.eachBefore((n) => {
|
|
1402
|
+
n.x = nodeIdx * context.barHeight();
|
|
1403
|
+
++nodeIdx;
|
|
1404
|
+
});
|
|
1405
|
+
const boxSize = this.barHeight() - 4;
|
|
1406
|
+
const transitionDuration = this._renderCount ? 500 : 0;
|
|
1407
|
+
const lines = this._svgLinks.selectAll(".link").data(links, function(d) {
|
|
1408
|
+
return getID(d);
|
|
1409
|
+
});
|
|
1410
|
+
lines.enter().append("path").attr("class", "link").attr("d", elbow);
|
|
1411
|
+
lines.transition().duration(transitionDuration).attr("d", elbow);
|
|
1412
|
+
lines.exit().remove();
|
|
1413
|
+
function elbow(d) {
|
|
1414
|
+
return "M" + d.parent.y + "," + d.parent.x + "V" + d.x + ", H" + d.y;
|
|
1415
|
+
}
|
|
1416
|
+
const nodes = this._svgNodes.selectAll(".node").data(dataNodes, function(d) {
|
|
1417
|
+
return getID(d);
|
|
1418
|
+
});
|
|
1419
|
+
nodes.transition().duration(transitionDuration).attr("transform", function(d) {
|
|
1420
|
+
return "translate(" + d.y + "," + d.x + ")";
|
|
1421
|
+
});
|
|
1422
|
+
const enterNodes = nodes.enter().append("g").attr("class", "node").attr("transform", function(d) {
|
|
1423
|
+
return "translate(" + d.y + "," + d.x + ")";
|
|
1424
|
+
}).call(this._selection.enter.bind(this._selection)).each(function() {
|
|
1425
|
+
const element = select(this);
|
|
1426
|
+
element.append("rect").attr("height", boxSize).attr("width", boxSize).on("click", function(d) {
|
|
1427
|
+
if (context._collapsed[getID(d)]) delete context._collapsed[getID(d)];
|
|
1428
|
+
else if (d.children) context._collapsed[getID(d)] = true;
|
|
1429
|
+
context.lazyRender();
|
|
1430
|
+
});
|
|
1431
|
+
element.append("text");
|
|
1432
|
+
}).style("opacity", 0);
|
|
1433
|
+
enterNodes.transition().style("opacity", 1);
|
|
1434
|
+
enterNodes.merge(nodes).select("rect").attr("x", -boxSize / 2).attr("y", -boxSize / 2).style("fill", color);
|
|
1435
|
+
enterNodes.merge(nodes).select("text").attr("dx", boxSize / 2 + 4 + "px").attr("dy", "0.33em").text(function(d) {
|
|
1436
|
+
return d.data.label;
|
|
1437
|
+
});
|
|
1438
|
+
nodes.exit().transition().style("opacity", 0).remove();
|
|
1439
|
+
if (!this._renderCount) context.zoomToFit();
|
|
1440
|
+
function color(d) {
|
|
1441
|
+
return context._collapsed[getID(d)] ? "#3182bd" : d.children ? "#c6dbef" : "#fd8d3c";
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
};
|
|
1445
|
+
Indented.prototype._class += " tree_Indented";
|
|
1446
|
+
Indented.prototype.implements(ITree.prototype);
|
|
1447
|
+
Indented.prototype.mixin(Utility.SimpleSelectionMixin);
|
|
1448
|
+
Indented.prototype.Column = IndentedColumn;
|
|
1449
|
+
Indented.prototype.publish("xmlColumn", null, "set", "Field", function() {
|
|
1450
|
+
return this.columns();
|
|
1451
|
+
}, { optional: true });
|
|
1452
|
+
Indented.prototype.publish("mappings", [], "propertyArray", "Source Columns", null, {
|
|
1453
|
+
autoExpand: IndentedColumn,
|
|
1454
|
+
disable: (w) => w.xmlColumn_exists()
|
|
1455
|
+
});
|
|
1456
|
+
Indented.prototype.publish("barHeight", 16, "number", "Bar height");
|
|
1457
|
+
function xmlToJson(xml, id = "") {
|
|
1458
|
+
const retVal = {
|
|
1459
|
+
id,
|
|
1460
|
+
label: "",
|
|
1461
|
+
attributes: {},
|
|
1462
|
+
children: []
|
|
1463
|
+
};
|
|
1464
|
+
retVal.label = xml.nodeName;
|
|
1465
|
+
if (xml.nodeType === 1) {
|
|
1466
|
+
if (xml.attributes.length > 0) for (let j = 0; j < xml.attributes.length; j++) {
|
|
1467
|
+
const attribute = xml.attributes.item(j);
|
|
1468
|
+
retVal.attributes[attribute.nodeName] = attribute.nodeValue;
|
|
1469
|
+
}
|
|
1470
|
+
} else if (xml.nodeType === 3) retVal.label = xml.nodeValue;
|
|
1471
|
+
if (xml.hasChildNodes()) for (let i = 0; i < xml.childNodes.length; i++) {
|
|
1472
|
+
const child = xmlToJson(xml.childNodes.item(i), id + "[" + retVal.children.length + "]");
|
|
1473
|
+
retVal.children.push(child);
|
|
1474
|
+
}
|
|
1475
|
+
return retVal;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
//#endregion
|
|
1479
|
+
//#region ../../node_modules/d3-path/src/path.js
|
|
1480
|
+
var pi$1 = Math.PI, tau$1 = 2 * pi$1, epsilon$1 = 1e-6, tauEpsilon = tau$1 - epsilon$1;
|
|
1481
|
+
function Path() {
|
|
1482
|
+
this._x0 = this._y0 = this._x1 = this._y1 = null;
|
|
1483
|
+
this._ = "";
|
|
1484
|
+
}
|
|
1485
|
+
function path() {
|
|
1486
|
+
return new Path();
|
|
1487
|
+
}
|
|
1488
|
+
Path.prototype = path.prototype = {
|
|
1489
|
+
constructor: Path,
|
|
1490
|
+
moveTo: function(x, y) {
|
|
1491
|
+
this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y);
|
|
1492
|
+
},
|
|
1493
|
+
closePath: function() {
|
|
1494
|
+
if (this._x1 !== null) {
|
|
1495
|
+
this._x1 = this._x0, this._y1 = this._y0;
|
|
1496
|
+
this._ += "Z";
|
|
1497
|
+
}
|
|
1498
|
+
},
|
|
1499
|
+
lineTo: function(x, y) {
|
|
1500
|
+
this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y);
|
|
1501
|
+
},
|
|
1502
|
+
quadraticCurveTo: function(x1, y1, x, y) {
|
|
1503
|
+
this._ += "Q" + +x1 + "," + +y1 + "," + (this._x1 = +x) + "," + (this._y1 = +y);
|
|
1504
|
+
},
|
|
1505
|
+
bezierCurveTo: function(x1, y1, x2, y2, x, y) {
|
|
1506
|
+
this._ += "C" + +x1 + "," + +y1 + "," + +x2 + "," + +y2 + "," + (this._x1 = +x) + "," + (this._y1 = +y);
|
|
1507
|
+
},
|
|
1508
|
+
arcTo: function(x1, y1, x2, y2, r) {
|
|
1509
|
+
x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
|
|
1510
|
+
var x0 = this._x1, y0 = this._y1, x21 = x2 - x1, y21 = y2 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01;
|
|
1511
|
+
if (r < 0) throw new Error("negative radius: " + r);
|
|
1512
|
+
if (this._x1 === null) this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1);
|
|
1513
|
+
else if (!(l01_2 > epsilon$1));
|
|
1514
|
+
else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon$1) || !r) this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1);
|
|
1515
|
+
else {
|
|
1516
|
+
var x20 = x2 - x0, y20 = y2 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r * Math.tan((pi$1 - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21;
|
|
1517
|
+
if (Math.abs(t01 - 1) > epsilon$1) this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01);
|
|
1518
|
+
this._ += "A" + r + "," + r + ",0,0," + +(y01 * x20 > x01 * y20) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21);
|
|
1519
|
+
}
|
|
1520
|
+
},
|
|
1521
|
+
arc: function(x, y, r, a0, a1, ccw) {
|
|
1522
|
+
x = +x, y = +y, r = +r, ccw = !!ccw;
|
|
1523
|
+
var dx = r * Math.cos(a0), dy = r * Math.sin(a0), x0 = x + dx, y0 = y + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0;
|
|
1524
|
+
if (r < 0) throw new Error("negative radius: " + r);
|
|
1525
|
+
if (this._x1 === null) this._ += "M" + x0 + "," + y0;
|
|
1526
|
+
else if (Math.abs(this._x1 - x0) > epsilon$1 || Math.abs(this._y1 - y0) > epsilon$1) this._ += "L" + x0 + "," + y0;
|
|
1527
|
+
if (!r) return;
|
|
1528
|
+
if (da < 0) da = da % tau$1 + tau$1;
|
|
1529
|
+
if (da > tauEpsilon) this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0);
|
|
1530
|
+
else if (da > epsilon$1) this._ += "A" + r + "," + r + ",0," + +(da >= pi$1) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1));
|
|
1531
|
+
},
|
|
1532
|
+
rect: function(x, y, w, h) {
|
|
1533
|
+
this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + +w + "v" + +h + "h" + -w + "Z";
|
|
1534
|
+
},
|
|
1535
|
+
toString: function() {
|
|
1536
|
+
return this._;
|
|
1537
|
+
}
|
|
1538
|
+
};
|
|
1539
|
+
var path_default = path;
|
|
1540
|
+
|
|
1541
|
+
//#endregion
|
|
1542
|
+
//#region ../../node_modules/d3-shape/src/constant.js
|
|
1543
|
+
function constant_default(x) {
|
|
1544
|
+
return function constant() {
|
|
1545
|
+
return x;
|
|
1546
|
+
};
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
//#endregion
|
|
1550
|
+
//#region ../../node_modules/d3-shape/src/math.js
|
|
1551
|
+
var abs = Math.abs;
|
|
1552
|
+
var atan2 = Math.atan2;
|
|
1553
|
+
var cos = Math.cos;
|
|
1554
|
+
var max$1 = Math.max;
|
|
1555
|
+
var min = Math.min;
|
|
1556
|
+
var sin = Math.sin;
|
|
1557
|
+
var sqrt = Math.sqrt;
|
|
1558
|
+
var epsilon = 1e-12;
|
|
1559
|
+
var pi = Math.PI;
|
|
1560
|
+
var halfPi = pi / 2;
|
|
1561
|
+
var tau = 2 * pi;
|
|
1562
|
+
function acos(x) {
|
|
1563
|
+
return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);
|
|
1564
|
+
}
|
|
1565
|
+
function asin(x) {
|
|
1566
|
+
return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
//#endregion
|
|
1570
|
+
//#region ../../node_modules/d3-shape/src/arc.js
|
|
1571
|
+
function arcInnerRadius(d) {
|
|
1572
|
+
return d.innerRadius;
|
|
1573
|
+
}
|
|
1574
|
+
function arcOuterRadius(d) {
|
|
1575
|
+
return d.outerRadius;
|
|
1576
|
+
}
|
|
1577
|
+
function arcStartAngle(d) {
|
|
1578
|
+
return d.startAngle;
|
|
1579
|
+
}
|
|
1580
|
+
function arcEndAngle(d) {
|
|
1581
|
+
return d.endAngle;
|
|
1582
|
+
}
|
|
1583
|
+
function arcPadAngle(d) {
|
|
1584
|
+
return d && d.padAngle;
|
|
1585
|
+
}
|
|
1586
|
+
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
|
|
1587
|
+
var x10 = x1 - x0, y10 = y1 - y0, x32 = x3 - x2, y32 = y3 - y2, t = y32 * x10 - x32 * y10;
|
|
1588
|
+
if (t * t < 1e-12) return;
|
|
1589
|
+
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
|
|
1590
|
+
return [x0 + t * x10, y0 + t * y10];
|
|
1591
|
+
}
|
|
1592
|
+
function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
1593
|
+
var x01 = x0 - x1, y01 = y0 - y1, lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x11 = x0 + ox, y11 = y0 + oy, x10 = x1 + ox, y10 = y1 + oy, x00 = (x11 + x10) / 2, y00 = (y11 + y10) / 2, dx = x10 - x11, dy = y10 - y11, d2 = dx * dx + dy * dy, r = r1 - rc, D = x11 * y10 - x10 * y11, d = (dy < 0 ? -1 : 1) * sqrt(max$1(0, r * r * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x00, dy0 = cy0 - y00, dx1 = cx1 - x00, dy1 = cy1 - y00;
|
|
1594
|
+
if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
|
|
1595
|
+
return {
|
|
1596
|
+
cx: cx0,
|
|
1597
|
+
cy: cy0,
|
|
1598
|
+
x01: -ox,
|
|
1599
|
+
y01: -oy,
|
|
1600
|
+
x11: cx0 * (r1 / r - 1),
|
|
1601
|
+
y11: cy0 * (r1 / r - 1)
|
|
1602
|
+
};
|
|
1603
|
+
}
|
|
1604
|
+
function arc_default() {
|
|
1605
|
+
var innerRadius = arcInnerRadius, outerRadius = arcOuterRadius, cornerRadius = constant_default(0), padRadius = null, startAngle = arcStartAngle, endAngle = arcEndAngle, padAngle = arcPadAngle, context = null;
|
|
1606
|
+
function arc() {
|
|
1607
|
+
var buffer, r, r0 = +innerRadius.apply(this, arguments), r1 = +outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) - halfPi, a1 = endAngle.apply(this, arguments) - halfPi, da = abs(a1 - a0), cw = a1 > a0;
|
|
1608
|
+
if (!context) context = buffer = path_default();
|
|
1609
|
+
if (r1 < r0) r = r1, r1 = r0, r0 = r;
|
|
1610
|
+
if (!(r1 > 1e-12)) context.moveTo(0, 0);
|
|
1611
|
+
else if (da > tau - 1e-12) {
|
|
1612
|
+
context.moveTo(r1 * cos(a0), r1 * sin(a0));
|
|
1613
|
+
context.arc(0, 0, r1, a0, a1, !cw);
|
|
1614
|
+
if (r0 > 1e-12) {
|
|
1615
|
+
context.moveTo(r0 * cos(a1), r0 * sin(a1));
|
|
1616
|
+
context.arc(0, 0, r0, a1, a0, cw);
|
|
1617
|
+
}
|
|
1618
|
+
} else {
|
|
1619
|
+
var a01 = a0, a11 = a1, a00 = a0, a10 = a1, da0 = da, da1 = da, ap = padAngle.apply(this, arguments) / 2, rp = ap > 1e-12 && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)), rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), rc0 = rc, rc1 = rc, t0, t1;
|
|
1620
|
+
if (rp > 1e-12) {
|
|
1621
|
+
var p0 = asin(rp / r0 * sin(ap)), p1 = asin(rp / r1 * sin(ap));
|
|
1622
|
+
if ((da0 -= p0 * 2) > 1e-12) p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0;
|
|
1623
|
+
else da0 = 0, a00 = a10 = (a0 + a1) / 2;
|
|
1624
|
+
if ((da1 -= p1 * 2) > 1e-12) p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1;
|
|
1625
|
+
else da1 = 0, a01 = a11 = (a0 + a1) / 2;
|
|
1626
|
+
}
|
|
1627
|
+
var x01 = r1 * cos(a01), y01 = r1 * sin(a01), x10 = r0 * cos(a10), y10 = r0 * sin(a10);
|
|
1628
|
+
if (rc > 1e-12) {
|
|
1629
|
+
var x11 = r1 * cos(a11), y11 = r1 * sin(a11), x00 = r0 * cos(a00), y00 = r0 * sin(a00), oc;
|
|
1630
|
+
if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {
|
|
1631
|
+
var ax = x01 - oc[0], ay = y01 - oc[1], bx = x11 - oc[0], by = y11 - oc[1], kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2), lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
|
|
1632
|
+
rc0 = min(rc, (r0 - lc) / (kc - 1));
|
|
1633
|
+
rc1 = min(rc, (r1 - lc) / (kc + 1));
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
if (!(da1 > 1e-12)) context.moveTo(x01, y01);
|
|
1637
|
+
else if (rc1 > 1e-12) {
|
|
1638
|
+
t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
|
|
1639
|
+
t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
|
|
1640
|
+
context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
|
1641
|
+
if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
|
|
1642
|
+
else {
|
|
1643
|
+
context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
|
|
1644
|
+
context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
|
|
1645
|
+
context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
|
|
1646
|
+
}
|
|
1647
|
+
} else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
|
|
1648
|
+
if (!(r0 > 1e-12) || !(da0 > 1e-12)) context.lineTo(x10, y10);
|
|
1649
|
+
else if (rc0 > 1e-12) {
|
|
1650
|
+
t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
|
|
1651
|
+
t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
|
|
1652
|
+
context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
|
1653
|
+
if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
|
|
1654
|
+
else {
|
|
1655
|
+
context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
|
|
1656
|
+
context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);
|
|
1657
|
+
context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
|
|
1658
|
+
}
|
|
1659
|
+
} else context.arc(0, 0, r0, a10, a00, cw);
|
|
1660
|
+
}
|
|
1661
|
+
context.closePath();
|
|
1662
|
+
if (buffer) return context = null, buffer + "" || null;
|
|
1663
|
+
}
|
|
1664
|
+
arc.centroid = function() {
|
|
1665
|
+
var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;
|
|
1666
|
+
return [cos(a) * r, sin(a) * r];
|
|
1667
|
+
};
|
|
1668
|
+
arc.innerRadius = function(_) {
|
|
1669
|
+
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant_default(+_), arc) : innerRadius;
|
|
1670
|
+
};
|
|
1671
|
+
arc.outerRadius = function(_) {
|
|
1672
|
+
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant_default(+_), arc) : outerRadius;
|
|
1673
|
+
};
|
|
1674
|
+
arc.cornerRadius = function(_) {
|
|
1675
|
+
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant_default(+_), arc) : cornerRadius;
|
|
1676
|
+
};
|
|
1677
|
+
arc.padRadius = function(_) {
|
|
1678
|
+
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant_default(+_), arc) : padRadius;
|
|
1679
|
+
};
|
|
1680
|
+
arc.startAngle = function(_) {
|
|
1681
|
+
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant_default(+_), arc) : startAngle;
|
|
1682
|
+
};
|
|
1683
|
+
arc.endAngle = function(_) {
|
|
1684
|
+
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant_default(+_), arc) : endAngle;
|
|
1685
|
+
};
|
|
1686
|
+
arc.padAngle = function(_) {
|
|
1687
|
+
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant_default(+_), arc) : padAngle;
|
|
1688
|
+
};
|
|
1689
|
+
arc.context = function(_) {
|
|
1690
|
+
return arguments.length ? (context = _ == null ? null : _, arc) : context;
|
|
1691
|
+
};
|
|
1692
|
+
return arc;
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
//#endregion
|
|
1696
|
+
//#region src/SunburstPartition.ts
|
|
1697
|
+
var SunburstPartition = class extends SVGWidget {
|
|
1698
|
+
svg;
|
|
1699
|
+
radius;
|
|
1700
|
+
_xScale;
|
|
1701
|
+
_yScale;
|
|
1702
|
+
partition;
|
|
1703
|
+
arc;
|
|
1704
|
+
_resetRoot;
|
|
1705
|
+
constructor() {
|
|
1706
|
+
super();
|
|
1707
|
+
ITree.call(this);
|
|
1708
|
+
}
|
|
1709
|
+
data(_) {
|
|
1710
|
+
const retVal = SVGWidget.prototype.data.apply(this, arguments);
|
|
1711
|
+
if (arguments.length) this._resetRoot = true;
|
|
1712
|
+
return retVal;
|
|
1713
|
+
}
|
|
1714
|
+
enter(_domNode, element) {
|
|
1715
|
+
const context = this;
|
|
1716
|
+
this.radius = Math.min(this.width(), this.height()) / 2;
|
|
1717
|
+
this._xScale = scaleLinear().range([0, 2 * Math.PI]);
|
|
1718
|
+
this._yScale = scaleSqrt().range([0, this.radius]);
|
|
1719
|
+
this.partition = partition_default();
|
|
1720
|
+
this.arc = arc_default().startAngle(function(d) {
|
|
1721
|
+
return Math.max(0, Math.min(2 * Math.PI, context._xScale(d.x0)));
|
|
1722
|
+
}).endAngle(function(d) {
|
|
1723
|
+
return Math.max(0, Math.min(2 * Math.PI, context._xScale(d.x1)));
|
|
1724
|
+
}).innerRadius(function(d) {
|
|
1725
|
+
return Math.max(0, context._yScale(d.y0));
|
|
1726
|
+
}).outerRadius(function(d) {
|
|
1727
|
+
return Math.max(0, context._yScale(d.y1));
|
|
1728
|
+
});
|
|
1729
|
+
this.svg = element.append("g");
|
|
1730
|
+
}
|
|
1731
|
+
update(_domNode, _element) {
|
|
1732
|
+
const context = this;
|
|
1733
|
+
this._palette = this._palette.switch(this.paletteID());
|
|
1734
|
+
if (this.useClonedPalette()) this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id());
|
|
1735
|
+
this.radius = Math.min(this.width(), this.height()) / 2;
|
|
1736
|
+
this._yScale.range([0, this.radius]);
|
|
1737
|
+
const root = hierarchy(this.data()).sum(function(d) {
|
|
1738
|
+
return d.size !== void 0 ? d.size : 1;
|
|
1739
|
+
});
|
|
1740
|
+
const paths = this.svg.selectAll("path").data(this.partition(root).descendants(), function(d, i) {
|
|
1741
|
+
return d.data.label !== void 0 ? d.data.label : i;
|
|
1742
|
+
});
|
|
1743
|
+
paths.enter().append("path").on("click", function(d) {
|
|
1744
|
+
context.click(d.data, null, null);
|
|
1745
|
+
}).on("dblclick", function(d) {
|
|
1746
|
+
const event = d3Event();
|
|
1747
|
+
if (event) event.stopPropagation();
|
|
1748
|
+
context.zoomTo(d);
|
|
1749
|
+
}).each(function() {
|
|
1750
|
+
select(this).append("title");
|
|
1751
|
+
}).merge(paths).attr("d", this.arc).style("fill", function(d) {
|
|
1752
|
+
return d.data.__viz_fill ? d.data.__viz_fill : context._palette(d.data.label);
|
|
1753
|
+
}).style("stroke", function(d) {
|
|
1754
|
+
return d.value > 16 ? "white" : "none";
|
|
1755
|
+
}).select("title").text(function(d) {
|
|
1756
|
+
return d.data.label;
|
|
1757
|
+
});
|
|
1758
|
+
paths.exit().remove();
|
|
1759
|
+
if (this._resetRoot) {
|
|
1760
|
+
this._resetRoot = false;
|
|
1761
|
+
this.zoomTo(root);
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
zoomTo(d) {
|
|
1765
|
+
const context = this;
|
|
1766
|
+
this.svg.transition().duration(750).tween("scale", function() {
|
|
1767
|
+
const xd = interpolate(context._xScale.domain(), [d.x0, d.x1]);
|
|
1768
|
+
const yd = interpolate(context._yScale.domain(), [d.y0, 1]);
|
|
1769
|
+
const yr = interpolate(context._yScale.range(), [d.y0 ? 20 : 0, context.radius]);
|
|
1770
|
+
return function(t) {
|
|
1771
|
+
context._xScale.domain(xd(t));
|
|
1772
|
+
context._yScale.domain(yd(t)).range(yr(t));
|
|
1773
|
+
};
|
|
1774
|
+
}).selectAll("path").attrTween("d", function(d2) {
|
|
1775
|
+
return function() {
|
|
1776
|
+
return context.arc(d2);
|
|
1777
|
+
};
|
|
1778
|
+
});
|
|
1779
|
+
}
|
|
1780
|
+
};
|
|
1781
|
+
SunburstPartition.prototype._class += " tree_SunburstPartition";
|
|
1782
|
+
SunburstPartition.prototype.implements(ITree.prototype);
|
|
1783
|
+
SunburstPartition.prototype.publish("paletteID", "default", "set", "Color palette for this widget", SunburstPartition.prototype._palette.switch(), { tags: ["Basic", "Shared"] });
|
|
1784
|
+
SunburstPartition.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] });
|
|
1785
|
+
|
|
1786
|
+
//#endregion
|
|
1787
|
+
//#region src/Treemap.ts
|
|
1788
|
+
var TreemapColumn = class extends PropertyExt {
|
|
1789
|
+
_owner;
|
|
1790
|
+
constructor() {
|
|
1791
|
+
super();
|
|
1792
|
+
}
|
|
1793
|
+
owner(_) {
|
|
1794
|
+
if (!arguments.length) return this._owner;
|
|
1795
|
+
this._owner = _;
|
|
1796
|
+
return this;
|
|
1797
|
+
}
|
|
1798
|
+
valid() {
|
|
1799
|
+
return !!this.column();
|
|
1800
|
+
}
|
|
1801
|
+
column;
|
|
1802
|
+
};
|
|
1803
|
+
TreemapColumn.prototype._class += " tree_Dendrogram.TreemapColumn";
|
|
1804
|
+
TreemapColumn.prototype.publish("column", null, "set", "Field", function() {
|
|
1805
|
+
return this._owner ? this._owner.columns() : [];
|
|
1806
|
+
}, { optional: true });
|
|
1807
|
+
var Treemap = class extends HTMLWidget {
|
|
1808
|
+
Column;
|
|
1809
|
+
_d3Treemap;
|
|
1810
|
+
_elementDIV;
|
|
1811
|
+
_selection;
|
|
1812
|
+
constructor() {
|
|
1813
|
+
super();
|
|
1814
|
+
ITree.call(this);
|
|
1815
|
+
Utility.SimpleSelectionMixin.call(this, true);
|
|
1816
|
+
}
|
|
1817
|
+
getTilingMethod() {
|
|
1818
|
+
switch (this.tilingMethod()) {
|
|
1819
|
+
case "treemapBinary": return binary_default;
|
|
1820
|
+
case "treemapDice": return dice_default;
|
|
1821
|
+
case "treemapSlice": return slice_default;
|
|
1822
|
+
case "treemapSliceDice": return sliceDice_default;
|
|
1823
|
+
case "treemapResquarify": return resquarify_default;
|
|
1824
|
+
case "treemapSquarify":
|
|
1825
|
+
default: return squarify_default;
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
treemapData() {
|
|
1829
|
+
if (!this.mappings().filter((mapping) => mapping.valid()).length) return this.data();
|
|
1830
|
+
return formatData({
|
|
1831
|
+
key: "root",
|
|
1832
|
+
values: this._db.aggregateView(this.mappings().map(function(mapping) {
|
|
1833
|
+
return mapping.column();
|
|
1834
|
+
}), this.aggrType(), this.aggrColumn()).entries()
|
|
1835
|
+
});
|
|
1836
|
+
function formatData(node) {
|
|
1837
|
+
if (node.values instanceof Array) {
|
|
1838
|
+
const children = node.values.filter(function(value) {
|
|
1839
|
+
return !(value instanceof Array);
|
|
1840
|
+
}).map(function(value) {
|
|
1841
|
+
return formatData(value);
|
|
1842
|
+
});
|
|
1843
|
+
const retVal2 = { label: node.key };
|
|
1844
|
+
if (children.length) retVal2.children = children;
|
|
1845
|
+
else retVal2.size = 22;
|
|
1846
|
+
return retVal2;
|
|
1847
|
+
}
|
|
1848
|
+
return {
|
|
1849
|
+
label: node.key,
|
|
1850
|
+
size: node.values.aggregate,
|
|
1851
|
+
origRows: node.values
|
|
1852
|
+
};
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
enter(domNode, element) {
|
|
1856
|
+
super.enter(domNode, element);
|
|
1857
|
+
this._d3Treemap = treemap_default();
|
|
1858
|
+
this._elementDIV = element.append("div");
|
|
1859
|
+
this._selection.widgetElement(this._elementDIV);
|
|
1860
|
+
}
|
|
1861
|
+
update(domNode, element) {
|
|
1862
|
+
super.update(domNode, element);
|
|
1863
|
+
const context = this;
|
|
1864
|
+
this._palette = this._palette.switch(this.paletteID());
|
|
1865
|
+
if (this.useClonedPalette()) this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id());
|
|
1866
|
+
const root = hierarchy(this.treemapData()).sum(this.nodeWeight);
|
|
1867
|
+
this._d3Treemap.size([this.width(), this.height()]).paddingInner(this.paddingInner()).paddingOuter(this.paddingOuter()).paddingTop(this.paddingTop());
|
|
1868
|
+
if (["treemapSquarify", "treemapResquarify"].indexOf(this.tilingMethod()) !== -1) this._d3Treemap.tile(this.getTilingMethod()["ratio"](this.squarifyRatio()));
|
|
1869
|
+
else this._d3Treemap.tile(this.getTilingMethod());
|
|
1870
|
+
this._d3Treemap(root);
|
|
1871
|
+
this._elementDIV.style("font-size", this.fontSize_exists() ? this.fontSize() + "px" : null).style("line-height", this.fontSize_exists() ? this.fontSize() + 2 + "px" : null);
|
|
1872
|
+
const node = this._elementDIV.selectAll(".node").data(root.descendants());
|
|
1873
|
+
node.enter().append("div").attr("class", "node").call(this._selection.enter.bind(this._selection)).on("click", function(d) {
|
|
1874
|
+
if (d) {
|
|
1875
|
+
let columnLabel = "";
|
|
1876
|
+
context.mappings().forEach(function(mapping) {
|
|
1877
|
+
if (mapping.column()) columnLabel = mapping.column();
|
|
1878
|
+
});
|
|
1879
|
+
if (d.origRows) context.click(context.rowToObj(d.origRows[0]), columnLabel, context._selection.selected(this));
|
|
1880
|
+
else context.click(d.data, columnLabel, context._selection.selected(this));
|
|
1881
|
+
}
|
|
1882
|
+
}).on("dblclick", function(d) {
|
|
1883
|
+
if (d) {
|
|
1884
|
+
let columnLabel = "";
|
|
1885
|
+
context.mappings().forEach(function(mapping) {
|
|
1886
|
+
if (mapping.column()) columnLabel = mapping.column();
|
|
1887
|
+
});
|
|
1888
|
+
if (d.origRows) context.dblclick(context.rowToObj(d.origRows[0]), columnLabel, context._selection.selected(this));
|
|
1889
|
+
else context.dblclick(d.data, columnLabel, context._selection.selected(this));
|
|
1890
|
+
}
|
|
1891
|
+
}).merge(node).style("left", function(d) {
|
|
1892
|
+
return d.x0 + Math.max(0, d.x1 - d.x0) / 2 + "px";
|
|
1893
|
+
}).style("top", function(d) {
|
|
1894
|
+
return d.y0 + Math.max(0, d.y1 - d.y0) / 2 + "px";
|
|
1895
|
+
}).style("width", function() {
|
|
1896
|
+
return "0px";
|
|
1897
|
+
}).style("height", function() {
|
|
1898
|
+
return "0px";
|
|
1899
|
+
}).style("font-size", function(d) {
|
|
1900
|
+
return (d.children ? context.parentFontSize() : context.leafFontSize()) + "px";
|
|
1901
|
+
}).style("line-height", function(d) {
|
|
1902
|
+
return (d.children ? context.parentFontSize() : context.leafFontSize()) + "px";
|
|
1903
|
+
}).attr("title", tooltip).html(function(d) {
|
|
1904
|
+
if (!context.showRoot() && d.depth === 0) return null;
|
|
1905
|
+
if (d.children) if (context.enableParentLabels()) return context.parentWeightHTML(d);
|
|
1906
|
+
else return null;
|
|
1907
|
+
else return context.leafWeightHTML(d);
|
|
1908
|
+
}).style("background", function(d) {
|
|
1909
|
+
if (!context.showRoot() && d.depth === 0) {
|
|
1910
|
+
this.style.color = "transparent";
|
|
1911
|
+
return "transparent";
|
|
1912
|
+
}
|
|
1913
|
+
const light_dark = context.brighterLeafNodes() ? "brighter" : "darker";
|
|
1914
|
+
let _color;
|
|
1915
|
+
if (context.usePaletteOnParentNodes()) _color = d.children ? context._palette(d.data.label) : rgb(context._palette(d.parent.data.label))[light_dark](1);
|
|
1916
|
+
else {
|
|
1917
|
+
if (d.depth > context.depthColorLimit()) _color = rgb(d.parent.color)[light_dark](1);
|
|
1918
|
+
else _color = context._palette(d.data.label);
|
|
1919
|
+
d.color = _color;
|
|
1920
|
+
}
|
|
1921
|
+
this.style.color = Palette.textColor(_color);
|
|
1922
|
+
return _color;
|
|
1923
|
+
}).transition().duration(this.transitionDuration()).style("pointer-events", function(d) {
|
|
1924
|
+
return !context.showRoot() && d.depth === 0 ? "none" : "all";
|
|
1925
|
+
}).style("opacity", function(d) {
|
|
1926
|
+
return d.children ? 1 : null;
|
|
1927
|
+
}).style("left", function(d) {
|
|
1928
|
+
return d.x0 + "px";
|
|
1929
|
+
}).style("top", function(d) {
|
|
1930
|
+
return d.y0 + "px";
|
|
1931
|
+
}).style("width", function(d) {
|
|
1932
|
+
return Math.max(0, d.x1 - d.x0) + "px";
|
|
1933
|
+
}).style("height", function(d) {
|
|
1934
|
+
return Math.max(0, d.y1 - d.y0) + "px";
|
|
1935
|
+
}).each(function(d) {
|
|
1936
|
+
if (d.depth === 0) {
|
|
1937
|
+
this.style.color = !context.showRoot() ? "transparent" : "";
|
|
1938
|
+
this.style.borderColor = !context.showRoot() ? "transparent" : "";
|
|
1939
|
+
}
|
|
1940
|
+
});
|
|
1941
|
+
node.exit().transition().duration(this.transitionDuration()).style("opacity", 0).remove();
|
|
1942
|
+
function tooltip(d) {
|
|
1943
|
+
if (d.children && !context.enableParentTooltips()) return null;
|
|
1944
|
+
let retVal = d.data.label + " (" + d.value + ")";
|
|
1945
|
+
while (d.parent && d.parent.parent) {
|
|
1946
|
+
retVal = d.parent.data.label + " -> " + retVal;
|
|
1947
|
+
d = d.parent;
|
|
1948
|
+
}
|
|
1949
|
+
return retVal;
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
exit(domNode, element) {
|
|
1953
|
+
super.exit(domNode, element);
|
|
1954
|
+
}
|
|
1955
|
+
nodeWeight(d) {
|
|
1956
|
+
return d.size || 1;
|
|
1957
|
+
}
|
|
1958
|
+
parentWeightHTML(d) {
|
|
1959
|
+
return this.showParentWeight() ? `<span class="treemap-parent-label">${d.data.label}</span><span class="treemap-parent-value">${d.value}${this.weightSuffix()}</span>` : `<span class="treemap-parent-label">${d.data.label}</span>`;
|
|
1960
|
+
}
|
|
1961
|
+
leafWeightHTML(d) {
|
|
1962
|
+
return this.showLeafWeight() ? `<span class="treemap-leaf-label">${d.data.label}</span><span class="treemap-leaf-value">${d.value}${this.weightSuffix()}</span>` : `<span class="treemap-leaf-label">${d.data.label}</span>`;
|
|
1963
|
+
}
|
|
1964
|
+
};
|
|
1965
|
+
Treemap.prototype._class += " tree_Treemap";
|
|
1966
|
+
Treemap.prototype.implements(ITree.prototype);
|
|
1967
|
+
Treemap.prototype.mixin(Utility.SimpleSelectionMixin);
|
|
1968
|
+
Treemap.prototype.Column = TreemapColumn;
|
|
1969
|
+
Treemap.prototype.publish("paletteID", "default", "set", "Color palette for this widget", Treemap.prototype._palette.switch(), { tags: ["Basic", "Shared"] });
|
|
1970
|
+
Treemap.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] });
|
|
1971
|
+
Treemap.prototype.publish("mappings", [], "propertyArray", "Source Columns", null, { autoExpand: TreemapColumn });
|
|
1972
|
+
Treemap.prototype.publish("aggrType", null, "set", "Aggregation Type", [
|
|
1973
|
+
null,
|
|
1974
|
+
"mean",
|
|
1975
|
+
"median",
|
|
1976
|
+
"sum",
|
|
1977
|
+
"min",
|
|
1978
|
+
"max"
|
|
1979
|
+
], { optional: true });
|
|
1980
|
+
Treemap.prototype.publish("aggrColumn", null, "set", "Aggregation Field", function() {
|
|
1981
|
+
return this.columns();
|
|
1982
|
+
}, {
|
|
1983
|
+
optional: true,
|
|
1984
|
+
disable: (w) => !w.aggrType()
|
|
1985
|
+
});
|
|
1986
|
+
Treemap.prototype.publish("fontSize", null, "number", "Font Size", null, { optional: true });
|
|
1987
|
+
Treemap.prototype.publish("paddingInner", 18.6, "number", "Pixel spacing between each sibling node");
|
|
1988
|
+
Treemap.prototype.publish("paddingOuter", 30, "number", "Pixel padding of parent nodes");
|
|
1989
|
+
Treemap.prototype.publish("paddingTop", 41.4, "number", "Additional top pixel padding of parent nodes");
|
|
1990
|
+
Treemap.prototype.publish("showRoot", false, "boolean", "Show root element");
|
|
1991
|
+
Treemap.prototype.publish("parentFontSize", 18, "number", "Parent font-size");
|
|
1992
|
+
Treemap.prototype.publish("leafFontSize", 16, "number", "Leaf font-size");
|
|
1993
|
+
Treemap.prototype.publish("usePaletteOnParentNodes", false, "boolean", "Assign a color from the palette to every parent node");
|
|
1994
|
+
Treemap.prototype.publish("depthColorLimit", 1, "number", "Assign a color from the palette to node with depth lower than this value", null, {
|
|
1995
|
+
optional: true,
|
|
1996
|
+
disable: (w) => w.usePaletteOnParentNodes()
|
|
1997
|
+
});
|
|
1998
|
+
Treemap.prototype.publish("squarifyRatio", 1, "number", "Specifies the desired aspect ratio of the generated rectangles (must be >= 1)", null, {
|
|
1999
|
+
optional: true,
|
|
2000
|
+
disable: (w) => ["treemapSquarify", "treemapResquarify"].indexOf(w.tilingMethod()) === -1
|
|
2001
|
+
});
|
|
2002
|
+
Treemap.prototype.publish("showParentWeight", true, "boolean", "Show weight of parent nodes");
|
|
2003
|
+
Treemap.prototype.publish("showLeafWeight", true, "boolean", "Show weight of leaf nodes");
|
|
2004
|
+
Treemap.prototype.publish("weightSuffix", "", "string", "Weight suffix (ex: 'ms')");
|
|
2005
|
+
Treemap.prototype.publish("brighterLeafNodes", false, "boolean", "Brighter/darker leaf node color (false = darker)");
|
|
2006
|
+
Treemap.prototype.publish("enableParentLabels", true, "boolean", "Enable parent labels");
|
|
2007
|
+
Treemap.prototype.publish("enableParentTooltips", true, "boolean", "Enable parent tooltips");
|
|
2008
|
+
Treemap.prototype.publish("transitionDuration", 250, "number", "Transition Duration");
|
|
2009
|
+
Treemap.prototype.publish("tilingMethod", "treemapSquarify", "set", "Transition Duration", [
|
|
2010
|
+
"treemapBinary",
|
|
2011
|
+
"treemapDice",
|
|
2012
|
+
"treemapResquarify",
|
|
2013
|
+
"treemapSlice",
|
|
2014
|
+
"treemapSliceDice",
|
|
2015
|
+
"treemapSquarify"
|
|
2016
|
+
]);
|
|
2017
|
+
|
|
2018
|
+
//#endregion
|
|
2019
|
+
export { BUILD_VERSION, CirclePacking, Dendrogram, DendrogramColumn, DirectoryTree, Indented, IndentedColumn, PKG_NAME, PKG_VERSION, SunburstPartition, Treemap, TreemapColumn };
|
|
2020
|
+
//# sourceMappingURL=index.js.map!function(){try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".tree_CirclePacking circle{fill:#1f77b4;fill-opacity:.25;stroke:#1f77b4;stroke-width:1px}.tree_CirclePacking .leaf circle{fill:#ff7f0e;fill-opacity:1}.tree_CirclePacking .label{fill:#fff;text-anchor:middle}.tree_Dendrogram .node circle{fill:#dcf1ff;stroke:#1f77b4;stroke-width:1px}.tree_Dendrogram .node.selected circle{stroke:red}.tree_Dendrogram .node.over circle{stroke:orange}.tree_Dendrogram .node.selected.over circle{stroke:red}.tree_Dendrogram .node.selected text{fill:red}.tree_Dendrogram .node.over text{fill:orange}.tree_Dendrogram .node.selected.over text{fill:red}.tree_Dendrogram .node text{font-size:14px}.tree_Dendrogram .link{fill:none;stroke:#656565;stroke-width:1px}.tree_Indented .node rect{cursor:pointer;fill:#fff;stroke:#3182bd;stroke-width:1px}.tree_Indented .node text{pointer-events:none;font:10px sans-serif}.tree_Indented path.link{fill:none;stroke:#9ecae1;stroke-width:1.5px}.tree_Sunburst path{stroke:#fff;stroke-width:.5px;fill-rule:evenodd}.tree_Treemap *{box-sizing:border-box}.tree_Treemap .node{text-overflow:ellipsis;border:1px solid #333;position:absolute;overflow:hidden}.tree_Treemap .node.selected{border-color:red}.tree_Treemap .node.over{border-color:orange}.tree_Treemap .node.selected.over{border-color:red}.tree_Treemap .node>span.treemap-parent-label{margin:4px 4px 0;font-weight:700;display:inline-block}.tree_Treemap .node>span.treemap-parent-value{margin:4px 0 0;font-style:italic;font-weight:400}.tree_Treemap .node>span.treemap-singleton-label{margin:4px 0 0 4px;font-weight:400;display:block}.tree_Treemap .node>span.treemap-singleton-value{margin:0 0 0 4px;font-style:italic;display:block}\n/*$vite$:1*/")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}}();
|