Skip to content

Commit dff546f

Browse files
authored
Merge branch '2.0' into doc-update
2 parents d35a095 + 27ab567 commit dff546f

23 files changed

+520
-416
lines changed

public/assets/anglurBulge.png

6.74 KB
Loading

public/assets/closeCurveSpline.png

5.36 KB
Loading

public/assets/excludeSpline.png

2.14 KB
Loading

public/assets/includeSpline.png

3.58 KB
Loading

public/assets/openCurveSpline.png

4.28 KB
Loading

public/assets/roundBulge.png

7.15 KB
Loading

public/reference/data.json

Lines changed: 41 additions & 40 deletions
Large diffs are not rendered by default.

src/api/OpenProcessing.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const newCurationId = "89576";
1919
*/
2020
export type OpenProcessingCurationResponse = Array<{
2121
/** Sketch ID used for constructing URLs */
22-
visualID: string;
22+
visualID: number;
2323
/** Title of sketch */
2424
title: string;
2525
/** Description of sketch */
@@ -85,7 +85,7 @@ export const getCurationSketches = memoize(async (
8585
*/
8686
export type OpenProcessingSketchResponse = {
8787
/** Sketch ID used for constructing URLs */
88-
visualID: string;
88+
visualID: number;
8989
/** Title of sketch */
9090
title: string;
9191
/** Description of sketch */
@@ -108,7 +108,7 @@ export type OpenProcessingSketchResponse = {
108108
* @returns
109109
*/
110110
export const getSketch = memoize(
111-
async (id: string): Promise<OpenProcessingSketchResponse> => {
111+
async (id: number): Promise<OpenProcessingSketchResponse> => {
112112
// check for memoized sketch in curation sketches
113113
const curationSketches = await getCurationSketches();
114114
const memoizedSketch = curationSketches.find((el) => el.visualID === id);
@@ -134,7 +134,7 @@ export const getSketch = memoize(
134134
* But only uses the width and height properties from this call
135135
* Width and height should instead be added to properties for `/api/sketch/:id` or `api/curation/:curationId/sketches` instead
136136
*/
137-
export const getSketchSize = memoize(async (id: string) => {
137+
export const getSketchSize = memoize(async (id: number) => {
138138
const sketch = await getSketch(id)
139139
if (sketch.mode !== 'p5js') {
140140
return { width: undefined, height: undefined };
@@ -164,16 +164,16 @@ export const getSketchSize = memoize(async (id: string) => {
164164
return { width: undefined, height: undefined };
165165
});
166166

167-
export const makeSketchLinkUrl = (id: string) =>
167+
export const makeSketchLinkUrl = (id: number) =>
168168
`https://openprocessing.org/sketch/${id}`;
169169

170-
export const makeSketchEmbedUrl = (id: string) =>
170+
export const makeSketchEmbedUrl = (id: number) =>
171171
`https://openprocessing.org/sketch/${id}/embed/?plusEmbedFullscreen=true&plusEmbedInstructions=false`;
172172

173-
export const makeThumbnailUrl = (id: string) =>
173+
export const makeThumbnailUrl = (id: number) =>
174174
`https://openprocessing-usercontent.s3.amazonaws.com/thumbnails/visualThumbnail${id}@2x.jpg`;
175175

176-
export const getSketchThumbnailSource = async (id: string) => {
176+
export const getSketchThumbnailSource = async (id: number) => {
177177
const manualThumbs = import.meta.glob<ImageMetadata>('./images/*', { import: 'default' })
178178
const key = `./images/${id}.png`;
179179
if (manualThumbs[key]) {

src/content/reference/en/p5/beginContour.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ description: >
4747
clockwise order. Then, draw vertices for the negative space in
4848
4949
counter-clockwise order.</p>
50-
line: 2487
50+
line: 2471
5151
isConstructor: false
5252
itemtype: method
5353
example:

src/content/reference/en/p5/bezier.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ description: >
1212
1313
control than the spline curves created with the
1414
15-
<a href="/reference/p5/curve/">curve()</a> function.</p>
15+
<a href="/reference/p5/spline/">spline()</a> function.</p>
1616
1717
<p>The first two parameters, <code>x1</code> and <code>y1</code>, set the
1818
first anchor point. The

0 commit comments

Comments
 (0)