Chart/Plotly/Trace/Scatterpolar.pm untested

filter: Statementstmt 0.0% 0 / 122 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 / 163 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::Scatterpolar;
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::Scatterpolar::Hoverlabel;
10 use Chart::Plotly::Trace::Scatterpolar::Legendgrouptitle;
11 use Chart::Plotly::Trace::Scatterpolar::Line;
12 use Chart::Plotly::Trace::Scatterpolar::Marker;
13 use Chart::Plotly::Trace::Scatterpolar::Selected;
14 use Chart::Plotly::Trace::Scatterpolar::Stream;
15 use Chart::Plotly::Trace::Scatterpolar::Textfont;
16 use Chart::Plotly::Trace::Scatterpolar::Transform;
17 use Chart::Plotly::Trace::Scatterpolar::Unselected;
18  
19 our $VERSION = '0.042'; # VERSION
20  
21 # ABSTRACT: The scatterpolar trace type encompasses line charts, scatter charts, text charts, and bubble charts in polar coordinates. The data visualized as scatter point or lines is set in `r` (radial) and `theta` (angular) coordinates Text (appearing either on the chart or on hover only) is via `text`. Bubble charts are achieved by setting `marker.size` and/or `marker.color` to numerical arrays.
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 cliponaxis => (
56 is => "rw",
57 isa => "Bool",
58 documentation =>
59 "Determines whether or not markers and text nodes are clipped about the subplot axes. To show markers and text nodes above axis lines and tick labels, make sure to set `xaxis.layer` and `yaxis.layer` to *below traces*.",
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 dr => ( is => "rw",
82 isa => "Num",
83 documentation => "Sets the r coordinate step.",
84 );
85  
86 has dtheta => (
87 is => "rw",
88 isa => "Num",
89 documentation =>
90 "Sets the theta coordinate step. By default, the `dtheta` step equals the subplot's period divided by the length of the `r` coordinates.",
91 );
92  
93 has fill => (
94 is => "rw",
95 isa => enum( [ "none", "toself", "tonext" ] ),
96 documentation =>
97 "Sets the area to fill with a solid color. Use with `fillcolor` if not *none*. scatterpolar has a subset of the options available to scatter. *toself* connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. *tonext* fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like *toself* if there is no trace before it. *tonext* should not be used if one trace does not enclose the other.",
98 );
99  
100 has fillcolor => (
101 is => "rw",
102 isa => "Str",
103 documentation =>
104 "Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.",
105 );
106  
107 has hoverinfo => (
108 is => "rw",
109 isa => "Str|ArrayRef[Str]",
110 documentation =>
111 "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.",
112 );
113  
114 has hoverinfosrc => ( is => "rw",
115 isa => "Str",
116 documentation => "Sets the source reference on Chart Studio Cloud for `hoverinfo`.",
117 );
118  
119 has hoverlabel => ( is => "rw",
120 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatterpolar::Hoverlabel", );
121  
122 has hoveron => (
123 is => "rw",
124 isa => "Str",
125 documentation =>
126 "Do the hover effects highlight individual points (markers or line points) or do they highlight filled regions? If the fill is *toself* or *tonext* and there are no markers or text, then the default is *fills*, otherwise it is *points*.",
127 );
128  
129 has hovertemplate => (
130 is => "rw",
131 isa => "Str|ArrayRef[Str]",
132 documentation =>
133 "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>`.",
134 );
135  
136 has hovertemplatesrc => ( is => "rw",
137 isa => "Str",
138 documentation => "Sets the source reference on Chart Studio Cloud for `hovertemplate`.",
139 );
140  
141 has hovertext => (
142 is => "rw",
143 isa => "Str|ArrayRef[Str]",
144 documentation =>
145 "Sets hover text elements associated with each (x,y) 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 (x,y) coordinates. To be seen, trace `hoverinfo` must contain a *text* flag.",
146 );
147  
148 has hovertextsrc => ( is => "rw",
149 isa => "Str",
150 documentation => "Sets the source reference on Chart Studio Cloud for `hovertext`.",
151 );
152  
153 has ids => (
154 is => "rw",
155 isa => "ArrayRef|PDL",
156 documentation =>
157 "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.",
158 );
159  
160 has idssrc => ( is => "rw",
161 isa => "Str",
162 documentation => "Sets the source reference on Chart Studio Cloud for `ids`.",
163 );
164  
165 has legendgroup => (
166 is => "rw",
167 isa => "Str",
168 documentation =>
169 "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.",
170 );
171  
172 has legendgrouptitle => ( is => "rw",
173 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatterpolar::Legendgrouptitle", );
174  
175 has legendrank => (
176 is => "rw",
177 isa => "Num",
178 documentation =>
179 "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.",
180 );
181  
182 has line => ( is => "rw",
183 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatterpolar::Line", );
184  
185 has marker => ( is => "rw",
186 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatterpolar::Marker", );
187  
188 has pmeta => (
189 is => "rw",
190 isa => "Any|ArrayRef[Any]",
191 documentation =>
192 "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.",
193 );
194  
195 has metasrc => ( is => "rw",
196 isa => "Str",
197 documentation => "Sets the source reference on Chart Studio Cloud for `meta`.",
198 );
199  
200 has mode => (
201 is => "rw",
202 isa => "Str",
203 documentation =>
204 "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. If there are less than 20 points and the trace is not stacked then the default is *lines+markers*. Otherwise, *lines*.",
205 );
206  
207 has name => ( is => "rw",
208 isa => "Str",
209 documentation => "Sets the trace name. The trace name appear as the legend item and on hover.",
210 );
211  
212 has opacity => ( is => "rw",
213 isa => "Num",
214 documentation => "Sets the opacity of the trace.",
215 );
216  
217 has r => ( is => "rw",
218 isa => "ArrayRef|PDL",
219 documentation => "Sets the radial coordinates",
220 );
221  
222 has r0 => (
223 is => "rw",
224 isa => "Any",
225 documentation =>
226 "Alternate to `r`. Builds a linear space of r coordinates. Use with `dr` where `r0` is the starting coordinate and `dr` the step.",
227 );
228  
229 has rsrc => ( is => "rw",
230 isa => "Str",
231 documentation => "Sets the source reference on Chart Studio Cloud for `r`.",
232 );
233  
234 has selected => ( is => "rw",
235 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatterpolar::Selected", );
236  
237 has selectedpoints => (
238 is => "rw",
239 isa => "Any",
240 documentation =>
241 "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.",
242 );
243  
244 has showlegend => (
245 is => "rw",
246 isa => "Bool",
247 documentation => "Determines whether or not an item corresponding to this trace is shown in the legend.",
248 );
249  
250 has stream => ( is => "rw",
251 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatterpolar::Stream", );
252  
253 has subplot => (
254 is => "rw",
255 documentation =>
256 "Sets a reference between this trace's data coordinates and a polar subplot. If *polar* (the default value), the data refer to `layout.polar`. If *polar2*, the data refer to `layout.polar2`, and so on.",
257 );
258  
259 has text => (
260 is => "rw",
261 isa => "Str|ArrayRef[Str]",
262 documentation =>
263 "Sets text elements associated with each (x,y) 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 (x,y) coordinates. If trace `hoverinfo` contains a *text* flag and *hovertext* is not set, these elements will be seen in the hover labels.",
264 );
265  
266 has textfont => ( is => "rw",
267 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatterpolar::Textfont", );
268  
269 has textposition => (
270 is => "rw",
271 isa => union(
272 [
273 enum(
274 [ "top left",
275 "top center",
276 "top right",
277 "middle left",
278 "middle center",
279 "middle right",
280 "bottom left",
281 "bottom center",
282 "bottom right"
283 ]
284 ),
285 "ArrayRef"
286 ]
287 ),
288 documentation => "Sets the positions of the `text` elements with respects to the (x,y) coordinates.",
289 );
290  
291 has textpositionsrc => ( is => "rw",
292 isa => "Str",
293 documentation => "Sets the source reference on Chart Studio Cloud for `textposition`.",
294 );
295  
296 has textsrc => ( is => "rw",
297 isa => "Str",
298 documentation => "Sets the source reference on Chart Studio Cloud for `text`.",
299 );
300  
301 has texttemplate => (
302 is => "rw",
303 isa => "Str|ArrayRef[Str]",
304 documentation =>
305 "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 `r`, `theta` and `text`.",
306 );
307  
308 has texttemplatesrc => ( is => "rw",
309 isa => "Str",
310 documentation => "Sets the source reference on Chart Studio Cloud for `texttemplate`.",
311 );
312  
313 has theta => ( is => "rw",
314 isa => "ArrayRef|PDL",
315 documentation => "Sets the angular coordinates",
316 );
317  
318 has theta0 => (
319 is => "rw",
320 isa => "Any",
321 documentation =>
322 "Alternate to `theta`. Builds a linear space of theta coordinates. Use with `dtheta` where `theta0` is the starting coordinate and `dtheta` the step.",
323 );
324  
325 has thetasrc => ( is => "rw",
326 isa => "Str",
327 documentation => "Sets the source reference on Chart Studio Cloud for `theta`.",
328 );
329  
330 has thetaunit => (
331 is => "rw",
332 isa => enum( [ "radians", "degrees", "gradians" ] ),
333 documentation => "Sets the unit of input *theta* values. Has an effect only when on *linear* angular axes.",
334 );
335  
336 has transforms => ( is => "rw",
337 isa => "ArrayRef|ArrayRef[Chart::Plotly::Trace::Scatterpolar::Transform]", );
338  
339 has uid => (
340 is => "rw",
341 isa => "Str",
342 documentation =>
343 "Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.",
344 );
345  
346 has uirevision => (
347 is => "rw",
348 isa => "Any",
349 documentation =>
350 "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.",
351 );
352  
353 has unselected => ( is => "rw",
354 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatterpolar::Unselected", );
355  
356 has visible => (
357 is => "rw",
358 documentation =>
359 "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).",
360 );
361  
362 __PACKAGE__->meta->make_immutable();
363 1;
364  
365 __END__