File Coverage

blib/lib/Chart/Plotly/Trace/Scatter/Marker/Colorbar/Title.pm
Criterion Covered Total %
statement 12 28 42.8
branch 0 8 0.0
condition 0 8 0.0
subroutine 4 5 80.0
pod 1 1 100.0
total 17 50 34.0


line stmt bran cond sub pod time code
1             use Moose;
2 5     5   29 use MooseX::ExtraArgs;
  5         10  
  5         37  
3 5     5   26294 use Moose::Util::TypeConstraints qw(enum union);
  5         12  
  5         28  
4 5     5   8316 if ( !defined Moose::Util::TypeConstraints::find_type_constraint('PDL') ) {
  5         13  
  5         36  
5             Moose::Util::TypeConstraints::type('PDL');
6             }
7              
8             use Chart::Plotly::Trace::Scatter::Marker::Colorbar::Title::Font;
9 5     5   4611  
  5         16  
  5         1371  
10             our $VERSION = '0.042'; # VERSION
11              
12             # ABSTRACT: This attribute is one of the possible options for the trace scatter.
13              
14             my $self = shift;
15             my $extra_args = $self->extra_args // {};
16 0     0 1   my $meta = $self->meta;
17 0   0       my %hash = %$self;
18 0           for my $name ( sort keys %hash ) {
19 0           my $attr = $meta->get_attribute($name);
20 0           if ( defined $attr ) {
21 0           my $value = $hash{$name};
22 0 0         my $type = $attr->type_constraint;
23 0           if ( $type && $type->equals('Bool') ) {
24 0           $hash{$name} = $value ? \1 : \0;
25 0 0 0       }
26 0 0         }
27             }
28             %hash = ( %hash, %$extra_args );
29             delete $hash{'extra_args'};
30 0           if ( $self->can('type') && ( !defined $hash{'type'} ) ) {
31 0           $hash{type} = $self->type();
32 0 0 0       }
33 0           return \%hash;
34             }
35 0            
36             has font => ( is => "rw",
37             isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatter::Marker::Colorbar::Title::Font", );
38              
39             has side => (
40             is => "rw",
41             isa => enum( [ "right", "top", "bottom" ] ),
42             documentation =>
43             "Determines the location of color bar's title with respect to the color bar. Defaults to *top* when `orientation` if *v* and defaults to *right* when `orientation` if *h*. Note that the title's location used to be set by the now deprecated `titleside` attribute.",
44             );
45              
46             has text => (
47             is => "rw",
48             isa => "Str",
49             documentation =>
50             "Sets the title of the color bar. Note that before the existence of `title.text`, the title's contents used to be defined as the `title` attribute itself. This behavior has been deprecated.",
51             );
52              
53             __PACKAGE__->meta->make_immutable();
54             1;
55              
56              
57             =pod
58              
59             =encoding utf-8
60              
61             =head1 NAME
62              
63             Chart::Plotly::Trace::Scatter::Marker::Colorbar::Title - This attribute is one of the possible options for the trace scatter.
64              
65             =head1 VERSION
66              
67             version 0.042
68              
69             =head1 SYNOPSIS
70              
71             use HTML::Show;
72             use Chart::Plotly;
73             use Chart::Plotly::Trace::Scatter;
74             my $scatter = Chart::Plotly::Trace::Scatter->new( x => [ 1 .. 5 ], y => [ 1 .. 5 ] );
75            
76             HTML::Show::show( Chart::Plotly::render_full_html( data => [$scatter] ) );
77              
78             =head1 DESCRIPTION
79              
80             This attribute is part of the possible options for the trace scatter.
81              
82             This file has been autogenerated from the official plotly.js source.
83              
84             If you like Plotly, please support them: L<https://plot.ly/>
85             Open source announcement: L<https://plot.ly/javascript/open-source-announcement/>
86              
87             Full reference: L<https://plot.ly/javascript/reference/#scatter>
88              
89             =head1 DISCLAIMER
90              
91             This is an unofficial Plotly Perl module. Currently I'm not affiliated in any way with Plotly.
92             But I think plotly.js is a great library and I want to use it with perl.
93              
94             =head1 METHODS
95              
96             =head2 TO_JSON
97              
98             Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
99              
100             =head1 ATTRIBUTES
101              
102             =over
103              
104             =item * font
105              
106             =item * side
107              
108             Determines the location of color bar's title with respect to the color bar. Defaults to *top* when `orientation` if *v* and defaults to *right* when `orientation` if *h*. Note that the title's location used to be set by the now deprecated `titleside` attribute.
109              
110             =item * text
111              
112             Sets the title of the color bar. Note that before the existence of `title.text`, the title's contents used to be defined as the `title` attribute itself. This behavior has been deprecated.
113              
114             =back
115              
116             =head1 AUTHOR
117              
118             Pablo Rodríguez González <pablo.rodriguez.gonzalez@gmail.com>
119              
120             =head1 COPYRIGHT AND LICENSE
121              
122             This software is Copyright (c) 2022 by Pablo Rodríguez González.
123              
124             This is free software, licensed under:
125              
126             The MIT (X11) License
127              
128             =cut