Code Monkey home page Code Monkey logo

Comments (8)

happyshows avatar happyshows commented on May 16, 2024 1

cool thanks. I'll continue to post code chunks where I see maybe useful, you can take a look when you're available.

from echarts4r.

happyshows avatar happyshows commented on May 16, 2024 1

@JohnCoene could you take a look at your example code again? Latest version is breaking your example.

from echarts4r.

kovla avatar kovla commented on May 16, 2024 1

I think it would be really useful to include the example of using itemStyle= in the help section for this function. It is hard to discern what the desired format should be, and the error message itself is not very informative.

from echarts4r.

JohnCoene avatar JohnCoene commented on May 16, 2024

Hi Shows,

Thank you for the suggesting. I have implemented it, the only issue being that itemStyle is not applied to parent and only to child. itemStyle is an array in the original library which means we need to pass a list of data.frames or a list of lists.

It is imperfect but may work in future version. I plan on focusing more on echarts4r around October once work quiets down, I'll tackle this issue (amongst many others).

example

df <- data.frame(
  parent = c("earth", "earth", "earth", "mars", "mars"), 
  child = c("forest", "ocean", "iceberg", "elon", "curiosity"),
  value = ceiling(rnorm(5, 10, 2))
)

# add styles
df$color <- "red"
df$borderColor <- "black"

df %>% 
  tidyr::nest(color, borderColor, .key = "style") %>% # nest
  e_charts() %>% 
  e_sunburst(parent, child, value, style) 

Let me know what you think.

from echarts4r.

JohnCoene avatar JohnCoene commented on May 16, 2024

Thank you! Feel free to make a PR.

from echarts4r.

JohnCoene avatar JohnCoene commented on May 16, 2024

Hi Shows, I must thank you for sticking to the package despite all its bugs! I just pushed a fix. Thanks for reporting that :)

from echarts4r.

JohnCoene avatar JohnCoene commented on May 16, 2024

By the way, I also pushed some great performances improvements (in the rendered data.frame) by greatly lightening the output, I hope you see a difference.

from echarts4r.

JohnCoene avatar JohnCoene commented on May 16, 2024

Thanks for pointing that out, I added details as well as an example to the e_sunburst man page (dev version of course).

from echarts4r.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.