rich-iannone / DiagrammeR

Graph and network visualization using tabular data in R
https://rich-iannone.github.io/DiagrammeR/
Other
1.69k stars 247 forks source link

DiagrammerR is not working properly with bookdown #256

Open byzheng opened 6 years ago

byzheng commented 6 years ago

In the latest DiagrammerR and bookdown, the html-style label is not working properly.

In my test.gv file, I use html style label:

digraph carboncycle {

# Graph statements
graph [overlap = false]

A [label = <Biomass<BR/><font point-size="9" color="blue">unit: DM</font>>]
B [label = <Maintenance respiration<BR/><font point-size="9" color="blue">unit: CH<sub>2</sub>O</font>>]
A -> B
}

The output looks perfect in the Rstudio viewer. image

But the font is changed for html style label when I compiled in bookdown:

image

when gitbook-2.6.7 folder under _book/lib is removed, the gvViz output looks the same as in Rstudio. It seems there are some css style conflicts between grViz and gitbook.

I setup a repository for a minimum example: https://github.com/byzheng/DiagrammerR-test

byzheng commented 6 years ago

After look the elements in the html code:

The problem comes from font-size: inherit;, but don't know how to fix it.

image