return @vectors;
}
+around qw/ get_relationship del_relationship / => sub {
+ my $orig = shift;
+ my $self = shift;
+ my @args = @_;
+ if( @args == 1 && ref( $args[0] ) eq 'ARRAY' ) {
+ @args = @{$_[0]};
+ }
+ my( $source, $target ) = $self->_stringify_args( @args );
+ $self->$orig( $source, $target );
+};
+
=head2 reading_witnesses( $reading )
Return a list of sigils corresponding to the witnesses in which the reading appears.
next if $reading->id eq $reading->text;
my $rattrs;
my $label = $reading->text;
+ $label .= '-' if $reading->join_next;
+ $label = "-$label" if $reading->join_prior;
$label =~ s/\"/\\\"/g;
$rattrs->{'label'} = $label;
$rattrs->{'fillcolor'} = '#b3f36d' if $reading->is_common && $color_common;
is_start => 'boolean',
is_end => 'boolean',
is_lacuna => 'boolean',
+ is_common => 'boolean',
+ join_prior => 'boolean',
+ join_next => 'boolean',
);
foreach my $datum ( keys %node_data ) {
$node_data_keys{$datum} = 'dn'.$ndi++;
$start = $self->start unless $start;
$end = $self->end unless $end;
my @path = grep { !$_->is_meta } $self->reading_sequence( $start, $end, $wit );
- return join( ' ', map { $_->text } @path );
+ my $pathtext = '';
+ my $last;
+ foreach my $r ( @path ) {
+ if( $r->join_prior || !$last || $last->join_next ) {
+ $pathtext .= $r->text;
+ } else {
+ $pathtext .= ' ' . $r->text;
+ }
+ $last = $r;
+ }
+ return $pathtext;
}
=head1 INITIALIZATION METHODS
# Do we need to invalidate the cached data?
if( $self->has_cached_svg || $self->has_cached_table ) {
foreach my $r ( $self->readings ) {
- next if $existing_ranks{$r} == $r->rank;
+ next if $existing_ranks{$r} && $existing_ranks{$r} == $r->rank;
# Something has changed, so clear the cache
$self->_clear_cache;
# ...and recalculate the common readings.