-
Notifications
You must be signed in to change notification settings - Fork 246
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
using subscripts in diagrams #71
Comments
I'm going to look into this. I think it could be done with HTML. Just a theory at this point but I'll post an update soon. |
For now, mermaid("graph LR; A[A<sup>2</sup>]-->|Text with a <sub>xy</sub>|B") We'll need to monitor mermaid-js/mermaid#58 to see if this |
Thanks so much! |
For grViz("
digraph subscript {
# Graph statements
graph [layout = circo, overlap = false]
# Node statements
a [label =<
<TABLE><TR><TD>one<SUB>2</SUB></TD></TR></TABLE>>];
b [label = 'hi']
# Edge statements
a -> b
}
") Graphviz expects the use of a table when using HTML in a |
As another (not sure if better) option, you can use the unicode character (see Stack Overflow post). Just change 2 at the end of
|
@rich-iannone you don't have to use the
|
Ah, that's good about not needing the table def. Now it's a toss-up between which method is better: Unicode character code or old, uppercase HTML tags. I think we can do one better by having an interpreter in place to make it more convenient for the user to enter symbols and subscripts/superscripts (something Latex-like). |
As a last example, here we can manually set a smaller font size to the subscript. I know it is clunky, but it does get close to an expected result.
|
Spent a little time trying to make this a bit easier. Now by using the library(DiagrammeR)
grViz("
digraph subscript {
# Graph statements
graph [layout = circo, overlap = false]
# Node statements
node [fontname = Helvetica]
a [label = 'Two@_{2}']
b [label = 'Three@^{3}']
# Edge statements
a -> b
}
") Get the newest build of |
Sweet! Thanks!!! On Monday, March 2, 2015, Richard Iannone [email protected] wrote:
Micaela Martinez-Bakker NSF Doctoral Fellow e-mail:[email protected] web: I tweet about Infectious Disease Ecology @MartinezBakker |
Is it possible to add both - supersciprts and subscripts? The following snippet adds extra spaces for the subscripts:
|
Hello, Has the bug reported on Dec. 15, 2015 by @tinyheero been resolved? I am getting the same behaviour when using '@gamma' as the variable. Thanks |
Same issue as @tinyheero and @fintzij concerning subscripts for '@lambda' Thank you |
Seems the problem mentioned by tinyheero still persists. |
Hello,
Thanks for making this great package. I have a question, not really an issue. Could someone share how to use subscripts within a diagram? I have been trying to use paste0() and expressions to do this, but I have not managed to figure it out.
All the best,
Micaela
The text was updated successfully, but these errors were encountered: