Format string in graphviz - graph

How can I format string in graphviz NODE ?
Now I have common styles for NODE
node [ href=\"#\",
shape=box,
style=filled,
fillcolor=azure,
color = lightblue3,
fontname=Helvetica,
center=true,
fontsize=9
]
I want to change date format

Use html label
node[label=<>]
An example
i0[label=<
<TABLE border="0">
<TR>
<TD valign="top" rowspan="2">
I<sub>0</sub>:
</TD>
<TD align="left">
S'ā†’.S<BR ALIGN="LEFT"/>
</TD>
</TR>
<TR>
<TD align="left" bgcolor="#aaaaaa">
Sā†’.SS<BR ALIGN="LEFT"/>
Sā†’.(S)<BR ALIGN="LEFT"/>
Sā†’.a<BR ALIGN="LEFT"/>
</TD>
</TR>
</TABLE>
>];

You should be able to do this with html(-like) labels. Give the table one style and that cell a different style. Keep in mind that this HTML is a very constrained subset of real HTML.

Related

Positioning image in github markdown table

I have some content which does not take up the entire column. so I was trying to postion an image to that side so that it saves some space.
I tried checking for grid layouts or column layout in md but none of it has provided info on how to do it
This is what i am looking for
the code is # here
... thanks
The Markdown table does not support cell merge by default, so you should use HTML table.
And in comment, you said
"Even this time the image took only one row, ..."
in this case just use rowspan.
<table>
<tr>
<td>- Identifying cutomer needs (requirments)</td>
<td rowspan="11">
<img src="https://user-images.githubusercontent.com/74305823/118094261-783e8280-b409-11eb-8f50-8ed0b304fef0.png" width="300"/>
</td>
</tr>
<tr>
<td>- market analysis (requirements)</td>
</tr>
<tr>
<td>- defining goals (requirements)</td>
</tr>
<tr>
<td>- Establishing functions (Prodct concept)</td>
</tr>
<tr>
<td>- Task Specifications (Prodct concept)</td>
</tr>
<tr>
<td>- Conceptualizatoin (Solution concept)</td>
</tr>
<tr>
<td>- Evaluating Alternatives</td>
</tr>
<tr>
<td>- Emnodiment Design</td>
</tr>
<tr>
<td>- Analysis and Optimization</td>
</tr>
<tr>
<td>- Experiment</td>
</tr>
<tr>
<td>- Marketing</td>
</tr>
</table>
EDIT
AS #tarleb said, using <ul>...</ul> tag can be more simple.
<table>
<tr>
<td>
<ul>
<li>Identifying cutomer needs (requirments)</li>
<li>market analysis (requirements)</li>
<li>defining goals (requirements)</li>
<li>Establishing functions (Prodct concept)</li>
<li>Task Specifications (Prodct concept)</li>
<li>Conceptualizatoin (Solution concept)</li>
<li>Evaluating Alternatives</li>
<li>Emnodiment Design</li>
<li>Analysis and Optimization</li>
<li>Experiment</li>
<li>Marketing</li>
</ul>
</td>
<td>
<img src="https://user-images.githubusercontent.com/74305823/118094261-783e8280-b409-11eb-8f50-8ed0b304fef0.png" width="300"/>
</td>
</tr>
</table>

HTML anchor inside a table

The tr id element is not working as a destination for links.
I am trying to create the link www.mywebsite.com/page1.asp#row1
Each of these rows has a picture and description that I need to have go to a distinct url.
The code below is the closest that I have gotten, but it is still not working and I do not know why.
I am building this website in Volusion. This HTML is going into a content block within an already built framework.
<table>
<colgroup><col width="30%">
</colgroup>
<tbody>
<tr id = "row1">
<td><div style="text-align: center;"><img src="/img1.JPG" alt="" align="top" border="0px"></div></td>
<td valign="top">1st Image</td>
</tr>
<tr id = "row2">
<td><div style="text-align: center;"><img src="/img2.JPG=" align="top" border="0px"></div></td>
<td valign="top">2nd Image</td>
</tr>
<tr id = "row3">
<td><div style="text-align: center;"><img src="/img3.JPG" alt="" align="top" border="0px"></div></td>
<td valign="top">3rd Image</td>
</tr>
</tbody>
</table>
The path for the image is wrong I guess. Maybe once check the path like there might be another folder you may have forgot to add (like image/img1.jpg). or maybe try ./ instead of /. Also img2 src is wrong. please correct it

Output in one column from multiple input in asp.net

I have a problem to put the input from user in one line separate by comma.
As below code:
<table width="691" border="0" cellpadding="0" cellspacing="0">
<tr><%do while not rs2.EOF%>
<td width="159" rowspan="2" class="commontextBold"> </td>
<td width="200" rowspan="2" class="commontextBold"> </td>
<td>
<span class="commontextBold"><%=rs2.fields("do1").value%>
<% rs2.movenext
loop%>
</span>
</td>
From line 5 to 10, that is the code using to print the output.
For this code the output will looks like (as can see in attachment image):
1111111 -space- 2222222 : this output look like when using loop it will give to much space between the output
I need the output looks like this,
1111111,2222222
The output may be more that two, depend on user input.
How can i avoid the output print without too many spaces between the value?
FYI, this output will be print in the courier slip.
Code
output
Not quite sure if this is want you want:
<table width="691" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="159" rowspan="2" class="commontextBold"> </td>
<td width="200" rowspan="2" class="commontextBold"> </td>
<td>
<%do while not rs2.EOF%>
<span class="commontextBold"><%=rs2.fields("do1").value%></span>
<%rs2.movenext
loop%>
</td>

How to loop through Map in Thymeleaf

I am trying to understand how to loop through all entries in a Map in Thymeleaf. I have a domain object being processed by Thymeleaf that contains a Map.
How do I loop through the keys and fetch the values ?
Thanks.
Nevermind... I found it...
<tr th:each="instance : ${analysis.instanceMap}">
<td th:text="${instance.key}">keyvalue</td>
<td th:text="${instance.value.numOfData}">num</td>
</tr>
Thanks.
In case you have a List as the value. For example, when you have a map with key being the category, and value being a list of items pertaining to that category, you can use this:
<table>
<tr th:each="element : ${catsAndItems}">
<td th:text="${element.key}">keyvalue</td>
<table>
<tr th:each="anews : ${element.value}">
<td th:text="${anews.title}">Some name</td>
<td th:text="${anews.description}">Some name</td>
<td th:text="${anews.url}">Some name</td>
<td th:text="${anews.logo}">Some name</td>
<td th:text="${anews.collectionDate}">Some name</td>
</tr>
</table>
</tr>
</table>

Graphviz (xdot): How to make recursive nodes?

