g2_word_cloud | R Documentation |
opt param in rg2 is the PlotOptions for G2Plot.
You can construct an opt using function with g2_
prefix and g2_opt()
.
https://g2plot.antv.antgroup.com/en/api for details
g2_word_cloud(data, wordField, weightField, colorField = NULL)
data |
required. Data frame for plot. |
wordField |
word field |
weightField |
weight field |
colorField |
color field |
Other g2:
g2_area()
,
g2_bar()
,
g2_bidirectional_bar()
,
g2_box()
,
g2_bullet()
,
g2_chord()
,
g2_circle_packing()
,
g2_column()
,
g2_dual_axes()
,
g2_funnel()
,
g2_gauge()
,
g2_heatmap()
,
g2_histogram()
,
g2_line()
,
g2_liquid()
,
g2_pie()
,
g2_progress()
,
g2_radar()
,
g2_radial_bar()
,
g2_ring_progress()
,
g2_rose()
,
g2_sankey()
,
g2_scatter()
,
g2_stock()
,
g2_sunburst()
,
g2_tiny_area()
,
g2_tiny_column()
,
g2_treemap()
,
g2_venn()
,
g2_violin()
,
g2_waterfall()
,
g2()
jsonlite::fromJSON('https://gw.alipayobjects.com/os/antfincdn/jPKbal7r9r/mock.json') |>
g2_word_cloud('x','value') |>
g2_opt(
color='#122c6a',
wordStyle=list(
fontFamily='Verdana',
fontSize=c(24, 80)
)
) |>
g2()
jsonlite::fromJSON('https://gw.alipayobjects.com/os/antvdemo/assets/data/antv-keywords.json') |>
g2_word_cloud('name','value','name') |>
g2_opt(
imageMask='https://gw.alipayobjects.com/mdn/rms_2274c3/afts/img/A*07tdTIOmvlYAAAAAAAAAAABkARQnAQ',
wordStyle=list(
fontFamily='Verdana',
fontSize=c(8, 32)
)
) |>
g2()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.