Chart/Plotly/Trace/Parcoords/Dimension.pm untested

filter: Statementstmt 0.0% 0 / 45 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 73 CC 5 SCAR 29.7
CC
5
Cov
0%
TO_JSON
30.0
BEGIN
2.0
BEGIN
2.0
CRAP 19.5
1 package Chart::Plotly::Trace::Parcoords::Dimension;
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 our $VERSION = '0.042'; # VERSION
10  
11 # ABSTRACT: This attribute is one of the possible options for the trace parcoords.
12  
13 sub TO_JSON {
14 my $self = shift;
15 my $extra_args = $self->extra_args // {};
16 my $meta = $self->meta;
17 my %hash = %$self;
18 for my $name ( sort keys %hash ) {
19 my $attr = $meta->get_attribute($name);
20 if ( defined $attr ) {
21 my $value = $hash{$name};
22 my $type = $attr->type_constraint;
23 if ( $type && $type->equals('Bool') ) {
24 $hash{$name} = $value ? \1 : \0;
25 }
26 }
27 }
28 %hash = ( %hash, %$extra_args );
29 delete $hash{'extra_args'};
30 if ( $self->can('type') && ( !defined $hash{'type'} ) ) {
31 $hash{type} = $self->type();
32 }
33 return \%hash;
34 }
35  
36 has constraintrange => (
37 is => "rw",
38 isa => "ArrayRef|PDL",
39 documentation =>
40 "The domain range to which the filter on the dimension is constrained. Must be an array of `[fromValue, toValue]` with `fromValue <= toValue`, or if `multiselect` is not disabled, you may give an array of arrays, where each inner array is `[fromValue, toValue]`.",
41 );
42  
43 has description => (
44 is => "ro",
45 default => "The dimensions (variables) of the parallel coordinates chart. 2..60 dimensions are supported.",
46 );
47  
48 has label => ( is => "rw",
49 isa => "Str",
50 documentation => "The shown name of the dimension.",
51 );
52  
53 has multiselect => ( is => "rw",
54 isa => "Bool",
55 documentation => "Do we allow multiple selection ranges or just a single range?",
56 );
57  
58 has name => (
59 is => "rw",
60 isa => "Str",
61 documentation =>
62 "When used in a template, named items are created in the output figure in addition to any items the figure already has in this array. You can modify these items in the output figure by making your own item with `templateitemname` matching this `name` alongside your modifications (including `visible: false` or `enabled: false` to hide it). Has no effect outside of a template.",
63 );
64  
65 has range => (
66 is => "rw",
67 isa => "ArrayRef|PDL",
68 documentation =>
69 "The domain range that represents the full, shown axis extent. Defaults to the `values` extent. Must be an array of `[fromValue, toValue]` with finite numbers as elements.",
70 );
71  
72 has templateitemname => (
73 is => "rw",
74 isa => "Str",
75 documentation =>
76 "Used to refer to a named item in this array in the template. Named items from the template will be created even without a matching item in the input figure, but you can modify one by making an item with `templateitemname` matching its `name`, alongside your modifications (including `visible: false` or `enabled: false` to hide it). If there is no template or no matching item, this item will be hidden unless you explicitly show it with `visible: true`.",
77 );
78  
79 has tickformat => (
80 is => "rw",
81 isa => "Str",
82 documentation =>
83 "Sets the tick label formatting rule 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*",
84 );
85  
86 has ticktext => ( is => "rw",
87 isa => "ArrayRef|PDL",
88 documentation => "Sets the text displayed at the ticks position via `tickvals`.",
89 );
90  
91 has ticktextsrc => ( is => "rw",
92 isa => "Str",
93 documentation => "Sets the source reference on Chart Studio Cloud for `ticktext`.",
94 );
95  
96 has tickvals => ( is => "rw",
97 isa => "ArrayRef|PDL",
98 documentation => "Sets the values at which ticks on this axis appear.",
99 );
100  
101 has tickvalssrc => ( is => "rw",
102 isa => "Str",
103 documentation => "Sets the source reference on Chart Studio Cloud for `tickvals`.",
104 );
105  
106 has values => (
107 is => "rw",
108 isa => "ArrayRef|PDL",
109 documentation =>
110 "Dimension values. `values[n]` represents the value of the `n`th point in the dataset, therefore the `values` vector for all dimensions must be the same (longer vectors will be truncated). Each value must be a finite number.",
111 );
112  
113 has valuessrc => ( is => "rw",
114 isa => "Str",
115 documentation => "Sets the source reference on Chart Studio Cloud for `values`.",
116 );
117  
118 has visible => (
119 is => "rw",
120 isa => "Bool",
121 documentation => "Shows the dimension when set to `true` (the default). Hides the dimension for `false`.",
122 );
123  
124 __PACKAGE__->meta->make_immutable();
125 1;
126  
127 __END__