diff --git a/R/vartree.b.R b/R/vartree.b.R index e3189d2..b23dce7 100644 --- a/R/vartree.b.R +++ b/R/vartree.b.R @@ -322,10 +322,39 @@ vartreeClass <- if (requireNamespace('jmvcore')) R6::R6Class( root = xroot ) - # export as svg ---- results1 <- DiagrammeRsvg::export_svg(gv = results) - self$results$text1$setContent(print(results1)) + + results1 <- base::sub('width=\"[[:digit:]pt\"]+', + ifelse(horizontal==TRUE, 'width=400pt ', 'width=1000pt '), + results1) + # results1 <- base::sub('scale[([:digit:] [:digit:])]+', + # 'scale(1, 1)', + # results1) + + results1 <- paste0('
', + results1, + '
') + + #### ---------------------- + # a <- WebPage$new("index") + # + # a$add_style("body", list("font-family" = "Helvetica", "color" = "#24292e")) + # a$add_style("h2", list("font-size" = "3 em", "color" = "#911414", + # "text-align" = "center")) + # a$add_style("h3", list("font-size" = "1.5 em", "color" = "#2E2E8F", + # "text-align" = "center")) + # + # + # a$add_tag("h2", "Hey there!") + # a$add_tag("h3", "You've reached the rtask teams!") + # a$add_tag("p", "We are glad to have you here.") + # a$add_tag("p", "Enjoying R6 already?") + #### ---------------------- + + self$results$text1$setContent(results1) # ptable ---- @@ -343,5 +372,46 @@ vartreeClass <- if (requireNamespace('jmvcore')) R6::R6Class( } - ) + ) +) + + + +WebPage <- R6Class("WebPage", + public = list( + name = character(0), + head = c("","",""), + body = "", + style = '", body,"","") + } + ) )