—package
Chart::Plotly::Trace::Parcats::Line;
use
Moose;
use
MooseX::ExtraArgs;
if
( !
defined
Moose::Util::TypeConstraints::find_type_constraint(
'PDL'
) ) {
Moose::Util::TypeConstraints::type(
'PDL'
);
}
our
$VERSION
=
'0.042'
;
# VERSION
# ABSTRACT: This attribute is one of the possible options for the trace parcats.
sub
TO_JSON {
my
$self
=
shift
;
my
$extra_args
=
$self
->extra_args // {};
my
$meta
=
$self
->meta;
my
%hash
=
%$self
;
for
my
$name
(
sort
keys
%hash
) {
my
$attr
=
$meta
->get_attribute(
$name
);
if
(
defined
$attr
) {
my
$value
=
$hash
{
$name
};
my
$type
=
$attr
->type_constraint;
if
(
$type
&&
$type
->equals(
'Bool'
) ) {
$hash
{
$name
} =
$value
? \1 : \0;
}
}
}
%hash
= (
%hash
,
%$extra_args
);
delete
$hash
{
'extra_args'
};
if
(
$self
->can(
'type'
) && ( !
defined
$hash
{
'type'
} ) ) {
$hash
{type} =
$self
->type();
}
return
\
%hash
;
}
has
autocolorscale
=> (
is
=>
"rw"
,
isa
=>
"Bool"
,
documentation
=>
"Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `line.colorscale`. Has an effect only if in `line.color` is set to a numerical array. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed."
,
);
has
cauto
=> (
is
=>
"rw"
,
isa
=>
"Bool"
,
documentation
=>
"Determines whether or not the color domain is computed with respect to the input data (here in `line.color`) or the bounds set in `line.cmin` and `line.cmax` Has an effect only if in `line.color` is set to a numerical array. Defaults to `false` when `line.cmin` and `line.cmax` are set by the user."
,
);
has
cmax
=> (
is
=>
"rw"
,
isa
=>
"Num"
,
documentation
=>
"Sets the upper bound of the color domain. Has an effect only if in `line.color` is set to a numerical array. Value should have the same units as in `line.color` and if set, `line.cmin` must be set as well."
,
);
has
cmid
=> (
is
=>
"rw"
,
isa
=>
"Num"
,
documentation
=>
"Sets the mid-point of the color domain by scaling `line.cmin` and/or `line.cmax` to be equidistant to this point. Has an effect only if in `line.color` is set to a numerical array. Value should have the same units as in `line.color`. Has no effect when `line.cauto` is `false`."
,
);
has
cmin
=> (
is
=>
"rw"
,
isa
=>
"Num"
,
documentation
=>
"Sets the lower bound of the color domain. Has an effect only if in `line.color` is set to a numerical array. Value should have the same units as in `line.color` and if set, `line.cmax` must be set as well."
,
);
has
color
=> (
is
=>
"rw"
,
isa
=>
"Str|ArrayRef[Str]"
,
documentation
=>
"Sets the line color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `line.cmin` and `line.cmax` if set."
,
);
has
coloraxis
=> (
is
=>
"rw"
,
documentation
=>
"Sets a reference to a shared color axis. References to these shared color axes are *coloraxis*, *coloraxis2*, *coloraxis3*, etc. Settings for these shared color axes are set in the layout, under `layout.coloraxis`, `layout.coloraxis2`, etc. Note that multiple color scales can be linked to the same color axis."
,
);
has
colorbar
=> (
is
=>
"rw"
,
isa
=>
"Maybe[HashRef]|Chart::Plotly::Trace::Parcats::Line::Colorbar"
, );
has
colorscale
=> (
is
=>
"rw"
,
documentation
=>
"Sets the colorscale. Has an effect only if in `line.color` is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use `line.cmin` and `line.cmax`. Alternatively, `colorscale` may be a palette name string of the following list: Blackbody,Bluered,Blues,Cividis,Earth,Electric,Greens,Greys,Hot,Jet,Picnic,Portland,Rainbow,RdBu,Reds,Viridis,YlGnBu,YlOrRd."
,
);
has
colorsrc
=> (
is
=>
"rw"
,
isa
=>
"Str"
,
documentation
=>
"Sets the source reference on Chart Studio Cloud for `color`."
,
);
has
hovertemplate
=> (
is
=>
"rw"
,
isa
=>
"Str"
,
documentation
=>
"Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example \"y: %{y}\" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:\$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variables `count` and `probability`. Anything contained in tag `<extra>` is displayed in the secondary box, for example \"<extra>{fullData.name}</extra>\". To hide the secondary box completely, use an empty tag `<extra></extra>`."
,
);
has
reversescale
=> (
is
=>
"rw"
,
isa
=>
"Bool"
,
documentation
=>
"Reverses the color mapping if true. Has an effect only if in `line.color` is set to a numerical array. If true, `line.cmin` will correspond to the last color in the array and `line.cmax` will correspond to the first color."
,
);
has
shape
=> (
is
=>
"rw"
,
isa
=> enum( [
"linear"
,
"hspline"
] ),
documentation
=>
"Sets the shape of the paths. If `linear`, paths are composed of straight lines. If `hspline`, paths are composed of horizontal curved splines"
,
);
has
showscale
=> (
is
=>
"rw"
,
isa
=>
"Bool"
,
documentation
=>
"Determines whether or not a colorbar is displayed for this trace. Has an effect only if in `line.color` is set to a numerical array."
,
);
__PACKAGE__->meta->make_immutable();
1;
__END__
=pod
=encoding utf-8
=head1 NAME
Chart::Plotly::Trace::Parcats::Line - This attribute is one of the possible options for the trace parcats.
=head1 VERSION
version 0.042
=head1 SYNOPSIS
use Chart::Plotly;
use Chart::Plotly::Trace::Parcats;
use Chart::Plotly::Plot;
# Example from https://github.com/plotly/plotly.js/blob/7b751009fc9804272316f0bb539ed0386c0858bd/test/image/mocks/parcats_bundled.json
my $trace = Chart::Plotly::Trace::Parcats->new( bundlecolors => 1,
dimensions => [
{ label => 'One',
values => [ (1) x 2, 2, 1, 2, (1) x 2, 2, 1 ]
},
{ label => 'Two',
values => [ 'A', 'B', 'A', 'B', ('C') x 2, 'A', 'B', 'C' ]
},
{ label => 'Three',
values => [ (11) x 9 ]
}
],
domain => { x => [ 0.125, 0.625 ],
y => [ 0.25, 0.75 ]
},
line => { color => [ (0) x 2, (1) x 2, 0, 1, (0) x 3 ] }
);
my $plot = Chart::Plotly::Plot->new( traces => [$trace],
layout => { height => 602,
margin => { b => 40,
l => 40,
r => 40,
t => 50
},
width => 592
}
);
Chart::Plotly::show_plot($plot);
=head1 DESCRIPTION
This attribute is part of the possible options for the trace parcats.
This file has been autogenerated from the official plotly.js source.
If you like Plotly, please support them: L<https://plot.ly/>
Open source announcement: L<https://plot.ly/javascript/open-source-announcement/>
Full reference: L<https://plot.ly/javascript/reference/#parcats>
=head1 DISCLAIMER
This is an unofficial Plotly Perl module. Currently I'm not affiliated in any way with Plotly.
But I think plotly.js is a great library 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.
=head1 ATTRIBUTES
=over
=item * autocolorscale
Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `line.colorscale`. Has an effect only if in `line.color` is set to a numerical array. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.
=item * cauto
Determines whether or not the color domain is computed with respect to the input data (here in `line.color`) or the bounds set in `line.cmin` and `line.cmax` Has an effect only if in `line.color` is set to a numerical array. Defaults to `false` when `line.cmin` and `line.cmax` are set by the user.
=item * cmax
Sets the upper bound of the color domain. Has an effect only if in `line.color` is set to a numerical array. Value should have the same units as in `line.color` and if set, `line.cmin` must be set as well.
=item * cmid
Sets the mid-point of the color domain by scaling `line.cmin` and/or `line.cmax` to be equidistant to this point. Has an effect only if in `line.color` is set to a numerical array. Value should have the same units as in `line.color`. Has no effect when `line.cauto` is `false`.
=item * cmin
Sets the lower bound of the color domain. Has an effect only if in `line.color` is set to a numerical array. Value should have the same units as in `line.color` and if set, `line.cmax` must be set as well.
=item * color
Sets the line color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `line.cmin` and `line.cmax` if set.
=item * coloraxis
Sets a reference to a shared color axis. References to these shared color axes are *coloraxis*, *coloraxis2*, *coloraxis3*, etc. Settings for these shared color axes are set in the layout, under `layout.coloraxis`, `layout.coloraxis2`, etc. Note that multiple color scales can be linked to the same color axis.
=item * colorbar
=item * colorscale
Sets the colorscale. Has an effect only if in `line.color` is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use `line.cmin` and `line.cmax`. Alternatively, `colorscale` may be a palette name string of the following list: Blackbody,Bluered,Blues,Cividis,Earth,Electric,Greens,Greys,Hot,Jet,Picnic,Portland,Rainbow,RdBu,Reds,Viridis,YlGnBu,YlOrRd.
=item * colorsrc
Sets the source reference on Chart Studio Cloud for `color`.
=item * hovertemplate
Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variables `count` and `probability`. Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`.
=item * reversescale
Reverses the color mapping if true. Has an effect only if in `line.color` is set to a numerical array. If true, `line.cmin` will correspond to the last color in the array and `line.cmax` will correspond to the first color.
=item * shape
Sets the shape of the paths. If `linear`, paths are composed of straight lines. If `hspline`, paths are composed of horizontal curved splines
=item * showscale
Determines whether or not a colorbar is displayed for this trace. Has an effect only if in `line.color` is set to a numerical array.
=back
=head1 AUTHOR
Pablo Rodríguez González <pablo.rodriguez.gonzalez@gmail.com>
=head1 COPYRIGHT AND LICENSE
This software is Copyright (c) 2022 by Pablo Rodríguez González.
This is free software, licensed under:
The MIT (X11) License
=cut