File Coverage

blib/lib/Chart/Plotly/Trace/Scatter/Marker/Colorbar/Title/Font.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::Title::Font;
2 5     5   53 use Moose;
  5         10  
  5         34  
3 5     5   31788 use MooseX::ExtraArgs;
  5         14  
  5         30  
4 5     5   9962 use Moose::Util::TypeConstraints qw(enum union);
  5         17  
  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 => (
40             is => "ro",
41             default =>
42             "Sets this color bar's title font. Note that the title's font used to be set by the now deprecated `titlefont` attribute.",
43             );
44              
45             has family => (
46             is => "rw",
47             isa => "Str",
48             documentation =>
49             "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*.",
50             );
51              
52             has size => ( is => "rw",
53             isa => "Num", );
54              
55             __PACKAGE__->meta->make_immutable();
56             1;
57              
58             __END__
59              
60             =pod
61              
62             =encoding utf-8
63              
64             =head1 NAME
65              
66             Chart::Plotly::Trace::Scatter::Marker::Colorbar::Title::Font - This attribute is one of the possible options for the trace scatter.
67              
68             =head1 VERSION
69              
70             version 0.041
71              
72             =head1 SYNOPSIS
73              
74             use HTML::Show;
75             use Chart::Plotly;
76             use Chart::Plotly::Trace::Scatter;
77             my $scatter = Chart::Plotly::Trace::Scatter->new( x => [ 1 .. 5 ], y => [ 1 .. 5 ] );
78            
79             HTML::Show::show( Chart::Plotly::render_full_html( data => [$scatter] ) );
80              
81             =head1 DESCRIPTION
82              
83             This attribute is part of the possible options for the trace scatter.
84              
85             This file has been autogenerated from the official plotly.js source.
86              
87             If you like Plotly, please support them: L<https://plot.ly/>
88             Open source announcement: L<https://plot.ly/javascript/open-source-announcement/>
89              
90             Full reference: L<https://plot.ly/javascript/reference/#scatter>
91              
92             =head1 DISCLAIMER
93              
94             This is an unofficial Plotly Perl module. Currently I'm not affiliated in any way with Plotly.
95             But I think plotly.js is a great library and I want to use it with perl.
96              
97             =head1 METHODS
98              
99             =head2 TO_JSON
100              
101             Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
102              
103             =head1 ATTRIBUTES
104              
105             =over
106              
107             =item * color
108              
109             =item * description
110              
111             =item * family
112              
113             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*.
114              
115             =item * size
116              
117             =back
118              
119             =head1 AUTHOR
120              
121             Pablo Rodríguez González <pablo.rodriguez.gonzalez@gmail.com>
122              
123             =head1 COPYRIGHT AND LICENSE
124              
125             This software is Copyright (c) 2020 by Pablo Rodríguez González.
126              
127             This is free software, licensed under:
128              
129             The MIT (X11) License
130              
131             =cut