3 our @ISA = ('AA::Vertex');
7 my $v = AA::Vertex::new($class, $id);
12 $v->DefSet('hint', 0);
13 $v->Bind('y', sub { $v->Get("y0") - 50*$v->Get("h") });
14 $v->{XS} = AA::Label->new("$id-label");
16 'x' => sub { $v->Get('x') },
17 'y' => sub { $v->Get('y') + 80 },
19 'text' => sub { $v->Get('xs') },
20 'color' => sub { $v->Get('xs') ? [1,0,0] : [1,1,1] },
22 $v->Bind('color', sub { $v->Get('hint') ? [0,0.7,0] : [0.7,0,0.7] });
31 my ($class, $id, $v, $w) = @_;
32 my $e = AA::new($class, $id);
33 $e->{E} = AA::Edge->new("$id-e", $v, $w);
34 $e->{E}->Set('arrow', 1);
35 $e->{E}->Set('color', [1,0,0]);
39 $e->DefDep('ends', $e->{E}, 'ends');
40 $e->{E}->Bind('width', sub { $e->Get('f') * 5 + 1 });
41 # $e->{E}->Bind('overshoot', sub { $e->Get('f') * 3 + 3});
42 $e->{E}->Bind('arrow-size', sub { $e->Get('f') * 5 + 20});
48 my ($x1, $y1, $x2, $y2) = @{$e->Get('ends')};
50 $cairo->set_source_rgb(0.3, 1, 0);
51 $cairo->set_line_width($e->Get('c') * 5 + 1);
52 $cairo->move_to($x1, $y1);
53 $cairo->line_to($x2, $y2);