File Coverage

blib/lib/Chart/Plotly/Trace/Scatter/Marker/Colorbar/Tickfont.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::Tickfont;
2 5     5   38 use Moose;
  5         16  
  5         60  
3 5     5   32504 use MooseX::ExtraArgs;
  5         16  
  5         31  
4 5     5   10057 use Moose::Util::TypeConstraints qw(enum union);
  5         28  
  5         38  
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 color => ( is => "rw",
37             isa => "Str", );
38              
39             has description => ( is => "ro",
40             default => "Sets the color bar's tick label font", );
41              
42             has family => (
43             is => "rw",
44             isa => "Str",
45             documentation =>
46             "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.",
47             );
48              
49             has size => ( is => "rw",
50             isa => "Num", );
51              
52             __PACKAGE__->meta->make_immutable();
53             1;
54              
55             __END__
56              
57             =pod
58              
59             =encoding utf-8
60              
61             =head1 NAME
62              
63             Chart::Plotly::Trace::Scatter::Marker::Colorbar::Tickfont - This attribute is one of the possible options for the trace scatter.
64              
65             =head1 VERSION
66              
67             version 0.041
68              
69             =head1 SYNOPSIS
70              
71             use HTML::Show;
72             use Chart::Plotly;
73             use Chart::Plotly::Trace::Scatter;
74             my $scatter = Chart::Plotly::Trace::Scatter->new( x => [ 1 .. 5 ], y => [ 1 .. 5 ] );
75            
76             HTML::Show::show( Chart::Plotly::render_full_html( data => [$scatter] ) );
77              
78             =head1 DESCRIPTION
79              
80             This attribute is part of the possible options for the trace scatter.
81              
82             This file has been autogenerated from the official plotly.js source.
83              
84             If you like Plotly, please support them: L<https://plot.ly/>
85             Open source announcement: L<https://plot.ly/javascript/open-source-announcement/>
86              
87             Full reference: L<https://plot.ly/javascript/reference/#scatter>
88              
89             =head1 DISCLAIMER
90              
91             This is an unofficial Plotly Perl module. Currently I'm not affiliated in any way with Plotly.
92             But I think plotly.js is a great library and I want to use it with perl.
93              
94             =head1 METHODS
95              
96             =head2 TO_JSON
97              
98             Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
99              
100             =head1 ATTRIBUTES
101              
102             =over
103              
104             =item * color
105              
106             =item * description
107              
108             =item * family
109              
110             HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.
111              
112             =item * size
113              
114             =back
115              
116             =head1 AUTHOR
117              
118             Pablo Rodríguez González <pablo.rodriguez.gonzalez@gmail.com>
119              
120             =head1 COPYRIGHT AND LICENSE
121              
122             This software is Copyright (c) 2020 by Pablo Rodríguez González.
123              
124             This is free software, licensed under:
125              
126             The MIT (X11) License
127              
128             =cut