Chart/Plotly/Trace/Scatter3d.pm untested

filter: Statementstmt 0.0% 0 / 132 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 0.0% 0 / 16 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 175 CC 6 SCAR 26.0
CC
6
Cov
0%
TO_JSON
42.0
type
2.0
BEGIN
2.0
CRAP 13.4
1 package Chart::Plotly::Trace::Scatter3d;
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::Scatter3d::Error_x;
10 use Chart::Plotly::Trace::Scatter3d::Error_y;
11 use Chart::Plotly::Trace::Scatter3d::Error_z;
12 use Chart::Plotly::Trace::Scatter3d::Hoverlabel;
13 use Chart::Plotly::Trace::Scatter3d::Legendgrouptitle;
14 use Chart::Plotly::Trace::Scatter3d::Line;
15 use Chart::Plotly::Trace::Scatter3d::Marker;
16 use Chart::Plotly::Trace::Scatter3d::Projection;
17 use Chart::Plotly::Trace::Scatter3d::Stream;
18 use Chart::Plotly::Trace::Scatter3d::Textfont;
19 use Chart::Plotly::Trace::Scatter3d::Transform;
20  
21 our $VERSION = '0.042'; # VERSION
22  
23 # ABSTRACT: The data visualized as scatter point or lines in 3D dimension is set in `x`, `y`, `z`. 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` Projections are achieved via `projection`. Surface fills are achieved via `surfaceaxis`.
24  
25 sub TO_JSON {
26 my $self = shift;
27 my $extra_args = $self->extra_args // {};
28 my $meta = $self->meta;
29 my %hash = %$self;
30 for my $name ( sort keys %hash ) {
31 my $attr = $meta->get_attribute($name);
32 if ( defined $attr ) {
33 my $value = $hash{$name};
34 my $type = $attr->type_constraint;
35 if ( $type && $type->equals('Bool') ) {
36 $hash{$name} = $value ? \1 : \0;
37 }
38 }
39 }
40 my $plotly_meta = delete $hash{'pmeta'};
41 if ( defined $plotly_meta ) {
42 $hash{'meta'} = $plotly_meta;
43 }
44 %hash = ( %hash, %$extra_args );
45 delete $hash{'extra_args'};
46 if ( $self->can('type') && ( !defined $hash{'type'} ) ) {
47 $hash{type} = $self->type();
48 }
49 return \%hash;
50 }
51  
52 sub type {
53 my @components = split( /::/, __PACKAGE__ );
54 return lc( $components[-1] );
55 }
56  
57 has connectgaps => (
58 is => "rw",
59 isa => "Bool",
60 documentation =>
61 "Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.",
62 );
63  
64 has customdata => (
65 is => "rw",
66 isa => "ArrayRef|PDL",
67 documentation =>
68 "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",
69 );
70  
71 has customdatasrc => ( is => "rw",
72 isa => "Str",
73 documentation => "Sets the source reference on Chart Studio Cloud for `customdata`.",
74 );
75  
76 has error_x => ( is => "rw",
77 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatter3d::Error_x", );
78  
79 has error_y => ( is => "rw",
80 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatter3d::Error_y", );
81  
82 has error_z => ( is => "rw",
83 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatter3d::Error_z", );
84  
85 has hoverinfo => (
86 is => "rw",
87 isa => "Str|ArrayRef[Str]",
88 documentation =>
89 "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.",
90 );
91  
92 has hoverinfosrc => ( is => "rw",
93 isa => "Str",
94 documentation => "Sets the source reference on Chart Studio Cloud for `hoverinfo`.",
95 );
96  
97 has hoverlabel => ( is => "rw",
98 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatter3d::Hoverlabel", );
99  
100 has hovertemplate => (
101 is => "rw",
102 isa => "Str|ArrayRef[Str]",
103 documentation =>
104 "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>`.",
105 );
106  
107 has hovertemplatesrc => ( is => "rw",
108 isa => "Str",
109 documentation => "Sets the source reference on Chart Studio Cloud for `hovertemplate`.",
110 );
111  
112 has hovertext => (
113 is => "rw",
114 isa => "Str|ArrayRef[Str]",
115 documentation =>
116 "Sets text elements associated with each (x,y,z) triplet. 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,z) coordinates. To be seen, trace `hoverinfo` must contain a *text* flag.",
117 );
118  
119 has hovertextsrc => ( is => "rw",
120 isa => "Str",
121 documentation => "Sets the source reference on Chart Studio Cloud for `hovertext`.",
122 );
123  
124 has ids => (
125 is => "rw",
126 isa => "ArrayRef|PDL",
127 documentation =>
128 "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.",
129 );
130  
131 has idssrc => ( is => "rw",
132 isa => "Str",
133 documentation => "Sets the source reference on Chart Studio Cloud for `ids`.",
134 );
135  
136 has legendgroup => (
137 is => "rw",
138 isa => "Str",
139 documentation =>
140 "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.",
141 );
142  
143 has legendgrouptitle => ( is => "rw",
144 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatter3d::Legendgrouptitle", );
145  
146 has legendrank => (
147 is => "rw",
148 isa => "Num",
149 documentation =>
150 "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.",
151 );
152  
153 has line => ( is => "rw",
154 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatter3d::Line", );
155  
156 has marker => ( is => "rw",
157 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatter3d::Marker", );
158  
159 has pmeta => (
160 is => "rw",
161 isa => "Any|ArrayRef[Any]",
162 documentation =>
163 "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.",
164 );
165  
166 has metasrc => ( is => "rw",
167 isa => "Str",
168 documentation => "Sets the source reference on Chart Studio Cloud for `meta`.",
169 );
170  
171 has mode => (
172 is => "rw",
173 isa => "Str",
174 documentation =>
175 "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*.",
176 );
177  
178 has name => ( is => "rw",
179 isa => "Str",
180 documentation => "Sets the trace name. The trace name appear as the legend item and on hover.",
181 );
182  
183 has opacity => ( is => "rw",
184 isa => "Num",
185 documentation => "Sets the opacity of the trace.",
186 );
187  
188 has projection => ( is => "rw",
189 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatter3d::Projection", );
190  
191 has scene => (
192 is => "rw",
193 documentation =>
194 "Sets a reference between this trace's 3D coordinate system and a 3D scene. If *scene* (the default value), the (x,y,z) coordinates refer to `layout.scene`. If *scene2*, the (x,y,z) coordinates refer to `layout.scene2`, and so on.",
195 );
196  
197 has showlegend => (
198 is => "rw",
199 isa => "Bool",
200 documentation => "Determines whether or not an item corresponding to this trace is shown in the legend.",
201 );
202  
203 has stream => ( is => "rw",
204 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatter3d::Stream", );
205  
206 has surfaceaxis => (
207 is => "rw",
208 documentation =>
209 "If *-1*, the scatter points are not fill with a surface If *0*, *1*, *2*, the scatter points are filled with a Delaunay surface about the x, y, z respectively.",
210 );
211  
212 has surfacecolor => ( is => "rw",
213 isa => "Str",
214 documentation => "Sets the surface fill color.",
215 );
216  
217 has text => (
218 is => "rw",
219 isa => "Str|ArrayRef[Str]",
220 documentation =>
221 "Sets text elements associated with each (x,y,z) triplet. 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,z) coordinates. If trace `hoverinfo` contains a *text* flag and *hovertext* is not set, these elements will be seen in the hover labels.",
222 );
223  
224 has textfont => ( is => "rw",
225 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatter3d::Textfont", );
226  
227 has textposition => (
228 is => "rw",
229 isa => union(
230 [
231 enum(
232 [ "top left",
233 "top center",
234 "top right",
235 "middle left",
236 "middle center",
237 "middle right",
238 "bottom left",
239 "bottom center",
240 "bottom right"
241 ]
242 ),
243 "ArrayRef"
244 ]
245 ),
246 documentation => "Sets the positions of the `text` elements with respects to the (x,y) coordinates.",
247 );
248  
249 has textpositionsrc => ( is => "rw",
250 isa => "Str",
251 documentation => "Sets the source reference on Chart Studio Cloud for `textposition`.",
252 );
253  
254 has textsrc => ( is => "rw",
255 isa => "Str",
256 documentation => "Sets the source reference on Chart Studio Cloud for `text`.",
257 );
258  
259 has texttemplate => (
260 is => "rw",
261 isa => "Str|ArrayRef[Str]",
262 documentation =>
263 "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. ",
264 );
265  
266 has texttemplatesrc => ( is => "rw",
267 isa => "Str",
268 documentation => "Sets the source reference on Chart Studio Cloud for `texttemplate`.",
269 );
270  
271 has transforms => ( is => "rw",
272 isa => "ArrayRef|ArrayRef[Chart::Plotly::Trace::Scatter3d::Transform]", );
273  
274 has uid => (
275 is => "rw",
276 isa => "Str",
277 documentation =>
278 "Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.",
279 );
280  
281 has uirevision => (
282 is => "rw",
283 isa => "Any",
284 documentation =>
285 "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.",
286 );
287  
288 has visible => (
289 is => "rw",
290 documentation =>
291 "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).",
292 );
293  
294 has x => ( is => "rw",
295 isa => "ArrayRef|PDL",
296 documentation => "Sets the x coordinates.",
297 );
298  
299 has xcalendar => ( is => "rw",
300 isa => enum(
301 [ "chinese", "coptic", "discworld", "ethiopian", "gregorian", "hebrew", "islamic", "jalali",
302 "julian", "mayan", "nanakshahi", "nepali", "persian", "taiwan", "thai", "ummalqura"
303 ]
304 ),
305 documentation => "Sets the calendar system to use with `x` date data.",
306 );
307  
308 has xhoverformat => (
309 is => "rw",
310 isa => "Str",
311 documentation =>
312 "Sets the hover text formatting rulefor `x` using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: *%h* for half of the year as a decimal number as well as *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*By default the values are formatted using `xaxis.hoverformat`.",
313 );
314  
315 has xsrc => ( is => "rw",
316 isa => "Str",
317 documentation => "Sets the source reference on Chart Studio Cloud for `x`.",
318 );
319  
320 has y => ( is => "rw",
321 isa => "ArrayRef|PDL",
322 documentation => "Sets the y coordinates.",
323 );
324  
325 has ycalendar => ( is => "rw",
326 isa => enum(
327 [ "chinese", "coptic", "discworld", "ethiopian", "gregorian", "hebrew", "islamic", "jalali",
328 "julian", "mayan", "nanakshahi", "nepali", "persian", "taiwan", "thai", "ummalqura"
329 ]
330 ),
331 documentation => "Sets the calendar system to use with `y` date data.",
332 );
333  
334 has yhoverformat => (
335 is => "rw",
336 isa => "Str",
337 documentation =>
338 "Sets the hover text formatting rulefor `y` using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: *%h* for half of the year as a decimal number as well as *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*By default the values are formatted using `yaxis.hoverformat`.",
339 );
340  
341 has ysrc => ( is => "rw",
342 isa => "Str",
343 documentation => "Sets the source reference on Chart Studio Cloud for `y`.",
344 );
345  
346 has z => ( is => "rw",
347 isa => "ArrayRef|PDL",
348 documentation => "Sets the z coordinates.",
349 );
350  
351 has zcalendar => ( is => "rw",
352 isa => enum(
353 [ "chinese", "coptic", "discworld", "ethiopian", "gregorian", "hebrew", "islamic", "jalali",
354 "julian", "mayan", "nanakshahi", "nepali", "persian", "taiwan", "thai", "ummalqura"
355 ]
356 ),
357 documentation => "Sets the calendar system to use with `z` date data.",
358 );
359  
360 has zhoverformat => (
361 is => "rw",
362 isa => "Str",
363 documentation =>
364 "Sets the hover text formatting rulefor `z` using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: *%h* for half of the year as a decimal number as well as *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*By default the values are formatted using `zaxis.hoverformat`.",
365 );
366  
367 has zsrc => ( is => "rw",
368 isa => "Str",
369 documentation => "Sets the source reference on Chart Studio Cloud for `z`.",
370 );
371  
372 __PACKAGE__->meta->make_immutable();
373 1;
374  
375 __END__