Chart-GGPlot
view release on metacpan or search on metacpan
lib/Chart/GGPlot/Position/Dodge2.pm view on Meta::CPAN
sub {
my %count = count_by { $_ } $_->at('xmin')->flatten;
return List::AllUtils::max( values(%count), 1 );
}
)->flatten
);
}
return {
width => $self->width,
n => $n,
padding => $self->padding,
reverse => $self->reverse
};
}
method compute_panel ($data, $params, $scales) {
return collide2(
$data, $params->{width}, 'position_dodge2', \&pos_dodge2,
n => $params->{n},
padding => $params->{padding},
check_width => false,
reverse => $params->{reverse},
);
}
__PACKAGE__->meta->make_immutable;
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Chart::GGPlot::Position::Dodge2 - Position for 'dodge2'
=head1 VERSION
version 0.002003
=head1 DESCRIPTION
This is a special case of "dodge" for arranging box plots, bars and
rectangles. It allows padding between elements at the same position.
=head1 ATTRIBUTES
=head2 padding
Padding between elements at the same position.
Elements are shrunk by this proportion to allow space between them.
Defaults to 0.1.
=head2 reverse
If true, will reverse the default stacking order.
This is useful if you're rotating both the plot and legend.
=head1 SEE ALSO
L<Chart::GGPlot::Position>,
L<Chart::GGPlot::Position::Dodge>,
=head1 AUTHOR
Stephan Loyd <sloyd@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2019-2023 by Stephan Loyd.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
( run in 0.936 second using v1.01-cache-2.11-cpan-39bf76dae61 )