Chart/Plotly/Trace/Scattermapbox.pm untested

filter: Statementstmt 0.0% 0 / 111 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 152 CC 6 SCAR 26.8
CC
6
Cov
0%
TO_JSON
42.0
type
2.0
BEGIN
2.0
CRAP 14.6
1 package Chart::Plotly::Trace::Scattermapbox;
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::Hoverlabel;
10 use Chart::Plotly::Trace::Scattermapbox::Legendgrouptitle;
11 use Chart::Plotly::Trace::Scattermapbox::Line;
12 use Chart::Plotly::Trace::Scattermapbox::Marker;
13 use Chart::Plotly::Trace::Scattermapbox::Selected;
14 use Chart::Plotly::Trace::Scattermapbox::Stream;
15 use Chart::Plotly::Trace::Scattermapbox::Textfont;
16 use Chart::Plotly::Trace::Scattermapbox::Transform;
17 use Chart::Plotly::Trace::Scattermapbox::Unselected;
18  
19 our $VERSION = '0.042'; # VERSION
20  
21 # ABSTRACT: The data visualized as scatter point, lines or marker symbols on a Mapbox GL geographic map is provided by longitude/latitude pairs in `lon` and `lat`.
22  
23 sub TO_JSON {
24 my $self = shift;
25 my $extra_args = $self->extra_args // {};
26 my $meta = $self->meta;
27 my %hash = %$self;
28 for my $name ( sort keys %hash ) {
29 my $attr = $meta->get_attribute($name);
30 if ( defined $attr ) {
31 my $value = $hash{$name};
32 my $type = $attr->type_constraint;
33 if ( $type && $type->equals('Bool') ) {
34 $hash{$name} = $value ? \1 : \0;
35 }
36 }
37 }
38 my $plotly_meta = delete $hash{'pmeta'};
39 if ( defined $plotly_meta ) {
40 $hash{'meta'} = $plotly_meta;
41 }
42 %hash = ( %hash, %$extra_args );
43 delete $hash{'extra_args'};
44 if ( $self->can('type') && ( !defined $hash{'type'} ) ) {
45 $hash{type} = $self->type();
46 }
47 return \%hash;
48 }
49  
50 sub type {
51 my @components = split( /::/, __PACKAGE__ );
52 return lc( $components[-1] );
53 }
54  
55 has below => (
56 is => "rw",
57 isa => "Str",
58 documentation =>
59 "Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to *''*.",
60 );
61  
62 has connectgaps => (
63 is => "rw",
64 isa => "Bool",
65 documentation =>
66 "Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.",
67 );
68  
69 has customdata => (
70 is => "rw",
71 isa => "ArrayRef|PDL",
72 documentation =>
73 "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements",
74 );
75  
76 has customdatasrc => ( is => "rw",
77 isa => "Str",
78 documentation => "Sets the source reference on Chart Studio Cloud for `customdata`.",
79 );
80  
81 has fill => (
82 is => "rw",
83 isa => enum( [ "none", "toself" ] ),
84 documentation =>
85 "Sets the area to fill with a solid color. Use with `fillcolor` if not *none*. *toself* connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape.",
86 );
87  
88 has fillcolor => (
89 is => "rw",
90 isa => "Str",
91 documentation =>
92 "Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.",
93 );
94  
95 has hoverinfo => (
96 is => "rw",
97 isa => "Str|ArrayRef[Str]",
98 documentation =>
99 "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.",
100 );
101  
102 has hoverinfosrc => ( is => "rw",
103 isa => "Str",
104 documentation => "Sets the source reference on Chart Studio Cloud for `hoverinfo`.",
105 );
106  
107 has hoverlabel => ( is => "rw",
108 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattermapbox::Hoverlabel", );
109  
110 has hovertemplate => (
111 is => "rw",
112 isa => "Str|ArrayRef[Str]",
113 documentation =>
114 "Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example \"y: %{y}\" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:\$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. Anything contained in tag `<extra>` is displayed in the secondary box, for example \"<extra>{fullData.name}</extra>\". To hide the secondary box completely, use an empty tag `<extra></extra>`.",
115 );
116  
117 has hovertemplatesrc => ( is => "rw",
118 isa => "Str",
119 documentation => "Sets the source reference on Chart Studio Cloud for `hovertemplate`.",
120 );
121  
122 has hovertext => (
123 is => "rw",
124 isa => "Str|ArrayRef[Str]",
125 documentation =>
126 "Sets hover text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. To be seen, trace `hoverinfo` must contain a *text* flag.",
127 );
128  
129 has hovertextsrc => ( is => "rw",
130 isa => "Str",
131 documentation => "Sets the source reference on Chart Studio Cloud for `hovertext`.",
132 );
133  
134 has ids => (
135 is => "rw",
136 isa => "ArrayRef|PDL",
137 documentation =>
138 "Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.",
139 );
140  
141 has idssrc => ( is => "rw",
142 isa => "Str",
143 documentation => "Sets the source reference on Chart Studio Cloud for `ids`.",
144 );
145  
146 has lat => ( is => "rw",
147 isa => "ArrayRef|PDL",
148 documentation => "Sets the latitude coordinates (in degrees North).",
149 );
150  
151 has latsrc => ( is => "rw",
152 isa => "Str",
153 documentation => "Sets the source reference on Chart Studio Cloud for `lat`.",
154 );
155  
156 has legendgroup => (
157 is => "rw",
158 isa => "Str",
159 documentation =>
160 "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.",
161 );
162  
163 has legendgrouptitle => ( is => "rw",
164 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattermapbox::Legendgrouptitle", );
165  
166 has legendrank => (
167 is => "rw",
168 isa => "Num",
169 documentation =>
170 "Sets the legend rank for this trace. Items and groups with smaller ranks are presented on top/left side while with `*reversed* `legend.traceorder` they are on bottom/right side. The default legendrank is 1000, so that you can use ranks less than 1000 to place certain items before all unranked items, and ranks greater than 1000 to go after all unranked items.",
171 );
172  
173 has line => ( is => "rw",
174 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattermapbox::Line", );
175  
176 has lon => ( is => "rw",
177 isa => "ArrayRef|PDL",
178 documentation => "Sets the longitude coordinates (in degrees East).",
179 );
180  
181 has lonsrc => ( is => "rw",
182 isa => "Str",
183 documentation => "Sets the source reference on Chart Studio Cloud for `lon`.",
184 );
185  
186 has marker => ( is => "rw",
187 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattermapbox::Marker", );
188  
189 has pmeta => (
190 is => "rw",
191 isa => "Any|ArrayRef[Any]",
192 documentation =>
193 "Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index.",
194 );
195  
196 has metasrc => ( is => "rw",
197 isa => "Str",
198 documentation => "Sets the source reference on Chart Studio Cloud for `meta`.",
199 );
200  
201 has mode => (
202 is => "rw",
203 isa => "Str",
204 documentation =>
205 "Determines the drawing mode for this scatter trace. If the provided `mode` includes *text* then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover.",
206 );
207  
208 has name => ( is => "rw",
209 isa => "Str",
210 documentation => "Sets the trace name. The trace name appear as the legend item and on hover.",
211 );
212  
213 has opacity => ( is => "rw",
214 isa => "Num",
215 documentation => "Sets the opacity of the trace.",
216 );
217  
218 has selected => ( is => "rw",
219 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattermapbox::Selected", );
220  
221 has selectedpoints => (
222 is => "rw",
223 isa => "Any",
224 documentation =>
225 "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect.",
226 );
227  
228 has showlegend => (
229 is => "rw",
230 isa => "Bool",
231 documentation => "Determines whether or not an item corresponding to this trace is shown in the legend.",
232 );
233  
234 has stream => ( is => "rw",
235 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattermapbox::Stream", );
236  
237 has subplot => (
238 is => "rw",
239 documentation =>
240 "Sets a reference between this trace's data coordinates and a mapbox subplot. If *mapbox* (the default value), the data refer to `layout.mapbox`. If *mapbox2*, the data refer to `layout.mapbox2`, and so on.",
241 );
242  
243 has text => (
244 is => "rw",
245 isa => "Str|ArrayRef[Str]",
246 documentation =>
247 "Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a *text* flag and *hovertext* is not set, these elements will be seen in the hover labels.",
248 );
249  
250 has textfont => ( is => "rw",
251 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattermapbox::Textfont", );
252  
253 has textposition => (
254 is => "rw",
255 isa => enum(
256 [ "top left",
257 "top center",
258 "top right",
259 "middle left",
260 "middle center",
261 "middle right",
262 "bottom left",
263 "bottom center",
264 "bottom right"
265 ]
266 ),
267 documentation => "Sets the positions of the `text` elements with respects to the (x,y) coordinates.",
268 );
269  
270 has textsrc => ( is => "rw",
271 isa => "Str",
272 documentation => "Sets the source reference on Chart Studio Cloud for `text`.",
273 );
274  
275 has texttemplate => (
276 is => "rw",
277 isa => "Str|ArrayRef[Str]",
278 documentation =>
279 "Template string used for rendering the information text that appear on points. Note that this will override `textinfo`. Variables are inserted using %{variable}, for example \"y: %{y}\". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:\$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. Every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variables `lat`, `lon` and `text`.",
280 );
281  
282 has texttemplatesrc => ( is => "rw",
283 isa => "Str",
284 documentation => "Sets the source reference on Chart Studio Cloud for `texttemplate`.",
285 );
286  
287 has transforms => ( is => "rw",
288 isa => "ArrayRef|ArrayRef[Chart::Plotly::Trace::Scattermapbox::Transform]", );
289  
290 has uid => (
291 is => "rw",
292 isa => "Str",
293 documentation =>
294 "Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.",
295 );
296  
297 has uirevision => (
298 is => "rw",
299 isa => "Any",
300 documentation =>
301 "Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves.",
302 );
303  
304 has unselected => ( is => "rw",
305 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattermapbox::Unselected", );
306  
307 has visible => (
308 is => "rw",
309 documentation =>
310 "Determines whether or not this trace is visible. If *legendonly*, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).",
311 );
312  
313 __PACKAGE__->meta->make_immutable();
314 1;
315  
316 __END__