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

filter: Statementstmt 0.0% 0 / 59 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 88 CC 5 SCAR 28.7
CC
5
Cov
0%
TO_JSON
30.0
BEGIN
2.0
BEGIN
2.0
CRAP 17.6
1 package Chart::Plotly::Trace::Scattermapbox::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::Scattermapbox::Marker::Colorbar;
10  
11 our $VERSION = '0.042'; # VERSION
12  
13 # ABSTRACT: This attribute is one of the possible options for the trace scattermapbox.
14  
15 sub TO_JSON {
16 my $self = shift;
17 my $extra_args = $self->extra_args // {};
18 my $meta = $self->meta;
19 my %hash = %$self;
20 for my $name ( sort keys %hash ) {
21 my $attr = $meta->get_attribute($name);
22 if ( defined $attr ) {
23 my $value = $hash{$name};
24 my $type = $attr->type_constraint;
25 if ( $type && $type->equals('Bool') ) {
26 $hash{$name} = $value ? \1 : \0;
27 }
28 }
29 }
30 %hash = ( %hash, %$extra_args );
31 delete $hash{'extra_args'};
32 if ( $self->can('type') && ( !defined $hash{'type'} ) ) {
33 $hash{type} = $self->type();
34 }
35 return \%hash;
36 }
37  
38 has allowoverlap => ( is => "rw",
39 isa => "Bool",
40 documentation => "Flag to draw all symbols, even if they overlap.",
41 );
42  
43 has angle => (
44 is => "rw",
45 isa => "Num|ArrayRef[Num]",
46 documentation =>
47 "Sets the marker orientation from true North, in degrees clockwise. When using the *auto* default, no rotation would be applied in perspective views which is different from using a zero angle.",
48 );
49  
50 has anglesrc => ( is => "rw",
51 isa => "Str",
52 documentation => "Sets the source reference on Chart Studio Cloud for `angle`.",
53 );
54  
55 has autocolorscale => (
56 is => "rw",
57 isa => "Bool",
58 documentation =>
59 "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.",
60 );
61  
62 has cauto => (
63 is => "rw",
64 isa => "Bool",
65 documentation =>
66 "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.",
67 );
68  
69 has cmax => (
70 is => "rw",
71 isa => "Num",
72 documentation =>
73 "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.",
74 );
75  
76 has cmid => (
77 is => "rw",
78 isa => "Num",
79 documentation =>
80 "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`.",
81 );
82  
83 has cmin => (
84 is => "rw",
85 isa => "Num",
86 documentation =>
87 "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.",
88 );
89  
90 has color => (
91 is => "rw",
92 isa => "Str|ArrayRef[Str]",
93 documentation =>
94 "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.",
95 );
96  
97 has coloraxis => (
98 is => "rw",
99 documentation =>
100 "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.",
101 );
102  
103 has colorbar => ( is => "rw",
104 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattermapbox::Marker::Colorbar", );
105  
106 has colorscale => (
107 is => "rw",
108 documentation =>
109 "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.",
110 );
111  
112 has colorsrc => ( is => "rw",
113 isa => "Str",
114 documentation => "Sets the source reference on Chart Studio Cloud for `color`.",
115 );
116  
117 has opacity => ( is => "rw",
118 isa => "Num|ArrayRef[Num]",
119 documentation => "Sets the marker opacity.",
120 );
121  
122 has opacitysrc => ( is => "rw",
123 isa => "Str",
124 documentation => "Sets the source reference on Chart Studio Cloud for `opacity`.",
125 );
126  
127 has reversescale => (
128 is => "rw",
129 isa => "Bool",
130 documentation =>
131 "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.",
132 );
133  
134 has showscale => (
135 is => "rw",
136 isa => "Bool",
137 documentation =>
138 "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.",
139 );
140  
141 has size => ( is => "rw",
142 isa => "Num|ArrayRef[Num]",
143 documentation => "Sets the marker size (in px).",
144 );
145  
146 has sizemin => (
147 is => "rw",
148 isa => "Num",
149 documentation =>
150 "Has an effect only if `marker.size` is set to a numerical array. Sets the minimum size (in px) of the rendered marker points.",
151 );
152  
153 has sizemode => (
154 is => "rw",
155 isa => enum( [ "diameter", "area" ] ),
156 documentation =>
157 "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.",
158 );
159  
160 has sizeref => (
161 is => "rw",
162 isa => "Num",
163 documentation =>
164 "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`.",
165 );
166  
167 has sizesrc => ( is => "rw",
168 isa => "Str",
169 documentation => "Sets the source reference on Chart Studio Cloud for `size`.",
170 );
171  
172 has symbol => (
173 is => "rw",
174 isa => "Str|ArrayRef[Str]",
175 documentation =>
176 "Sets the marker symbol. Full list: https://www.mapbox.com/maki-icons/ Note that the array `marker.color` and `marker.size` are only available for *circle* symbols.",
177 );
178  
179 has symbolsrc => ( is => "rw",
180 isa => "Str",
181 documentation => "Sets the source reference on Chart Studio Cloud for `symbol`.",
182 );
183  
184 __PACKAGE__->meta->make_immutable();
185 1;
186  
187 __END__