Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[p5.js 2.0+ Bug Report]: Mismatched map() Reference Example

オープン 初心者向け
#9,329 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@j-xsen がすでに取り組んでいます。

2026年10月26日 から。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
87/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript
領域
documentation

調査の方向性

例は src/math/calculation.js の772~789行目あたりにあります。map() のリファレンス例を読み、最後の line() 呼び出しを説明されている動作と比較してください。下の線が水平方向に伸びるように呼び出しを変更し、マウスを動かすとリファレンスページに水平線が2本表示されることを確認してください。

索引モデルが issue の本文から書いたものです。

説明

Area:Math Documentation p5.js 2.0+
Most appropriate sub-area of p5.js?
  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • WebGPU
  • p5.strands
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)
p5.js version

2.3.4

Web browser and version

1.97.57 Chromium: 155.0.8059.80 (Official Build) (64-bit)

Operating system

Windows

Steps to reproduce this
Problem

There is an issue with the documentation for the map function.

Steps:
  1. Visit the map documentation (https://p5js.org/reference/p5/map/)
  2. Place mouse over the first canvas
  3. There is one vertical line and one horizontal line, rather than two horizontal lines.
Snippet:

src/math/calculation.js lines 772-789:

   * function setup() {
   *   createCanvas(100, 100);
   *
   *   describe('Two horizontal lines. The top line grows horizontally as the mouse moves to the right. The bottom line also grows horizontally but is scaled to stay on the left half of the canvas.');
   * }
   *
   * function draw() {
   *   background(200);
   *
   *   // Draw the top line.
   *   line(0, 25, mouseX, 25);
   *
   *   // Remap mouseX from [0, 100] to [0, 50].
   *   let x = map(mouseX, 0, 100, 0, 50);
   *
   *   // Draw the bottom line.
   *   line(0, 75, 0, x);
   * }

line(0, 75, 0, x); should be changed to line(0, 75, x, 75); to properly match the described behavior.

主要言語
JavaScript
スター
24.3k
フォーク
3.9k
平均マージ
3日 22時間
マージ済み PR(30日)
46

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

processing/p5.js のほかの issue

processing/p5.js の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。