Relation Graph Improvements

Want to help out? Need help accessing the AniDB API? This is the place to ask questions.

Moderator: AniDB

wahaha
AniDB Staff
Posts: 1497
Joined: Sun Nov 17, 2002 3:33 pm

Post by wahaha »

Well then, the changes for the crammed nodes - either to directly use them or to experiment with ;):

Code: Select all

  // global settings
  bgcolor = "#BFC2C9";
  node [fontsize = 10, fontname = Verdana, shape = plaintext];
[...]
  // for each node. Variables set in $...$
  1 [label=<
  <TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0">
    <TR><TD BGCOLOR = "#C8CAD1" BORDER="1">$anime_type$</TD><TD> </TD></TR>
    <TR><TD BGCOLOR = "#C8CAD1" COLSPAN="2" BORDER="1" PORT="name">
    <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
    <TR><TD BGCOLOR="$anime_type_color$" COLSPAN="2">$anime_title$</TD></TR>
    <TR><TD>$episodes$</TD><TD>$year$</TD></TR></TABLE></TD></TR>
  </TABLE>>, URL="..."];
Sample: http://wahaha.eu.tt/anidb/relations_node1.gif (the node's background [#C8CAD1] slightly differs from the surrounding background [#BFC2C9])

I'd suggest using light colors for $anime_type_color$. I used #D0DEF2 for TV, #D0F2DE for Movies, #DEDEDE for Other and #F2DED0 for OVAs.


Changes for relations on single edges:

Code: Select all

  // global settings
  edge [fontsize = 8, fontname = Verdana, labelfontsize = 8, labelfontname = Verdana];
  edge [ labeldistance = 1.3 , labelangle = -30, arrowsize = .8, minlen = 1];
[...]
  // a two-label-edge, example for: 1 is prequel of 2, 2 is sequel of 1
  1 -> 2 [ taillabel = "prequel", headlabel = "sequel", color = red4, dir = both, label = "          " ];

  // a single-label-edge
  1 -> 3 [ label = "alternative setting", dir = both, color = orange ];

 // of course, there can now be no "A -> B"-edge when there already was a "B -> A"-edge - it shouldn't matter which of the two is actually used, though.
A full example: http://wahaha.eu.tt/anidb/yua.png (listed the OVA seperately)
And the .dot-file it was generated from: http://wahaha.eu.tt/anidb/yua.dot

(EDIT: Added empty label to two-dir-edges and reduced minlen to 1)
Last edited by wahaha on Wed Mar 03, 2004 8:11 pm, edited 1 time in total.
exp
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post by exp »

hmm,

dunno, those entries might waste too much space?
I am not sure about that though.
What do others think about it?

BYe!
EXP
wahaha
AniDB Staff
Posts: 1497
Joined: Sun Nov 17, 2002 3:33 pm

Post by wahaha »

Space-wise, the main difference is that the nodes are a bit less wide (maybe 3%), but also significantly higher (~ 80%), mainly because the TV/OVA/Movie-info is put above the anime-name. For the whole graph, there's a certain gain by using the two-directional edges.

The episode-count and year alone don't make much of a difference (~ 10% increased height in a node).

