All examples By author By category About

timelyportfolio

summarytrees R htmlwidget - fix zoom

Built with blockbuilder.org

summarytrees converted to an htmlwidget. In this iteration, I wanted to separate the legend (an entropy line plot) from the tree. I would love feedback here.

live example

# devtools::install_github("timelyportfolio/summarytrees@htmlwidget")

library(summarytrees)
data(dmoz)

#use example from vignette
K <- 100
g <- greedy(node = dmoz[, "node"],
           parent = dmoz[, "parent"],
           weight = dmoz[, "weight"],
           label = dmoz[, "label"],
           K = K)

# Prepare the summary trees for visualization:
json <- prepare.vis(tree.list = g$summary.trees,
                    labels = g$data[, "label"],
                    tree = g$tree,
                    legend.width = 150,
                    node.width = 225,
                    node.height = 14,
                    units = "# of URLs",
                    print.weights = TRUE,
                    legend.color = "lightsteelblue",
                    color.level = 3)
summarytrees_htmlwidget(json)

forked from timelyportfolio's block: summarytrees R htmlwidget - better?