Chart/Plotly/Trace/Funnelarea.pm untested

filter: Statementstmt 0.0% 0 / 111 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 / 152 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::Funnelarea;
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::Funnelarea::Domain;
10 use Chart::Plotly::Trace::Funnelarea::Hoverlabel;
11 use Chart::Plotly::Trace::Funnelarea::Insidetextfont;
12 use Chart::Plotly::Trace::Funnelarea::Legendgrouptitle;
13 use Chart::Plotly::Trace::Funnelarea::Marker;
14 use Chart::Plotly::Trace::Funnelarea::Stream;
15 use Chart::Plotly::Trace::Funnelarea::Textfont;
16 use Chart::Plotly::Trace::Funnelarea::Title;
17 use Chart::Plotly::Trace::Funnelarea::Transform;
18  
19 our $VERSION = '0.042'; # VERSION
20  
21 # ABSTRACT: Visualize stages in a process using area-encoded trapezoids. This trace can be used to show data in a part-to-whole representation similar to a "pie" trace, wherein each item appears in a single stage. See also the "funnel" trace type for a different approach to visualizing funnel data.
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 aspectratio => ( is => "rw",
56 isa => "Num",
57 documentation => "Sets the ratio between height and width",
58 );
59  
60 has baseratio => ( is => "rw",
61 isa => "Num",
62 documentation => "Sets the ratio between bottom length and maximum top length.",
63 );
64  
65 has customdata => (
66 is => "rw",
67 isa => "ArrayRef|PDL",
68 documentation =>
69 "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",
70 );
71  
72 has customdatasrc => ( is => "rw",
73 isa => "Str",
74 documentation => "Sets the source reference on Chart Studio Cloud for `customdata`.",
75 );
76  
77 has dlabel => ( is => "rw",
78 isa => "Num",
79 documentation => "Sets the label step. See `label0` for more info.",
80 );
81  
82 has domain => ( is => "rw",
83 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Funnelarea::Domain", );
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::Funnelarea::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. variables `label`, `color`, `value`, `text` and `percent`. 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 hover text elements associated with each sector. If a single string, the same string appears for all data points. If an array of string, the items are mapped in order of this trace's sectors. 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 insidetextfont => ( is => "rw",
137 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Funnelarea::Insidetextfont", );
138  
139 has label0 => (
140 is => "rw",
141 isa => "Num",
142 documentation =>
143 "Alternate to `labels`. Builds a numeric set of labels. Use with `dlabel` where `label0` is the starting label and `dlabel` the step.",
144 );
145  
146 has labels => (
147 is => "rw",
148 isa => "ArrayRef|PDL",
149 documentation =>
150 "Sets the sector labels. If `labels` entries are duplicated, we sum associated `values` or simply count occurrences if `values` is not provided. For other array attributes (including color) we use the first non-empty entry among all occurrences of the label.",
151 );
152  
153 has labelssrc => ( is => "rw",
154 isa => "Str",
155 documentation => "Sets the source reference on Chart Studio Cloud for `labels`.",
156 );
157  
158 has legendgroup => (
159 is => "rw",
160 isa => "Str",
161 documentation =>
162 "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.",
163 );
164  
165 has legendgrouptitle => ( is => "rw",
166 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Funnelarea::Legendgrouptitle", );
167  
168 has legendrank => (
169 is => "rw",
170 isa => "Num",
171 documentation =>
172 "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.",
173 );
174  
175 has marker => ( is => "rw",
176 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Funnelarea::Marker", );
177  
178 has pmeta => (
179 is => "rw",
180 isa => "Any|ArrayRef[Any]",
181 documentation =>
182 "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.",
183 );
184  
185 has metasrc => ( is => "rw",
186 isa => "Str",
187 documentation => "Sets the source reference on Chart Studio Cloud for `meta`.",
188 );
189  
190 has name => ( is => "rw",
191 isa => "Str",
192 documentation => "Sets the trace name. The trace name appear as the legend item and on hover.",
193 );
194  
195 has opacity => ( is => "rw",
196 isa => "Num",
197 documentation => "Sets the opacity of the trace.",
198 );
199  
200 has scalegroup => (
201 is => "rw",
202 isa => "Str",
203 documentation =>
204 "If there are multiple funnelareas that should be sized according to their totals, link them by providing a non-empty group id here shared by every trace in the same group.",
205 );
206  
207 has showlegend => (
208 is => "rw",
209 isa => "Bool",
210 documentation => "Determines whether or not an item corresponding to this trace is shown in the legend.",
211 );
212  
213 has stream => ( is => "rw",
214 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Funnelarea::Stream", );
215  
216 has text => (
217 is => "rw",
218 isa => "ArrayRef|PDL",
219 documentation =>
220 "Sets text elements associated with each sector. If trace `textinfo` contains a *text* flag, these elements will be seen on the chart. If trace `hoverinfo` contains a *text* flag and *hovertext* is not set, these elements will be seen in the hover labels.",
221 );
222  
223 has textfont => ( is => "rw",
224 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Funnelarea::Textfont", );
225  
226 has textinfo => ( is => "rw",
227 isa => "Str",
228 documentation => "Determines which trace information appear on the graph.",
229 );
230  
231 has textposition => ( is => "rw",
232 isa => union( [ enum( [ "inside", "none" ] ), "ArrayRef" ] ),
233 documentation => "Specifies the location of the `textinfo`.",
234 );
235  
236 has textpositionsrc => ( is => "rw",
237 isa => "Str",
238 documentation => "Sets the source reference on Chart Studio Cloud for `textposition`.",
239 );
240  
241 has textsrc => ( is => "rw",
242 isa => "Str",
243 documentation => "Sets the source reference on Chart Studio Cloud for `text`.",
244 );
245  
246 has texttemplate => (
247 is => "rw",
248 isa => "Str|ArrayRef[Str]",
249 documentation =>
250 "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 `label`, `color`, `value`, `text` and `percent`.",
251 );
252  
253 has texttemplatesrc => ( is => "rw",
254 isa => "Str",
255 documentation => "Sets the source reference on Chart Studio Cloud for `texttemplate`.",
256 );
257  
258 has title => ( is => "rw",
259 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Funnelarea::Title", );
260  
261 has transforms => ( is => "rw",
262 isa => "ArrayRef|ArrayRef[Chart::Plotly::Trace::Funnelarea::Transform]", );
263  
264 has uid => (
265 is => "rw",
266 isa => "Str",
267 documentation =>
268 "Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.",
269 );
270  
271 has uirevision => (
272 is => "rw",
273 isa => "Any",
274 documentation =>
275 "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.",
276 );
277  
278 has values => ( is => "rw",
279 isa => "ArrayRef|PDL",
280 documentation => "Sets the values of the sectors. If omitted, we count occurrences of each label.",
281 );
282  
283 has valuessrc => ( is => "rw",
284 isa => "Str",
285 documentation => "Sets the source reference on Chart Studio Cloud for `values`.",
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 __PACKAGE__->meta->make_immutable();
295 1;
296  
297 __END__