« Chart/Plotly/Trace/Scatterternary/Marker/Colorbar/Title.pm
↑ Summary
Chart/Plotly/Trace/Splom/Hoverlabel.pm »
| 1 | package Chart::Plotly::Trace::Splom::Dimension; | ||
| 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 | use Chart::Plotly::Trace::Splom::Dimension::Axis; | ||
| 10 | |||
| 11 | our $VERSION = '0.042'; # VERSION | ||
| 12 | |||
| 13 | # ABSTRACT: This attribute is one of the possible options for the trace splom. | ||
| 14 | |||
| 15 | sub TO_JSON { | ||
| 16 | my $self = shift; | ||
| 17 | my $extra_args = $self->extra_args // {}; | ||
| 18 | my $meta = $self->meta; | ||
| 19 | my %hash = %$self; | ||
| 20 | for my $name ( sort keys %hash ) { | ||
| 21 | my $attr = $meta->get_attribute($name); | ||
| 22 | if ( defined $attr ) { | ||
| 23 | my $value = $hash{$name}; | ||
| 24 | my $type = $attr->type_constraint; | ||
| 25 | if ( $type && $type->equals('Bool') ) { | ||
| 26 | $hash{$name} = $value ? \1 : \0; | ||
| 27 | } | ||
| 28 | } | ||
| 29 | } | ||
| 30 | %hash = ( %hash, %$extra_args ); | ||
| 31 | delete $hash{'extra_args'}; | ||
| 32 | if ( $self->can('type') && ( !defined $hash{'type'} ) ) { | ||
| 33 | $hash{type} = $self->type(); | ||
| 34 | } | ||
| 35 | return \%hash; | ||
| 36 | } | ||
| 37 | |||
| 38 | has axis => ( is => "rw", | ||
| 39 | isa => "Maybe[HashRef]|Chart::Plotly::Trace::Splom::Dimension::Axis", ); | ||
| 40 | |||
| 41 | has label => ( is => "rw", | ||
| 42 | isa => "Str", | ||
| 43 | documentation => "Sets the label corresponding to this splom dimension.", | ||
| 44 | ); | ||
| 45 | |||
| 46 | has name => ( | ||
| 47 | is => "rw", | ||
| 48 | isa => "Str", | ||
| 49 | documentation => | ||
| 50 | "When used in a template, named items are created in the output figure in addition to any items the figure already has in this array. You can modify these items in the output figure by making your own item with `templateitemname` matching this `name` alongside your modifications (including `visible: false` or `enabled: false` to hide it). Has no effect outside of a template.", | ||
| 51 | ); | ||
| 52 | |||
| 53 | has templateitemname => ( | ||
| 54 | is => "rw", | ||
| 55 | isa => "Str", | ||
| 56 | documentation => | ||
| 57 | "Used to refer to a named item in this array in the template. Named items from the template will be created even without a matching item in the input figure, but you can modify one by making an item with `templateitemname` matching its `name`, alongside your modifications (including `visible: false` or `enabled: false` to hide it). If there is no template or no matching item, this item will be hidden unless you explicitly show it with `visible: true`.", | ||
| 58 | ); | ||
| 59 | |||
| 60 | has values => ( is => "rw", | ||
| 61 | isa => "ArrayRef|PDL", | ||
| 62 | documentation => "Sets the dimension values to be plotted.", | ||
| 63 | ); | ||
| 64 | |||
| 65 | has valuessrc => ( is => "rw", | ||
| 66 | isa => "Str", | ||
| 67 | documentation => "Sets the source reference on Chart Studio Cloud for `values`.", | ||
| 68 | ); | ||
| 69 | |||
| 70 | has visible => ( | ||
| 71 | is => "rw", | ||
| 72 | isa => "Bool", | ||
| 73 | documentation => | ||
| 74 | "Determines whether or not this dimension is shown on the graph. Note that even visible false dimension contribute to the default grid generate by this splom trace.", | ||
| 75 | ); | ||
| 76 | |||
| 77 | __PACKAGE__->meta->make_immutable(); | ||
| 78 | 1; | ||
| 79 | |||
| 80 | __END__ |