Skip to content

Commit 812d7d8

Browse files
authored
Merge pull request #1252 from somiaj/make-aria-options-consistant
Change Plots options to aria_label and aria_description.
2 parents 3c9ea20 + 15b8b9b commit 812d7d8

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

lib/Plots/Axes.pm

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Each axis and styles can be configured individually, such as:
3131
3232
$plot->axes->xaxis(min => -10, max => 10, tick_delta => 4);
3333
$plot->axes->yaxis(min => 0, max => 100, tick_delta => 20);
34-
$plot->axes->style(ariaLabel => 'Graph of function y = f(x).', show_grid => 0);
34+
$plot->axes->style(aria_label => 'Graph of function y = f(x).', show_grid => 0);
3535
3636
This can be combined using the set method by prepending either C<x> or C<y> in front
3737
of each key of the axes to configure (note keys that do not start with C<x> or C<y>
@@ -44,7 +44,7 @@ sent to C<< $plot->axes->style >>):
4444
ymin => 0,
4545
ymax => 100,
4646
ytick_delta => 20,
47-
ariaLabel => 'Graph of function y = f(x).',
47+
aria_label => 'Graph of function y = f(x).',
4848
show_grid => 0,
4949
);
5050
@@ -157,11 +157,11 @@ If this style is set, then the height of the graph will be computed using
157157
this aspect_ratio for the size of the image unless explicitly set.
158158
Default: ''
159159
160-
=item ariaLabel
160+
=item aria_label
161161
162162
The ARIA label in JSX graph output. Default is 'Graph'.
163163
164-
=item ariaDescription
164+
=item aria_description
165165
166166
The ARIA description in JSX graph output. This will be set to the images alt tag.
167167
Default is 'Generated graph'.
@@ -211,11 +211,11 @@ sub new {
211211
xaxis => {},
212212
yaxis => {},
213213
styles => {
214-
ariaLabel => 'Graph',
215-
ariaDescription => 'Generated graph',
216-
grid_color => 'gray',
217-
grid_alpha => 40,
218-
show_grid => 1,
214+
aria_label => 'Graph',
215+
aria_description => 'Generated graph',
216+
grid_color => 'gray',
217+
grid_alpha => 40,
218+
show_grid => 1,
219219
},
220220
@_
221221
}, $class;

lib/Plots/JSXGraph.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,8 @@ sub init_graph {
399399
$ymax += 0.11 * ($ymax - $ymin) if $xaxis_loc eq 'top' || $ymax == $xaxis_pos;
400400

401401
my $JSXOptions = Mojo::JSON::encode_json({
402-
title => $axes->style('ariaLabel'),
403-
description => $axes->style('ariaDescription'),
402+
title => $axes->style('aria_label'),
403+
description => $axes->style('aria_description'),
404404
boundingBox => [ $xmin, $ymax, $xmax, $ymin ],
405405
axis => 0,
406406
showNavigation => $allow_navigation,

macros/core/PGbasicmacros.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2843,7 +2843,7 @@ sub image {
28432843
$image_item->{width} = $width if $out_options{width};
28442844
$image_item->{height} = $height if $out_options{height};
28452845
$image_item->{tex_size} = $tex_size if $out_options{tex_size};
2846-
$image_item->axes->style(ariaDescription => shift @alt_list) if $out_options{alt};
2846+
$image_item->axes->style(aria_description => shift @alt_list) if $out_options{alt};
28472847

28482848
if ($image_item->ext eq 'html') {
28492849
push(@output_list, $image_item->draw);

macros/graph/plots.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ =head1 USAGE
2828
ytick_delta => 50,
2929
xlabel => '\(t\)',
3030
ylabel => '\(h(t)\)',
31-
ariaLabel => 'Height of an object as a function of time.',
31+
aria_label => 'Height of an object as a function of time.',
3232
axes_on_top => 1,
3333
);
3434

0 commit comments

Comments
 (0)