And actually, with rankdir=LR, the height-difference shouldn't have much of an impact for the graph as a whole.
A simple example (that doesn't prove anything... but anyway):
Image
(click to enlarge)
exp
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post by exp »

ok,

i've added a Q&D version of those graphs, what do you think?

pending problems:
- edge colors are sometimes wrong (easy to fix but i am too lazy atm :P)
- alt/title tags for image maps show html code (this might be a hard one)
- better colors needed?
- maybe another layout all together? (dunno)

BYe!
EXP
wahaha
AniDB Staff
Posts: 1497
Joined: Sun Nov 17, 2002 3:33 pm

Post by wahaha »

Wai ^^

There's a little bug with the graphs that occurs when there's no year set (and results in showing the anime-id instead of the table), because the parser can't handle "<TD></TD>". Just put a space in there and it works again.

For completeness' sake a log-excerpt from after exp's post:
#anidb wrote:<wahaha> EXP[BUSY]: with tooltip="whatever", the title-attribute of the cmap can be set independent from the label. However, I still don't know how to get rid of the alt-tag. (it's a node-attribute)
<wahaha> looks to me like there are three possibilities - none of them really good... create a seperate .dot for the map, alter the map after creation or change the program
<EXP[BUSY]> then i'll probably change the map file
About "edge colors are sometimes wrong":
I now think that it may even be helpful to keep it to differentiate between prequel-sequel and sequel-prequel, because they could otherwise create a wrong impression.
For example Slayers: http://anidb.ath.cx/perl-bin/animedb.pl?show=rel&aid=39
If all edges had the same color, it'd look like a perfect line from "Slayers Premium" to "Slayers Try", one'd have to really pay attention to the "prequel" and "sequel"-labels.
Currently, at least one can graps that there's something wrong with one's first impression.

Another possibility to approach this problem might be to declare one end of a bidirectional relation the "weak" side and mark it with a different sign, e.g. a reversed arrow or a circle.
These weak sides could be prequel (vs. sequel), side story (vs. parent story) and summary (vs. full story).
exp
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post by exp »

Hm,

it might be interesting to play with some different arrow styles.
I'll leave that to you :P

BYe!
EXP
egg
Posts: 769
Joined: Tue Nov 11, 2003 7:17 am

Post by egg »

wahaha wrote:Wai ^^
About "edge colors are sometimes wrong":
I now think that it may even be helpful to keep it to differentiate between prequel-sequel and sequel-prequel, because they could otherwise create a wrong impression.
For example Slayers: http://anidb.ath.cx/perl-bin/animedb.pl?show=rel&aid=39
If all edges had the same color, it'd look like a perfect line from "Slayers Premium" to "Slayers Try", one'd have to really pay attention to the "prequel" and "sequel"-labels.
Currently, at least one can graps that there's something wrong with one's first impression.
Actually I think that the system should always define the forward side relation, even if the user defined it the other way around. The reason for this is otherwise the routing can end up looking like a mess. This one turned out to be somewhat elegant and happened to make it fit on one page, but it could turn out to be much worse. For instance, with tenchi this is part of the problem. Tenchi Muyo GXP is put in the middle of the mess because it is trying to put all of the other series to the right because that is the direction the link was generated. If the link direction specified in the strong side relation, the steps will flow naturally from left to right and not zig-zag back and forth.
wahaha wrote:Another possibility to approach this problem might be to declare one end of a bidirectional relation the "weak" side and mark it with a different sign, e.g. a reversed arrow or a circle.
These weak sides could be prequel (vs. sequel), side story (vs. parent story) and summary (vs. full story).
I would change the arrow attribute to "oinv", that is open(non-filled) inverse arrow. I can't test it ATM, but I will try it out and upload a sample later.

Also, another thing I was thinking, is maybe it would be better to have the graphs go down (portrait) mode rather than to the right (landscape). Most of the graphs go off to the right of the page, but most people are used to scrolling down.

BTW, exp, can we get some newer dot files to play around with?
exp
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post by exp »

egg wrote:Actually I think that the system should always define the forward side relation, even if the user defined it the other way around. The reason for this is otherwise the routing can end up looking like a mess. This one turned out to be somewhat elegant and happened to make it fit on one page, but it could turn out to be much worse. For instance, with tenchi this is part of the problem. Tenchi Muyo GXP is put in the middle of the mess because it is trying to put all of the other series to the right because that is the direction the link was generated. If the link direction specified in the strong side relation, the steps will flow naturally from left to right and not zig-zag back and forth.
hm, I am not sure if the ordering of the edges in the dot file has any effect on the resulting image though.
maybe someone could play around a bit to confirm/refute that?
egg wrote:I would change the arrow attribute to "oinv", that is open(non-filled) inverse arrow. I can't test it ATM, but I will try it out and upload a sample later.
feel free to give it a try. but always try the stuff first, bc some things just don't work as one would them expect too @ graphviz :P
egg wrote:Also, another thing I was thinking, is maybe it would be better to have the graphs go down (portrait) mode rather than to the right (landscape). Most of the graphs go off to the right of the page, but most people are used to scrolling down.
Well we could try that, but what you're requesting are not the graph options portrait/landscape, i tried those once and they rotate the image
by 90° (including all text labels) so that's not exactly what we need :P
egg wrote:BTW, exp, can we get some newer dot files to play around with?
the link on the main page points directly to the "work" directory.
so those dot files are always up to date.
you can go through all anime groups (there are ~140 i think) by just increasing the number in:
http://anidb.ath.cx/pics/graph/g-1.dot

if you have a specific anime you want to have the dot file for you could
also get (example for aid 1):
http://anidb.ath.cx/pics/graph/a-1.dot

BYe!
EXP
Maokun
Posts: 5
Joined: Sat Feb 28, 2004 1:07 am
Location: Colombia
Contact:

Post by Maokun »

whoa! too much smart talk @.@;
Anyways, I love wahaha's last graph (the one of YUA) thats what I would have done it if I knew a word about programming >>; but I still think that the word "prequel" should be used only for the real instances of the word, more now that you are including the year. So use prequel for the prior parts that were released after other part. And an unreated question =) I havent watched YUA, and I see both the movie and TV2 are sequels of TV1, is Movie still related to TV2? if not shouldnt it be called alternate ending?
egg
Posts: 769
Joined: Tue Nov 11, 2003 7:17 am

Post by egg »

@(*$&$@# :evil: Geocities :evil: doesn't even let me post a link to the images, so I had to create a page to view them. So go here to look at the new graphs.
exp wrote:hm, I am not sure if the ordering of the edges in the dot file has any effect on the resulting image though.
maybe someone could play around a bit to confirm/refute that?
I downloaded the dot file for Slayers, and I only changed the relation order and colors. The arrow direction does make a difference, it has to do with how it calculates "ranking" of each step.
exp wrote:Well we could try that, but what you're requesting are not the graph options portrait/landscape, i tried those once and they rotate the image
by 90° (including all text labels) so that's not exactly what we need :P
Well, all I did was comment out the line rankdir, and the default is Top to Bottom, this does what I expected, but I'm not sure if it's what you want... :P
exp wrote:feel free to give it a try. but always try the stuff first, bc some things just don't work as one would them expect too @ graphviz :P
OK, you were right, "oinv" did not look good especially at an angle. :P I changed it dot, but I don't know if the open dot or filled in dot looks better.
exp wrote:if you have a specific anime you want to have the dot file for you could
also get (example for aid 1):
http://anidb.ath.cx/pics/graph/a-1.dot
Thanks. :D These don't appear to be here, but the ones are there by group, so that's OK. It's just much easier to just fiddle with them than it is to create them from scratch...
exp
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post by exp »

i fixed some little stuff now, patched dot to use tooltip for alt tags too and tried the top to bottom layout.

take a look at tell me what you think (especially @ top-bottom layout)
i kinda like it for the big anime groups like gundam, but IMHO the
small stuff looked better the old way (left to right).

BYe!
EXP
AnimeMusouka
Posts: 1
Joined: Thu Mar 04, 2004 6:11 pm

Post by AnimeMusouka »

Regarding the Tenchi graph: This might be being picky, but if I remember correctly, Tenchi in Tokyo and Tenchi Universe are not sequels to Ryo-Ohki, they are rather alternative setting versions (they take place in another "universe," or different setting.) The one that is a sequel to Ryo-Ohki is GXP, which takes place in the same universe. So does daughter of Darkness, if I remember correctly. I also think that Tenchi Forever takes place in the Tenchi Universe universe, as a sequel. I don't remember where Tenchi in Love took place though. In any case, my point is, if we replace all those messy Sequel-Prequel relations (which are not even accurate) with simple "alternative setting" lines, perhaps the graph would look better?
egg
Posts: 769
Joined: Tue Nov 11, 2003 7:17 am

Post by egg »

exp wrote:i fixed some little stuff now, patched dot to use tooltip for alt tags too and tried the top to bottom layout.
I was going to look at the tooltips next, but now I don't have to. :P It looks like you fixed the color of the prequel->sequel relations, but you have not reversed them, so some of the layouts still look funny.
exp wrote:take a look at tell me what you think (especially @ top-bottom layout)
i kinda like it for the big anime groups like gundam, but IMHO the
small stuff looked better the old way (left to right).
I agree, on the small ones, going down does look a little strange. Maybe if you set it for left right routing for a small number (4?) of animes in the group.
AnimeMusouka wrote:In any case, my point is, if we replace all those messy Sequel-Prequel relations (which are not even accurate) with simple "alternative setting" lines, perhaps the graph would look better?
It doesn't matter what type of relations are there, the problem is there are too many. There are only supposed to be prequel/sequel links to the immediate prequel/sequel and the others are handled by the system through inheritance. The problem is every possible prequel/sequel link has been filled in, and the graphing program is just swamped. I already have a request in the DB-Change forum to remove the extra relations, but it appears that none of the mods want to take on this project yet.
DonGato
Posts: 1296
Joined: Sun Nov 17, 2002 9:08 pm
Location: The Pampas, The land of the Gaucho!
Contact:

Post by DonGato »

The current one is much better. Now is understandable and nice to the eyes. Good work wahaha!
Skywalka
Posts: 889
Joined: Tue Sep 16, 2003 7:57 pm

Post by Skywalka »

It's a bit irritationg that the arrow labels are now starting right in the middle of the arrowheads (I took a look at YUA).

Maybe you can adjust that again a bit.

Other than that the current view is pretty close to perfect, I like it very much.

w00t. Another great feature implemented.

Though there currently is no option to CREQ relatons ;-)
Locked