File Coverage

blib/lib/Chart/Plotly/Trace/Scatter/Unselected.pm
Criterion Covered Total %
statement 15 31 48.3
branch 0 8 0.0
condition 0 8 0.0
subroutine 5 6 83.3
pod 1 1 100.0
total 21 54 38.8


line stmt bran cond sub pod time code
1             package Chart::Plotly::Trace::Scatter::Unselected;
2 4     4   30 use Moose;
  4         11  
  4         31  
3 4     4   26123 use MooseX::ExtraArgs;
  4         20  
  4         325  
4 4     4   8383 use Moose::Util::TypeConstraints qw(enum union);
  4         12  
  4         36  
5             if ( !defined Moose::Util::TypeConstraints::find_type_constraint('PDL') ) {
6             Moose::Util::TypeConstraints::type('PDL');
7             }
8              
9 4     4   4253 use Chart::Plotly::Trace::Scatter::Unselected::Marker;
  4         14  
  4         156  
10 4     4   2345 use Chart::Plotly::Trace::Scatter::Unselected::Textfont;
  4         17  
  4         1157  
11              
12             our $VERSION = '0.041'; # VERSION
13              
14             # ABSTRACT: This attribute is one of the possible options for the trace scatter.
15              
16             sub TO_JSON {
17 0     0 1   my $self = shift;
18 0   0       my $extra_args = $self->extra_args // {};
19 0           my $meta = $self->meta;
20 0           my %hash = %$self;
21 0           for my $name ( sort keys %hash ) {
22 0           my $attr = $meta->get_attribute($name);
23 0 0         if ( defined $attr ) {
24 0           my $value = $hash{$name};
25 0           my $type = $attr->type_constraint;
26 0 0 0       if ( $type && $type->equals('Bool') ) {
27 0 0         $hash{$name} = $value ? \1 : \0;
28             }
29             }
30             }
31 0           %hash = ( %hash, %$extra_args );
32 0           delete $hash{'extra_args'};
33 0 0 0       if ( $self->can('type') && ( !defined $hash{'type'} ) ) {
34 0           $hash{type} = $self->type();
35             }
36 0           return \%hash;
37             }
38              
39             has marker => ( is => "rw",
40             isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatter::Unselected::Marker", );
41              
42             has textfont => ( is => "rw",
43             isa => "Maybe[HashRef]|Chart::Plotly::Trace::Scatter::Unselected::Textfont", );
44              
45             __PACKAGE__->meta->make_immutable();
46             1;
47              
48             __END__
49              
50             =pod
51              
52             =encoding utf-8
53              
54             =head1 NAME
55              
56             Chart::Plotly::Trace::Scatter::Unselected - This attribute is one of the possible options for the trace scatter.
57              
58             =head1 VERSION
59              
60             version 0.041
61              
62             =head1 SYNOPSIS
63              
64             use HTML::Show;
65             use Chart::Plotly;
66             use Chart::Plotly::Trace::Scatter;
67             my $scatter = Chart::Plotly::Trace::Scatter->new( x => [ 1 .. 5 ], y => [ 1 .. 5 ] );
68            
69             HTML::Show::show( Chart::Plotly::render_full_html( data => [$scatter] ) );
70              
71             =head1 DESCRIPTION
72              
73             This attribute is part of the possible options for the trace scatter.
74              
75             This file has been autogenerated from the official plotly.js source.
76              
77             If you like Plotly, please support them: L<https://plot.ly/>
78             Open source announcement: L<https://plot.ly/javascript/open-source-announcement/>
79              
80             Full reference: L<https://plot.ly/javascript/reference/#scatter>
81              
82             =head1 DISCLAIMER
83              
84             This is an unofficial Plotly Perl module. Currently I'm not affiliated in any way with Plotly.
85             But I think plotly.js is a great library and I want to use it with perl.
86              
87             =head1 METHODS
88              
89             =head2 TO_JSON
90              
91             Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
92              
93             =head1 ATTRIBUTES
94              
95             =over
96              
97             =item * marker
98              
99             =item * textfont
100              
101             =back
102              
103             =head1 AUTHOR
104              
105             Pablo Rodríguez González <pablo.rodriguez.gonzalez@gmail.com>
106              
107             =head1 COPYRIGHT AND LICENSE
108              
109             This software is Copyright (c) 2020 by Pablo Rodríguez González.
110              
111             This is free software, licensed under:
112              
113             The MIT (X11) License
114              
115             =cut