| 1 | package CXC::Gnuplot::V1::AxisMinorTics; | ||
| 2 | |||
| 3 | 1 | ▶ | use v5.38; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use experimental 'builtin', 'declared_refs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use Object::Pad 0.821; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 6 | |||
| 7 | our $VERSION = 'v0.29.3'; | ||
| 8 | |||
| 9 | class CXC::Gnuplot::V1::AxisMinorTics : isa(CXC::Gnuplot::V1::Base) | ||
| 10 | does( CXC::Gnuplot::V1::Role::Clone ); | ||
| 11 | |||
| 12 | no namespace::clean; | ||
| 13 | |||
| 14 | use Ref::Util 'is_ref'; | ||
| 15 | |||
| 16 | use namespace::clean; | ||
| 17 | |||
| 18 | use CXC::Gnuplot::V1::Types -lexical, qw( | ||
| 19 | Enum | ||
| 20 | Tuple | ||
| 21 | PositiveOrZeroInt | ||
| 22 | TicTimeIncr | ||
| 23 | ); | ||
| 24 | use CXC::Gnuplot::V1::Util -lexical, 'pvalidate', 'to_hash_r'; | ||
| 25 | |||
| 26 | my sub croak { | ||
| 27 | require Carp; | ||
| 28 | goto \&Carp::croak; | ||
| 29 | } | ||
| 30 | |||
| 31 | #<<< no tidy | ||
| 32 | field $intervals :param :reader = undef; # { freq | "default" } | ||
| 33 | field $time :param :reader = undef; # { <N> <units> } | ||
| 34 | #>>> | ||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | |||
| 39 | |||
| 40 | |||
| 41 | |||
| 42 | |||
| 43 | |||
| 44 | |||
| 45 | |||
| 46 | |||
| 47 | |||
| 48 | |||
| 49 | ADJUST { | ||
| 50 | |||
| 51 | defined $intervals | ||
| 52 | and defined $time | ||
| 53 | and croak( q{specify only one of 'intervals' or 'time'} ); | ||
| 54 | |||
| 55 | pvalidate( intervals => Enum ['default'] | PositiveOrZeroInt, \$intervals ); | ||
| 56 | pvalidate( time => TicTimeIncr, \$time ); | ||
| 57 | } | ||
| 58 | |||
| 59 | |||
| 60 | |||
| 61 | |||
| 62 | |||
| 63 | |||
| 64 | |||
| 65 | |||
| 66 | |||
| 67 | |||
| 68 | |||
| 69 | |||
| 70 | |||
| 71 | |||
| 72 | method BUILDARGS : common (@args ) { | ||
| 73 | return ( intervals => $args[0] ) if @args == 1 && !is_ref( $args[0] ); | ||
| 74 | return $class->SUPER::BUILDARGS( @args ); | ||
| 75 | } | ||
| 76 | |||
| 77 | |||
| 78 | |||
| 79 | |||
| 80 | |||
| 81 | |||
| 82 | |||
| 83 | |||
| 84 | method to_hash { | ||
| 85 | to_hash_r( { | ||
| 86 | ( defined $intervals ? ( intervals => $intervals ) : () ), # | ||
| 87 | ( defined $time ? ( time => $time ) : () ), | ||
| 88 | } ); | ||
| 89 | } | ||
| 90 | |||
| 91 | |||
| 92 | |||
| 93 | |||
| 94 | |||
| 95 | method opts { | ||
| 96 | my @opts; | ||
| 97 | |||
| 98 | defined $intervals | ||
| 99 | and push @opts, [$intervals]; | ||
| 100 | |||
| 101 | defined $time | ||
| 102 | and push @opts, [ time => [ $time->@{ 'multiple', 'unit' } ] ]; | ||
| 103 | |||
| 104 | return @opts; | ||
| 105 | } | ||
| 106 | |||
| 107 | # | ||
| 108 | # This file is part of CXC-Gnuplot | ||
| 109 | # | ||
| 110 | # This software is Copyright (c) 2024 by Smithsonian Astrophysical Observatory. | ||
| 111 | # | ||
| 112 | # This is free software, licensed under: | ||
| 113 | # | ||
| 114 | # The GNU General Public License, Version 3, June 2007 | ||
| 115 | # | ||
| 116 | |||
| 117 | 1; | ||
| 118 | |||
| 119 | __END__ | ||