My question is I want to integrate a d3.js visualization to my markdown rather than a link pointing to the visualization on external website. Is there a way to achieve that?
You have now the R2D3 package that allows that!
Rmardown is one way of including D3 visualisation in R
https://rstudio.github.io/r2d3/articles/publishing.html#r-markdown