File Coverage

blib/lib/Chart/Plotly/Trace/Scatter/Marker/Colorbar/Tickformatstop.pm
Criterion Covered Total %
statement 9 25 36.0
branch 0 8 0.0
condition 0 8 0.0
subroutine 3 4 75.0
pod 1 1 100.0
total 13 46 28.2


line stmt bran cond sub pod time code
1             package Chart::Plotly::Trace::Scatter::Marker::Colorbar::Tickformatstop;
2 5     5   41 use Moose;
  5         15  
  5         41  
3 5     5   33972 use MooseX::ExtraArgs;
  5         13  
  5         43  
4 5     5   10517 use Moose::Util::TypeConstraints qw(enum union);
  5         28  
  5         48  
5             if ( !defined Moose::Util::TypeConstraints::find_type_constraint('PDL') ) {
6             Moose::Util::TypeConstraints::type('PDL');
7             }
8              
9             our $VERSION = '0.041'; # VERSION
10              
11             # ABSTRACT: This attribute is one of the possible options for the trace scatter.
12              
13             sub TO_JSON {
14 0     0 1   my $self = shift;
15 0   0       my $extra_args = $self->extra_args // {};
16 0           my $meta = $self->meta;
17 0           my %hash = %$self;
18 0           for my $name ( sort keys %hash ) {
19 0           my $attr = $meta->get_attribute($name);
20 0 0         if ( defined $attr ) {
21 0           my $value = $hash{$name};
22 0           my $type = $attr->type_constraint;
23 0 0 0       if ( $type && $type->equals('Bool') ) {
24 0 0         $hash{$name} = $value ? \1 : \0;
25             }
26             }
27             }
28 0           %hash = ( %hash, %$extra_args );
29 0           delete $hash{'extra_args'};
30 0 0 0       if ( $self->can('type') && ( !defined $hash{'type'} ) ) {
31 0           $hash{type} = $self->type();
32             }
33 0           return \%hash;
34             }
35              
36             has dtickrange => (
37             is => "rw",
38             isa => "ArrayRef|PDL",
39             documentation =>
40             "range [*min*, *max*], where *min*, *max* - dtick values which describe some zoom level, it is possible to omit *min* or *max* value by passing *null*",
41             );
42              
43             has enabled => (
44             is => "rw",
45             isa => "Bool",
46             documentation =>
47             "Determines whether or not this stop is used. If `false`, this stop is ignored even within its `dtickrange`.",
48             );
49              
50             has name => (
51             is => "rw",
52             isa => "Str",
53             documentation =>
54             "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.",
55             );
56              
57             has templateitemname => (
58             is => "rw",
59             isa => "Str",
60             documentation =>
61             "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`.",
62             );
63              
64             has value => ( is => "rw",
65             isa => "Str",
66             documentation => "string - dtickformat for described zoom level, the same as *tickformat*",
67             );
68              
69             __PACKAGE__->meta->make_immutable();
70             1;
71              
72             __END__
73              
74             =pod
75              
76             =encoding utf-8
77              
78             =head1 NAME
79              
80             Chart::Plotly::Trace::Scatter::Marker::Colorbar::Tickformatstop - This attribute is one of the possible options for the trace scatter.
81              
82             =head1 VERSION
83              
84             version 0.041
85              
86             =head1 SYNOPSIS
87              
88             use HTML::Show;
89             use Chart::Plotly;
90             use Chart::Plotly::Trace::Scatter;
91             my $scatter = Chart::Plotly::Trace::Scatter->new( x => [ 1 .. 5 ], y => [ 1 .. 5 ] );
92            
93             HTML::Show::show( Chart::Plotly::render_full_html( data => [$scatter] ) );
94              
95             =head1 DESCRIPTION
96              
97             This attribute is part of the possible options for the trace scatter.
98              
99             This file has been autogenerated from the official plotly.js source.
100              
101             If you like Plotly, please support them: L<https://plot.ly/>
102             Open source announcement: L<https://plot.ly/javascript/open-source-announcement/>
103              
104             Full reference: L<https://plot.ly/javascript/reference/#scatter>
105              
106             =head1 DISCLAIMER
107              
108             This is an unofficial Plotly Perl module. Currently I'm not affiliated in any way with Plotly.
109             But I think plotly.js is a great library and I want to use it with perl.
110              
111             =head1 METHODS
112              
113             =head2 TO_JSON
114              
115             Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
116              
117             =head1 ATTRIBUTES
118              
119             =over
120              
121             =item * dtickrange
122              
123             range [*min*, *max*], where *min*, *max* - dtick values which describe some zoom level, it is possible to omit *min* or *max* value by passing *null*
124              
125             =item * enabled
126              
127             Determines whether or not this stop is used. If `false`, this stop is ignored even within its `dtickrange`.
128              
129             =item * name
130              
131             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.
132              
133             =item * templateitemname
134              
135             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`.
136              
137             =item * value
138              
139             string - dtickformat for described zoom level, the same as *tickformat*
140              
141             =back
142              
143             =head1 AUTHOR
144              
145             Pablo Rodríguez González <pablo.rodriguez.gonzalez@gmail.com>
146              
147             =head1 COPYRIGHT AND LICENSE
148              
149             This software is Copyright (c) 2020 by Pablo Rodríguez González.
150              
151             This is free software, licensed under:
152              
153             The MIT (X11) License
154              
155             =cut