Chart/Plotly/Trace/Scattergeo/Marker.pm untested

filter: Statementstmt 0.0% 0 / 64 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 95 CC 5 SCAR 26.9
CC
5
Cov
0%
TO_JSON
30.0
BEGIN
2.0
BEGIN
2.0
CRAP 14.7
1 package Chart::Plotly::Trace::Scattergeo::Marker;
2 use Moose;
3 use MooseX::ExtraArgs;
4 use Moose::Util::TypeConstraints qw(enum union);
5 if ( !defined Moose::Util::TypeConstraints::find_type_constraint('PDL') ) {
6 Moose::Util::TypeConstraints::type('PDL');
7 }
8  
9 use Chart::Plotly::Trace::Scattergeo::Marker::Colorbar;
10 use Chart::Plotly::Trace::Scattergeo::Marker::Gradient;
11 use Chart::Plotly::Trace::Scattergeo::Marker::Line;
12  
13 our $VERSION = '0.042'; # VERSION
14  
15 # ABSTRACT: This attribute is one of the possible options for the trace scattergeo.
16  
17 sub TO_JSON {
18 my $self = shift;
19 my $extra_args = $self->extra_args // {};
20 my $meta = $self->meta;
21 my %hash = %$self;
22 for my $name ( sort keys %hash ) {
23 my $attr = $meta->get_attribute($name);
24 if ( defined $attr ) {
25 my $value = $hash{$name};
26 my $type = $attr->type_constraint;
27 if ( $type && $type->equals('Bool') ) {
28 $hash{$name} = $value ? \1 : \0;
29 }
30 }
31 }
32 %hash = ( %hash, %$extra_args );
33 delete $hash{'extra_args'};
34 if ( $self->can('type') && ( !defined $hash{'type'} ) ) {
35 $hash{type} = $self->type();
36 }
37 return \%hash;
38 }
39  
40 has autocolorscale => (
41 is => "rw",
42 isa => "Bool",
43 documentation =>
44 "Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.colorscale`. Has an effect only if in `marker.color` is set to a numerical array. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.",
45 );
46  
47 has cauto => (
48 is => "rw",
49 isa => "Bool",
50 documentation =>
51 "Determines whether or not the color domain is computed with respect to the input data (here in `marker.color`) or the bounds set in `marker.cmin` and `marker.cmax` Has an effect only if in `marker.color` is set to a numerical array. Defaults to `false` when `marker.cmin` and `marker.cmax` are set by the user.",
52 );
53  
54 has cmax => (
55 is => "rw",
56 isa => "Num",
57 documentation =>
58 "Sets the upper bound of the color domain. Has an effect only if in `marker.color` is set to a numerical array. Value should have the same units as in `marker.color` and if set, `marker.cmin` must be set as well.",
59 );
60  
61 has cmid => (
62 is => "rw",
63 isa => "Num",
64 documentation =>
65 "Sets the mid-point of the color domain by scaling `marker.cmin` and/or `marker.cmax` to be equidistant to this point. Has an effect only if in `marker.color` is set to a numerical array. Value should have the same units as in `marker.color`. Has no effect when `marker.cauto` is `false`.",
66 );
67  
68 has cmin => (
69 is => "rw",
70 isa => "Num",
71 documentation =>
72 "Sets the lower bound of the color domain. Has an effect only if in `marker.color` is set to a numerical array. Value should have the same units as in `marker.color` and if set, `marker.cmax` must be set as well.",
73 );
74  
75 has color => (
76 is => "rw",
77 isa => "Str|ArrayRef[Str]",
78 documentation =>
79 "Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.cmin` and `marker.cmax` if set.",
80 );
81  
82 has coloraxis => (
83 is => "rw",
84 documentation =>
85 "Sets a reference to a shared color axis. References to these shared color axes are *coloraxis*, *coloraxis2*, *coloraxis3*, etc. Settings for these shared color axes are set in the layout, under `layout.coloraxis`, `layout.coloraxis2`, etc. Note that multiple color scales can be linked to the same color axis.",
86 );
87  
88 has colorbar => ( is => "rw",
89 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattergeo::Marker::Colorbar", );
90  
91 has colorscale => (
92 is => "rw",
93 documentation =>
94 "Sets the colorscale. Has an effect only if in `marker.color` is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use `marker.cmin` and `marker.cmax`. Alternatively, `colorscale` may be a palette name string of the following list: Blackbody,Bluered,Blues,Cividis,Earth,Electric,Greens,Greys,Hot,Jet,Picnic,Portland,Rainbow,RdBu,Reds,Viridis,YlGnBu,YlOrRd.",
95 );
96  
97 has colorsrc => ( is => "rw",
98 isa => "Str",
99 documentation => "Sets the source reference on Chart Studio Cloud for `color`.",
100 );
101  
102 has gradient => ( is => "rw",
103 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattergeo::Marker::Gradient", );
104  
105 has line => ( is => "rw",
106 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattergeo::Marker::Line", );
107  
108 has opacity => ( is => "rw",
109 isa => "Num|ArrayRef[Num]",
110 documentation => "Sets the marker opacity.",
111 );
112  
113 has opacitysrc => ( is => "rw",
114 isa => "Str",
115 documentation => "Sets the source reference on Chart Studio Cloud for `opacity`.",
116 );
117  
118 has reversescale => (
119 is => "rw",
120 isa => "Bool",
121 documentation =>
122 "Reverses the color mapping if true. Has an effect only if in `marker.color` is set to a numerical array. If true, `marker.cmin` will correspond to the last color in the array and `marker.cmax` will correspond to the first color.",
123 );
124  
125 has showscale => (
126 is => "rw",
127 isa => "Bool",
128 documentation =>
129 "Determines whether or not a colorbar is displayed for this trace. Has an effect only if in `marker.color` is set to a numerical array.",
130 );
131  
132 has size => ( is => "rw",
133 isa => "Num|ArrayRef[Num]",
134 documentation => "Sets the marker size (in px).",
135 );
136  
137 has sizemin => (
138 is => "rw",
139 isa => "Num",
140 documentation =>
141 "Has an effect only if `marker.size` is set to a numerical array. Sets the minimum size (in px) of the rendered marker points.",
142 );
143  
144 has sizemode => (
145 is => "rw",
146 isa => enum( [ "diameter", "area" ] ),
147 documentation =>
148 "Has an effect only if `marker.size` is set to a numerical array. Sets the rule for which the data in `size` is converted to pixels.",
149 );
150  
151 has sizeref => (
152 is => "rw",
153 isa => "Num",
154 documentation =>
155 "Has an effect only if `marker.size` is set to a numerical array. Sets the scale factor used to determine the rendered size of marker points. Use with `sizemin` and `sizemode`.",
156 );
157  
158 has sizesrc => ( is => "rw",
159 isa => "Str",
160 documentation => "Sets the source reference on Chart Studio Cloud for `size`.",
161 );
162  
163 has symbol => (
164 is => "rw",
165 isa => "Maybe[ArrayRef]",
166 documentation =>
167 "Sets the marker symbol type. Adding 100 is equivalent to appending *-open* to a symbol name. Adding 200 is equivalent to appending *-dot* to a symbol name. Adding 300 is equivalent to appending *-open-dot* or *dot-open* to a symbol name.",
168 );
169  
170 has symbolsrc => ( is => "rw",
171 isa => "Str",
172 documentation => "Sets the source reference on Chart Studio Cloud for `symbol`.",
173 );
174  
175 __PACKAGE__->meta->make_immutable();
176 1;
177  
178 __END__