Chart/Plotly/Trace/Scattercarpet.pm untested

filter: Statementstmt 0.0% 0 / 116 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 / 157 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::Scattercarpet;
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::Scattercarpet::Hoverlabel;
10 use Chart::Plotly::Trace::Scattercarpet::Legendgrouptitle;
11 use Chart::Plotly::Trace::Scattercarpet::Line;
12 use Chart::Plotly::Trace::Scattercarpet::Marker;
13 use Chart::Plotly::Trace::Scattercarpet::Selected;
14 use Chart::Plotly::Trace::Scattercarpet::Stream;
15 use Chart::Plotly::Trace::Scattercarpet::Textfont;
16 use Chart::Plotly::Trace::Scattercarpet::Transform;
17 use Chart::Plotly::Trace::Scattercarpet::Unselected;
18  
19 our $VERSION = '0.042'; # VERSION
20  
21 # ABSTRACT: Plots a scatter trace on either the first carpet axis or the carpet axis with a matching `carpet` attribute.
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 a => ( is => "rw",
56 isa => "ArrayRef|PDL",
57 documentation => "Sets the a-axis coordinates.",
58 );
59  
60 has asrc => ( is => "rw",
61 isa => "Str",
62 documentation => "Sets the source reference on Chart Studio Cloud for `a`.",
63 );
64  
65 has b => ( is => "rw",
66 isa => "ArrayRef|PDL",
67 documentation => "Sets the b-axis coordinates.",
68 );
69  
70 has bsrc => ( is => "rw",
71 isa => "Str",
72 documentation => "Sets the source reference on Chart Studio Cloud for `b`.",
73 );
74  
75 has carpet => (
76 is => "rw",
77 isa => "Str",
78 documentation =>
79 "An identifier for this carpet, so that `scattercarpet` and `contourcarpet` traces can specify a carpet plot on which they lie",
80 );
81  
82 has connectgaps => (
83 is => "rw",
84 isa => "Bool",
85 documentation =>
86 "Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.",
87 );
88  
89 has customdata => (
90 is => "rw",
91 isa => "ArrayRef|PDL",
92 documentation =>
93 "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",
94 );
95  
96 has customdatasrc => ( is => "rw",
97 isa => "Str",
98 documentation => "Sets the source reference on Chart Studio Cloud for `customdata`.",
99 );
100  
101 has fill => (
102 is => "rw",
103 isa => enum( [ "none", "toself", "tonext" ] ),
104 documentation =>
105 "Sets the area to fill with a solid color. Use with `fillcolor` if not *none*. scatterternary 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.",
106 );
107  
108 has fillcolor => (
109 is => "rw",
110 isa => "Str",
111 documentation =>
112 "Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.",
113 );
114  
115 has hoverinfo => (
116 is => "rw",
117 isa => "Str|ArrayRef[Str]",
118 documentation =>
119 "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.",
120 );
121  
122 has hoverinfosrc => ( is => "rw",
123 isa => "Str",
124 documentation => "Sets the source reference on Chart Studio Cloud for `hoverinfo`.",
125 );
126  
127 has hoverlabel => ( is => "rw",
128 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattercarpet::Hoverlabel", );
129  
130 has hoveron => (
131 is => "rw",
132 isa => "Str",
133 documentation =>
134 "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*.",
135 );
136  
137 has hovertemplate => (
138 is => "rw",
139 isa => "Str|ArrayRef[Str]",
140 documentation =>
141 "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>`.",
142 );
143  
144 has hovertemplatesrc => ( is => "rw",
145 isa => "Str",
146 documentation => "Sets the source reference on Chart Studio Cloud for `hovertemplate`.",
147 );
148  
149 has hovertext => (
150 is => "rw",
151 isa => "Str|ArrayRef[Str]",
152 documentation =>
153 "Sets hover text elements associated with each (a,b) point. If a single string, the same string appears over all the data points. If an array of strings, the items are mapped in order to the the data points in (a,b). To be seen, trace `hoverinfo` must contain a *text* flag.",
154 );
155  
156 has hovertextsrc => ( is => "rw",
157 isa => "Str",
158 documentation => "Sets the source reference on Chart Studio Cloud for `hovertext`.",
159 );
160  
161 has ids => (
162 is => "rw",
163 isa => "ArrayRef|PDL",
164 documentation =>
165 "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.",
166 );
167  
168 has idssrc => ( is => "rw",
169 isa => "Str",
170 documentation => "Sets the source reference on Chart Studio Cloud for `ids`.",
171 );
172  
173 has legendgroup => (
174 is => "rw",
175 isa => "Str",
176 documentation =>
177 "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.",
178 );
179  
180 has legendgrouptitle => ( is => "rw",
181 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattercarpet::Legendgrouptitle", );
182  
183 has legendrank => (
184 is => "rw",
185 isa => "Num",
186 documentation =>
187 "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.",
188 );
189  
190 has line => ( is => "rw",
191 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattercarpet::Line", );
192  
193 has marker => ( is => "rw",
194 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattercarpet::Marker", );
195  
196 has pmeta => (
197 is => "rw",
198 isa => "Any|ArrayRef[Any]",
199 documentation =>
200 "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.",
201 );
202  
203 has metasrc => ( is => "rw",
204 isa => "Str",
205 documentation => "Sets the source reference on Chart Studio Cloud for `meta`.",
206 );
207  
208 has mode => (
209 is => "rw",
210 isa => "Str",
211 documentation =>
212 "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*.",
213 );
214  
215 has name => ( is => "rw",
216 isa => "Str",
217 documentation => "Sets the trace name. The trace name appear as the legend item and on hover.",
218 );
219  
220 has opacity => ( is => "rw",
221 isa => "Num",
222 documentation => "Sets the opacity of the trace.",
223 );
224  
225 has selected => ( is => "rw",
226 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattercarpet::Selected", );
227  
228 has selectedpoints => (
229 is => "rw",
230 isa => "Any",
231 documentation =>
232 "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.",
233 );
234  
235 has showlegend => (
236 is => "rw",
237 isa => "Bool",
238 documentation => "Determines whether or not an item corresponding to this trace is shown in the legend.",
239 );
240  
241 has stream => ( is => "rw",
242 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattercarpet::Stream", );
243  
244 has text => (
245 is => "rw",
246 isa => "Str|ArrayRef[Str]",
247 documentation =>
248 "Sets text elements associated with each (a,b) point. If a single string, the same string appears over all the data points. If an array of strings, the items are mapped in order to the the data points in (a,b). If trace `hoverinfo` contains a *text* flag and *hovertext* is not set, these elements will be seen in the hover labels.",
249 );
250  
251 has textfont => ( is => "rw",
252 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattercarpet::Textfont", );
253  
254 has textposition => (
255 is => "rw",
256 isa => union(
257 [
258 enum(
259 [ "top left",
260 "top center",
261 "top right",
262 "middle left",
263 "middle center",
264 "middle right",
265 "bottom left",
266 "bottom center",
267 "bottom right"
268 ]
269 ),
270 "ArrayRef"
271 ]
272 ),
273 documentation => "Sets the positions of the `text` elements with respects to the (x,y) coordinates.",
274 );
275  
276 has textpositionsrc => ( is => "rw",
277 isa => "Str",
278 documentation => "Sets the source reference on Chart Studio Cloud for `textposition`.",
279 );
280  
281 has textsrc => ( is => "rw",
282 isa => "Str",
283 documentation => "Sets the source reference on Chart Studio Cloud for `text`.",
284 );
285  
286 has texttemplate => (
287 is => "rw",
288 isa => "Str|ArrayRef[Str]",
289 documentation =>
290 "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 `a`, `b` and `text`.",
291 );
292  
293 has texttemplatesrc => ( is => "rw",
294 isa => "Str",
295 documentation => "Sets the source reference on Chart Studio Cloud for `texttemplate`.",
296 );
297  
298 has transforms => ( is => "rw",
299 isa => "ArrayRef|ArrayRef[Chart::Plotly::Trace::Scattercarpet::Transform]", );
300  
301 has uid => (
302 is => "rw",
303 isa => "Str",
304 documentation =>
305 "Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.",
306 );
307  
308 has uirevision => (
309 is => "rw",
310 isa => "Any",
311 documentation =>
312 "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.",
313 );
314  
315 has unselected => ( is => "rw",
316 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scattercarpet::Unselected", );
317  
318 has visible => (
319 is => "rw",
320 documentation =>
321 "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).",
322 );
323  
324 has xaxis => (
325 is => "rw",
326 documentation =>
327 "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.",
328 );
329  
330 has yaxis => (
331 is => "rw",
332 documentation =>
333 "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.",
334 );
335  
336 __PACKAGE__->meta->make_immutable();
337 1;
338  
339 __END__