更多 TrelliscopeJS 功能

使用 R 中的 Trelliscope 可视化大数据

Ryan Hafen

Author, TrelliscopeJS

使用 Plotly 增强 ggplot 面板交互性

只需在 facet_trelliscope() 中添加 as_plotly = TRUE

例如:

gap_life <- select(gapminder, year, lifeExp, country, continent)
ggplot(gap_life, aes(year, lifeExp)) +
  geom_point() +
  facet_trelliscope(~ country + continent,
    name = "lifeExp_by_country",
    desc = "Life expectancy vs. year for 142 countries.",
    nrow = 2, ncol = 3,
    as_plotly = TRUE)
使用 R 中的 Trelliscope 可视化大数据

使用 Plotly 增强 ggplot 面板交互性

使用 R 中的 Trelliscope 可视化大数据

基于上下文的自动认知量(cognostics)

只需在 facet_trelliscope() 中添加 auto_cog = TRUE

例如:

ggplot(gap_life, aes(year, lifeExp)) +
  geom_point() +
  facet_trelliscope(~ country + continent,
    name = "lifeExp_by_country",
    desc = "Life expectancy vs. year for 142 countries.",
    nrow = 2, ncol = 3,
    auto_cog = TRUE)

更多可用的自动认知量请参阅 autocogs::autocog 帮助。

使用 R 中的 Trelliscope 可视化大数据

基于上下文的自动认知量(cognostics)

使用 R 中的 Trelliscope 可视化大数据

坐标轴范围

可用 scales 参数控制坐标轴范围。

三种选项:

  • "same"(默认)
  • "sliced"
  • "free"
使用 R 中的 Trelliscope 可视化大数据

scales = "same"

每个面板的坐标范围相同。

便于进行"同类"比较。

使用 R 中的 Trelliscope 可视化大数据

scales = "sliced"

每个面板的范围跨度一致,但起点不一定相同。

便于比较尺度差异。

使用 R 中的 Trelliscope 可视化大数据

scales = "free"

每个面板的范围基于其自身数据的边界。

使用 R 中的 Trelliscope 可视化大数据

Passons à la pratique !

使用 R 中的 Trelliscope 可视化大数据

Preparing Video For Download...