Chart/Plotly/Trace/Scatterpolargl.pm untested

filter: Statementstmt 0.0% 0 / 120 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 / 161 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::Scatterpolargl;
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::Scatterpolargl::Hoverlabel;
10 use Chart::Plotly::Trace::Scatterpolargl::Legendgrouptitle;
11 use Chart::Plotly::Trace::Scatterpolargl::Line;
12 use Chart::Plotly::Trace::Scatterpolargl::Marker;
13 use Chart::Plotly::Trace::Scatterpolargl::Selected;
14 use Chart::Plotly::Trace::Scatterpolargl::Stream;
15 use Chart::Plotly::Trace::Scatterpolargl::Textfont;
16 use Chart::Plotly::Trace::Scatterpolargl::Transform;
17 use Chart::Plotly::Trace::Scatterpolargl::Unselected;
18  
19 our $VERSION = '0.042'; # VERSION
20  
21 # ABSTRACT: The scatterpolargl trace type encompasses line charts, scatter charts, and bubble charts in polar coordinates using the WebGL plotting engine. The data visualized as scatter point or lines is set in `r` (radial) and `theta` (angular) coordinates 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 connectgaps => (
56 is => "rw",
57 isa => "Bool",
58 documentation =>
59 "Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.",
60 );
61  
62 has customdata => (
63 is => "rw",
64 isa => "ArrayRef|PDL",
65 documentation =>
66 "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",
67 );
68  
69 has customdatasrc => ( is => "rw",
70 isa => "Str",
71 documentation => "Sets the source reference on Chart Studio Cloud for `customdata`.",
72 );
73  
74 has dr => ( is => "rw",
75 isa => "Num",
76 documentation => "Sets the r coordinate step.",
77 );
78  
79 has dtheta => (
80 is => "rw",
81 isa => "Num",
82 documentation =>
83 "Sets the theta coordinate step. By default, the `dtheta` step equals the subplot's period divided by the length of the `r` coordinates.",
84 );
85  
86 has fill => (
87 is => "rw",
88 isa => enum( [ "none", "tozeroy", "tozerox", "tonexty", "tonextx", "toself", "tonext" ] ),
89 documentation =>
90 "Sets the area to fill with a solid color. Defaults to *none* unless this trace is stacked, then it gets *tonexty* (*tonextx*) if `orientation` is *v* (*h*) Use with `fillcolor` if not *none*. *tozerox* and *tozeroy* fill to x=0 and y=0 respectively. *tonextx* and *tonexty* fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like *tozerox* and *tozeroy*. *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. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order.",
91 );
92  
93 has fillcolor => (
94 is => "rw",
95 isa => "Str",
96 documentation =>
97 "Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.",
98 );
99  
100 has hoverinfo => (
101 is => "rw",
102 isa => "Str|ArrayRef[Str]",
103 documentation =>
104 "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.",
105 );
106  
107 has hoverinfosrc => ( is => "rw",
108 isa => "Str",
109 documentation => "Sets the source reference on Chart Studio Cloud for `hoverinfo`.",
110 );
111  
112 has hoverlabel => ( is => "rw",
113 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatterpolargl::Hoverlabel", );
114  
115 has hovertemplate => (
116 is => "rw",
117 isa => "Str|ArrayRef[Str]",
118 documentation =>
119 "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>`.",
120 );
121  
122 has hovertemplatesrc => ( is => "rw",
123 isa => "Str",
124 documentation => "Sets the source reference on Chart Studio Cloud for `hovertemplate`.",
125 );
126  
127 has hovertext => (
128 is => "rw",
129 isa => "Str|ArrayRef[Str]",
130 documentation =>
131 "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.",
132 );
133  
134 has hovertextsrc => ( is => "rw",
135 isa => "Str",
136 documentation => "Sets the source reference on Chart Studio Cloud for `hovertext`.",
137 );
138  
139 has ids => (
140 is => "rw",
141 isa => "ArrayRef|PDL",
142 documentation =>
143 "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.",
144 );
145  
146 has idssrc => ( is => "rw",
147 isa => "Str",
148 documentation => "Sets the source reference on Chart Studio Cloud for `ids`.",
149 );
150  
151 has legendgroup => (
152 is => "rw",
153 isa => "Str",
154 documentation =>
155 "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.",
156 );
157  
158 has legendgrouptitle => ( is => "rw",
159 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatterpolargl::Legendgrouptitle", );
160  
161 has legendrank => (
162 is => "rw",
163 isa => "Num",
164 documentation =>
165 "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.",
166 );
167  
168 has line => ( is => "rw",
169 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatterpolargl::Line", );
170  
171 has marker => ( is => "rw",
172 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatterpolargl::Marker", );
173  
174 has pmeta => (
175 is => "rw",
176 isa => "Any|ArrayRef[Any]",
177 documentation =>
178 "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.",
179 );
180  
181 has metasrc => ( is => "rw",
182 isa => "Str",
183 documentation => "Sets the source reference on Chart Studio Cloud for `meta`.",
184 );
185  
186 has mode => (
187 is => "rw",
188 isa => "Str",
189 documentation =>
190 "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*.",
191 );
192  
193 has name => ( is => "rw",
194 isa => "Str",
195 documentation => "Sets the trace name. The trace name appear as the legend item and on hover.",
196 );
197  
198 has opacity => ( is => "rw",
199 isa => "Num",
200 documentation => "Sets the opacity of the trace.",
201 );
202  
203 has r => ( is => "rw",
204 isa => "ArrayRef|PDL",
205 documentation => "Sets the radial coordinates",
206 );
207  
208 has r0 => (
209 is => "rw",
210 isa => "Any",
211 documentation =>
212 "Alternate to `r`. Builds a linear space of r coordinates. Use with `dr` where `r0` is the starting coordinate and `dr` the step.",
213 );
214  
215 has rsrc => ( is => "rw",
216 isa => "Str",
217 documentation => "Sets the source reference on Chart Studio Cloud for `r`.",
218 );
219  
220 has selected => ( is => "rw",
221 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatterpolargl::Selected", );
222  
223 has selectedpoints => (
224 is => "rw",
225 isa => "Any",
226 documentation =>
227 "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.",
228 );
229  
230 has showlegend => (
231 is => "rw",
232 isa => "Bool",
233 documentation => "Determines whether or not an item corresponding to this trace is shown in the legend.",
234 );
235  
236 has stream => ( is => "rw",
237 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatterpolargl::Stream", );
238  
239 has subplot => (
240 is => "rw",
241 documentation =>
242 "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.",
243 );
244  
245 has text => (
246 is => "rw",
247 isa => "Str|ArrayRef[Str]",
248 documentation =>
249 "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.",
250 );
251  
252 has textfont => ( is => "rw",
253 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatterpolargl::Textfont", );
254  
255 has textposition => (
256 is => "rw",
257 isa => union(
258 [
259 enum(
260 [ "top left",
261 "top center",
262 "top right",
263 "middle left",
264 "middle center",
265 "middle right",
266 "bottom left",
267 "bottom center",
268 "bottom right"
269 ]
270 ),
271 "ArrayRef"
272 ]
273 ),
274 documentation => "Sets the positions of the `text` elements with respects to the (x,y) coordinates.",
275 );
276  
277 has textpositionsrc => ( is => "rw",
278 isa => "Str",
279 documentation => "Sets the source reference on Chart Studio Cloud for `textposition`.",
280 );
281  
282 has textsrc => ( is => "rw",
283 isa => "Str",
284 documentation => "Sets the source reference on Chart Studio Cloud for `text`.",
285 );
286  
287 has texttemplate => (
288 is => "rw",
289 isa => "Str|ArrayRef[Str]",
290 documentation =>
291 "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`.",
292 );
293  
294 has texttemplatesrc => ( is => "rw",
295 isa => "Str",
296 documentation => "Sets the source reference on Chart Studio Cloud for `texttemplate`.",
297 );
298  
299 has theta => ( is => "rw",
300 isa => "ArrayRef|PDL",
301 documentation => "Sets the angular coordinates",
302 );
303  
304 has theta0 => (
305 is => "rw",
306 isa => "Any",
307 documentation =>
308 "Alternate to `theta`. Builds a linear space of theta coordinates. Use with `dtheta` where `theta0` is the starting coordinate and `dtheta` the step.",
309 );
310  
311 has thetasrc => ( is => "rw",
312 isa => "Str",
313 documentation => "Sets the source reference on Chart Studio Cloud for `theta`.",
314 );
315  
316 has thetaunit => (
317 is => "rw",
318 isa => enum( [ "radians", "degrees", "gradians" ] ),
319 documentation => "Sets the unit of input *theta* values. Has an effect only when on *linear* angular axes.",
320 );
321  
322 has transforms => ( is => "rw",
323 isa => "ArrayRef|ArrayRef[Chart::Plotly::Trace::Scatterpolargl::Transform]", );
324  
325 has uid => (
326 is => "rw",
327 isa => "Str",
328 documentation =>
329 "Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.",
330 );
331  
332 has uirevision => (
333 is => "rw",
334 isa => "Any",
335 documentation =>
336 "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.",
337 );
338  
339 has unselected => ( is => "rw",
340 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatterpolargl::Unselected", );
341  
342 has visible => (
343 is => "rw",
344 documentation =>
345 "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).",
346 );
347  
348 __PACKAGE__->meta->make_immutable();
349 1;
350  
351 __END__