Skip to content

Instantly share code, notes, and snippets.

@helgasoft
Last active May 6, 2024 07:24
Show Gist options
  • Save helgasoft/e914fe6f4a9ed9407f78e41cb18b3aaa to your computer and use it in GitHub Desktop.
Save helgasoft/e914fe6f4a9ed9407f78e41cb18b3aaa to your computer and use it in GitHub Desktop.
echarty announcements and temporary notes
#' This gist is for echarty announcements and notes
#' Comments are temporary, periodically deleted.
#' If you like echarty, please consider granting a Github star ⭐.
library(echarty)
data.frame(x = seq.int(1, 5, 1),
y = seq.int(1, 10, 2)) |>
ec.init(
series.param= list(
type='line', symbolSize= 10,
lineStyle = list(opacity= 0.7),
itemStyle = list(opacity= 1),
areaStyle= list(color= 'red', opacity= 0.5))
)
@helgasoft
Copy link
Author

echarty is on WebR - see the Coder.
Live R-code execution inside a single web page. No Rmd. No server. No installation. Wow!
Thanks to: @seanbirchall for the idea and @timelyportfolio for the solution 💐👑

@helgasoft
Copy link
Author

@bluefoxr - scale scatter points by group

library(echarty)
bubble_size <- x <- y <- 1:5
df1 <- data.frame(
  x = c(x, x + 6),
  y = c(y, y + 6),
  Size = c(bubble_size*2, bubble_size*10),
  Group = c(rep("SMALL", 5), rep("BIG", 5))
)
df1 |> group_by(Group) |> 
ec.init( series.param= list(symbolSize= ec.clmn('Size')) )

@bluefoxr
Copy link

bluefoxr commented May 6, 2024

Hi @helgasoft thanks very much for this! The only thing is I am working on an app which has echarts4r built in in various places, so I can't easily switch to another package. But for the next project I will definitely look into using echarty, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment