Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: exporting Flourish graphs to Canva/Flourish/Office #8

Open
zmeers opened this issue Nov 21, 2024 · 3 comments
Open

Comments

@zmeers
Copy link
Contributor

zmeers commented Nov 21, 2024

I would love the ability to write Flourish graphs from R & Python to:

  • Canva - my marketing team builds decks in Canva, I would love to just slot the graphs in via Python.
  • Flourish's website - likewise, for Canva access via the Flourish content app
  • Word, PPT, etc. - can be screenshots.

Just putting in a feature request for this. 🙏🏻

@zmeers zmeers changed the title Feature request: Feature request: exporting Flourish graphs to Canva/Flourish/Office Nov 21, 2024
@luptilu
Copy link

luptilu commented Nov 21, 2024

100%, this is coming up loads with Flourish customers too!

@zmeers
Copy link
Contributor Author

zmeers commented Nov 21, 2024

Thinking about this some more for writing from R/Python -> Microsoft products.

If there is the ability to take screenshots via Flourish API in R & Python, you could write a wrapper function that uses those functions to save the screenshot to a temporary file, then load the temporary file back into the file so that the screenshot renders in the compiled Word/PPT document, not the interactive graph.

# create a flourish graph 
scatterplot = flourish("scatter") |> bind_scatter_data(data = df, ...)
# lets say you have a function called `snapshot_graph()` that will save the snapshot to a file
# wrap that in another function and add to the package - could look something like this
print_static_graph <- function(graph, file_extension){
  tmp_file <- tempfile(pattern = "file", tmpdir = tempdir(), fileext = file_extension)
  snapshot_graph(graph,  file_ext = file_extension, file_path = tmp_file)
  include_graphics(tmp_file)
  unlink(tmp_file)
}

So for the end R/Python user it'd look like:

scatterplot = flourish("scatter") |> bind_scatter_data(data = df, ...)
print_static_graph(scatterplot, "png")

Something like that! Then when they compile the R/Python file to Word or PPT, it would render as a static snapshot/image.

@zmeers
Copy link
Contributor Author

zmeers commented Nov 21, 2024

For additional context as to why I'd find this useful.
At my new workplace, the research function kind of works like this:

  1. We do our analyses in R, Python, Julia, Observable etc.
  2. Then write a data-driven report with lots of tables & graphs in (R or Quarto) Markdown which is rendered to Word & Powerpoint.
  3. Additional non-data people add suggestions in Word & PPT; we then make final edits to written content there.
  4. The marketing team takes PPT content (graphs etc), recreating them in Canva charts (transcribing the data into the Canva data panel etc).

I just feel like there are quite a few ways to make this process more efficient, but it's not quite there yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants