<style>
.code {
    background-color: #FADED9;
    color: red;
    font-family: courier;
    border: 2px solid black;
    margin: 20px;
    padding: 20px;
}
</style>

<!--begin.rcode Static_ggplot

cat(plotter$create_title("Example report", "example_report", hlevel = 1, indexable = FALSE, clickable = FALSE, t_id = NULL))
cat(plotter$create_title("Static plots", "static_plot", hlevel = 2, indexable = TRUE, clickable = FALSE, t_id = NULL))
cat(plotter$create_title("Heatmap example", "heatmap_t", hlevel = 3, indexable = TRUE, clickable = FALSE, t_id = NULL, clickable_text = ""))

    mod_func <- function(data_frame){
       mod_table <- reshape2::melt(as.matrix(data_frame)) 
       colnames(mod_table) <- c("x_axis", "y_axis", "Freq")
       n_columns <-  check_numeric_fields(mod_table)

       mod_table[,n_columns] <- lapply(mod_table[,n_columns], 
        function(col) {
             if (!is.factor(col)){
                as.numeric(col)
             } else {
                col
             }
       })
       mod_table$Freq <- log(mod_table$Freq + 1)
       return(mod_table)
    }
       col <-  c("#0000D5","#FFFFFF","#D50000")
       text_colour <-  "black"
       na_col <-  "grey50"
	   cat(plotter$static_ggplot_main("data_toc_sample.txt", header = T, func = mod_func, smp_attr = 17,
                                      plotting_function = function(ggplot_obj) { 
    
       ggplot_obj + ggplot2::aes(x = x_axis, y = y_axis, fill =Freq) +
       ggplot2::geom_tile(show.legend = TRUE) +
       ggplot2::theme_minimal() +
       ggplot2::theme(panel.grid.major = ggplot2::element_blank()) +
       ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 25, face = "bold", hjust = 1), axis.text.y = ggplot2::element_text(face = "bold")) +
       ggplot2::scale_fill_gradient2(low = col[1], mid= col[2], high = col[3], na.value = na_col, guide = "colourbar", aesthetics = "fill")
	}))
end.rcode-->

<!--begin.rcode Static_baseplot, echo = TRUE
    cat(plotter$create_title("Static barplot example", "static_barplot", hlevel = 2, indexable = FALSE))
    # Make sure the plotting function does not automatically draw the plot, but rather returns
    # the plot object. Default "plot_type" value is "plot", which calls base R plot function.
    cat(plotter$prettify_div(plotter$static_plot_main("barplot2.txt", resizable = FALSE, header = TRUE,
            row_names = TRUE, transpose = TRUE,
            plotting_function = function(plot_obj){as.matrix(plot_obj)}),
            preset = "magic"))
    # There is a way to use static_plot_main even if the plotting function always draws the plot,
    # but it is messy and perhaps a bit dangerous. Only use this if you absolutely need to. Pay attention
    # to how we define the plotting function: with no input, and plotting "data_frame"
    cat(plotter$prettify_div(plotter$static_plot_main("barplot2.txt", resizable = FALSE, header = TRUE,
            row_names = TRUE, transpose = TRUE, plot_type = "autoplot",
            plotting_function = function(){barplot(as.matrix(data_frame))}),
            preset = "magic"))
    # Autoplot can also receive plotting args
    cat(plotter$prettify_div(plotter$static_plot_main("barplot2.txt", resizable = FALSE, header = TRUE,
            row_names = TRUE, transpose = TRUE, plot_type = "autoplot",
            plotting_function = function(){barplot(as.matrix(data_frame^test_arg))}, plotting_args = list(test_arg = 90)),
            preset = "magic"))
end.rcode-->

<!--begin.rcode Resizable_ggplot_heatmap, echo = TRUE
    cat(plotter$create_title("Heatmap example resizable", "heatmap_t", hlevel = 3, indexable = TRUE, clickable = FALSE, t_id = NULL, clickable_text = ""))

    cat(plotter$static_ggplot_main("data_toc_sample.txt", header = T, func = mod_func, smp_attr = 17, width = 1200, height = 500, size_unit = "px",
                                   resizable = TRUE, plotting_function = function(ggplot_obj) {
        
           ggplot_obj + ggplot2::aes(x = x_axis, y = y_axis, fill =Freq) +
           ggplot2::geom_tile(show.legend = TRUE) +
           ggplot2::theme_minimal() +
           ggplot2::theme(panel.grid.major = ggplot2::element_blank()) +
           ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 25, face = "bold", hjust = 1), axis.text.y = ggplot2::element_text(face = "bold")) +
           ggplot2::scale_fill_gradient2(low = col[1], mid= col[2], high = col[3], na.value = na_col, guide = "colourbar", aesthetics = "fill")
        }))
