@@ -13,14 +13,15 @@ slug: learn/
1313
1414 <h1 >{{ #i18n " labeling-canvases-title" }} {{ /i18n }} </h1 >
1515
16- <p >{{ #i18n " labeling-canvases-intro-1" }} {{ /i18n }} <a class = " code" href =" {{ root }} /reference/#/p5/describe" >describe()</a >,
17- <a class = " code" href =" {{ root }} /reference/#/p5/describeElement" >describeElement()</a >, <a class = " code" href =" {{ root }} /reference/#/p5/gridOutput" >gridOutput()</a >,
18- {{ #i18n " labeling-canvases-intro-2" }} {{ /i18n }} <a class = " code" href =" {{ root }} /reference/#/p5/textOutput" >textOutput()</a > {{ #i18n " labeling-canvases-intro-3" }} {{ /i18n }} </p >
16+ <h2 >{{ #i18n " labeling-canvases-intro" }} {{ /i18n }} </h2 >
17+ <p >{{ #i18n " labeling-canvases-intro-1" }} {{ /i18n }} </p >
1918
2019 <h2 >{{ #i18n " labeling-canvases-what-is-labeling" }} {{ /i18n }} </h2 >
2120 <p >{{ #i18n " labeling-canvases-what-is-labeling-1" }} {{ /i18n }} </p >
22- <p >{{ #i18n " labeling-canvases-what-is-labeling-2" }} {{ /i18n }} </p >
23- <p >{{ #i18n " labeling-canvases-what-is-labeling-3" }} {{ /i18n }} <a href =" {{ root }} /learn/p5-screen-reader.html" >Using p5 with a screen reader</a >.</p >
21+
22+ <h2 >{{ #i18n " labeling-canvases-why-labeling-matters" }} {{ /i18n }} </h2 >
23+ <p >{{ #i18n " labeling-canvases-why-labeling-matters-1" }} {{ /i18n }} </p >
24+ <p >{{ #i18n " labeling-canvases-why-labeling-matters-2" }} {{ /i18n }} </p >
2425
2526 <h2 >{{ #i18n " labeling-canvases-available-labels" }} {{ /i18n }} </h2 >
2627 <p >{{ #i18n " labeling-canvases-available-labels-1" }} {{ /i18n }} :</p >
@@ -31,130 +32,107 @@ slug: learn/
3132 <li >{{ #i18n " labeling-canvases-available-labels-li-4" }} {{ /i18n }} </li >
3233 </ul >
3334
34- <h2 >{{ #i18n " labeling-canvases-best-practices" }} {{ /i18n }} </h2 >
35-
36- <h3 >{{ #i18n " labeling-canvases-best-practices-what-requires-labeling" }} {{ /i18n }} </h3 >
37- <p >{{ #i18n " labeling-canvases-best-practices-what-requires-labeling-1" }} {{ /i18n }} </p >
38- <p >{{ #i18n " labeling-canvases-best-practices-what-requires-labeling-2" }} {{ /i18n }} </p >
39-
40-
41- <!-- Code example below copied from Reference page: https://p5js.org/reference/#/p5/describe-->
35+ <h2 >{{ #i18n " labeling-canvases-prerequisites" }} {{ /i18n }} </h2 >
36+ <p >{{ #i18n " labeling-canvases-prerequisites-1" }} {{ /i18n }} </p >
37+ <p >{{ #i18n " labeling-canvases-prerequisites-2" }} {{ /i18n }} </p >
4238
4339 <script type =" text/p5" data-p5-version =" {{ version }} " >
4440function setup () {
4541 createCanvas (100 , 100 );
42+ describe (" A blue square in the center of a black canvas." );
4643}
4744
4845function draw () {
49- background (255 , 192 , 203 );
46+ background (250 );
5047 noStroke ();
5148 fill (200 ,0 ,0 );
5249
53- describeElement (" Heart" ," Red heart in the bottom right corner." );
54- ellipse (67 , 67 , 20 , 20 );
55- ellipse (83 , 67 , 20 , 20 );
56- triangle (91 , 73 , 75 , 95 , 59 , 73 );
50+ rect (67 , 67 , 20 , 20 );
5751}
5852</script >
5953
60- <p >{{ #i18n " labeling-canvases-best-practices-what-requires-labeling-3" }} {{ /i18n }} </p >
61- <p >{{ #i18n " labeling-canvases-best-practices-what-requires-labeling-4" }} {{ /i18n }} </p >
54+ <h2 >{{ #i18n " labeling-canvases-steps-for-labeling" }} {{ /i18n }} </h2 >
55+
56+ <h3 >{{ #i18n " labeling-canvases-steps-for-labeling-step-1" }} {{ /i18n }} </h3 >
57+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-1-1" }} {{ /i18n }} </p >
58+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-1-2" }} {{ /i18n }} </p >
59+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-1-3" }} {{ /i18n }} </p >
6260
6361 <script type =" text/p5" data-p5-version =" {{ version }} " >
6462function setup () {
6563 createCanvas (100 , 100 );
64+ describe (" A red heart in the bottom right corner of a white background." );
6665}
6766
6867function draw () {
69- background (255 , 192 , 203 );
68+ background (250 );
7069 noStroke ();
7170 fill (200 ,0 ,0 );
7271
73- textSize (12 );
74- textStyle (NORMAL );
75- describeElement (" Text" , " The text 'Hello world!' in the upper left corner of a pink canvas.'" );
76- text (' Hello world!' , 5 , 30 );
72+ ellipse (67 , 67 , 20 , 20 );
73+ ellipse (83 , 67 , 20 , 20 );
74+ triangle (91 , 73 , 75 , 95 , 59 , 73 );
7775}
7876</script >
7977
80- <p >{{ #i18n " labeling-canvases-best-practices-what-requires-labeling-5" }} {{ /i18n }} </p >
78+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-1-4" }} {{ /i18n }} </p >
79+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-1-5" }} {{ /i18n }} </p >
80+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-1-6" }} {{ /i18n }} </p >
81+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-1-7" }} {{ /i18n }} </p >
8182
82- <h3 >{{ #i18n " labeling-canvases-best-practices-dont-label" }} {{ /i18n }} </h3 >
83- <p >{{ #i18n " labeling-canvases-best-practices-dont-label-1" }} {{ /i18n }} </p >
84- <p >{{ #i18n " labeling-canvases-best-practices-dont-label-2" }} {{ /i18n }} </p >
85-
86- <h3 >{{ #i18n " labeling-canvases-best-practices-using-labels" }} {{ /i18n }} </h3 >
83+ <h4 >{{ #i18n " labeling-canvases-steps-for-labeling-step-1-complex" }} {{ /i18n }} </h4 >
84+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-1-complex-1" }} {{ /i18n }} </p >
85+ <ul class =" list_view" >
86+ <li >{{ #i18n " labeling-canvases-steps-for-labeling-step-1-complex-li-1" }} {{ /i18n }} </li >
87+ <li >{{ #i18n " labeling-canvases-steps-for-labeling-step-1-complex-li-2" }} {{ /i18n }} </li >
88+ <li >{{ #i18n " labeling-canvases-steps-for-labeling-step-1-complex-li-3" }} {{ /i18n }} </li >
89+ <li >{{ #i18n " labeling-canvases-steps-for-labeling-step-1-complex-li-4" }} {{ /i18n }} </li >
90+ </ul >
91+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-1-complex-2" }} {{ /i18n }} </p >
8792
88- <h4 >{{ #i18n " labeling-canvases-best-practices-using-labels-all-canvases" }} {{ /i18n }} </h4 >
89- <p >{{ #i18n " labeling-canvases-best-practices-using-labels-all-canvases-1" }} {{ /i18n }} </p >
93+ <h3 >{{ #i18n " labeling-canvases-steps-for-labeling-step-2" }} {{ /i18n }} </h3 >
94+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-2-1" }} {{ /i18n }} </p >
95+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-2-2" }} {{ /i18n }} </p >
96+ <h4 >{{ #i18n " labeling-canvases-steps-for-labeling-step-2-using-de" }} {{ /i18n }} </h4 >
97+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-2-using-de-1" }} {{ /i18n }} </p >
98+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-2-using-de-2" }} {{ /i18n }} </p >
99+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-2-using-de-3" }} {{ /i18n }} </p >
100+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-2-using-de-4" }} {{ /i18n }} </p >
90101
91102 <script type =" text/p5" data-p5-version =" {{ version }} " >
92103function setup () {
93104 createCanvas (100 , 100 );
105+ // pProvides an overall description of the canvas.
106+ describe (" Text in the top right corner with red heart in the bottom right corner on a white background." );
94107}
95108
96109function draw () {
97110 background (250 );
98111 noStroke ();
112+ fill (200 , 0 , 0 );
99113
100- describe (" Flower with red petals and a green stem on a white canvas." );
101-
102- fill (" #0DCC23" );
103- rect (48 , 50 , 5 , 50 );
104-
105- fill (200 ,0 ,0 );
106- ellipse (40 , 55 , 18 );
107- ellipse (40 , 45 , 18 );
108- ellipse (50 , 40 , 18 );
109- ellipse (60 , 55 , 18 );
110- ellipse (60 , 45 , 18 );
111- ellipse (50 , 60 , 18 );
112-
113- fill (" #FFE200" );
114- ellipse (50 ,50 ,15 );
115- }
116- </script >
117-
118- <p >{{ #i18n " labeling-canvases-best-practices-using-labels-all-canvases-2" }} {{ /i18n }} </p >
119-
120- <h4 >{{ #i18n " labeling-canvases-best-practices-using-labels-simple" }} {{ /i18n }} </h4 >
121- <p >{{ #i18n " labeling-canvases-best-practices-using-labels-simple-1" }} {{ /i18n }} </p >
122-
123- <script type =" text/p5" data-p5-version =" {{ version }} " >
124- function setup () {
125- createCanvas (100 , 100 );
126- }
114+ textSize (12 );
115+ textStyle (NORMAL );
116+ // Specific label for text.
117+ describeElement (" Text" , " The text 'Hello world!' in the upper left corner of a white canvas." );
118+ text (' Hello world!' , 5 , 30 );
127119
128- function draw () {
129- background ( 250 );
130- noStroke ( );
131-
132- textOutput ( LABEL );
120+ // Specific label for the heart.
121+ describeElement ( " Heart " , " A red heart in the bottom right corner. " );
122+ ellipse ( 67 , 67 , 20 , 20 );
123+ ellipse ( 83 , 67 , 20 , 20 );
124+ triangle ( 91 , 73 , 75 , 95 , 59 , 73 );
133125
134- fill (" #0DCC23" );
135- rect (48 , 50 , 5 , 50 );
136-
137- fill (200 ,0 ,0 );
138- ellipse (40 , 55 , 18 );
139- ellipse (40 , 45 , 18 );
140- ellipse (50 , 40 , 18 );
141- ellipse (60 , 55 , 18 );
142- ellipse (60 , 45 , 18 );
143- ellipse (50 , 60 , 18 );
144-
145- fill (" #FFE200" );
146- ellipse (50 ,50 ,15 );
147126}
148127</script >
149128
150- <p >{{ #i18n " labeling-canvases-best-practices-using-labels-simple-2" }} {{ /i18n }} </p >
151- <p >{{ #i18n " labeling-canvases-best-practices-using-labels-simple-3" }} {{ /i18n }} </p >
152-
153- <h4 >{{ #i18n " labeling-canvases-best-practices-using-labels-interactive" }} {{ /i18n }} </h4 >
154- <p >{{ #i18n " labeling-canvases-best-practices-using-labels-interactive-1" }} {{ /i18n }} </p >
129+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-2-using-de-5" }} {{ /i18n }} </p >
130+ <h4 >{{ #i18n " labeling-canvases-steps-for-labeling-step-2-using-go-to" }} {{ /i18n }} </h4 >
131+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-2-using-go-to-1" }} {{ /i18n }} </p >
132+ <h4 >{{ #i18n " labeling-canvases-steps-for-labeling-step-2-animated" }} {{ /i18n }} </h4 >
133+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-2-animated-1" }} {{ /i18n }} </p >
134+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-2-animated-2" }} {{ /i18n }} </p >
155135
156- <!-- Code example below copied from Reference page: https://p5js.org/reference/#/p5/describe-->
157-
158136 <script type =" text/p5" data-p5-version =" {{ version }} " >
159137let x = 0 ;
160138
@@ -170,58 +148,46 @@ function draw() {
170148 fill (0 , 255 , 0 );
171149 ellipse (x, 50 , 40 , 40 );
172150 x = x + 0.1 ;
173- describe (' green circle at x pos ' + round (x) + ' moving to the right' , LABEL );
151+ // Label updates with shape’s translation.
152+ describe (" A green circle at x position " + round (x) + " , moving to the right" , LABEL );
174153}
175154</script >
176155
177- <p >{{ #i18n " labeling-canvases-best-practices-using-labels-interactive-2" }} {{ /i18n }} </p >
178- <p >{{ #i18n " labeling-canvases-best-practices-using-labels-interactive-3" }} {{ /i18n }} </p >
179-
180- <h4 >{{ #i18n " labeling-canvases-best-practices-using-labels-complex" }} {{ /i18n }} </h4 >
181- <p >{{ #i18n " labeling-canvases-best-practices-using-labels-complex-1" }} {{ /i18n }} </p >
182-
183- <ul class =" list_view" >
184- <li >{{ #i18n " labeling-canvases-best-practices-using-labels-complex-ul-1" }} {{ /i18n }} </li >
185- <li >{{ #i18n " labeling-canvases-best-practices-using-labels-complex-ul-2" }} {{ /i18n }} </li >
186- <li >{{ #i18n " labeling-canvases-best-practices-using-labels-complex-ul-3" }} {{ /i18n }} </li >
187- </ul >
188- <p >{{ #i18n " labeling-canvases-best-practices-using-labels-complex-2" }} {{ /i18n }} </p >
189-
190- <h3 >{{ #i18n " labeling-canvases-how-not-to-use-labels" }} {{ /i18n }} </h3 >
156+ <h4 >{{ #i18n " labeling-canvases-steps-for-labeling-step-2-do-donts" }} {{ /i18n }} </h4 >
157+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-2-do-donts-1" }} {{ /i18n }} </p >
158+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-2-do-donts-2" }} {{ /i18n }} </p >
191159
192- <h4 >{{ #i18n " labeling-canvases-how-not-to-use-labels-sub " }} {{ /i18n }} </h4 >
193- <p >{{ #i18n " labeling-canvases-how-not-to-use-labels-sub -1" }} {{ /i18n }} </p >
160+ <h3 >{{ #i18n " labeling-canvases-steps-for-labeling-step-3 " }} {{ /i18n }} </h3 >
161+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-3 -1" }} {{ /i18n }} </p >
194162
195- <h4 >{{ #i18n " labeling-canvases-how-not-to-use-labels-info-overkill" }} {{ /i18n }} </h4 >
196- <p >{{ #i18n " labeling-canvases-how-not-to-use-labels-info-overkill-1" }} {{ /i18n }} </p >
197- <p >{{ #i18n " labeling-canvases-how-not-to-use-labels-info-overkill-2" }} {{ /i18n }} </p >
198- <p >{{ #i18n " labeling-canvases-how-not-to-use-labels-info-overkill-3" }} {{ /i18n }} </p >
199-
200- <h2 >{{ #i18n " labeling-canvases-testing-labels" }} {{ /i18n }} </h2 >
201- <p >{{ #i18n " labeling-canvases-testing-labels-1" }} {{ /i18n }} </p >
202-
203- <script type =" text/p5" data-p5-version =" {{ version }} " >
163+ <script type =" text/p5" data-p5-version =" {{ version }} " >
204164function setup () {
205165 createCanvas (100 , 100 );
206166}
207167
208168function draw () {
169+
170+ // LABEL shows the label next to the canvas.
209171 gridOutput (LABEL );
210172
211- background (255 , 192 , 203 );
173+ background (250 );
212174 noStroke ();
213- fill (200 ,0 , 0 );
175+ fill (200 , 0 , 0 );
214176
215177 ellipse (67 , 67 , 20 , 20 );
216178 ellipse (83 , 67 , 20 , 20 );
217179 triangle (91 , 73 , 75 , 95 , 59 , 73 );
218180}
219181</script >
220182
221- <p >{{ #i18n " labeling-canvases-testing-labels-2" }} {{ /i18n }} </p >
222- <p >{{ #i18n " labeling-canvases-testing-labels-3" }} {{ /i18n }} </p >
223- <br >
224- <p >{{ #i18n " labeling-canvases-note" }} {{ /i18n }} </p >
183+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-3-2" }} {{ /i18n }} </p >
184+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-3-3" }} {{ /i18n }} </p >
185+ <p >{{ #i18n " labeling-canvases-steps-for-labeling-step-3-4" }} {{ /i18n }} </p >
186+
187+ <h2 >{{ #i18n " labeling-canvases-conclusion" }} {{ /i18n }} </h2 >
188+ <p >{{ #i18n " labeling-canvases-conclusion-1" }} {{ /i18n }} </p >
189+ <p >{{ #i18n " labeling-canvases-conclusion-2" }} {{ /i18n }} </p >
190+ <p >{{ #i18n " labeling-canvases-conclusion-3" }} {{ /i18n }} </p >
225191
226192<!-- this script only needs to get added once even if there are multiple widget instances -->
227193<script src =" //toolness.github.io/p5.js-widget/p5-widget.js" ></script >
0 commit comments