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

How to embed in Markdown&html outside Rmd and shiny #109

Open
huyingjie opened this issue Dec 16, 2017 · 3 comments
Open

How to embed in Markdown&html outside Rmd and shiny #109

huyingjie opened this issue Dec 16, 2017 · 3 comments

Comments

@huyingjie
Copy link

My blog uses hexo, which is a static website generator. Each blog post is a Markdown file. blogdown developed by Yihui Xie has a lot of errors and I do not have the knowledge to fix them. I do not use shiny.

How to embed the animation plot generated in a Markdown file? Do you have javascript link similar to bootstrap<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"></script>?

How to get the javascript code containing data which generates the animation plot?

Thank you.

@yulijia
Copy link
Collaborator

yulijia commented Dec 18, 2017

I am not familiar with hexo. But you can generate the animation figure on your local computer, and upload it to online storage platform. Then you can embed the figure with markdown syntax ![GitHub Logo](/images/logo.png).

Animation is not a javascript library, if you want to generate animation picture with javascript, please take a look at D3.js and ployly, there are a lot of ways to produce dynamic, interactive data visualizations in web browsers.

@huyingjie
Copy link
Author

@yulijia Thank you for your reply. My definition of animation is not clear. It is not an animated gif file. I want to embed graphs generated from ployly r package. Yes, there are a lot of r packages generating interactive visualization graph. But none of them supply the raw codes of javascript. Thus, it is impossible for me to embed them in hexo.

Hexo will automatically convert a html which has interactive grah into a post. But I want to embed them in a post, not to create a graph as a whole post.

@yulijia
Copy link
Collaborator

yulijia commented Dec 19, 2017

This is maybe what you need: Data Visualization Using Plotly in Hexo, and here is the raw html code of that post.

Hexo cannot convert any r code (in Markdown file) to figure (in html static website). Please use blogdown, also Yihui provides a simple example at blogdown-hexo.

If you have any question when using blogdown, please ask them on StackOverflow with the blogdown tag.

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