File Coverage

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