File Coverage

blib/lib/Chart/Plotly/Trace/Scatter/Error_x.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_x;
2 3     3   19 use Moose;
  3         4  
  3         16  
3 3     3   15582 use MooseX::ExtraArgs;
  3         6  
  3         14  
4 3     3   5084 use Moose::Util::TypeConstraints qw(enum union);
  3         7  
  3         17  
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 copy_ystyle => ( is => "rw",
66             isa => "Bool", );
67              
68             has symmetric => (
69             is => "rw",
70             isa => "Bool",
71             documentation =>
72             "Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.",
73             );
74              
75             has thickness => ( is => "rw",
76             isa => "Num",
77             documentation => "Sets the thickness (in px) of the error bars.",
78             );
79              
80             has traceref => ( is => "rw",
81             isa => "Int", );
82              
83             has tracerefminus => ( is => "rw",
84             isa => "Int", );
85              
86             has value => (
87             is => "rw",
88             isa => "Num",
89             documentation =>
90             "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.",
91             );
92              
93             has valueminus => (
94             is => "rw",
95             isa => "Num",
96             documentation =>
97             "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",
98             );
99              
100             has visible => ( is => "rw",
101             isa => "Bool",
102             documentation => "Determines whether or not this set of error bars is visible.",
103             );
104              
105             has width => ( is => "rw",
106             isa => "Num",
107             documentation => "Sets the width (in px) of the cross-bar at both ends of the error bars.",
108             );
109              
110             __PACKAGE__->meta->make_immutable();
111             1;
112              
113             __END__
114              
115             =pod
116              
117             =encoding utf-8
118              
119             =head1 NAME
120              
121             Chart::Plotly::Trace::Scatter::Error_x - This attribute is one of the possible options for the trace scatter.
122              
123             =head1 VERSION
124              
125             version 0.039
126              
127             =head1 SYNOPSIS
128              
129             use HTML::Show;
130             use Chart::Plotly;
131             use Chart::Plotly::Trace::Scatter;
132             my $scatter = Chart::Plotly::Trace::Scatter->new( x => [ 1 .. 5 ], y => [ 1 .. 5 ] );
133            
134             HTML::Show::show( Chart::Plotly::render_full_html( data => [$scatter] ) );
135              
136             =head1 DESCRIPTION
137              
138             This attribute is part of the possible options for the trace scatter.
139              
140             This file has been autogenerated from the official plotly.js source.
141              
142             If you like Plotly, please support them: L<https://plot.ly/>
143             Open source announcement: L<https://plot.ly/javascript/open-source-announcement/>
144              
145             Full reference: L<https://plot.ly/javascript/reference/#scatter>
146              
147             =head1 DISCLAIMER
148              
149             This is an unofficial Plotly Perl module. Currently I'm not affiliated in any way with Plotly.
150             But I think plotly.js is a great library and I want to use it with perl.
151              
152             =head1 METHODS
153              
154             =head2 TO_JSON
155              
156             Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
157              
158             =head1 ATTRIBUTES
159              
160             =over
161              
162             =item * array
163              
164             Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.
165              
166             =item * arrayminus
167              
168             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.
169              
170             =item * arrayminussrc
171              
172             Sets the source reference on plot.ly for arrayminus .
173              
174             =item * arraysrc
175              
176             Sets the source reference on plot.ly for array .
177              
178             =item * color
179              
180             Sets the stoke color of the error bars.
181              
182             =item * copy_ystyle
183              
184             =item * symmetric
185              
186             Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.
187              
188             =item * thickness
189              
190             Sets the thickness (in px) of the error bars.
191              
192             =item * traceref
193              
194             =item * tracerefminus
195              
196             =item * value
197              
198             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.
199              
200             =item * valueminus
201              
202             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
203              
204             =item * visible
205              
206             Determines whether or not this set of error bars is visible.
207              
208             =item * width
209              
210             Sets the width (in px) of the cross-bar at both ends of the error bars.
211              
212             =back
213              
214             =head1 AUTHOR
215              
216             Pablo Rodríguez González <pablo.rodriguez.gonzalez@gmail.com>
217              
218             =head1 COPYRIGHT AND LICENSE
219              
220             This software is Copyright (c) 2020 by Pablo Rodríguez González.
221              
222             This is free software, licensed under:
223              
224             The MIT (X11) License
225              
226             =cut