@things-factory/integration-ui 6.1.106 → 6.1.108

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.
@@ -8,10 +8,6 @@ export class GraphViewer {
8
8
  arrowSize: 4,
9
9
  colors: this.colors(),
10
10
  highlight: undefined,
11
- iconMap: this.fontAwesomeIcons(),
12
- icons: undefined,
13
- imageMap: {},
14
- images: undefined,
15
11
  infoPanel: true,
16
12
  minCollision: undefined,
17
13
  graphData: undefined,
@@ -135,7 +131,7 @@ export class GraphViewer {
135
131
  }
136
132
  })
137
133
  .on('dblclick', (event, d) => {
138
- this.stickNode(d, event);
134
+ this.stickNode(event, d);
139
135
  if (typeof this.options.onNodeDoubleClick === 'function') {
140
136
  this.options.onNodeDoubleClick(d);
141
137
  }
@@ -176,7 +172,7 @@ export class GraphViewer {
176
172
  return n;
177
173
  }
178
174
  appendOutlineToNode(node) {
179
- return node
175
+ const outline = node
180
176
  .append('circle')
181
177
  .attr('class', 'outline')
182
178
  .attr('r', this.options.nodeRadius)
@@ -192,6 +188,15 @@ export class GraphViewer {
192
188
  .text(d => {
193
189
  return this.toString(d);
194
190
  });
191
+ node
192
+ .append('text')
193
+ .attr('class', 'node-text')
194
+ .attr('x', 0)
195
+ .attr('y', 52)
196
+ .attr('text-anchor', 'middle') // 텍스트 중앙 정렬
197
+ .attr('fill', 'black') // 텍스트 색상을 검은색으로 변경
198
+ .text(d => d.text);
199
+ return outline;
195
200
  }
196
201
  appendBoxToNode(node) {
197
202
  const rect = node
@@ -236,26 +241,15 @@ export class GraphViewer {
236
241
  appendTextToNode(node) {
237
242
  return node
238
243
  .append('text')
239
- .attr('class', d => {
240
- return 'text' + (this.icon(d) ? ' icon' : '');
241
- })
242
244
  .attr('fill', '#ffffff')
243
- .attr('font-size', d => {
244
- return this.icon(d) ? this.options.nodeRadius + 'px' : '10px';
245
- })
246
245
  .attr('pointer-events', 'none')
247
246
  .attr('text-anchor', 'middle')
248
- .attr('y', d => {
249
- return this.icon(d) ? Math.round(this.options.nodeRadius * 0.32) + 'px' : '4px';
250
- })
251
- .html(d => {
252
- var _icon = this.icon(d);
253
- return _icon ? '&#x' + _icon : d.text;
254
- });
255
- }
256
- appendRandomDataToNode(d, maxNodesToGenerate) {
257
- var data = this.randomD3Data(d, maxNodesToGenerate);
258
- this.updateWithGraphData(data);
247
+ .attr('y', '24px')
248
+ .attr('font-family', 'Material Icons')
249
+ .attr('font-size', '48px')
250
+ .attr('text-anchor', 'middle')
251
+ .attr('alignment-baseline', 'middle')
252
+ .text(d => this.icon(d));
259
253
  }
260
254
  appendRelationship() {
261
255
  return this.relationship
@@ -358,7 +352,7 @@ export class GraphViewer {
358
352
  defaultDarkenColor() {
359
353
  return d3.rgb(this.options.colors[this.options.colors.length - 1]).darker(1);
360
354
  }
361
- dragEnded(d, event) {
355
+ dragEnded(event, d) {
362
356
  if (!event.active) {
363
357
  this.simulation.alphaTarget(0);
364
358
  }
@@ -366,10 +360,10 @@ export class GraphViewer {
366
360
  this.options.onNodeDragEnd(d);
367
361
  }
368
362
  }
369
- dragged(d, event) {
370
- this.stickNode(d, event);
363
+ dragged(event, d) {
364
+ this.stickNode(event, d);
371
365
  }
372
- dragStarted(d, event) {
366
+ dragStarted(event, d) {
373
367
  if (!event.active) {
374
368
  this.simulation.alphaTarget(0.3).restart();
375
369
  }
@@ -385,658 +379,8 @@ export class GraphViewer {
385
379
  this.merge(obj, obj2);
386
380
  return obj;
387
381
  }
388
- fontAwesomeIcons() {
389
- return {
390
- glass: 'f000',
391
- music: 'f001',
392
- search: 'f002',
393
- 'envelope-o': 'f003',
394
- heart: 'f004',
395
- star: 'f005',
396
- 'star-o': 'f006',
397
- user: 'f007',
398
- film: 'f008',
399
- 'th-large': 'f009',
400
- th: 'f00a',
401
- 'th-list': 'f00b',
402
- check: 'f00c',
403
- 'remove,close,times': 'f00d',
404
- 'search-plus': 'f00e',
405
- 'search-minus': 'f010',
406
- 'power-off': 'f011',
407
- signal: 'f012',
408
- 'gear,cog': 'f013',
409
- 'trash-o': 'f014',
410
- home: 'f015',
411
- 'file-o': 'f016',
412
- 'clock-o': 'f017',
413
- road: 'f018',
414
- download: 'f019',
415
- 'arrow-circle-o-down': 'f01a',
416
- 'arrow-circle-o-up': 'f01b',
417
- inbox: 'f01c',
418
- 'play-circle-o': 'f01d',
419
- 'rotate-right,repeat': 'f01e',
420
- refresh: 'f021',
421
- 'list-alt': 'f022',
422
- lock: 'f023',
423
- flag: 'f024',
424
- headphones: 'f025',
425
- 'volume-off': 'f026',
426
- 'volume-down': 'f027',
427
- 'volume-up': 'f028',
428
- qrcode: 'f029',
429
- barcode: 'f02a',
430
- tag: 'f02b',
431
- tags: 'f02c',
432
- book: 'f02d',
433
- bookmark: 'f02e',
434
- print: 'f02f',
435
- camera: 'f030',
436
- font: 'f031',
437
- bold: 'f032',
438
- italic: 'f033',
439
- 'text-height': 'f034',
440
- 'text-width': 'f035',
441
- 'align-left': 'f036',
442
- 'align-center': 'f037',
443
- 'align-right': 'f038',
444
- 'align-justify': 'f039',
445
- list: 'f03a',
446
- 'dedent,outdent': 'f03b',
447
- indent: 'f03c',
448
- 'video-camera': 'f03d',
449
- 'photo,image,picture-o': 'f03e',
450
- pencil: 'f040',
451
- 'map-marker': 'f041',
452
- adjust: 'f042',
453
- tint: 'f043',
454
- 'edit,pencil-square-o': 'f044',
455
- 'share-square-o': 'f045',
456
- 'check-square-o': 'f046',
457
- arrows: 'f047',
458
- 'step-backward': 'f048',
459
- 'fast-backward': 'f049',
460
- backward: 'f04a',
461
- play: 'f04b',
462
- pause: 'f04c',
463
- stop: 'f04d',
464
- forward: 'f04e',
465
- 'fast-forward': 'f050',
466
- 'step-forward': 'f051',
467
- eject: 'f052',
468
- 'chevron-left': 'f053',
469
- 'chevron-right': 'f054',
470
- 'plus-circle': 'f055',
471
- 'minus-circle': 'f056',
472
- 'times-circle': 'f057',
473
- 'check-circle': 'f058',
474
- 'question-circle': 'f059',
475
- 'info-circle': 'f05a',
476
- crosshairs: 'f05b',
477
- 'times-circle-o': 'f05c',
478
- 'check-circle-o': 'f05d',
479
- ban: 'f05e',
480
- 'arrow-left': 'f060',
481
- 'arrow-right': 'f061',
482
- 'arrow-up': 'f062',
483
- 'arrow-down': 'f063',
484
- 'mail-forward,share': 'f064',
485
- expand: 'f065',
486
- compress: 'f066',
487
- plus: 'f067',
488
- minus: 'f068',
489
- asterisk: 'f069',
490
- 'exclamation-circle': 'f06a',
491
- gift: 'f06b',
492
- leaf: 'f06c',
493
- fire: 'f06d',
494
- eye: 'f06e',
495
- 'eye-slash': 'f070',
496
- 'warning,exclamation-triangle': 'f071',
497
- plane: 'f072',
498
- calendar: 'f073',
499
- random: 'f074',
500
- comment: 'f075',
501
- magnet: 'f076',
502
- 'chevron-up': 'f077',
503
- 'chevron-down': 'f078',
504
- retweet: 'f079',
505
- 'shopping-cart': 'f07a',
506
- folder: 'f07b',
507
- 'folder-open': 'f07c',
508
- 'arrows-v': 'f07d',
509
- 'arrows-h': 'f07e',
510
- 'bar-chart-o,bar-chart': 'f080',
511
- 'twitter-square': 'f081',
512
- 'facebook-square': 'f082',
513
- 'camera-retro': 'f083',
514
- key: 'f084',
515
- 'gears,cogs': 'f085',
516
- comments: 'f086',
517
- 'thumbs-o-up': 'f087',
518
- 'thumbs-o-down': 'f088',
519
- 'star-half': 'f089',
520
- 'heart-o': 'f08a',
521
- 'sign-out': 'f08b',
522
- 'linkedin-square': 'f08c',
523
- 'thumb-tack': 'f08d',
524
- 'external-link': 'f08e',
525
- 'sign-in': 'f090',
526
- trophy: 'f091',
527
- 'github-square': 'f092',
528
- upload: 'f093',
529
- 'lemon-o': 'f094',
530
- phone: 'f095',
531
- 'square-o': 'f096',
532
- 'bookmark-o': 'f097',
533
- 'phone-square': 'f098',
534
- twitter: 'f099',
535
- 'facebook-f,facebook': 'f09a',
536
- github: 'f09b',
537
- unlock: 'f09c',
538
- 'credit-card': 'f09d',
539
- 'feed,rss': 'f09e',
540
- 'hdd-o': 'f0a0',
541
- bullhorn: 'f0a1',
542
- bell: 'f0f3',
543
- certificate: 'f0a3',
544
- 'hand-o-right': 'f0a4',
545
- 'hand-o-left': 'f0a5',
546
- 'hand-o-up': 'f0a6',
547
- 'hand-o-down': 'f0a7',
548
- 'arrow-circle-left': 'f0a8',
549
- 'arrow-circle-right': 'f0a9',
550
- 'arrow-circle-up': 'f0aa',
551
- 'arrow-circle-down': 'f0ab',
552
- globe: 'f0ac',
553
- wrench: 'f0ad',
554
- tasks: 'f0ae',
555
- filter: 'f0b0',
556
- briefcase: 'f0b1',
557
- 'arrows-alt': 'f0b2',
558
- 'group,users': 'f0c0',
559
- 'chain,link': 'f0c1',
560
- cloud: 'f0c2',
561
- flask: 'f0c3',
562
- 'cut,scissors': 'f0c4',
563
- 'copy,files-o': 'f0c5',
564
- paperclip: 'f0c6',
565
- 'save,floppy-o': 'f0c7',
566
- square: 'f0c8',
567
- 'navicon,reorder,bars': 'f0c9',
568
- 'list-ul': 'f0ca',
569
- 'list-ol': 'f0cb',
570
- strikethrough: 'f0cc',
571
- underline: 'f0cd',
572
- table: 'f0ce',
573
- magic: 'f0d0',
574
- truck: 'f0d1',
575
- pinterest: 'f0d2',
576
- 'pinterest-square': 'f0d3',
577
- 'google-plus-square': 'f0d4',
578
- 'google-plus': 'f0d5',
579
- money: 'f0d6',
580
- 'caret-down': 'f0d7',
581
- 'caret-up': 'f0d8',
582
- 'caret-left': 'f0d9',
583
- 'caret-right': 'f0da',
584
- columns: 'f0db',
585
- 'unsorted,sort': 'f0dc',
586
- 'sort-down,sort-desc': 'f0dd',
587
- 'sort-up,sort-asc': 'f0de',
588
- envelope: 'f0e0',
589
- linkedin: 'f0e1',
590
- 'rotate-left,undo': 'f0e2',
591
- 'legal,gavel': 'f0e3',
592
- 'dashboard,tachometer': 'f0e4',
593
- 'comment-o': 'f0e5',
594
- 'comments-o': 'f0e6',
595
- 'flash,bolt': 'f0e7',
596
- sitemap: 'f0e8',
597
- umbrella: 'f0e9',
598
- 'paste,clipboard': 'f0ea',
599
- 'lightbulb-o': 'f0eb',
600
- exchange: 'f0ec',
601
- 'cloud-download': 'f0ed',
602
- 'cloud-upload': 'f0ee',
603
- 'user-md': 'f0f0',
604
- stethoscope: 'f0f1',
605
- suitcase: 'f0f2',
606
- 'bell-o': 'f0a2',
607
- coffee: 'f0f4',
608
- cutlery: 'f0f5',
609
- 'file-text-o': 'f0f6',
610
- 'building-o': 'f0f7',
611
- 'hospital-o': 'f0f8',
612
- ambulance: 'f0f9',
613
- medkit: 'f0fa',
614
- 'fighter-jet': 'f0fb',
615
- beer: 'f0fc',
616
- 'h-square': 'f0fd',
617
- 'plus-square': 'f0fe',
618
- 'angle-double-left': 'f100',
619
- 'angle-double-right': 'f101',
620
- 'angle-double-up': 'f102',
621
- 'angle-double-down': 'f103',
622
- 'angle-left': 'f104',
623
- 'angle-right': 'f105',
624
- 'angle-up': 'f106',
625
- 'angle-down': 'f107',
626
- desktop: 'f108',
627
- laptop: 'f109',
628
- tablet: 'f10a',
629
- 'mobile-phone,mobile': 'f10b',
630
- 'circle-o': 'f10c',
631
- 'quote-left': 'f10d',
632
- 'quote-right': 'f10e',
633
- spinner: 'f110',
634
- circle: 'f111',
635
- 'mail-reply,reply': 'f112',
636
- 'github-alt': 'f113',
637
- 'folder-o': 'f114',
638
- 'folder-open-o': 'f115',
639
- 'smile-o': 'f118',
640
- 'frown-o': 'f119',
641
- 'meh-o': 'f11a',
642
- gamepad: 'f11b',
643
- 'keyboard-o': 'f11c',
644
- 'flag-o': 'f11d',
645
- 'flag-checkered': 'f11e',
646
- terminal: 'f120',
647
- code: 'f121',
648
- 'mail-reply-all,reply-all': 'f122',
649
- 'star-half-empty,star-half-full,star-half-o': 'f123',
650
- 'location-arrow': 'f124',
651
- crop: 'f125',
652
- 'code-fork': 'f126',
653
- 'unlink,chain-broken': 'f127',
654
- question: 'f128',
655
- info: 'f129',
656
- exclamation: 'f12a',
657
- superscript: 'f12b',
658
- subscript: 'f12c',
659
- eraser: 'f12d',
660
- 'puzzle-piece': 'f12e',
661
- microphone: 'f130',
662
- 'microphone-slash': 'f131',
663
- shield: 'f132',
664
- 'calendar-o': 'f133',
665
- 'fire-extinguisher': 'f134',
666
- rocket: 'f135',
667
- maxcdn: 'f136',
668
- 'chevron-circle-left': 'f137',
669
- 'chevron-circle-right': 'f138',
670
- 'chevron-circle-up': 'f139',
671
- 'chevron-circle-down': 'f13a',
672
- html5: 'f13b',
673
- css3: 'f13c',
674
- anchor: 'f13d',
675
- 'unlock-alt': 'f13e',
676
- bullseye: 'f140',
677
- 'ellipsis-h': 'f141',
678
- 'ellipsis-v': 'f142',
679
- 'rss-square': 'f143',
680
- 'play-circle': 'f144',
681
- ticket: 'f145',
682
- 'minus-square': 'f146',
683
- 'minus-square-o': 'f147',
684
- 'level-up': 'f148',
685
- 'level-down': 'f149',
686
- 'check-square': 'f14a',
687
- 'pencil-square': 'f14b',
688
- 'external-link-square': 'f14c',
689
- 'share-square': 'f14d',
690
- compass: 'f14e',
691
- 'toggle-down,caret-square-o-down': 'f150',
692
- 'toggle-up,caret-square-o-up': 'f151',
693
- 'toggle-right,caret-square-o-right': 'f152',
694
- 'euro,eur': 'f153',
695
- gbp: 'f154',
696
- 'dollar,usd': 'f155',
697
- 'rupee,inr': 'f156',
698
- 'cny,rmb,yen,jpy': 'f157',
699
- 'ruble,rouble,rub': 'f158',
700
- 'won,krw': 'f159',
701
- 'bitcoin,btc': 'f15a',
702
- file: 'f15b',
703
- 'file-text': 'f15c',
704
- 'sort-alpha-asc': 'f15d',
705
- 'sort-alpha-desc': 'f15e',
706
- 'sort-amount-asc': 'f160',
707
- 'sort-amount-desc': 'f161',
708
- 'sort-numeric-asc': 'f162',
709
- 'sort-numeric-desc': 'f163',
710
- 'thumbs-up': 'f164',
711
- 'thumbs-down': 'f165',
712
- 'youtube-square': 'f166',
713
- youtube: 'f167',
714
- xing: 'f168',
715
- 'xing-square': 'f169',
716
- 'youtube-play': 'f16a',
717
- dropbox: 'f16b',
718
- 'stack-overflow': 'f16c',
719
- instagram: 'f16d',
720
- flickr: 'f16e',
721
- adn: 'f170',
722
- bitbucket: 'f171',
723
- 'bitbucket-square': 'f172',
724
- tumblr: 'f173',
725
- 'tumblr-square': 'f174',
726
- 'long-arrow-down': 'f175',
727
- 'long-arrow-up': 'f176',
728
- 'long-arrow-left': 'f177',
729
- 'long-arrow-right': 'f178',
730
- apple: 'f179',
731
- windows: 'f17a',
732
- android: 'f17b',
733
- linux: 'f17c',
734
- dribbble: 'f17d',
735
- skype: 'f17e',
736
- foursquare: 'f180',
737
- trello: 'f181',
738
- female: 'f182',
739
- male: 'f183',
740
- 'gittip,gratipay': 'f184',
741
- 'sun-o': 'f185',
742
- 'moon-o': 'f186',
743
- archive: 'f187',
744
- bug: 'f188',
745
- vk: 'f189',
746
- weibo: 'f18a',
747
- renren: 'f18b',
748
- pagelines: 'f18c',
749
- 'stack-exchange': 'f18d',
750
- 'arrow-circle-o-right': 'f18e',
751
- 'arrow-circle-o-left': 'f190',
752
- 'toggle-left,caret-square-o-left': 'f191',
753
- 'dot-circle-o': 'f192',
754
- wheelchair: 'f193',
755
- 'vimeo-square': 'f194',
756
- 'turkish-lira,try': 'f195',
757
- 'plus-square-o': 'f196',
758
- 'space-shuttle': 'f197',
759
- slack: 'f198',
760
- 'envelope-square': 'f199',
761
- wordpress: 'f19a',
762
- openid: 'f19b',
763
- 'institution,bank,university': 'f19c',
764
- 'mortar-board,graduation-cap': 'f19d',
765
- yahoo: 'f19e',
766
- google: 'f1a0',
767
- reddit: 'f1a1',
768
- 'reddit-square': 'f1a2',
769
- 'stumbleupon-circle': 'f1a3',
770
- stumbleupon: 'f1a4',
771
- delicious: 'f1a5',
772
- digg: 'f1a6',
773
- 'pied-piper-pp': 'f1a7',
774
- 'pied-piper-alt': 'f1a8',
775
- drupal: 'f1a9',
776
- joomla: 'f1aa',
777
- language: 'f1ab',
778
- fax: 'f1ac',
779
- building: 'f1ad',
780
- child: 'f1ae',
781
- paw: 'f1b0',
782
- spoon: 'f1b1',
783
- cube: 'f1b2',
784
- cubes: 'f1b3',
785
- behance: 'f1b4',
786
- 'behance-square': 'f1b5',
787
- steam: 'f1b6',
788
- 'steam-square': 'f1b7',
789
- recycle: 'f1b8',
790
- 'automobile,car': 'f1b9',
791
- 'cab,taxi': 'f1ba',
792
- tree: 'f1bb',
793
- spotify: 'f1bc',
794
- deviantart: 'f1bd',
795
- soundcloud: 'f1be',
796
- database: 'f1c0',
797
- 'file-pdf-o': 'f1c1',
798
- 'file-word-o': 'f1c2',
799
- 'file-excel-o': 'f1c3',
800
- 'file-powerpoint-o': 'f1c4',
801
- 'file-photo-o,file-picture-o,file-image-o': 'f1c5',
802
- 'file-zip-o,file-archive-o': 'f1c6',
803
- 'file-sound-o,file-audio-o': 'f1c7',
804
- 'file-movie-o,file-video-o': 'f1c8',
805
- 'file-code-o': 'f1c9',
806
- vine: 'f1ca',
807
- codepen: 'f1cb',
808
- jsfiddle: 'f1cc',
809
- 'life-bouy,life-buoy,life-saver,support,life-ring': 'f1cd',
810
- 'circle-o-notch': 'f1ce',
811
- 'ra,resistance,rebel': 'f1d0',
812
- 'ge,empire': 'f1d1',
813
- 'git-square': 'f1d2',
814
- git: 'f1d3',
815
- 'y-combinator-square,yc-square,hacker-news': 'f1d4',
816
- 'tencent-weibo': 'f1d5',
817
- qq: 'f1d6',
818
- 'wechat,weixin': 'f1d7',
819
- 'send,paper-plane': 'f1d8',
820
- 'send-o,paper-plane-o': 'f1d9',
821
- history: 'f1da',
822
- 'circle-thin': 'f1db',
823
- header: 'f1dc',
824
- paragraph: 'f1dd',
825
- sliders: 'f1de',
826
- 'share-alt': 'f1e0',
827
- 'share-alt-square': 'f1e1',
828
- bomb: 'f1e2',
829
- 'soccer-ball-o,futbol-o': 'f1e3',
830
- tty: 'f1e4',
831
- binoculars: 'f1e5',
832
- plug: 'f1e6',
833
- slideshare: 'f1e7',
834
- twitch: 'f1e8',
835
- yelp: 'f1e9',
836
- 'newspaper-o': 'f1ea',
837
- wifi: 'f1eb',
838
- calculator: 'f1ec',
839
- paypal: 'f1ed',
840
- 'google-wallet': 'f1ee',
841
- 'cc-visa': 'f1f0',
842
- 'cc-mastercard': 'f1f1',
843
- 'cc-discover': 'f1f2',
844
- 'cc-amex': 'f1f3',
845
- 'cc-paypal': 'f1f4',
846
- 'cc-stripe': 'f1f5',
847
- 'bell-slash': 'f1f6',
848
- 'bell-slash-o': 'f1f7',
849
- trash: 'f1f8',
850
- copyright: 'f1f9',
851
- at: 'f1fa',
852
- eyedropper: 'f1fb',
853
- 'paint-brush': 'f1fc',
854
- 'birthday-cake': 'f1fd',
855
- 'area-chart': 'f1fe',
856
- 'pie-chart': 'f200',
857
- 'line-chart': 'f201',
858
- lastfm: 'f202',
859
- 'lastfm-square': 'f203',
860
- 'toggle-off': 'f204',
861
- 'toggle-on': 'f205',
862
- bicycle: 'f206',
863
- bus: 'f207',
864
- ioxhost: 'f208',
865
- angellist: 'f209',
866
- cc: 'f20a',
867
- 'shekel,sheqel,ils': 'f20b',
868
- meanpath: 'f20c',
869
- buysellads: 'f20d',
870
- connectdevelop: 'f20e',
871
- dashcube: 'f210',
872
- forumbee: 'f211',
873
- leanpub: 'f212',
874
- sellsy: 'f213',
875
- shirtsinbulk: 'f214',
876
- simplybuilt: 'f215',
877
- skyatlas: 'f216',
878
- 'cart-plus': 'f217',
879
- 'cart-arrow-down': 'f218',
880
- diamond: 'f219',
881
- ship: 'f21a',
882
- 'user-secret': 'f21b',
883
- motorcycle: 'f21c',
884
- 'street-view': 'f21d',
885
- heartbeat: 'f21e',
886
- venus: 'f221',
887
- mars: 'f222',
888
- mercury: 'f223',
889
- 'intersex,transgender': 'f224',
890
- 'transgender-alt': 'f225',
891
- 'venus-double': 'f226',
892
- 'mars-double': 'f227',
893
- 'venus-mars': 'f228',
894
- 'mars-stroke': 'f229',
895
- 'mars-stroke-v': 'f22a',
896
- 'mars-stroke-h': 'f22b',
897
- neuter: 'f22c',
898
- genderless: 'f22d',
899
- 'facebook-official': 'f230',
900
- 'pinterest-p': 'f231',
901
- whatsapp: 'f232',
902
- server: 'f233',
903
- 'user-plus': 'f234',
904
- 'user-times': 'f235',
905
- 'hotel,bed': 'f236',
906
- viacoin: 'f237',
907
- train: 'f238',
908
- subway: 'f239',
909
- medium: 'f23a',
910
- 'yc,y-combinator': 'f23b',
911
- 'optin-monster': 'f23c',
912
- opencart: 'f23d',
913
- expeditedssl: 'f23e',
914
- 'battery-4,battery-full': 'f240',
915
- 'battery-3,battery-three-quarters': 'f241',
916
- 'battery-2,battery-half': 'f242',
917
- 'battery-1,battery-quarter': 'f243',
918
- 'battery-0,battery-empty': 'f244',
919
- 'mouse-pointer': 'f245',
920
- 'i-cursor': 'f246',
921
- 'object-group': 'f247',
922
- 'object-ungroup': 'f248',
923
- 'sticky-note': 'f249',
924
- 'sticky-note-o': 'f24a',
925
- 'cc-jcb': 'f24b',
926
- 'cc-diners-club': 'f24c',
927
- clone: 'f24d',
928
- 'balance-scale': 'f24e',
929
- 'hourglass-o': 'f250',
930
- 'hourglass-1,hourglass-start': 'f251',
931
- 'hourglass-2,hourglass-half': 'f252',
932
- 'hourglass-3,hourglass-end': 'f253',
933
- hourglass: 'f254',
934
- 'hand-grab-o,hand-rock-o': 'f255',
935
- 'hand-stop-o,hand-paper-o': 'f256',
936
- 'hand-scissors-o': 'f257',
937
- 'hand-lizard-o': 'f258',
938
- 'hand-spock-o': 'f259',
939
- 'hand-pointer-o': 'f25a',
940
- 'hand-peace-o': 'f25b',
941
- trademark: 'f25c',
942
- registered: 'f25d',
943
- 'creative-commons': 'f25e',
944
- gg: 'f260',
945
- 'gg-circle': 'f261',
946
- tripadvisor: 'f262',
947
- odnoklassniki: 'f263',
948
- 'odnoklassniki-square': 'f264',
949
- 'get-pocket': 'f265',
950
- 'wikipedia-w': 'f266',
951
- safari: 'f267',
952
- chrome: 'f268',
953
- firefox: 'f269',
954
- opera: 'f26a',
955
- 'internet-explorer': 'f26b',
956
- 'tv,television': 'f26c',
957
- contao: 'f26d',
958
- '500px': 'f26e',
959
- amazon: 'f270',
960
- 'calendar-plus-o': 'f271',
961
- 'calendar-minus-o': 'f272',
962
- 'calendar-times-o': 'f273',
963
- 'calendar-check-o': 'f274',
964
- industry: 'f275',
965
- 'map-pin': 'f276',
966
- 'map-signs': 'f277',
967
- 'map-o': 'f278',
968
- map: 'f279',
969
- commenting: 'f27a',
970
- 'commenting-o': 'f27b',
971
- houzz: 'f27c',
972
- vimeo: 'f27d',
973
- 'black-tie': 'f27e',
974
- fonticons: 'f280',
975
- 'reddit-alien': 'f281',
976
- edge: 'f282',
977
- 'credit-card-alt': 'f283',
978
- codiepie: 'f284',
979
- modx: 'f285',
980
- 'fort-awesome': 'f286',
981
- usb: 'f287',
982
- 'product-hunt': 'f288',
983
- mixcloud: 'f289',
984
- scribd: 'f28a',
985
- 'pause-circle': 'f28b',
986
- 'pause-circle-o': 'f28c',
987
- 'stop-circle': 'f28d',
988
- 'stop-circle-o': 'f28e',
989
- 'shopping-bag': 'f290',
990
- 'shopping-basket': 'f291',
991
- hashtag: 'f292',
992
- bluetooth: 'f293',
993
- 'bluetooth-b': 'f294',
994
- percent: 'f295',
995
- gitlab: 'f296',
996
- wpbeginner: 'f297',
997
- wpforms: 'f298',
998
- envira: 'f299',
999
- 'universal-access': 'f29a',
1000
- 'wheelchair-alt': 'f29b',
1001
- 'question-circle-o': 'f29c',
1002
- blind: 'f29d',
1003
- 'audio-description': 'f29e',
1004
- 'volume-control-phone': 'f2a0',
1005
- braille: 'f2a1',
1006
- 'assistive-listening-systems': 'f2a2',
1007
- 'asl-interpreting,american-sign-language-interpreting': 'f2a3',
1008
- 'deafness,hard-of-hearing,deaf': 'f2a4',
1009
- glide: 'f2a5',
1010
- 'glide-g': 'f2a6',
1011
- 'signing,sign-language': 'f2a7',
1012
- 'low-vision': 'f2a8',
1013
- viadeo: 'f2a9',
1014
- 'viadeo-square': 'f2aa',
1015
- snapchat: 'f2ab',
1016
- 'snapchat-ghost': 'f2ac',
1017
- 'snapchat-square': 'f2ad',
1018
- 'pied-piper': 'f2ae',
1019
- 'first-order': 'f2b0',
1020
- yoast: 'f2b1',
1021
- themeisle: 'f2b2',
1022
- 'google-plus-circle,google-plus-official': 'f2b3',
1023
- 'fa,font-awesome': 'f2b4'
1024
- };
1025
- }
1026
382
  icon(d) {
1027
- var code;
1028
- if (this.options.iconMap && this.options.showIcons && this.options.icons) {
1029
- if (this.options.icons[d.labels[0]] && this.options.iconMap[this.options.icons[d.labels[0]]]) {
1030
- code = this.options.iconMap[this.options.icons[d.labels[0]]];
1031
- }
1032
- else if (this.options.iconMap[d.labels[0]]) {
1033
- code = this.options.iconMap[d.labels[0]];
1034
- }
1035
- else if (this.options.icons[d.labels[0]]) {
1036
- code = this.options.icons[d.labels[0]];
1037
- }
1038
- }
1039
- return code;
383
+ return d.icon;
1040
384
  }
1041
385
  image(d) {
1042
386
  var i, imagesForLabel, img, imgLevel, label, labelPropertyValue, property, value;
@@ -1070,7 +414,6 @@ export class GraphViewer {
1070
414
  return img;
1071
415
  }
1072
416
  init(_selector, _options) {
1073
- this.initIconMap();
1074
417
  this.merge(this.options, _options);
1075
418
  if (this.options.icons) {
1076
419
  this.options.showIcons = true;
@@ -1078,7 +421,6 @@ export class GraphViewer {
1078
421
  if (!this.options.minCollision) {
1079
422
  this.options.minCollision = this.options.nodeRadius * 2;
1080
423
  }
1081
- this.initImageMap();
1082
424
  this.selector = _selector;
1083
425
  this.container = d3.select(this.selector);
1084
426
  // this.container.attr('class', 'graph-container').html('')
@@ -1097,37 +439,11 @@ export class GraphViewer {
1097
439
  console.error('Error: both graphData and dataUrl are empty!');
1098
440
  }
1099
441
  }
1100
- initIconMap() {
1101
- Object.keys(this.options.iconMap).forEach((key, index) => {
1102
- var keys = key.split(','), value = this.options.iconMap[key];
1103
- keys.forEach(key => {
1104
- this.options.iconMap[key] = value;
1105
- });
1106
- });
1107
- }
1108
- initImageMap() {
1109
- var key, keys, selector;
1110
- const images = this.options.images;
1111
- for (key in images) {
1112
- if (images.hasOwnProperty(key)) {
1113
- keys = key.split('|');
1114
- if (!this.options.imageMap[keys[0]]) {
1115
- this.options.imageMap[keys[0]] = [key];
1116
- }
1117
- else {
1118
- this.options.imageMap[keys[0]].push(key);
1119
- }
1120
- }
1121
- }
1122
- }
1123
442
  initSimulation() {
1124
443
  const x = this.svg.node().parentElement.parentElement.clientWidth / 2;
1125
444
  const y = this.svg.node().parentElement.parentElement.clientHeight / 2;
1126
445
  var simulation = d3
1127
446
  .forceSimulation()
1128
- // .velocityDecay(0.8)
1129
- // .force('x', d3.force().strength(0.002))
1130
- // .force('y', d3.force().strength(0.002))
1131
447
  .force('collide', d3
1132
448
  .forceCollide()
1133
449
  .radius(d => {
@@ -1273,30 +589,7 @@ export class GraphViewer {
1273
589
  relationships: this.relationships.length
1274
590
  };
1275
591
  }
1276
- /*
1277
- function smoothTransform(elem, translate, scale) {
1278
- var animationMilliseconds = 5000,
1279
- timeoutMilliseconds = 50,
1280
- steps = parseInt(animationMilliseconds / timeoutMilliseconds);
1281
-
1282
- setTimeout(function() {
1283
- smoothTransformStep(elem, translate, scale, timeoutMilliseconds, 1, steps);
1284
- }, timeoutMilliseconds);
1285
- }
1286
-
1287
- function smoothTransformStep(elem, translate, scale, timeoutMilliseconds, step, steps) {
1288
- var progress = step / steps;
1289
-
1290
- elem.attr('transform', 'translate(' + (translate[0] * progress) + ', ' + (translate[1] * progress) + ') scale(' + (scale * progress) + ')');
1291
-
1292
- if (step < steps) {
1293
- setTimeout(function() {
1294
- smoothTransformStep(elem, translate, scale, timeoutMilliseconds, step + 1, steps);
1295
- }, timeoutMilliseconds);
1296
- }
1297
- }
1298
- */
1299
- stickNode(d, event) {
592
+ stickNode(event, d) {
1300
593
  d.fx = event.x;
1301
594
  d.fy = event.y;
1302
595
  }
@@ -1510,7 +803,6 @@ export class GraphViewer {
1510
803
  this.svgScale = 0.85 / Math.max(width / fullWidth, height / fullHeight);
1511
804
  this.svgTranslate = [fullWidth / 2 - this.svgScale * midX, fullHeight / 2 - this.svgScale * midY];
1512
805
  this.svg.attr('transform', 'translate(' + this.svgTranslate[0] + ', ' + this.svgTranslate[1] + ') scale(' + this.svgScale + ')');
1513
- // smoothTransform(this.svgTranslate, this.svgScale);
1514
806
  }
1515
807
  }
1516
808
  //# sourceMappingURL=graph-viewer.js.map