Questions tagged «htmltools»

2
R:如何优雅地将代码逻辑与UI / html-tags分开?
问题 动态创建ui元素(shiny.tag,,shiny.tag.list...)时,我经常发现很难将其与代码逻辑分开,并且通常最终会产生混乱的嵌套嵌套tags$div(...),并与循环和条件语句混合在一起。尽管令人讨厌且难看,但它也容易出错,例如,在对html模板进行更改时。 可复制的例子 假设我具有以下数据结构: my_data <- list( container_a = list( color = "orange", height = 100, content = list( vec_a = c(type = "p", value = "impeach"), vec_b = c(type = "h1", value = "orange") ) ), container_b = list( color = "yellow", height = 50, content = list( vec_a …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.