Devel::IPerl::Plugin::Chart::Plotly - Inline display of plotly charts in Jupyter notebooks using Devel::IPerl kernel
version 0.041
# In notebook IPerl->load_plugin('Chart::Plotly'); # Trace objects get displayed automatically use Chart::Plotly::Trace::Scatter; my $scatter_trace = Chart::Plotly::Trace::Scatter->new( x => [ 1 .. 5 ], y => [ 1 .. 5 ] ); # Also Plot objects use Chart::Plotly::Trace::Box; use Chart::Plotly::Plot; my $x = [ 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3 ]; my $box1 = Chart::Plotly::Trace::Box->new( x => $x, y => [ map { rand() } ( 1 .. ( scalar(@$x) ) ) ], name => "box1" ); my $box2 = Chart::Plotly::Trace::Box->new( x => $x, y => [ map { rand() } ( 1 .. ( scalar(@$x) ) ) ], name => "box2" ); my $plot = Chart::Plotly::Plot->new( traces => [ $box1, $box2 ], layout => { boxmode => 'group' } );
Plugin to display automatically Chart::Plotly plot objects in Jupyter notebooks using kernel Devel::IPerl
The example above can be viewed in nbviewer
This method is called automatically by Devel::IPerl. You only need to load the plugin:
IPerl->load_plugin('Chart::Plotly');
Pablo Rodríguez González <pablo.rodriguez.gonzalez@gmail.com>
This software is Copyright (c) 2020 by Pablo Rodríguez González.
This is free software, licensed under:
The MIT (X11) License
To install Chart::Plotly, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Chart::Plotly
CPAN shell
perl -MCPAN -e shell install Chart::Plotly
For more information on module installation, please visit the detailed CPAN module installation guide.