Git Product home page Git Product logo

Comments (12)

yutannihilation avatar yutannihilation commented on May 24, 2024 2

Thanks. FYI, if you are OK with the screenshots, using webshot is more handy.

https://bookdown.org/yihui/bookdown/html-widgets.html

For example, this should work (after you install PhantomJS by webshot::install_phantomjs()):

---
title: "plot.ly test"
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(
  echo = TRUE,
  screenshot.force = TRUE
)
```

## plot.ly test

```{r plotly}
library(plotly)

plot_ly(economics, x = ~pop)
```

from conflr.

statquant avatar statquant commented on May 24, 2024 1

image
image

from conflr.

yutannihilation avatar yutannihilation commented on May 24, 2024

I think Confluence doesn't allow you to embed plot.ly. Can you?

from conflr.

MadsTrolle avatar MadsTrolle commented on May 24, 2024

I guess there is no easy way of embedding the plotly JavaScript object in confluence… Will look a bit more into if that's possible

A simple workaround would be turning the plotly item into a png, that's then included in the markdown like below.

`

p = plotly::plot_ly(pressure, x = ~temperature, y = ~pressure, mode = 'type', type = 'scatter')
plotly::orca(p, "tmp.png")
knitr::include_graphics("tmp.png")

`

The above deploys the image to our company confluence page using conflr. Not a pretty solution, though… And would require an installation of the orca command line program on the user side https://github.com/plotly/orca and version

from conflr.

MadsTrolle avatar MadsTrolle commented on May 24, 2024

Excellent advice - many thanks!

from conflr.

statquant avatar statquant commented on May 24, 2024

FYI some people in my company are using plotly in confluence and it is totally reactive. People put things in an iframe to make it work

from conflr.

yutannihilation avatar yutannihilation commented on May 24, 2024

Yeah, if HTML macro is available, it's possible. But, I don't think it's not always the case.

HTML macros are disabled by default
https://confluence.atlassian.com/doc/html-macro-38273085.html

Unfortunately, I don't have access to a Confluence with HTML macro enabled... Do you want to try a PR for this feature?

from conflr.

arisehkawamura avatar arisehkawamura commented on May 24, 2024

@statquant
Can you share us the full HTML code?

from conflr.

statquant avatar statquant commented on May 24, 2024

Hello @yutannihilation if you can drive me a bit I'd like to try to PR this, I think that would really make a huge difference to this package and our work flow in general. I have access to confluence with html macro

from conflr.

yutannihilation avatar yutannihilation commented on May 24, 2024

A PR for this will be really appreciated!

from conflr.

statquant avatar statquant commented on May 24, 2024

Would you have some tips and pointers to get me started ?

from conflr.

yutannihilation avatar yutannihilation commented on May 24, 2024

Sorry, I don't have much time to write some developer guide... I guess you can add something like replace_htmlwidgets() in this function:

translate_to_confl_macro <- function(html_text, image_size_default = 600) {

from conflr.

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.