File Coverage

blib/lib/Chart/Plotly/Trace/Scatter/Error_y.pm
Criterion Covered Total %
statement 9 25 36.0
branch 0 8 0.0
condition 0 8 0.0
subroutine 3 4 75.0
pod 1 1 100.0
total 13 46 28.2


line stmt bran cond sub pod time code
1             use Moose;
2 4     4   21 use MooseX::ExtraArgs;
  4         8  
  4         25  
3 4     4   21339 use Moose::Util::TypeConstraints qw(enum union);
  4         8  
  4         47  
4 4     4   6641 if ( !defined Moose::Util::TypeConstraints::find_type_constraint('PDL') ) {
  4         8  
  4         42  
5             Moose::Util::TypeConstraints::type('PDL');
6             }
7              
8             our $VERSION = '0.042'; # VERSION
9              
10             # ABSTRACT: This attribute is one of the possible options for the trace scatter.
11              
12             my $self = shift;
13             my $extra_args = $self->extra_args // {};
14 0     0 1   my $meta = $self->meta;
15 0   0       my %hash = %$self;
16 0           for my $name ( sort keys %hash ) {
17 0           my $attr = $meta->get_attribute($name);
18 0           if ( defined $attr ) {
19 0           my $value = $hash{$name};
20 0 0         my $type = $attr->type_constraint;
21 0           if ( $type && $type->equals('Bool') ) {
22 0           $hash{$name} = $value ? \1 : \0;
23 0 0 0       }
24 0 0         }
25             }
26             %hash = ( %hash, %$extra_args );
27             delete $hash{'extra_args'};
28 0           if ( $self->can('type') && ( !defined $hash{'type'} ) ) {
29 0           $hash{type} = $self->type();
30 0 0 0       }
31 0           return \%hash;
32             }
33 0            
34             has array => (
35             is => "rw",
36             isa => "ArrayRef|PDL",
37             documentation =>
38             "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.",
39             );
40              
41             has arrayminus => (
42             is => "rw",
43             isa => "ArrayRef|PDL",
44             documentation =>
45             "Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.",
46             );
47              
48             has arrayminussrc => ( is => "rw",
49             isa => "Str",
50             documentation => "Sets the source reference on Chart Studio Cloud for `arrayminus`.",
51             );
52              
53             has arraysrc => ( is => "rw",
54             isa => "Str",
55             documentation => "Sets the source reference on Chart Studio Cloud for `array`.",
56             );
57              
58             has color => ( is => "rw",
59             isa => "Str",
60             documentation => "Sets the stoke color of the error bars.",
61             );
62              
63             has symmetric => (
64             is => "rw",
65             isa => "Bool",
66             documentation =>
67             "Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.",
68             );
69              
70             has thickness => ( is => "rw",
71             isa => "Num",
72             documentation => "Sets the thickness (in px) of the error bars.",
73             );
74              
75             has traceref => ( is => "rw",
76             isa => "Int", );
77              
78             has tracerefminus => ( is => "rw",
79             isa => "Int", );
80              
81             has value => (
82             is => "rw",
83             isa => "Num",
84             documentation =>
85             "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars.",
86             );
87              
88             has valueminus => (
89             is => "rw",
90             isa => "Num",
91             documentation =>
92             "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars",
93             );
94              
95             has visible => ( is => "rw",
96             isa => "Bool",
97             documentation => "Determines whether or not this set of error bars is visible.",
98             );
99              
100             has width => ( is => "rw",
101             isa => "Num",
102             documentation => "Sets the width (in px) of the cross-bar at both ends of the error bars.",
103             );
104              
105             __PACKAGE__->meta->make_immutable();
106             1;
107              
108              
109             =pod
110              
111             =encoding utf-8
112              
113             =head1 NAME
114              
115             Chart::Plotly::Trace::Scatter::Error_y - This attribute is one of the possible options for the trace scatter.
116              
117             =head1 VERSION
118              
119             version 0.042
120              
121             =head1 SYNOPSIS
122              
123             use HTML::Show;
124             use Chart::Plotly;
125             use Chart::Plotly::Trace::Scatter;
126             my $scatter = Chart::Plotly::Trace::Scatter->new( x => [ 1 .. 5 ], y => [ 1 .. 5 ] );
127            
128             HTML::Show::show( Chart::Plotly::render_full_html( data => [$scatter] ) );
129              
130             =head1 DESCRIPTION
131              
132             This attribute is part of the possible options for the trace scatter.
133              
134             This file has been autogenerated from the official plotly.js source.
135              
136             If you like Plotly, please support them: L<https://plot.ly/>
137             Open source announcement: L<https://plot.ly/javascript/open-source-announcement/>
138              
139             Full reference: L<https://plot.ly/javascript/reference/#scatter>
140              
141             =head1 DISCLAIMER
142              
143             This is an unofficial Plotly Perl module. Currently I'm not affiliated in any way with Plotly.
144             But I think plotly.js is a great library and I want to use it with perl.
145              
146             =head1 METHODS
147              
148             =head2 TO_JSON
149              
150             Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
151              
152             =head1 ATTRIBUTES
153              
154             =over
155              
156             =item * array
157              
158             Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.
159              
160             =item * arrayminus
161              
162             Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.
163              
164             =item * arrayminussrc
165              
166             Sets the source reference on Chart Studio Cloud for `arrayminus`.
167              
168             =item * arraysrc
169              
170             Sets the source reference on Chart Studio Cloud for `array`.
171              
172             =item * color
173              
174             Sets the stoke color of the error bars.
175              
176             =item * symmetric
177              
178             Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.
179              
180             =item * thickness
181              
182             Sets the thickness (in px) of the error bars.
183              
184             =item * traceref
185              
186             =item * tracerefminus
187              
188             =item * value
189              
190             Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars.
191              
192             =item * valueminus
193              
194             Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars
195              
196             =item * visible
197              
198             Determines whether or not this set of error bars is visible.
199              
200             =item * width
201              
202             Sets the width (in px) of the cross-bar at both ends of the error bars.
203              
204             =back
205              
206             =head1 AUTHOR
207              
208             Pablo Rodríguez González <pablo.rodriguez.gonzalez@gmail.com>
209              
210             =head1 COPYRIGHT AND LICENSE
211              
212             This software is Copyright (c) 2022 by Pablo Rodríguez González.
213              
214             This is free software, licensed under:
215              
216             The MIT (X11) License
217              
218             =cut