Chart/Plotly/Trace/Pointcloud.pm untested

filter: Statementstmt 0.0% 0 / 83 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 119 CC 6 SCAR 29.5
CC
6
Cov
0%
TO_JSON
42.0
type
2.0
BEGIN
2.0
CRAP 19.1
1 package Chart::Plotly::Trace::Pointcloud;
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::Pointcloud::Hoverlabel;
10 use Chart::Plotly::Trace::Pointcloud::Legendgrouptitle;
11 use Chart::Plotly::Trace::Pointcloud::Marker;
12 use Chart::Plotly::Trace::Pointcloud::Stream;
13  
14 our $VERSION = '0.042'; # VERSION
15  
16 # ABSTRACT: *pointcloud* trace is deprecated! Please consider switching to the *scattergl* trace type. The data visualized as a point cloud set in `x` and `y` using the WebGl plotting engine.
17  
18 sub TO_JSON {
19 my $self = shift;
20 my $extra_args = $self->extra_args // {};
21 my $meta = $self->meta;
22 my %hash = %$self;
23 for my $name ( sort keys %hash ) {
24 my $attr = $meta->get_attribute($name);
25 if ( defined $attr ) {
26 my $value = $hash{$name};
27 my $type = $attr->type_constraint;
28 if ( $type && $type->equals('Bool') ) {
29 $hash{$name} = $value ? \1 : \0;
30 }
31 }
32 }
33 my $plotly_meta = delete $hash{'pmeta'};
34 if ( defined $plotly_meta ) {
35 $hash{'meta'} = $plotly_meta;
36 }
37 %hash = ( %hash, %$extra_args );
38 delete $hash{'extra_args'};
39 if ( $self->can('type') && ( !defined $hash{'type'} ) ) {
40 $hash{type} = $self->type();
41 }
42 return \%hash;
43 }
44  
45 sub type {
46 my @components = split( /::/, __PACKAGE__ );
47 return lc( $components[-1] );
48 }
49  
50 has customdata => (
51 is => "rw",
52 isa => "ArrayRef|PDL",
53 documentation =>
54 "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",
55 );
56  
57 has customdatasrc => ( is => "rw",
58 isa => "Str",
59 documentation => "Sets the source reference on Chart Studio Cloud for `customdata`.",
60 );
61  
62 has hoverinfo => (
63 is => "rw",
64 isa => "Str|ArrayRef[Str]",
65 documentation =>
66 "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.",
67 );
68  
69 has hoverinfosrc => ( is => "rw",
70 isa => "Str",
71 documentation => "Sets the source reference on Chart Studio Cloud for `hoverinfo`.",
72 );
73  
74 has hoverlabel => ( is => "rw",
75 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Pointcloud::Hoverlabel", );
76  
77 has ids => (
78 is => "rw",
79 isa => "ArrayRef|PDL",
80 documentation =>
81 "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.",
82 );
83  
84 has idssrc => ( is => "rw",
85 isa => "Str",
86 documentation => "Sets the source reference on Chart Studio Cloud for `ids`.",
87 );
88  
89 has indices => (
90 is => "rw",
91 isa => "ArrayRef|PDL",
92 documentation =>
93 "A sequential value, 0..n, supply it to avoid creating this array inside plotting. If specified, it must be a typed `Int32Array` array. Its length must be equal to or greater than the number of points. For the best performance and memory use, create one large `indices` typed array that is guaranteed to be at least as long as the largest number of points during use, and reuse it on each `Plotly.restyle()` call.",
94 );
95  
96 has indicessrc => ( is => "rw",
97 isa => "Str",
98 documentation => "Sets the source reference on Chart Studio Cloud for `indices`.",
99 );
100  
101 has legendgroup => (
102 is => "rw",
103 isa => "Str",
104 documentation =>
105 "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.",
106 );
107  
108 has legendgrouptitle => ( is => "rw",
109 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Pointcloud::Legendgrouptitle", );
110  
111 has legendrank => (
112 is => "rw",
113 isa => "Num",
114 documentation =>
115 "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.",
116 );
117  
118 has marker => ( is => "rw",
119 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Pointcloud::Marker", );
120  
121 has pmeta => (
122 is => "rw",
123 isa => "Any|ArrayRef[Any]",
124 documentation =>
125 "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.",
126 );
127  
128 has metasrc => ( is => "rw",
129 isa => "Str",
130 documentation => "Sets the source reference on Chart Studio Cloud for `meta`.",
131 );
132  
133 has name => ( is => "rw",
134 isa => "Str",
135 documentation => "Sets the trace name. The trace name appear as the legend item and on hover.",
136 );
137  
138 has opacity => ( is => "rw",
139 isa => "Num",
140 documentation => "Sets the opacity of the trace.",
141 );
142  
143 has showlegend => (
144 is => "rw",
145 isa => "Bool",
146 documentation => "Determines whether or not an item corresponding to this trace is shown in the legend.",
147 );
148  
149 has stream => ( is => "rw",
150 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Pointcloud::Stream", );
151  
152 has text => (
153 is => "rw",
154 isa => "Str|ArrayRef[Str]",
155 documentation =>
156 "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.",
157 );
158  
159 has textsrc => ( is => "rw",
160 isa => "Str",
161 documentation => "Sets the source reference on Chart Studio Cloud for `text`.",
162 );
163  
164 has uid => (
165 is => "rw",
166 isa => "Str",
167 documentation =>
168 "Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.",
169 );
170  
171 has uirevision => (
172 is => "rw",
173 isa => "Any",
174 documentation =>
175 "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.",
176 );
177  
178 has visible => (
179 is => "rw",
180 documentation =>
181 "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).",
182 );
183  
184 has x => ( is => "rw",
185 isa => "ArrayRef|PDL",
186 documentation => "Sets the x coordinates.",
187 );
188  
189 has xaxis => (
190 is => "rw",
191 documentation =>
192 "Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If *x* (the default value), the x coordinates refer to `layout.xaxis`. If *x2*, the x coordinates refer to `layout.xaxis2`, and so on.",
193 );
194  
195 has xbounds => (
196 is => "rw",
197 isa => "ArrayRef|PDL",
198 documentation =>
199 "Specify `xbounds` in the shape of `[xMin, xMax] to avoid looping through the `xy` typed array. Use it in conjunction with `xy` and `ybounds` for the performance benefits.",
200 );
201  
202 has xboundssrc => ( is => "rw",
203 isa => "Str",
204 documentation => "Sets the source reference on Chart Studio Cloud for `xbounds`.",
205 );
206  
207 has xsrc => ( is => "rw",
208 isa => "Str",
209 documentation => "Sets the source reference on Chart Studio Cloud for `x`.",
210 );
211  
212 has xy => (
213 is => "rw",
214 isa => "ArrayRef|PDL",
215 documentation =>
216 "Faster alternative to specifying `x` and `y` separately. If supplied, it must be a typed `Float32Array` array that represents points such that `xy[i * 2] = x[i]` and `xy[i * 2 + 1] = y[i]`",
217 );
218  
219 has xysrc => ( is => "rw",
220 isa => "Str",
221 documentation => "Sets the source reference on Chart Studio Cloud for `xy`.",
222 );
223  
224 has y => ( is => "rw",
225 isa => "ArrayRef|PDL",
226 documentation => "Sets the y coordinates.",
227 );
228  
229 has yaxis => (
230 is => "rw",
231 documentation =>
232 "Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If *y* (the default value), the y coordinates refer to `layout.yaxis`. If *y2*, the y coordinates refer to `layout.yaxis2`, and so on.",
233 );
234  
235 has ybounds => (
236 is => "rw",
237 isa => "ArrayRef|PDL",
238 documentation =>
239 "Specify `ybounds` in the shape of `[yMin, yMax] to avoid looping through the `xy` typed array. Use it in conjunction with `xy` and `xbounds` for the performance benefits.",
240 );
241  
242 has yboundssrc => ( is => "rw",
243 isa => "Str",
244 documentation => "Sets the source reference on Chart Studio Cloud for `ybounds`.",
245 );
246  
247 has ysrc => ( is => "rw",
248 isa => "Str",
249 documentation => "Sets the source reference on Chart Studio Cloud for `y`.",
250 );
251  
252 __PACKAGE__->meta->make_immutable();
253 1;
254  
255 __END__