Skip to content

e_theme() conversion failed with error 99 when saving echarts4r object to .html #407

Description

@nvelden

When using the e_theme() function and saving the widget as .html using the saveWidget() function I get the below error. This is because there is no "default" template for this particular graph.

In a normal R script this is ignored and the graph runs without errors. Would it be possible to add a warning when a theme is used that does not exist because it took a very long time to understand why the graph was only giving an error when saved to .html.

---
title: "Untitled"
author: "Me"
date: "15 2 2022"
output: html_document
---
library(echarts4r)
library(magrittr)
library(htmltools)
knitr::opts_chunk$set(echo = TRUE)
data("volcano")

surface <- as.data.frame(as.table(volcano))
surface$Var1 <- as.numeric(surface$Var1)
surface$Var2 <- as.numeric(surface$Var2)

surface_chart <- 
  surface %>%
  e_charts(Var1, reorder = FALSE) %>%
  e_surface(Var2, Freq) %>%
  e_theme("default") %>% 
  e_visual_map(Freq)
htmlwidgets::saveWidget(surface_chart, file = "surface.html")

    File surface_files/default-1.0.0/default.js not found in resource path
    Quitting from lines 16-30 (test.Rmd) 
    Fehler: pandoc document conversion failed with error 99

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions