Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
fc6d120
start html support
mert-kurttutan May 14, 2025
3b89ce4
Fix type error
mert-kurttutan May 14, 2025
d00f992
add fontname support
mert-kurttutan May 14, 2025
25fa935
add support for text declaration and font style
mert-kurttutan May 14, 2025
3fc31ae
rustfmt
mert-kurttutan May 14, 2025
53ff597
Add support for fontweight
mert-kurttutan May 14, 2025
26b88be
Better layout for cells with multi text items
mert-kurttutan May 15, 2025
d7f96bf
Remove stale comments
mert-kurttutan May 15, 2025
33b9340
Revert tspan change
mert-kurttutan May 15, 2025
bfd0051
Font support for table
mert-kurttutan May 15, 2025
c11f08b
remove output file
mert-kurttutan May 15, 2025
f7c419a
Handle error for using text after tag wrapping table
mert-kurttutan May 15, 2025
5935984
Count spaces for handling table wrapper text, see the note: https://g…
mert-kurttutan May 15, 2025
267a921
Remove some stale comments, bettter name for detecting invalid string…
mert-kurttutan May 15, 2025
8ff779f
rustfmt
mert-kurttutan May 15, 2025
94a79b1
remove some stale comment and new token error print
mert-kurttutan May 15, 2025
60d8b56
dont pad html text, not compatible with inner layout algo
mert-kurttutan May 15, 2025
f931d3d
remove output file
mert-kurttutan May 15, 2025
fc5de14
more precise measurement of line width
mert-kurttutan May 15, 2025
0b910db
flatten the structure of text in html
mert-kurttutan May 15, 2025
8b82624
rustfmt
mert-kurttutan May 15, 2025
dfc21ee
add support for baseline shift
mert-kurttutan May 15, 2025
c942392
Correct alignment within cell
mert-kurttutan May 15, 2025
38febce
rustfmt
mert-kurttutan May 16, 2025
6f30444
remove stale comment and print
mert-kurttutan May 16, 2025
0ef2585
better visibility deafult for html
mert-kurttutan May 16, 2025
7910f06
add support for embedding image
mert-kurttutan May 17, 2025
8d4a4a5
Add validation for row and table splitting and some reorganization
mert-kurttutan May 17, 2025
276635d
Better horizontal layout within cell, fix inheritance bug for font_we…
mert-kurttutan May 17, 2025
9a64cac
Fix inheritance bug for font style
mert-kurttutan May 17, 2025
e95b330
remove stale comment
mert-kurttutan May 17, 2025
f00d5b5
better layout for height within cell
mert-kurttutan May 17, 2025
736699b
add lr test for html, remove redundant clip argument for html parsing
mert-kurttutan May 17, 2025
34aaae0
Better api for handling image size
mert-kurttutan May 17, 2025
342cb3c
rustfmt
mert-kurttutan May 17, 2025
487a359
Merge branch 'nadavrot:master' into html
mert-kurttutan Jun 8, 2025
a91d60b
make html into variant of shape content
mert-kurttutan Jun 8, 2025
d0f0b23
Update benchmark after ShapeContent update
mert-kurttutan Jun 8, 2025
174b215
Process html string at the level of graph statements
mert-kurttutan Jun 8, 2025
0300137
Fix the default shape and introduce no shape with text content
mert-kurttutan Jun 8, 2025
a741bb4
remove stale comment
mert-kurttutan Jun 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions examples/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn test_main(n_node: usize, _n_edge: usize) {

for i in 0..n_node {
let elem = Element::create(
ShapeKind::Circle(format!("hi_{}", i)),
ShapeKind::Box(ShapeContent::String(format!("hi_{}", i))),
StyleAttr::new(Color::transparent(), 0, None, 0, 0),
Orientation::LeftToRight,
Point::zero(),
Expand All @@ -29,7 +29,7 @@ fn test_main(n_node: usize, _n_edge: usize) {
println!("Time elapsed in expensive_function() is: {:?}", duration);
println!("--------------------------------------");
}
use layout::std_shapes::shapes::{Element, ShapeKind};
use layout::std_shapes::shapes::{Element, ShapeContent, ShapeKind};
use layout::topo::layout::VisualGraph;

fn main() {
Expand Down
13 changes: 13 additions & 0 deletions inputs/html.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
digraph structs {
node [shape=plaintext]
struct3 [label=<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
<TR>
<TD COLSPAN="1" ROWSPAN="2">1st col</TD>
<TD COLSPAN="1" ROWSPAN="2">2nd col</TD>
</TR>
<TR>
<TD COLSPAN="1" ROWSPAN="1" >3rd col</TD>
</TR>
</TABLE>>];
}
19 changes: 19 additions & 0 deletions inputs/html2.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
digraph structs {
node [shape=plaintext];

struct3 [label=<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
<TR>
<TD ROWSPAN="3">hello<BR/>world</TD>
<TD COLSPAN="3">b</TD>
<TD ROWSPAN="3">g</TD>
<TD ROWSPAN="3">h</TD>
</TR>
<TR>
<TD>c</TD><TD PORT="here">d</TD><TD>e</TD>
</TR>
<TR>
<TD COLSPAN="3">f</TD>
</TR>
</TABLE>>];
}
24 changes: 24 additions & 0 deletions inputs/html3.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
digraph structs {
node [shape=plaintext]
struct1 [ label=<
<tABLE BORDER="16" BGCOLOr="bisque" CELLPADDING="2" ROWS="*adfasdfadsf" vALIGN="Top" >
<TR>
<TD CELLPADDING="1" CELLSPACING="12" COlSPAN="3">elephant</TD>
<TD BORDER="1" CELLSPACING="12" ROWSPAN="2" BgCOLOR="chaRtreuse"
vALIGN="Top" ALIGN="right">two</TD>
</TR>
<TR>
<TD CELLSPACING="12" COLSPAN="2" ROWSPAN="2">
<TABLE BGCOLOR="grey">
<Tr><TD>corn</TD></Tr>
<TR><TD BGCOLOR="Yellow">c</TD></TR>
<TR><TD>f</TD></TR>
</TABLE>
</TD>
<TD BGCOLOR="white">penguin</TD>
</TR>
<TR>
<TD COLSPAN="2" BORDER="4" ALIGN="right" PORT="there">4</TD>
</TR>
</tABLE>>];
}
28 changes: 28 additions & 0 deletions inputs/html_arrow.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
digraph structs {
node [shape=plaintext]
struct1 [label=<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
<TR><TD>left</TD><TD PORT="f1">mid dle</TD><TD PORT="f2">right</TD></TR>
</TABLE>>];
struct2 [label=<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
<TR><TD PORT="f0">one</TD><TD>two</TD></TR>
</TABLE>>];
struct3 [label=<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
<TR>
<TD ROWSPAN="3">hello<BR/>world</TD>
<TD COLSPAN="3">b</TD>
<TD ROWSPAN="3">g</TD>
<TD ROWSPAN="3">h</TD>
</TR>
<TR>
<TD>c</TD><TD PORT="here">d</TD><TD>e</TD>
</TR>
<TR>
<TD COLSPAN="3">f</TD>
</TR>
</TABLE>>];
struct1:f1 -> struct2:f0;
struct1:f2 -> struct3:here;
}
51 changes: 51 additions & 0 deletions inputs/html_complex.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
digraph G {
rankdir=LR
node [shape=plaintext]
a [
label=<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
<TR><TD ROWSPAN="3" BGCOLOR="yellow"><SUP>class</SUP></TD></TR>
<TR><TD PORT="here" BGCOLOR="lightblue">qualifier</TD></TR>
</TABLE>>
]
b [shape=ellipse style=filled
label=<
<I><TABLE BGCOLOR="bisque">
<TR>
<TD COLSPAN="3">elephant</TD>
<TD ROWSPAN="2" BGCOLOR="chartreuse"
VALIGN="bottom" ALIGN="right">two</TD>
</TR>
<TR>
<TD COLSPAN="2" ROWSPAN="2">
<TABLE BGCOLOR="grey">
<TR><TD>corn</TD></TR>
<TR><TD BGCOLOR="yellow">c</TD></TR>
<TR><TD>f</TD></TR>
</TABLE>
</TD>
<TD BGCOLOR="white">penguin</TD>
</TR>
<TR>
<TD COLSPAN="2" BORDER="4" ALIGN="right" PORT="there">4</TD>
</TR>
</TABLE></I>>
]
c [
label=<long line 1<BR/>line 2<BR ALIGN="LEFT"/>line 3<BR ALIGN="RIGHT"/>>
]

subgraph { rank=same b c }
a:here -> b:there [dir=both arrowtail=diamond]
c -> b
d [shape=triangle]
d -> c [label=<
<TABLE>
<TR>
<TD BGCOLOR="red" WIDTH="10"> </TD>
<TD>Edge labels<BR/>also</TD>
<TD BGCOLOR="blue" WIDTH="10"> </TD>
</TR>
</TABLE>>
]
}
Loading
Loading