Chart-GGPlot

 view release on metacpan or  search on metacpan

lib/Chart/GGPlot/Backend/Plotly.pm  view on Meta::CPAN


    $plotly_layout{hovermode} = 'closest';
    $plotly_layout{barmode} = $barmode // 'relative';
    
    # border
    my $el_panel_border = $theme->at('panel_border');
    unless ( not defined $el_panel_border or $el_panel_border->is_blank ) {
        $plotly_layout{shapes} = [
            {
                type      => 'rect',
                fillcolor => 'transparent',
                line      => {
                    color    => to_rgb( $el_panel_border->at('color') ),
                    width    => 1,
                    linetype => 'solid',
                },
                xref => 'paper',
                x0   => 0,
                x1   => 1,
                yref => 'paper',
                y0   => 0,

lib/Chart/GGPlot/Backend/Plotly/Util.pm  view on Meta::CPAN

  ribbon
);
our %EXPORT_TAGS = ( all => \@EXPORT_OK );

my $dpi = 96;

sub to_px { mm_to_px($_[0], $dpi) }

sub _rgb {
    my ($c) = @_;
    return 'transparent' if $c eq 'BAD';
    return $c =~ /^#/ ? $c : colorname_to_csshex($c);
}

sub _rgba {
    my ($c, $a) = @_;

    return 'transparent' if $c eq 'BAD';
    $c = $c =~ /^#/ ? $c : colorname_to_csshex($c);
    return $c if $a == 1;

    if ($c =~ /^#/) {
        return sprintf(
            "rgba(%s,%s,%s,%s)",
            csshex_to_rgb255($c),
            0+sprintf("%.2f", $a)   # 0+ for removing trailing zeros
        );
    }



( run in 0.622 second using v1.01-cache-2.11-cpan-0a6323c29d9 )