end.rcode-->


<!--begin.rcode Custom_size_ggplot_heatmap, echo = TRUE
    cat(plotter$create_title("Heatmap example custom size", "heatmap_t", hlevel = 3, indexable = TRUE, clickable = FALSE, t_id = NULL, clickable_text = ""))

    cat(plotter$static_ggplot_main("data_toc_sample.txt", header = T, func = mod_func, smp_attr = 17, width = 1200, height = 500, size_unit = "px",
                                    transpose = FALSE, img_properties = "width='1200' height='500'", plotting_function = function(ggplot_obj) {
        
           ggplot_obj + ggplot2::aes(x = x_axis, y = y_axis, fill =Freq) +
           ggplot2::geom_tile(show.legend = TRUE) +
           ggplot2::theme_minimal() +
           ggplot2::theme(panel.grid.major = ggplot2::element_blank()) +
           ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 25, face = "bold", hjust = 1), axis.text.y = ggplot2::element_text(face = "bold")) +
           ggplot2::scale_fill_gradient2(low = col[1], mid= col[2], high = col[3], na.value = na_col, guide = "colourbar", aesthetics = "fill")
        }))
end.rcode-->


<!--begin.rcode Mermaid_examples
    cat(plotter$create_title("Mermaid chart examples", "mermaid", hlevel = 2, indexable = TRUE, clickable = TRUE, t_id = "mermaid_chart"))
       cat(plotter$create_collapsable_container(id = "mermaid_chart", html_code =plotter$mermaid_chart('
    ---
    config:
      theme: dark
    ---
    flowchart LR
        1A[Option Parsing]
        1B[/opt/]
        subgraph Input preparison
            A[Target generation] 
            B[Read count table]
            C[Read External DE data]
            D[Read Library size files] 
        end
        E["`**main_degenes_Hunter**`"]
        EE[/final_results/]
        LL[main_report.Rmd]
        subgraph Writting
            F[write.table]
            H>filtered_count_data.txt]
            G>control_treatment.txt]
            I>hunter_results_table.txt]
            J["`**write_df_list_as_tables** (Normalized_counts)`"]
            K["`**write_df_list_as_tables** (allgenes)`"]
            L["`**write_expression_report**`"]
            M>"DEG_report.html"]   
            
        end

        1A --> 1B
        1B -- target_file
              Treatment_columns
              Control_columns --> A

        1B --input_file--> B
        1B --external_DEA_file--> C
        1B --library_sizes-->D
        1B --> E
        A & B & C & D --> E
        E  ==> EE
        1B -- output_files --> Writting
        EE --> F 
        EE --all_data_normalized---> J
        EE --"all_counts_for_plotting"---> K
        F  --"raw_filter"--> H
        F  --"sample_group"--> G
        F  --"DE_all_genes"--> I
        EE & LL --> L
        L --> M      
        
        ')))

    cat(plotter$mermaid_chart('
        venn-beta
        title Venn diagram
        
        set A
            text A_1[600]
        set B
            text B_1[200]
        set C
            text C_1[300]
        set D
            text D_1[2]
        set E
            text E_1[8]

        union A,B[140]
        union A,B,C[446]
        union A,B,D[26]
        union A,B,C,E[49]
        union A,B,C,D[10]
        union A,B,C,E,D[39]
        '))
end.rcode-->


<!--begin.rcode table_bootstrap, echo = TRUE
    cat(plotter$create_title("Tables", "tables", hlevel = 2, indexable = TRUE, clickable = FALSE, t_id = NULL))
    cat(plotter$create_title("Bootstrap type", "tables_bs", hlevel = 3, indexable = TRUE, clickable = FALSE, t_id = NULL))
    plotter$hash_vars[["test_data_frame"]] <- data.frame( "V1" = c("h0", "r1", "r2", "r3"), 
                                "V2" = c("h1", "-","var_attr1", "var_attr2"),
                                "V3" = c("h2", "smp_attr1", 1, 2), 
                                "V4" = c("h3", "smp_attr2", 3, 4), 
                                row.names = 1:4)
    cat(plotter$table(list(id = "test_data_frame", header = TRUE, row_names = TRUE, smp_attr = 2,
                      var_attr = 2, attrib = list('class' = 'table table-striped'))))
    cat(plotter$table(list(id = "test_data_frame", header = TRUE, row_names = TRUE, smp_attr = 2,
                      var_attr = 2, attrib = list('class' = 'table table-striped'), rownames_col = "renamed_rows")))
end.rcode-->

<!--begin.rcode merge_hashed_tables, echo = TRUE

    plotter$hash_vars$table1 <- data.frame(val1 = 1:5, val2 = 6:10)
    plotter$hash_vars$table2 <- data.frame(val1 = 11:15, val2 = 16:20)
    plotter$merge_hashed_tables(ids = c("table1", "table2"), from_id_name = "origin", target_id = "merged_table")
    cat(plotter$prettify_div(plotter$barplot(list(id = "merged_table", title = "Merged table barplot", header = NULL, row_names = NULL,
                                                  text = FALSE, text = FALSE, transpose = TRUE, smp_attr = 3,
                                                  colorBy = "origin", config = list(graphOrientation = "vertical", showLegend = TRUE,
                                                  smpLabelImage = TRUE, xAxisTitle = "Values"))), preset = "magic"))

end.rcode-->

<!--begin.rcode filtering tables, echo = TRUE
   cat(plotter$create_title("Table filtering", "table_filtering", hlevel = 2, indexable = TRUE, clickable = FALSE, t_id = NULL))
   cat("<p><b>Important note</b>: Rownames column is included in the count, bear it in mind when filling out the filt_cols argument.</p>")
   cat(plotter$table(list(id = "table1_header.txt", header = TRUE, text = FALSE, row_names = FALSE, styled = "dt", custom_buttons = c('copyHtml5', 'excelHtml5', 'csvHtml5', 'pdfHtml5'), filt_cols = 2:3, filt_col_names = c("Log_FC", "Patients"))))
end.rcode-->


<!--begin.rcode cvX_heatmap, echo = TRUE
cat(plotter$prettify_div(plotter$heatmap(list(id = "data_toc_sample.txt", title = "Heatmap", header = TRUE, smp_attr = 17, text = FALSE,
                         row_names = FALSE, transpose = FALSE, config = list("varOverlays" = c("category")))), preset = "magic"))
end.rcode-->


<!--begin.rcode cvX_cluster_heatmap, echo = TRUE
    plotter$create_title("Heatmaps with trees", "tree_heatmaps", hlevel = 2, indexable = FALSE)
    cluster_table <- plotter$get_data(list(id = "data_toc_sample.txt", row_names = NULL, header = TRUE, transpose = FALSE,
                                      text = "dynamic"))$data_frame
    rownames(cluster_table) <- seq(0, nrow(cluster_table) -1)
    test_tree <- hclust(dist(cluster_table[,(1:length(cluster_table)-1)]))
    cluster_table$clust <- cutree(test_tree,8)
    data_toc_sample_nw <- ape::write.tree(ape::as.phylo(test_tree))
    rownames(cluster_table) <- as.character(sample(100))
    plotter$hash_vars$cluster_table <- cluster_table
    cat(plotter$prettify_div(plotter$heatmap(list(id = "cluster_table", title = "Heatmap", tree = data_toc_sample_nw, header = NULL, smp_attr = c(17, 18),
                             text = "dynamic", row_names = NULL, transpose = FALSE, config = list("varOverlays" = c("category", "clust")))), preset = "magic"))
end.rcode-->

<!--begin.rcode cvX_double_heatmap, echo = TRUE
    cat(plotter$prettify_div(plotter$heatmap(list(id = "heatmap_colors.txt", header = FALSE, row_names = FALSE, text = "dynamic", x_label = "Intensity",
                                             extra_data = list(id ="heatmap_sizes.txt", header = FALSE, row_names = FALSE, text = "dynamic"),
                                             config = list(sizeLegendTitle = "Textual Similarity", sizes = c(3, 11, 15, 40)),
                                             title = "double heatmap")), preset = "magic"))
end.rcode-->

<!--begin.rcode cvX_density, echo = TRUE
    cat(plotter$prettify_div(plotter$density(list(id = "density_ridgeline_example.txt", title = "Density plot", header = TRUE,
                        text = FALSE, row_names = TRUE, fillDensity = TRUE, median = TRUE)), preset = "magic"))
end.rcode-->

<br>
<br>
<br>
<br>
<br>
<br>

<!--begin.rcode plotter_datatable, echo = TRUE
    cat(plotter$create_title("DataTable type", "tables_dt", hlevel = 3, indexable = TRUE,
                              clickable = FALSE, t_id = NULL))
    cat(plotter$table(list(id = "test_data_frame", header = TRUE, row_names = TRUE, smp_attr = 2, var_attr = 2,
                       styled = "dt")))
    cat(plotter$create_title("Custom table attributes", "tables_dt", hlevel = 3, indexable = TRUE,
                              clickable = FALSE, t_id = NULL))
    cat(plotter$table(list(id = "test_data_frame", attrib = list(width = "100%"), header = TRUE, row_names = TRUE, smp_attr = 2, var_attr = 2,
                       styled = "dt")))
end.rcode-->

<!--begin.rcode cvX_scatter2D, echo = TRUE
    cat(plotter$prettify_div(plotter$scatter2D(list(id = "x_y.txt", title = "Simple Scatter", row_names = FALSE, header = TRUE,
                               x_label = "Num genes", y_label = "FPKM", alpha = 0.3, theme = "tableau",
                               text = FALSE)), preset = "magic"))
    cat(plotter$prettify_div(plotter$scatter2D(list(id = "x_y.txt", title = "Scatter with densities", row_names = FALSE, header = TRUE,
                               x_label = "Num genes", y_label = "FPKM", add_densities = TRUE, text = FALSE)), preset = "magic"))
    cat(plotter$prettify_div(plotter$scatter2D(list(id = "x_y_factor.txt", title = "Scatter with factors", row_names = FALSE,
                               header = TRUE, x_label = "Num genes", y_label = "FPKM", text = "dynamic",
                               smp_attr = 1:2, colorScaleBy = "patient", sizeBy = "group")), preset = "magic"))
    cat(plotter$prettify_div(plotter$scatter2D(list(id = "barplot3.txt", title = "Scatter with custom point info", row_names = TRUE,
                               header = TRUE, text = "dynamic", height = 300, width = 300, var_attr = 2:3,
                               smp_attr = 2:3, xAxis = "brain", yAxis = "lung", x_label = "Brain", y_label = "Lung",
                               config = list("hoverTemplate" = "Type of gene: {type} <br>
                                                                Other type of gene: {type2} <br>
                                                                Lung Expr: {lung} <br>
                                                                Brain Expr: {brain} "))), preset = "magic"))
end.rcode-->

<!--begin.rcode cvX_scatter3D, echo = TRUE
    cat(plotter$prettify_div(plotter$scatter3D(list(id = 'scatter3dsizeAndColor.txt', header = TRUE, row_names = TRUE, x_label = 'Num genes', title = "Scatter3D plot",
                                                    y_label = 'FPKM', z_label= "3rdMetric", smp_attr = 7, xAxis = "liver", yAxis = "brain",
                                                    zAxis = "lung", pointSize = "spleen", colorScaleBy = "kidney", shapeBy = "pathway", text = "dynamic")),
                                               preset = "magic"))
end.rcode-->

<!--begin.rcode cvX_barplot, echo = TRUE
    cat(plotter$prettify_div(plotter$barplot(list(id = "barplot1.txt", title = "Vertical barplot with multiple series", row_names = TRUE, header = TRUE,
                                                  text = FALSE, config = list('graphOrientation' = 'vertical', 'xAxisTitle' = 'Values'))), preset = "magic"))
    cat(plotter$prettify_div(plotter$barplot(list(id = "barplot2.txt", title = "Horizontal barplot", row_names = TRUE, header = TRUE,
                                                  height = 300, text = FALSE)), preset = "magic"))
    cat(plotter$prettify_div(plotter$barplot(list(id = "barplot2.txt", title = "Barplot with intensities", row_names = TRUE, header = TRUE,
                                                  text = "dynamic", height = 300, colorScale = TRUE, config = list('graphOrientation' = 'vertical'))), preset = "magic"))
    cat(plotter$prettify_div(plotter$barplot(list(id = "barplot3.txt", title = "Tiny barplot", row_names = TRUE, header = TRUE, text = "dynamic",
                                                  height = 300, width = 300, var_attr = 2:3, smp_attr = 2:3, segregate = list('var' = 'nerv', 'smp'= 'type2'),
                                                  config = list('layoutCollapse' = 'false', 'layoutType' = 'rows', 'graphOrientation' = 'vertical' ))),
                                                  preset = "magic"))
end.rcode-->

<p>We can also define functions to transform data before plotting<p>
<!--begin.rcode cvX_lineplot, echo = TRUE
    mod_data <- function(df) {
        df[2,2] <- 1000
        return(df)
    }
    cat(plotter$prettify_div(plotter$line(list(id = "barplot1.txt", title = "plain line plot", header = TRUE, text = FALSE)), preset = "magic"))
    cat(plotter$prettify_div(plotter$line(list(id = "barplot1.txt", title = "modified line plot", header = TRUE, text = FALSE,
                                               func = mod_data, config = list('graphOrientation' = 'vertical'))), preset = "magic"))
    cat(plotter$prettify_div(plotter$line(list(id = 'lineplot.txt', title = "line plot realistic case", fields = c(6, 3, 4, 5),
                                               smp_attr = 2, header = TRUE, row_names = TRUE, text = 1, config = list(graphOrientation = "vertical"))),
                                               preset = "magic"))
end.rcode-->

<h2> You can edit the properties of divs with an interface function <h2>
<!--begin.rcode Pretty_divs, echo = TRUE
    cat(plotter$prettify_div("This is a simple div"))
    cat(plotter$prettify_div("This is a right-justified div", display = "flex", justify = "right"))
    cat(plotter$prettify_div("This is a preset div", preset = "magic",
                             overflow = "preset will override other arguments"))
end.rcode-->

<!--begin.rcode boxplots, echo = TRUE

    cat(plotter$prettify_div(plotter$boxplot(list(id = 'boxplot.txt', title = "Simple boxplot", header = TRUE,
                                                  row_names = TRUE,
                                                  text = "dynamic", format = "wide")), preset = "magic"))
    cat(plotter$prettify_div(plotter$boxplot(list(id = 'boxplot_one_series.txt',
                                                  title = "Boxplot with one series", header = TRUE,
                                                  row_names = TRUE, text = "dynamic", format = "long")),
                                                  preset = "magic"))
    cat(plotter$prettify_div(plotter$boxplot(list(id = 'boxplot_factor.txt', title = "Factor boxplot",
                                                  header = TRUE, row_names = TRUE,
                                                  text = "dynamic", format = "wide", smp_attr = 5,
                                                  group = "pathway")), preset = "magic"))
    cat(plotter$prettify_div(plotter$boxplot(list(id = 'boxplot_one_series_nonames.txt',
                                                  title = "Unnamed series boxplot", header = FALSE,
                                                  row_names = FALSE, add_header_row_names = TRUE,
                                                  text = "dynamic", format = "long")), preset = "magic"))
    cat(plotter$prettify_div(plotter$boxplot(list(id = 'boxplot_two_series_nonames.txt',
                                                  title = "Two unnamed series boxplot", header = FALSE,
                                                  row_names = FALSE, add_header_row_names = TRUE,
                                                  text = "dynamic", format = "wide")), preset = "magic"))
    cat(plotter$prettify_div(plotter$boxplot(list(id = 'boxplot_factor.txt', title = "Violin boxplot",
                                                  header = TRUE,
                                                  row_names = TRUE, text = "dynamic", format = "wide",
                                                  smp_attr = 5, group = "pathway", add_violin = TRUE)),
                                                  preset = "magic"))
    cat(plotter$prettify_div(plotter$boxplot(list(id = 'rank_distribution.txt', title = "Split boxplot",
                                                  header = TRUE,
                                                  row_names = FALSE, text = "dynamic", format = "long",
                                                  smp_attr = 1:3, group = c("clust_method", "clust_status"),
                                                  height = 500, width= 900)), preset = "magic"))
    cat(plotter$prettify_div(plotter$boxplot(list(id = 'rank_distribution.txt', title = "Split boxplot with original data in hover",
                                                  header = TRUE, showBoxplotOriginalData = TRUE,
                                                  row_names = FALSE, text = "dynamic", format = "long",
                                                  smp_attr = 1:3, group = c("clust_method", "clust_status"),
                                                  height = 500, width= 900)), preset = "magic"))
    cat(plotter$prettify_div(plotter$boxplot(list(id = 'boxplot_grid.txt',
                                                  title = "Four-way split vertical boxplot",
                                                  header = TRUE, row_names = FALSE,
                                                  text = "dynamic", format = "long", smp_attr = 1:2,
                                                  group = c("genes", "samples"), height = 700, width= 800,
                                                  config=list(graphOrientation = "vertical"))),
                                                  preset = "magic"))
    cat(plotter$prettify_div(plotter$boxplot(list(id = 'boxplot_3factor.txt',
                                                  title = "Boxplot with three factors",
                                                  header = TRUE, row_names = TRUE,
                                                  text = "dynamic", format = "long", smp_attr = 3:6,
                                                  group = c("pathway", "dataset", "type"),
                                                  config = list(graphOrientation = "vertical", colorBy = "top"))),
                                                  preset = "magic"))
    cat(plotter$prettify_div(plotter$boxplot(list(id = 'boxplot_wide_2factor.txt',
                                                  title = "Two factor boxplot from wide table", header = TRUE,
                                                  row_names = TRUE, smp_attr = 5:6, text = "dynamic",
                                                  group = c("pathway", "sequencing"), format = "wide",
                                                  add_violin = TRUE)), preset = "magic"))
end.rcode-->

<!--begin.rcode grid showcase, echo = TRUE
    cat(plotter$create_title("You may use our plot_grid method to do what its name suggests", "grid_example", hlevel = 2, indexable = FALSE))
    code_list <- list()
    code_list[[1]] <- plotter$boxplot(list(id = 'boxplot.txt', title = "Simple boxplot", header = TRUE, width = "400px",
                                      row_names = TRUE, text = "dynamic", format = "wide"))
    code_list[[2]] <- plotter$boxplot(list(id = 'boxplot.txt', title = "Simple boxplot", header = TRUE, width = "400px",
                                      row_names = TRUE,text = "dynamic", format = "wide"))
    code_list[[3]] <- plotter$boxplot(list(id = 'boxplot.txt', title = "Simple boxplot", header = TRUE, width = "400px",
                                      row_names = TRUE, text = "dynamic", format = "wide"))
    code_list[[4]] <- plotter$boxplot(list(id = 'boxplot.txt', title = "Simple boxplot", header = TRUE, width = "400px",
                                      row_names = TRUE, text = "dynamic", format = "wide"))
    cat(plotter$plot_grid(code_list))
end.rcode-->


<!--begin.rcode collapsable containers, echo = TRUE
    cat(plotter$create_title("Collapsable demo", id = "click_demo", hlevel = 1, indexable = TRUE, clickable = TRUE, t_id = "clickme_id",
                             clickable_text = "(Click me)"))
    example_div <- plotter$table(list(id = "test_data_frame", header = TRUE, row_names = TRUE, smp_attr = 2,
                      var_attr = 2, attrib = list('class' = 'table table-striped')))
    cat(plotter$create_collapsable_container(id = "clickme_id", html_code = example_div))
end.rcode-->

<!--begin.rcode Custom_loading, echo = TRUE
    cat(plotter$create_title("Generate table data using a custom object", "custom_loading", hlevel = 2, indexable = FALSE))
    plotter$hash_vars$ref_data <- 5
    generate_table <- function(n) {
        return(data.frame(seq(n)))
    }
    cat(plotter$prettify_div(plotter$table(list(id = "ref_data", get_table_meth = generate_table)), preset = "magic"))
end.rcode -->

<!--begin.rcode embed_html, class.output = NULL
    cat(plotter$create_title("Embed other html files", "embed_html", hlevel = 1, indexable = TRUE))
    cat(plotter$create_title("Embed a simple html file", "simple_embed", hlevel = 2, indexable = FALSE))
    cat(plotter$embed_html("./demo_files/embed.html", border = FALSE, html_attribs = 'style="width: 100vw; height: 100vh;"'))
    cat(plotter$create_title("Embed a complex html file", "complex_embed", hlevel = 2, indexable = FALSE))
    cat(plotter$embed_html("./demo_files/html_to_embed.html", border = FALSE,
        html_attribs = 'style="width: 100vw; height: 100vh;"'))
end.rcode -->
