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