« Chart/Plotly/Trace/Scattercarpet/Marker/Gradient.pm
↑ Summary
Chart/Plotly/Trace/Scattercarpet/Selected/Marker.pm »
| 1 | package Chart::Plotly::Trace::Scattercarpet::Marker::Line; | ||
| 2 | use Moose; | ||
| 3 | use MooseX::ExtraArgs; | ||
| 4 | use Moose::Util::TypeConstraints qw(enum union); | ||
| 5 | if ( !defined Moose::Util::TypeConstraints::find_type_constraint('PDL') ) { | ||
| 6 | Moose::Util::TypeConstraints::type('PDL'); | ||
| 7 | } | ||
| 8 | |||
| 9 | our $VERSION = '0.042'; # VERSION | ||
| 10 | |||
| 11 | # ABSTRACT: This attribute is one of the possible options for the trace scattercarpet. | ||
| 12 | |||
| 13 | sub TO_JSON { | ||
| 14 | my $self = shift; | ||
| 15 | my $extra_args = $self->extra_args // {}; | ||
| 16 | my $meta = $self->meta; | ||
| 17 | my %hash = %$self; | ||
| 18 | for my $name ( sort keys %hash ) { | ||
| 19 | my $attr = $meta->get_attribute($name); | ||
| 20 | if ( defined $attr ) { | ||
| 21 | my $value = $hash{$name}; | ||
| 22 | my $type = $attr->type_constraint; | ||
| 23 | if ( $type && $type->equals('Bool') ) { | ||
| 24 | $hash{$name} = $value ? \1 : \0; | ||
| 25 | } | ||
| 26 | } | ||
| 27 | } | ||
| 28 | %hash = ( %hash, %$extra_args ); | ||
| 29 | delete $hash{'extra_args'}; | ||
| 30 | if ( $self->can('type') && ( !defined $hash{'type'} ) ) { | ||
| 31 | $hash{type} = $self->type(); | ||
| 32 | } | ||
| 33 | return \%hash; | ||
| 34 | } | ||
| 35 | |||
| 36 | has autocolorscale => ( | ||
| 37 | is => "rw", | ||
| 38 | isa => "Bool", | ||
| 39 | documentation => | ||
| 40 | "Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.line.colorscale`. Has an effect only if in `marker.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.", | ||
| 41 | ); | ||
| 42 | |||
| 43 | has cauto => ( | ||
| 44 | is => "rw", | ||
| 45 | isa => "Bool", | ||
| 46 | documentation => | ||
| 47 | "Determines whether or not the color domain is computed with respect to the input data (here in `marker.line.color`) or the bounds set in `marker.line.cmin` and `marker.line.cmax` Has an effect only if in `marker.line.color` is set to a numerical array. Defaults to `false` when `marker.line.cmin` and `marker.line.cmax` are set by the user.", | ||
| 48 | ); | ||
| 49 | |||
| 50 | has cmax => ( | ||
| 51 | is => "rw", | ||
| 52 | isa => "Num", | ||
| 53 | documentation => | ||
| 54 | "Sets the upper bound of the color domain. Has an effect only if in `marker.line.color` is set to a numerical array. Value should have the same units as in `marker.line.color` and if set, `marker.line.cmin` must be set as well.", | ||
| 55 | ); | ||
| 56 | |||
| 57 | has cmid => ( | ||
| 58 | is => "rw", | ||
| 59 | isa => "Num", | ||
| 60 | documentation => | ||
| 61 | "Sets the mid-point of the color domain by scaling `marker.line.cmin` and/or `marker.line.cmax` to be equidistant to this point. Has an effect only if in `marker.line.color` is set to a numerical array. Value should have the same units as in `marker.line.color`. Has no effect when `marker.line.cauto` is `false`.", | ||
| 62 | ); | ||
| 63 | |||
| 64 | has cmin => ( | ||
| 65 | is => "rw", | ||
| 66 | isa => "Num", | ||
| 67 | documentation => | ||
| 68 | "Sets the lower bound of the color domain. Has an effect only if in `marker.line.color` is set to a numerical array. Value should have the same units as in `marker.line.color` and if set, `marker.line.cmax` must be set as well.", | ||
| 69 | ); | ||
| 70 | |||
| 71 | has color => ( | ||
| 72 | is => "rw", | ||
| 73 | isa => "Str|ArrayRef[Str]", | ||
| 74 | documentation => | ||
| 75 | "Sets the marker.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 `marker.line.cmin` and `marker.line.cmax` if set.", | ||
| 76 | ); | ||
| 77 | |||
| 78 | has coloraxis => ( | ||
| 79 | is => "rw", | ||
| 80 | documentation => | ||
| 81 | "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.", | ||
| 82 | ); | ||
| 83 | |||
| 84 | has colorscale => ( | ||
| 85 | is => "rw", | ||
| 86 | documentation => | ||
| 87 | "Sets the colorscale. Has an effect only if in `marker.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 `marker.line.cmin` and `marker.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.", | ||
| 88 | ); | ||
| 89 | |||
| 90 | has colorsrc => ( is => "rw", | ||
| 91 | isa => "Str", | ||
| 92 | documentation => "Sets the source reference on Chart Studio Cloud for `color`.", | ||
| 93 | ); | ||
| 94 | |||
| 95 | has reversescale => ( | ||
| 96 | is => "rw", | ||
| 97 | isa => "Bool", | ||
| 98 | documentation => | ||
| 99 | "Reverses the color mapping if true. Has an effect only if in `marker.line.color` is set to a numerical array. If true, `marker.line.cmin` will correspond to the last color in the array and `marker.line.cmax` will correspond to the first color.", | ||
| 100 | ); | ||
| 101 | |||
| 102 | has width => ( is => "rw", | ||
| 103 | isa => "Num|ArrayRef[Num]", | ||
| 104 | documentation => "Sets the width (in px) of the lines bounding the marker points.", | ||
| 105 | ); | ||
| 106 | |||
| 107 | has widthsrc => ( is => "rw", | ||
| 108 | isa => "Str", | ||
| 109 | documentation => "Sets the source reference on Chart Studio Cloud for `width`.", | ||
| 110 | ); | ||
| 111 | |||
| 112 | __PACKAGE__->meta->make_immutable(); | ||
| 113 | 1; | ||
| 114 | |||
| 115 | __END__ |