d the labels are set in `x`. By setting `orientation` to *h*, the roles are interchanged.
sub TO_JSON {
my $self = shift;
my $extra_args = $self->extra_args // {};
my $meta =
y and I want to use it with perl.
=head1 METHODS
=head2 TO_JSON
Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
=head2 type
Trace type.
=head1 ATTRIBUTES
=
analysis. The samples are specified in `dimensions`. The colors are set in `line.color`.
sub TO_JSON {
my $self = shift;
my $extra_args = $self->extra_args // {};
my $meta =
y and I want to use it with perl.
=head1 METHODS
=head2 TO_JSON
Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
=head2 type
Trace type.
=head1 ATTRIBUTES
=
Projections are achieved via `projection`. Surface fills are achieved via `surfaceaxis`.
sub TO_JSON {
my $self = shift;
my $extra_args = $self->extra_args // {};
my $meta =
y and I want to use it with perl.
=head1 METHODS
=head2 TO_JSON
Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
=head2 type
Trace type.
=head1 ATTRIBUTES
=
# VERSION
# ABSTRACT: Parallel categories diagram for multidimensional categorical data.
sub TO_JSON {
my $self = shift;
my $extra_args = $self->extra_args // {};
my $meta =
m/plotly/plotly.js/blob/7b751009fc9804272316f0bb539ed0386c0858bd/test/image/mocks/parcats_bundled.json
my $trace = Chart::Plotly::Trace::Parcats->new( bundlecolors => 1,
y and I want to use it with perl.
=head1 METHODS
=head2 TO_JSON
Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
=head2 type
Trace type.
=head1 ATTRIBUTES
=
ll as spaceframe between iso-min and iso-max values could also be drawn using this trace.
sub TO_JSON {
my $self = shift;
my $extra_args = $self->extra_args // {};
my $meta =
8bdcd5ad4d9395626237/test/image/mocks/gl3d_volume_airflow.json
my $volume = Chart::Plotly::Trace::Volume->new(
"flatshading"=>JSON::true,
"lighting"=>{
"facenormalsep
(255,255,0)" ], [ 0.875, "rgb(255,0,0)" ], [ 1.0, "rgb(127,127,127)" ]],
"reversescale"=>JSON::true,
"opacityscale"=>[
[0, 1.0],
[0.2, 0.9],
[0
ings;
use utf8;
use Exporter 'import';
use vars qw(@EXPORT_OK);
@EXPORT_OK = qw(show_plot);
use JSON;
use Params::Validate qw(:all);
use Text::Template;
use Module::Load;
use Ref::Util;
use HTML::Sh
_process_data {
my $data = shift;
my $json_formatter = JSON->new->allow_blessed(1)->convert_blessed(1);
local *PDL::TO_JSON = sub { $_[0]->unpdl };
if ( Ref::Util::is_blessed
warn 'Cannot load adapter: ' . $adapter_name . '. ' . $@;
}
}
my $data_string = $json_formatter->encode($data);
return $data_string;
}
sub _load_plotly {
my $how_to_load = sh
d be:
=over
=item Perl data structure of the json expected by plotly.js: L<http://plot.ly/javascript/reference/> (this data would be serialized to JSON)
=item Array ref of objects of type Chart::Pl
otly::Trace::*
=item Anything that could be serialized to JSON with the json expected by plotly.js
=back
=back
=head1 AUTHOR
Pablo RodrĂguez González
=head1 BUGS
Please report any bugs or fea
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use JSON;
use Path::Tiny;
use Text::Template;
use Scalar::Util;
my $trace_name = shift;
my $plotly_base_path = '../plotly.js';
my $example_
ge/mocks");
for my $mock_json ($plotly_mocks->children(qr/.*\Q$trace_name\E.*\.json$/)) {
print "Processing: $mock_json ...";
my $chart_struct = from_json($mock_json->slurp_utf8);
my
.com/plotly/plotly.js/blob/' . $commit . '/' . $path_for_git;
my $file = path($mock_json->basename('.json') . ".pl");
my $data = $chart_struct->{data};
my %traces_packages;
my @tra
js} // $params{plotly} // _plotlyjs;
my $tmp_json = Path::Tiny->tempfile( SUFFIX => '.json' );
$tmp_json->spew_raw( $plot->to_json_text );
# For now have to explicitly specif
https://github.com/plotly/orca/issues/101
my @orca_line = ( $ORCA_COMMAND, 'graph', $tmp_json, '--plotlyjs', $plotlyjs, '-d', $file->parent,
'-o', $file->basename, (
Path::Tiny;
use Text::Template;
use JSON;
use Cwd;
use Data::Dump;
use Scalar::Util;
# TODO update
# TODO Use enum names
# TODO Use enums with JSON::false and JSON::true and number
# TODO Types: colo
= cwd;
my $types_without_moose_equivalent = {};
my $plotly_schema = from_json($plotly_js_dist_path->child('plot-schema.json')->slurp_utf8());
my $traces_schema = $plotly_schema->{'traces'};
for my
package Chart::Plotly::Plot;
use Moose;
use JSON qw();
use utf8;
use UUID::Tiny ':std';
our $VERSION = '0.042'; # VERSION
use Chart::Plotly;
has traces => ( traits => ['Array'],
sub TO_JSON {
my $self = shift;
my $layout = $self->layout;
my $config = $self->config;
my %json = ( data => $self->traces() );
if ( defined $layout ) {
$json{layout}
g ) {
$json{config} = $config;
}
return \%json;
}
sub to_json_text {
my $self = shift;
my $layout = $self->layout;
my $config = $self->config;
my $json = '{ "data"
is using a column-major order, ie. the grid is represented as a vector of column vectors.
sub TO_JSON {
my $self = shift;
my $extra_args = $self->extra_args // {};
my $meta =
y and I want to use it with perl.
=head1 METHODS
=head2 TO_JSON
Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
=head2 type
Trace type.
=head1 ATTRIBUTES
=
See also the "funnelarea" trace type for a different approach to visualizing funnel data.
sub TO_JSON {
my $self = shift;
my $extra_args = $self->extra_args // {};
my $meta =
y::Plot;
use JSON;
use Chart::Plotly::Trace::Funnel;
# Example from https://github.com/plotly/plotly.js/blob/b93e3a5a83b6561ac6258a59f274b5fc87630c3e/test/image/mocks/funnel_11.json
my $trace1 =
alf Dose', 'Full Dose', 'Double Dose', ], 'y' => [1.4102837, 1.236752, 0.8396031, ], 'visible' => JSON::false, 'orientation' => 'v', });
my $trace4 = Chart::Plotly::Trace::Funnel->new({'y' => [0.86
ning options are set `xbins` and `ybins` respectively if no aggregation data is provided.
sub TO_JSON {
my $self = shift;
my $extra_args = $self->extra_args // {};
my $meta =
y and I want to use it with perl.
=head1 METHODS
=head2 TO_JSON
Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
=head2 type
Trace type.
=head1 ATTRIBUTES
=
ce on either the first carpet axis or the carpet axis with a matching `carpet` attribute.
sub TO_JSON {
my $self = shift;
my $extra_args = $self->extra_args // {};
my $meta =
y and I want to use it with perl.
=head1 METHODS
=head2 TO_JSON
Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
=head2 type
Trace type.
=head1 ATTRIBUTES
=
ng). By default, increasing items are drawn in green whereas decreasing are drawn in red.
sub TO_JSON {
my $self = shift;
my $extra_args = $self->extra_args // {};
my $meta =
y and I want to use it with perl.
=head1 METHODS
=head2 TO_JSON
Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
=head2 type
Trace type.
=head1 ATTRIBUTES
=
is encoded by the norm of (u, v, w), and the local radius by the divergence of (u, v, w).
sub TO_JSON {
my $self = shift;
my $extra_args = $self->extra_args // {};
my $meta =
y/plotly.js/blob/273292dcb24170f775dbc7ebb285c9b6a80b10f4/test/image/mocks/gl3d_streamtube-simple.json
my $trace = Chart::Plotly::Trace::Streamtube->new(
cmax => 3,
cmin => 0,
y and I want to use it with perl.
=head1 METHODS
=head2 TO_JSON
Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
=head2 type
Trace type.
=head1 ATTRIBUTES
=
# VERSION
# ABSTRACT: The data visualized by the radial span of the bars is set in `r`
sub TO_JSON {
my $self = shift;
my $extra_args = $self->extra_args // {};
my $meta =
m/plotly/plotly.js/blob/235fe5b214a576d5749ab4c2aaf625dbf7138d63/test/image/mocks/polar_wind-rose.json
my $trace1 = Chart::Plotly::Trace::Barpolar->new(
r => [ 77.5, 72.5, 70.0, 45.0,
y and I want to use it with perl.
=head1 METHODS
=head2 TO_JSON
Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
=head2 type
Trace type.
=head1 ATTRIBUTES
=
on cartesian features and using regl framework. WebGL version of the heatmap trace type.
sub TO_JSON {
my $self = shift;
my $extra_args = $self->extra_args // {};
my $meta =
y and I want to use it with perl.
=head1 METHODS
=head2 TO_JSON
Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
=head2 type
Trace type.
=head1 ATTRIBUTES
=
# ABSTRACT: This attribute is one of the possible options for the trace choroplethmapbox.
sub TO_JSON {
my $self = shift;
my $extra_args = $self->extra_args // {};
my $meta =
use JSON;
use Chart::Plotly::Trace::Choroplethmapbox;
# Example from https://github.com/plotly/plotly.js/blob/cb202a8e47631e20555de382d2bbc7393625519b/test/image/mocks/mapbox_choropleth0.json
my
>new({'locations' => ['NY', 'MA', 'VT', ], 'geojson' => 'https://raw.githubusercontent.com/python-visualization/folium/master/examples/data/us-states.json', 'z' => [10, 20, 30, ], });
my $plot =