g2-tag-cloud 标签云 - 图1 This article has not been translated, hope that your can PR to translated it. Help us!g2-tag-cloud 标签云 - 图2

g2-tag-cloud 标签云

标签云是一套相关的标签以及与此相应的权重展示方式,一般典型的标签云有 30 至 150 个标签,而权重影响使用的字体大小或其他视觉效果。

  1. import { G2TagCloudModule } from '@delon/chart/tag-cloud';

代码演示

g2-tag-cloud 标签云 - 图3

基础

基础用法。

  1. import { Component } from '@angular/core';
  2. import { G2TagCloudClickItem, G2TagCloudData } from '@delon/chart/tag-cloud';
  3. import { NzMessageService } from 'ng-zorro-antd/message';
  4. @Component({
  5. selector: 'chart-tag-cloud-basic',
  6. template: `<g2-tag-cloud [data]="tags" height="400" (clickItem)="handleClick($event)"></g2-tag-cloud>`,
  7. })
  8. export class ChartTagCloudBasicComponent {
  9. tags: G2TagCloudData[] = [
  10. { value: 9, name: 'AntV' },
  11. { value: 8, name: 'F2' },
  12. { value: 8, name: 'G2' },
  13. { value: 8, name: 'G6' },
  14. { value: 8, name: 'DataSet' },
  15. { value: 8, name: '墨者学院' },
  16. { value: 6, name: 'Analysis' },
  17. { value: 6, name: 'Data Mining' },
  18. { value: 6, name: 'Data Vis' },
  19. { value: 6, name: 'Design' },
  20. { value: 6, name: 'Grammar' },
  21. { value: 6, name: 'Graphics' },
  22. { value: 6, name: 'Graph' },
  23. { value: 6, name: 'Hierarchy' },
  24. { value: 6, name: 'Labeling' },
  25. { value: 6, name: 'Layout' },
  26. { value: 6, name: 'Quantitative' },
  27. { value: 6, name: 'Relation' },
  28. { value: 6, name: 'Statistics' },
  29. { value: 6, name: '可视化' },
  30. { value: 6, name: '数据' },
  31. { value: 6, name: '数据可视化' },
  32. { value: 4, name: 'Arc Diagram' },
  33. { value: 4, name: 'Bar Chart' },
  34. { value: 4, name: 'Canvas' },
  35. { value: 4, name: 'Chart' },
  36. { value: 4, name: 'DAG' },
  37. { value: 4, name: 'DG' },
  38. { value: 4, name: 'Facet' },
  39. { value: 4, name: 'Geo' },
  40. { value: 4, name: 'Line' },
  41. { value: 4, name: 'MindMap' },
  42. { value: 4, name: 'Pie' },
  43. { value: 4, name: 'Pizza Chart' },
  44. { value: 4, name: 'Punch Card' },
  45. { value: 4, name: 'SVG' },
  46. { value: 4, name: 'Sunburst' },
  47. { value: 4, name: 'Tree' },
  48. { value: 4, name: 'UML' },
  49. { value: 3, name: 'Chart' },
  50. { value: 3, name: 'View' },
  51. { value: 3, name: 'Geom' },
  52. { value: 3, name: 'Shape' },
  53. { value: 3, name: 'Scale' },
  54. { value: 3, name: 'Animate' },
  55. { value: 3, name: 'Global' },
  56. { value: 3, name: 'Slider' },
  57. { value: 3, name: 'Connector' },
  58. { value: 3, name: 'Transform' },
  59. { value: 3, name: 'Util' },
  60. { value: 3, name: 'DomUtil' },
  61. { value: 3, name: 'MatrixUtil' },
  62. { value: 3, name: 'PathUtil' },
  63. { value: 3, name: 'G' },
  64. { value: 3, name: '2D' },
  65. { value: 3, name: '3D' },
  66. { value: 3, name: 'Line' },
  67. { value: 3, name: 'Area' },
  68. { value: 3, name: 'Interval' },
  69. { value: 3, name: 'Schema' },
  70. { value: 3, name: 'Edge' },
  71. { value: 3, name: 'Polygon' },
  72. { value: 3, name: 'Heatmap' },
  73. { value: 3, name: 'Render' },
  74. { value: 3, name: 'Tooltip' },
  75. { value: 3, name: 'Axis' },
  76. { value: 3, name: 'Guide' },
  77. { value: 3, name: 'Coord' },
  78. { value: 3, name: 'Legend' },
  79. { value: 3, name: 'Path' },
  80. { value: 3, name: 'Helix' },
  81. { value: 3, name: 'Theta' },
  82. { value: 3, name: 'Rect' },
  83. { value: 3, name: 'Polar' },
  84. { value: 3, name: 'Dsv' },
  85. { value: 3, name: 'Csv' },
  86. { value: 3, name: 'Tsv' },
  87. { value: 3, name: 'GeoJSON' },
  88. { value: 3, name: 'TopoJSON' },
  89. { value: 3, name: 'Filter' },
  90. { value: 3, name: 'Map' },
  91. { value: 3, name: 'Pick' },
  92. { value: 3, name: 'Rename' },
  93. { value: 3, name: 'Filter' },
  94. { value: 3, name: 'Map' },
  95. { value: 3, name: 'Pick' },
  96. { value: 3, name: 'Rename' },
  97. { value: 3, name: 'Reverse' },
  98. { value: 3, name: 'sort' },
  99. { value: 3, name: 'Subset' },
  100. { value: 3, name: 'Partition' },
  101. { value: 3, name: 'Imputation' },
  102. { value: 3, name: 'Fold' },
  103. { value: 3, name: 'Aggregate' },
  104. { value: 3, name: 'Proportion' },
  105. { value: 3, name: 'Histogram' },
  106. { value: 3, name: 'Quantile' },
  107. { value: 3, name: 'Treemap' },
  108. { value: 3, name: 'Hexagon' },
  109. { value: 3, name: 'Binning' },
  110. { value: 3, name: 'kernel' },
  111. { value: 3, name: 'Regression' },
  112. { value: 3, name: 'Density' },
  113. { value: 3, name: 'Sankey' },
  114. { value: 3, name: 'Voronoi' },
  115. { value: 3, name: 'Projection' },
  116. { value: 3, name: 'Centroid' },
  117. { value: 3, name: 'H5' },
  118. { value: 3, name: 'Mobile' },
  119. { value: 3, name: 'K线图' },
  120. { value: 3, name: '关系图' },
  121. { value: 3, name: '烛形图' },
  122. { value: 3, name: '股票图' },
  123. { value: 3, name: '直方图' },
  124. { value: 3, name: '金字塔图' },
  125. { value: 3, name: '分面' },
  126. { value: 3, name: '南丁格尔玫瑰图' },
  127. { value: 3, name: '饼图' },
  128. { value: 3, name: '线图' },
  129. { value: 3, name: '点图' },
  130. { value: 3, name: '散点图' },
  131. { value: 3, name: '子弹图' },
  132. { value: 3, name: '柱状图' },
  133. { value: 3, name: '仪表盘' },
  134. { value: 3, name: '气泡图' },
  135. { value: 3, name: '漏斗图' },
  136. { value: 3, name: '热力图' },
  137. { value: 3, name: '玉玦图' },
  138. { value: 3, name: '直方图' },
  139. { value: 3, name: '矩形树图' },
  140. { value: 3, name: '箱形图' },
  141. { value: 3, name: '色块图' },
  142. { value: 3, name: '螺旋图' },
  143. { value: 3, name: '词云' },
  144. { value: 3, name: '词云图' },
  145. { value: 3, name: '雷达图' },
  146. { value: 3, name: '面积图' },
  147. { value: 3, name: '马赛克图' },
  148. { value: 3, name: '盒须图' },
  149. { value: 3, name: '坐标轴' },
  150. { value: 3, name: '' },
  151. { value: 3, name: 'Jacques Bertin' },
  152. { value: 3, name: 'Leland Wilkinson' },
  153. { value: 3, name: 'William Playfair' },
  154. { value: 3, name: '关联' },
  155. { value: 3, name: '分布' },
  156. { value: 3, name: '区间' },
  157. { value: 3, name: '占比' },
  158. { value: 3, name: '地图' },
  159. { value: 3, name: '时间' },
  160. { value: 3, name: '比较' },
  161. { value: 3, name: '流程' },
  162. { value: 3, name: '趋势' },
  163. { value: 2, name: '亦叶' },
  164. { value: 2, name: '再飞' },
  165. { value: 2, name: '完白' },
  166. { value: 2, name: '巴思' },
  167. { value: 2, name: '张初尘' },
  168. { value: 2, name: '御术' },
  169. { value: 2, name: '有田' },
  170. { value: 2, name: '沉鱼' },
  171. { value: 2, name: '玉伯' },
  172. { value: 2, name: '画康' },
  173. { value: 2, name: '祯逸' },
  174. { value: 2, name: '绝云' },
  175. { value: 2, name: '罗宪' },
  176. { value: 2, name: '萧庆' },
  177. { value: 2, name: '董珊珊' },
  178. { value: 2, name: '陆沉' },
  179. { value: 2, name: '顾倾' },
  180. { value: 2, name: 'Domo' },
  181. { value: 2, name: 'GPL' },
  182. { value: 2, name: 'PAI' },
  183. { value: 2, name: 'SPSS' },
  184. { value: 2, name: 'SYSTAT' },
  185. { value: 2, name: 'Tableau' },
  186. { value: 2, name: 'D3' },
  187. { value: 2, name: 'Vega' },
  188. { value: 2, name: '统计图表' },
  189. ];
  190. constructor(private msg: NzMessageService) {}
  191. handleClick(data: G2TagCloudClickItem): void {
  192. this.msg.info(`${data.item.name} - ${data.item.value}`);
  193. }
  194. }

API

g2-tag-cloud

参数说明类型默认值
[delay]延迟渲染,单位:毫秒number200
[height]高度值number200
[width]宽度值,若不指定自动按宿主元素的宽度number0
[data]数据G2TagCloudData[][]
[theme]定制图表主题string | LooseObject-
(clickItem)点击项回调EventEmitter<G2TagCloudClickItem>-

G2TagCloudData

参数说明类型默认值
[name]名称string-
[value]number-