I'm currently writing a graphs library in Java, and I would like a tool to visualize some graphs. I discovered Graph-viz, which happens to be a great - although buggy - way of doing this.
In my model, Graphs are composed of Nodes and Edges. Every Node have a certain number of Ports (I/O/IO) and Edges link those Ports together. Some special nodes are called GraphNodes and embed a Graph. The Ports of these GraphNodes are mapped to some Ports of the internal Nodes.
I'd like to provide several representation. The first of them, with which I am satisfied, is as follows: http://i.stack.imgur.com/ujU71.png
The input Ports are represented in green, the output ones in red, and the input-output ones in blue.
In this representation, the GraphNodes are not expanded and are displayed just as simple Nodes. In a second version, I would like to create something that looks like the following picture: http://i.stack.imgur.com/Cx624.png
The problem is that I can't manage to create a sub-graph (cluster) with fixed areas (it seems not to be possible). Another solution I tried was to embed a graph into a node. However, inserting some code into the <td> </td> part of a HTML label does not evaluate the code:
digraph graph0
{
node1
[
label =
<
<table border="0" cellspacing="0">
<tr>
<td cellpadding="0">
<table border="0" cellspacing="0">
<tr>
<td bgcolor="palegreen" border="1" port="port2">port2</td>
<td bgcolor="palegreen" border="1" port="port3">port3</td>
</tr>
</table>
</td>
</tr>
<tr>
<td cellpadding="0">
<table border="0" cellspacing="0">
<tr>
<td cellpadding="0">
<table border="0" cellspacing="0">
<tr>
<td bgcolor="skyblue" border="1" port="port5">port5</td>
</tr>
</table>
</td>
<td bgcolor="peachpuff" border="1">
subgraph clusterTest
{
nodeTest
}
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td cellpadding="0">
<table border="0" cellspacing="0">
<tr>
<td bgcolor="lightpink" border="1" port="port4">port4</td>
</tr>
</table>
</td>
</tr>
</table>
>
style = "invisible"
]
}
The previous code creates the following graph: http://i.stack.imgur.com/E9jQ1.png
Finally, the best solution I can come up with is the following: http://i.stack.imgur.com/VzS5g.png
However I am not satisfied with it, because the GraphNodes' Ports are placed in strange locations sometimes.
Do you please know how I can reach the target graph layout? Please ask for any other information if needed.
EDIT: I still didn't find any solution. A way to handle this would be to be able to fix the position of given nodes inside the containing cluster, but it seems not to be possible with "dot" layout. Any idea ?
Using a digraph, one can specify the positions of nodes (relative to one another). This can be used to force certain elements to appear above others. While other nodes can be forced to appear on the same level ( port 101 and 102 in this example)
Fake nesting: This graph does not use nested plaintext/semi-html nodes because I don't think that is possible (not a feature). I'm not sure if any graphviz libraries support them either, but it may be worth looking into other libraries. I've never even used dot from Java or Python, otherwise I would make a suggestion.
digraph {
nodesep = 0.2
ranksep = 0.8
pad = 0.1
node [ shape=square ]
node [ style=filled ]
edge [ arrowhead=none ]
//rankdir = LR
component_starter [ label = <
port02
port03
port06
S
port07
port08
port04
port05
> style = "invisible" ]
subgraph cluster_container {
label="I/O device with components "
color=orange
//margin = 0
edge [ style="invis"]
//edge [ len="0.5" minlen="1" ]
node [ height="0.5" width="2" fixedsize=true ];
node [ shape=rectangle style=filled ]
{
node [ color=palegreen ];
{ rank = same port101 -> port102 }
}
{
node [ color=skyblue];
port103 port104 }
{
node [ height="1.5" width="2" fixedsize=true ];
node [ color=peachpuff];
//notaport
}
{
node [ height="0.5" width="4" fixedsize=true ];
node [ color=lightpink];
output
}
//--
//subgraph cluster_inner {
//label="abstractions"
//color="black"
//style="invis"
component_a [ label = <
<table border="0" cellspacing="0"><tr>
<td border="1" bgcolor="white" > </td>
<td border="1" bgcolor="palegreen" port="port2">port2</td>
<td border="1" bgcolor="palegreen" port="port3">port3</td>
</tr><tr>
<td border="1" bgcolor="skyblue" port="port6">port6</td>
<td border="1" bgcolor="peachpuff" rowspan="3" colspan="2">A</td>
</tr><tr>
<td border="1" bgcolor="skyblue" port="port7">port7</td>
</tr><tr>
<td border="1" bgcolor="skyblue" port="port8">port8</td>
</tr><tr>
<td border="1" bgcolor="lightpink" colspan="1" port="port4">port4</td>
<td border="1" bgcolor="lightpink" colspan="2" port="port5">port5</td>
</tr></table> > style = "invisible" ]
component_b [ label = <
<table border="0" cellspacing="0"><tr>
<td border="1" bgcolor="white" > </td>
<td border="1" bgcolor="palegreen" port="port22">port22</td>
<td border="1" bgcolor="palegreen" port="port23">port23</td>
</tr><tr>
<td border="1" bgcolor="skyblue" port="port25">port25</td>
<td border="1" bgcolor="peachpuff" colspan="2"> B </td>
</tr><tr>
<td border="1" bgcolor="lightpink" colspan="3" port="port24">port24</td>
</tr></table> > style = "invisible" ]
//-
component_c [ label = <
<table border="0" cellspacing="0"><tr>
<td border="1" bgcolor="white" > </td>
<td border="1" bgcolor="palegreen" port="port32">port32</td>
<td border="1" bgcolor="palegreen" port="port33">port33</td>
</tr><tr>
<td border="1" bgcolor="skyblue" port="port35">port35</td>
<td border="1" bgcolor="peachpuff" colspan="2"> C </td>
</tr><tr>
<td border="1" bgcolor="lightpink" colspan="3" port="port34">port34</td>
</tr></table> > style = "invisible" ]
//}
port101 -> port103
port102 -> component_a
port102 -> component_b
port103 -> port104
component_a -> output;
component_b -> output;
component_c -> output;
edge [ style="" arrowhead="normal" color="#444444"]
component_a:port4 -> output;
component_c:port34 -> component_a:port3;
component_a:port5 -> component_b:port22;
port101 -> component_c:port33
//-
{ rank = same
edge [ dir=back ]
port104 -> component_a:port8
}
}
component_starter;
component_starter:port5 -> port101;
}
The above dot file, compressed. Use base64 -d nesting.bz2.base64 |bzcat to view it.
QlpoOTFBWSZTWd/epEIABCzfgHAwWAP/3zgkmAq/7//6UASZm8a7VNrQBQQlSDUaYjTINGjIyZAG
ho0aNMgkUZJpEIzUw0TTEzQBoAIwCTUiFT1NppDymGk0Pap6gMmCaAAcwAAAAAAAAAAFSRJoGp6B
TyNTyhABoD1DQ0aephLyAcTAhMSQiKogMBLsVaZBYIwUHIGFISYVKCMVkRgLypG2mhHPb5z0hBap
yN3HCL2iJVDYvXI6SykmzPN9LCaex+63c7jyTnk18c2KgvDZq6Kkz+WWf4DU4KoQsCQJ1gKpAcwC
mp5nGnmlI8wBNtgDi+Hmf0/g/v4PoNaZVrhy5cdWCavJkutPC0t50kljBJLHXrbQUjJMPPDCUKwN
NHO8aaiqKTus3tLEpprCW8Gzr68DtvyteHrqa7JJ9J46R4muUMuU39kJYPEgwJWwCSqsgMteezTo
ta1rr3va1sccdW/32OJUROFkmUzqeyHn+g96EccgEY5SfJixh2aJgQC0JVmWAtrdagoOkDZAViKA
qUpGZ1dXNJikmmsRZmAO16Kq9osW7KzzPZPS9IeLIqXo0cOoNwatry3Mi792YMRvA3oiKxe84ac7
EMGmdrabTaG0qqDpAMJJn5IeAbvMNiSJW8og7y+Ik+CExJBhLDZlKFSFKMBgIIMai57J5pLmgl5R
Qm261e797RF6qhy82NQypLEa8ktUVAL2R1hxThWC3pVB0jBThRxVLfHHJeZHv+pMEkxZ3P6KP+ho
QWyC9gtIM2cxJK2pIiiIooOPlxE0kkspJPijcgrHRHw6XvMpwy5ldiqlUpWzvymgxr78zAXh4vSW
L3jya8Hqc6ekwhhDROybThDBnIdmdlN6ClO8bo7ucxNqSVjHNGd8F8ocW2qmT0bJRujojA9MJqnC
TPg09tZlJ5d/am7W8E6GeU3TkyVC0N5nTgeXXn7Sj1UWijm1Q07OKeXiyPbENRSNcNzrnkyxkNeu
RgS5GWEXKkpTdIy8NenUhVYpqkbUCushe+cQ15oMcRIrb4GZscDDVmLk3LF7Txk6yFvmky8aoiK5
T+3pVRjVVVUtLRVFFI0q1lrpHlGqNnHKOVIKkktUYAuq2L1bekwQeG68LX3tK64kVNRw2tDb7rLn
acBl0J61Ld57HXXHKpXLjoqAo5yyRvQ/YxLdufjNCSaEk4mmYLcZp1ybI1BqDTum20PSm2cId4pU
Zx00pZzOJZwnSHjAqXNkWCM4s/+LuSKcKEhv71IhAA==

Resources