File Coverage

blib/lib/Chart/Plotly/Trace/Scatter/Fillpattern.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         27  
3 4     4   22080 use Moose::Util::TypeConstraints qw(enum union);
  4         8  
  4         40  
4 4     4   6753 if ( !defined Moose::Util::TypeConstraints::find_type_constraint('PDL') ) {
  4         9  
  4         36  
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 bgcolor => (
35             is => "rw",
36             isa => "Str|ArrayRef[Str]",
37             documentation =>
38             "When there is no colorscale sets the color of background pattern fill. Defaults to a `marker.color` background when `fillmode` is *overlay*. Otherwise, defaults to a transparent background.",
39             );
40              
41             has bgcolorsrc => ( is => "rw",
42             isa => "Str",
43             documentation => "Sets the source reference on Chart Studio Cloud for `bgcolor`.",
44             );
45              
46             has description => ( is => "ro",
47             default => "Sets the pattern within the marker.", );
48              
49             has fgcolor => (
50             is => "rw",
51             isa => "Str|ArrayRef[Str]",
52             documentation =>
53             "When there is no colorscale sets the color of foreground pattern fill. Defaults to a `marker.color` background when `fillmode` is *replace*. Otherwise, defaults to dark grey or white to increase contrast with the `bgcolor`.",
54             );
55              
56             has fgcolorsrc => ( is => "rw",
57             isa => "Str",
58             documentation => "Sets the source reference on Chart Studio Cloud for `fgcolor`.",
59             );
60              
61             has fgopacity => (
62             is => "rw",
63             isa => "Num",
64             documentation =>
65             "Sets the opacity of the foreground pattern fill. Defaults to a 0.5 when `fillmode` is *overlay*. Otherwise, defaults to 1.",
66             );
67              
68             has fillmode => (
69             is => "rw",
70             isa => enum( [ "replace", "overlay" ] ),
71             documentation => "Determines whether `marker.color` should be used as a default to `bgcolor` or a `fgcolor`.",
72             );
73              
74             has shape => (
75             is => "rw",
76             isa => union( [ enum( [ "", "/", "\\", "x", "-", "|", "+", "." ] ), "ArrayRef" ] ),
77             documentation => "Sets the shape of the pattern fill. By default, no pattern is used for filling the area.",
78             );
79              
80             has shapesrc => ( is => "rw",
81             isa => "Str",
82             documentation => "Sets the source reference on Chart Studio Cloud for `shape`.",
83             );
84              
85             has size => (
86             is => "rw",
87             isa => "Num|ArrayRef[Num]",
88             documentation =>
89             "Sets the size of unit squares of the pattern fill in pixels, which corresponds to the interval of repetition of the pattern.",
90             );
91              
92             has sizesrc => ( is => "rw",
93             isa => "Str",
94             documentation => "Sets the source reference on Chart Studio Cloud for `size`.",
95             );
96              
97             has solidity => (
98             is => "rw",
99             isa => "Num|ArrayRef[Num]",
100             documentation =>
101             "Sets the solidity of the pattern fill. Solidity is roughly the fraction of the area filled by the pattern. Solidity of 0 shows only the background color without pattern and solidty of 1 shows only the foreground color without pattern.",
102             );
103              
104             has soliditysrc => ( is => "rw",
105             isa => "Str",
106             documentation => "Sets the source reference on Chart Studio Cloud for `solidity`.",
107             );
108              
109             __PACKAGE__->meta->make_immutable();
110             1;
111              
112              
113             =pod
114              
115             =encoding utf-8
116              
117             =head1 NAME
118              
119             Chart::Plotly::Trace::Scatter::Fillpattern - This attribute is one of the possible options for the trace scatter.
120              
121             =head1 VERSION
122              
123             version 0.042
124              
125             =head1 SYNOPSIS
126              
127             use HTML::Show;
128             use Chart::Plotly;
129             use Chart::Plotly::Trace::Scatter;
130             my $scatter = Chart::Plotly::Trace::Scatter->new( x => [ 1 .. 5 ], y => [ 1 .. 5 ] );
131            
132             HTML::Show::show( Chart::Plotly::render_full_html( data => [$scatter] ) );
133              
134             =head1 DESCRIPTION
135              
136             This attribute is part of the possible options for the trace scatter.
137              
138             This file has been autogenerated from the official plotly.js source.
139              
140             If you like Plotly, please support them: L<https://plot.ly/>
141             Open source announcement: L<https://plot.ly/javascript/open-source-announcement/>
142              
143             Full reference: L<https://plot.ly/javascript/reference/#scatter>
144              
145             =head1 DISCLAIMER
146              
147             This is an unofficial Plotly Perl module. Currently I'm not affiliated in any way with Plotly.
148             But I think plotly.js is a great library and I want to use it with perl.
149              
150             =head1 METHODS
151              
152             =head2 TO_JSON
153              
154             Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
155              
156             =head1 ATTRIBUTES
157              
158             =over
159              
160             =item * bgcolor
161              
162             When there is no colorscale sets the color of background pattern fill. Defaults to a `marker.color` background when `fillmode` is *overlay*. Otherwise, defaults to a transparent background.
163              
164             =item * bgcolorsrc
165              
166             Sets the source reference on Chart Studio Cloud for `bgcolor`.
167              
168             =item * description
169              
170             =item * fgcolor
171              
172             When there is no colorscale sets the color of foreground pattern fill. Defaults to a `marker.color` background when `fillmode` is *replace*. Otherwise, defaults to dark grey or white to increase contrast with the `bgcolor`.
173              
174             =item * fgcolorsrc
175              
176             Sets the source reference on Chart Studio Cloud for `fgcolor`.
177              
178             =item * fgopacity
179              
180             Sets the opacity of the foreground pattern fill. Defaults to a 0.5 when `fillmode` is *overlay*. Otherwise, defaults to 1.
181              
182             =item * fillmode
183              
184             Determines whether `marker.color` should be used as a default to `bgcolor` or a `fgcolor`.
185              
186             =item * shape
187              
188             Sets the shape of the pattern fill. By default, no pattern is used for filling the area.
189              
190             =item * shapesrc
191              
192             Sets the source reference on Chart Studio Cloud for `shape`.
193              
194             =item * size
195              
196             Sets the size of unit squares of the pattern fill in pixels, which corresponds to the interval of repetition of the pattern.
197              
198             =item * sizesrc
199              
200             Sets the source reference on Chart Studio Cloud for `size`.
201              
202             =item * solidity
203              
204             Sets the solidity of the pattern fill. Solidity is roughly the fraction of the area filled by the pattern. Solidity of 0 shows only the background color without pattern and solidty of 1 shows only the foreground color without pattern.
205              
206             =item * soliditysrc
207              
208             Sets the source reference on Chart Studio Cloud for `solidity`.
209              
210             =back
211              
212             =head1 AUTHOR
213              
214             Pablo Rodríguez González <pablo.rodriguez.gonzalez@gmail.com>
215              
216             =head1 COPYRIGHT AND LICENSE
217              
218             This software is Copyright (c) 2022 by Pablo Rodríguez González.
219              
220             This is free software, licensed under:
221              
222             The MIT (X11) License
223              
224             =cut