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

Test embedding html versions of infographics #29

Closed
Robinlovelace opened this issue Feb 25, 2021 · 4 comments
Closed

Test embedding html versions of infographics #29

Robinlovelace opened this issue Feb 25, 2021 · 4 comments

Comments

@Robinlovelace
Copy link
Contributor

I've created a html version of the baseline mode split infographic for testing: https://rpubs.com/RobinLovelace/730913

See the commit below for the html and associated files in the actdev repo. There are probably better ways of doing this and svg may be a good option but this is just a starter to see what's possible.

I can output this in other formats based on plotly but there may be technical limitations with this approach. See https://plotly.com/ggplot2/ and this chapter of a free and open source book: https://plotly-r.com/improving-ggplotly.html for what is possible.

(Caveat: this is not my area so not sure I can make changes to this quickly, hence seeing this a question of testing only, may be quicker to do it 100% on the JS side in this repo but suspect that will take a lot of time looking at the code to generate these plots, we could output .csv/.json files in a file format that's easier to convert into these plots as another option).

Robinlovelace added a commit to cyipt/actdev that referenced this issue Feb 25, 2021
Robinlovelace added a commit to cyipt/actdev that referenced this issue Feb 25, 2021
@Robinlovelace
Copy link
Contributor Author

It may be worth taking a look at and reproducing the code here to get a handle of what's going on: you can run it from the root directory of the actdev repo and it should work: https://github.com/cyipt/actdev/blob/main/code/mode-split-summary.R

@Siequnu
Copy link
Collaborator

Siequnu commented Feb 26, 2021

This is a 4.66MB file which is unusably large. It appears to be loading some sort of massive blob at the start of the file.

If this is the aforementioned way of embedding HTML from R, we'll have to seek another way unless we can reduce the size. (i.e. JS on my side based on your JSONs or CSVs, and using PNGs (with #434343/transparent background) for the more complex visuals).

@Siequnu
Copy link
Collaborator

Siequnu commented Feb 26, 2021

I will experiment generating a JS mode-split chart and push that to the UI, should only be a couple dozen kb at max and will be quite flexible.

@Siequnu
Copy link
Collaborator

Siequnu commented Mar 4, 2021

Current charts working well for now, closing this unless we decide to change the chart generation again.

@Siequnu Siequnu closed this as completed Mar 4, 2021
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