plotly.R icon indicating copy to clipboard operation
plotly.R copied to clipboard

quick implementation of most of ggraph/ggforce

Open cpsievert opened this issue 5 years ago • 9 comments

TODO:

  • [ ] Converters for ggforce's GeomMarkCircle/GeomMarkEllipsis/GeomMarkHull
  • [ ] Converter for ggraph's GeomAxisHive (path + text?). For example, see https://github.com/thomasp85/ggraph/blob/8d23845/R/geom_axis_hive.R#L123-L142
  • [ ] Add relevant key attributes.
  • [ ] Throw warnings/pointers to issues when lack of plotly.js support for color/width arrays is relevant (perhaps this should be done at the geom2trace() level).
  • [ ] Catch cases where we need to incorporate geom params into the drawing logic?
  • [ ] Tests!

cpsievert avatar Aug 22 '18 18:08 cpsievert

Was this PR ever considered? What's the situation now?

gvdr avatar Jan 23 '20 08:01 gvdr

@danton267 would you mind filing an issue requesting this feature? Having some {ggraph}/{ggforce} support would have a much higher ROI compared to some of the other extensions you've requested https://github.com/plotly/plotly.R/issues/created_by/danton267

cpsievert avatar Nov 02 '21 19:11 cpsievert

@cpsievert I will happily work on some of the geoms

moutikabdessabour avatar Nov 02 '21 20:11 moutikabdessabour

@moutikabdessabour it'd be great if you could also look into converting {ggraph} based treemaps, so that we can avoid the potential licensing issues with converting {treemapify} https://github.com/plotly/plotly.R/pull/2051

cpsievert avatar Nov 02 '21 21:11 cpsievert

@cpsievert currently implementing ggraph's GeomAxisHive. Once I will finish I will move forward to ggraph's treemaps

moutikabdessabour avatar Nov 02 '21 23:11 moutikabdessabour

@cpsievert I have successfully deconstructed the geoms however I'm facing some transparency issues. attached is my deconstruction when rendered using ggplot and ggplotly

the ggplot one is a bit opaque because alpha gets rescaled to fill the 0 to 1 interval. this is not an issue. ggplot

ggplotly was complaining that unique alpha was bigger then one so I added alpha as an aes to the split_on function. ggplotly

moutikabdessabour avatar Nov 03 '21 10:11 moutikabdessabour

I implemented the ggraph's {treemap} this is the one that's similar to {treemapify} output. Screen Shot 2021-11-03 at 4 25 20 AM

Do you think I should go forward and implement all the examples found here?? https://www.data-imaginist.com/2017/ggraph-introduction-layouts/

Now all the hierarchical plots are supported.

EDIT:

I just noticed that you had some of the geoms implemented in this PR. so ggraph treemaps are supported in this PR too

EDIT 2: I managed to get the desired output for ggraph::geom_axis_hive. How can I push the changes? or do you want me to paste the code here.

Screen Shot 2021-11-03 at 6 25 47 AM

Edit 3:

Managed to implement GeomMarkCircle Screen Shot 2021-11-03 at 7 40 07 AM

I was able to implement all the ggforce geoms you put in the first comment.

@cpsievert how would I convert mm to px in plotly? thanks again for your time.

moutikabdessabour avatar Nov 03 '21 11:11 moutikabdessabour

Hello @moutikabdessabour @cpsievert ! Thanks for your work - I am new to posting GitHub issues.

Out of the ggforce package, is it possible to implement the geom_GeomPathInterpolate() so that the geom_link2() will plot? Thank you! And any workarounds appreciated :)

cassandraxmah avatar Oct 19 '22 01:10 cassandraxmah

Just want to put in my two cents that this would be an incredible addition if it somehow passes checks one day.

jamesdalg avatar Jul 27 '23 21:07 jamesdalg