Chart/Plotly/Trace/Splom.pm untested

filter: Statementstmt 0.0% 0 / 100 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 / 141 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::Splom;
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::Splom::Diagonal;
10 use Chart::Plotly::Trace::Splom::Dimension;
11 use Chart::Plotly::Trace::Splom::Hoverlabel;
12 use Chart::Plotly::Trace::Splom::Legendgrouptitle;
13 use Chart::Plotly::Trace::Splom::Marker;
14 use Chart::Plotly::Trace::Splom::Selected;
15 use Chart::Plotly::Trace::Splom::Stream;
16 use Chart::Plotly::Trace::Splom::Transform;
17 use Chart::Plotly::Trace::Splom::Unselected;
18  
19 our $VERSION = '0.042'; # VERSION
20  
21 # ABSTRACT: Splom traces generate scatter plot matrix visualizations. Each splom `dimensions` items correspond to a generated axis. Values for each of those dimensions are set in `dimensions[i].values`. Splom traces support all `scattergl` marker style attributes. Specify `layout.grid` attributes and/or layout x-axis and y-axis attributes for more control over the axis positioning and style.
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 customdata => (
56 is => "rw",
57 isa => "ArrayRef|PDL",
58 documentation =>
59 "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",
60 );
61  
62 has customdatasrc => ( is => "rw",
63 isa => "Str",
64 documentation => "Sets the source reference on Chart Studio Cloud for `customdata`.",
65 );
66  
67 has diagonal => ( is => "rw",
68 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Splom::Diagonal", );
69  
70 has dimensions => ( is => "rw",
71 isa => "ArrayRef|ArrayRef[Chart::Plotly::Trace::Splom::Dimension]", );
72  
73 has hoverinfo => (
74 is => "rw",
75 isa => "Str|ArrayRef[Str]",
76 documentation =>
77 "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.",
78 );
79  
80 has hoverinfosrc => ( is => "rw",
81 isa => "Str",
82 documentation => "Sets the source reference on Chart Studio Cloud for `hoverinfo`.",
83 );
84  
85 has hoverlabel => ( is => "rw",
86 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Splom::Hoverlabel", );
87  
88 has hovertemplate => (
89 is => "rw",
90 isa => "Str|ArrayRef[Str]",
91 documentation =>
92 "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>`.",
93 );
94  
95 has hovertemplatesrc => ( is => "rw",
96 isa => "Str",
97 documentation => "Sets the source reference on Chart Studio Cloud for `hovertemplate`.",
98 );
99  
100 has hovertext => ( is => "rw",
101 isa => "Str|ArrayRef[Str]",
102 documentation => "Same as `text`.",
103 );
104  
105 has hovertextsrc => ( is => "rw",
106 isa => "Str",
107 documentation => "Sets the source reference on Chart Studio Cloud for `hovertext`.",
108 );
109  
110 has ids => (
111 is => "rw",
112 isa => "ArrayRef|PDL",
113 documentation =>
114 "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.",
115 );
116  
117 has idssrc => ( is => "rw",
118 isa => "Str",
119 documentation => "Sets the source reference on Chart Studio Cloud for `ids`.",
120 );
121  
122 has legendgroup => (
123 is => "rw",
124 isa => "Str",
125 documentation =>
126 "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.",
127 );
128  
129 has legendgrouptitle => ( is => "rw",
130 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Splom::Legendgrouptitle", );
131  
132 has legendrank => (
133 is => "rw",
134 isa => "Num",
135 documentation =>
136 "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.",
137 );
138  
139 has marker => ( is => "rw",
140 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Splom::Marker", );
141  
142 has pmeta => (
143 is => "rw",
144 isa => "Any|ArrayRef[Any]",
145 documentation =>
146 "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.",
147 );
148  
149 has metasrc => ( is => "rw",
150 isa => "Str",
151 documentation => "Sets the source reference on Chart Studio Cloud for `meta`.",
152 );
153  
154 has name => ( is => "rw",
155 isa => "Str",
156 documentation => "Sets the trace name. The trace name appear as the legend item and on hover.",
157 );
158  
159 has opacity => ( is => "rw",
160 isa => "Num",
161 documentation => "Sets the opacity of the trace.",
162 );
163  
164 has selected => ( is => "rw",
165 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Splom::Selected", );
166  
167 has selectedpoints => (
168 is => "rw",
169 isa => "Any",
170 documentation =>
171 "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.",
172 );
173  
174 has showlegend => (
175 is => "rw",
176 isa => "Bool",
177 documentation => "Determines whether or not an item corresponding to this trace is shown in the legend.",
178 );
179  
180 has showlowerhalf => (
181 is => "rw",
182 isa => "Bool",
183 documentation => "Determines whether or not subplots on the lower half from the diagonal are displayed.",
184 );
185  
186 has showupperhalf => (
187 is => "rw",
188 isa => "Bool",
189 documentation => "Determines whether or not subplots on the upper half from the diagonal are displayed.",
190 );
191  
192 has stream => ( is => "rw",
193 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Splom::Stream", );
194  
195 has text => (
196 is => "rw",
197 isa => "Str|ArrayRef[Str]",
198 documentation =>
199 "Sets text elements associated with each (x,y) pair to appear on hover. 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.",
200 );
201  
202 has textsrc => ( is => "rw",
203 isa => "Str",
204 documentation => "Sets the source reference on Chart Studio Cloud for `text`.",
205 );
206  
207 has transforms => ( is => "rw",
208 isa => "ArrayRef|ArrayRef[Chart::Plotly::Trace::Splom::Transform]", );
209  
210 has uid => (
211 is => "rw",
212 isa => "Str",
213 documentation =>
214 "Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.",
215 );
216  
217 has uirevision => (
218 is => "rw",
219 isa => "Any",
220 documentation =>
221 "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.",
222 );
223  
224 has unselected => ( is => "rw",
225 isa => "Maybe[HashRef]|Chart::Plotly::Trace::Splom::Unselected", );
226  
227 has visible => (
228 is => "rw",
229 documentation =>
230 "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).",
231 );
232  
233 has xaxes => (
234 is => "rw",
235 isa => "ArrayRef|PDL",
236 documentation =>
237 "Sets the list of x axes corresponding to dimensions of this splom trace. By default, a splom will match the first N xaxes where N is the number of input dimensions. Note that, in case where `diagonal.visible` is false and `showupperhalf` or `showlowerhalf` is false, this splom trace will generate one less x-axis and one less y-axis.",
238 );
239  
240 has xhoverformat => (
241 is => "rw",
242 isa => "Str",
243 documentation =>
244 "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`.",
245 );
246  
247 has yaxes => (
248 is => "rw",
249 isa => "ArrayRef|PDL",
250 documentation =>
251 "Sets the list of y axes corresponding to dimensions of this splom trace. By default, a splom will match the first N yaxes where N is the number of input dimensions. Note that, in case where `diagonal.visible` is false and `showupperhalf` or `showlowerhalf` is false, this splom trace will generate one less x-axis and one less y-axis.",
252 );
253  
254 has yhoverformat => (
255 is => "rw",
256 isa => "Str",
257 documentation =>
258 "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`.",
259 );
260  
261 __PACKAGE__->meta->make_immutable();
262 1;
263  
264 __END__