| 1 | package Chart::Plotly::Trace::Scatter::Hoverlabel; | ||||||||||||||||||||||||||||
| 2 | 4 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use MooseX::ExtraArgs; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use Moose::Util::TypeConstraints qw(enum union); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 4 | ▶ | if ( !defined Moose::Util::TypeConstraints::find_type_constraint('PDL') ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 6 | 0 | Moose::Util::TypeConstraints::type('PDL'); | |||||||||||||||||||||||||||
| 7 | } | ||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 4 | ▶ | use Chart::Plotly::Trace::Scatter::Hoverlabel::Font; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 4 | our $VERSION = '0.042'; # VERSION | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | # ABSTRACT: This attribute is one of the possible options for the trace scatter. | ||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 0 | ▶ | sub TO_JSON { | ||||||||||||||||||||||||||
|
Subroutine
TO_JSON: not called CC=9 SCAR=45.0
Pod
documented
| |||||||||||||||||||||||||||||
| 16 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 17 | 0 | ▶ | my $extra_args = $self->extra_args // {}; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->extra_args // {}
MC/DC0%0/1
$self->extra_args // {}
$self->extra_args
Truth table0%0/2
A
A= $self->extra_args
| |||||||||||||||||||||||||||||
| 18 | 0 | my $meta = $self->meta; | |||||||||||||||||||||||||||
| 19 | 0 | my %hash = %$self; | |||||||||||||||||||||||||||
| 20 | 0 | for my $name ( sort keys %hash ) { | |||||||||||||||||||||||||||
| 21 | 0 | my $attr = $meta->get_attribute($name); | |||||||||||||||||||||||||||
| 22 | 0 | ▶ | if ( defined $attr ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | 0 | my $value = $hash{$name}; | |||||||||||||||||||||||||||
| 24 | 0 | my $type = $attr->type_constraint; | |||||||||||||||||||||||||||
| 25 | 0 | ▶ | if ( $type && $type->equals('Bool') ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$type and $type->equals("Bool")
MC/DC0%0/2
$type and $type->equals("Bool")
$type
$type->equals("Bool")
Truth table0%0/3
A and B
A= $typeB= $type->equals("Bool")
| |||||||||||||||||||||||||||||
| 26 | 0 | ▶ | $hash{$name} = $value ? \1 : \0; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | 0 | %hash = ( %hash, %$extra_args ); | |||||||||||||||||||||||||||
| 31 | 0 | delete $hash{'extra_args'}; | |||||||||||||||||||||||||||
| 32 | 0 | ▶ | if ( $self->can('type') && ( !defined $hash{'type'} ) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->can("type") and not defined $hash{"type"}
MC/DC0%0/2
$self->can("type") and not defined $hash{"type"}
$self->can("type")
not defined $hash{"type"}
Truth table0%0/3
A and not(B)
A= $self->can("type")B= not defined $hash{"type"}
| |||||||||||||||||||||||||||||
| 33 | 0 | $hash{type} = $self->type(); | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | 0 | return \%hash; | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 4 | has align => ( | |||||||||||||||||||||||||||
| 39 | is => "rw", | ||||||||||||||||||||||||||||
| 40 | isa => union( [ enum( [ "left", "right", "auto" ] ), "ArrayRef" ] ), | ||||||||||||||||||||||||||||
| 41 | documentation => | ||||||||||||||||||||||||||||
| 42 | "Sets the horizontal alignment of the text content within hover label box. Has an effect only if the hover label text spans more two or more lines", | ||||||||||||||||||||||||||||
| 43 | ); | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | 4 | has alignsrc => ( is => "rw", | |||||||||||||||||||||||||||
| 46 | isa => "Str", | ||||||||||||||||||||||||||||
| 47 | documentation => "Sets the source reference on Chart Studio Cloud for `align`.", | ||||||||||||||||||||||||||||
| 48 | ); | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 4 | has bgcolor => ( is => "rw", | |||||||||||||||||||||||||||
| 51 | isa => "Str|ArrayRef[Str]", | ||||||||||||||||||||||||||||
| 52 | documentation => "Sets the background color of the hover labels for this trace", | ||||||||||||||||||||||||||||
| 53 | ); | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 4 | has bgcolorsrc => ( is => "rw", | |||||||||||||||||||||||||||
| 56 | isa => "Str", | ||||||||||||||||||||||||||||
| 57 | documentation => "Sets the source reference on Chart Studio Cloud for `bgcolor`.", | ||||||||||||||||||||||||||||
| 58 | ); | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | 4 | has bordercolor => ( is => "rw", | |||||||||||||||||||||||||||
| 61 | isa => "Str|ArrayRef[Str]", | ||||||||||||||||||||||||||||
| 62 | documentation => "Sets the border color of the hover labels for this trace.", | ||||||||||||||||||||||||||||
| 63 | ); | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 4 | has bordercolorsrc => ( is => "rw", | |||||||||||||||||||||||||||
| 66 | isa => "Str", | ||||||||||||||||||||||||||||
| 67 | documentation => "Sets the source reference on Chart Studio Cloud for `bordercolor`.", | ||||||||||||||||||||||||||||
| 68 | ); | ||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | 4 | has font => ( is => "rw", | |||||||||||||||||||||||||||
| 71 | isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatter::Hoverlabel::Font", ); | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | 4 | has namelength => ( | |||||||||||||||||||||||||||
| 74 | is => "rw", | ||||||||||||||||||||||||||||
| 75 | isa => "Int|ArrayRef[Int]", | ||||||||||||||||||||||||||||
| 76 | documentation => | ||||||||||||||||||||||||||||
| 77 | "Sets the default length (in number of characters) of the trace name in the hover labels for all traces. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", | ||||||||||||||||||||||||||||
| 78 | ); | ||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | 4 | has namelengthsrc => ( is => "rw", | |||||||||||||||||||||||||||
| 81 | isa => "Str", | ||||||||||||||||||||||||||||
| 82 | documentation => "Sets the source reference on Chart Studio Cloud for `namelength`.", | ||||||||||||||||||||||||||||
| 83 | ); | ||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | 4 | __PACKAGE__->meta->make_immutable(); | |||||||||||||||||||||||||||
| 86 | 4 | 1; | |||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | __END__ | ||||||||||||||||||||||||||||