本文へ移動
日本語
「平面図と軸測図」は Pro に含まれます。解除するとプレビューが表示されます。

仕組み

An 8 × 3 m room drawn twice: as a plan, the orthographic view from straight above with x and y rulers, and as an axonometric view. A cube, a cylinder and a square pyramid stand in it. The plan shows only their footprints (a square, a circle, a square with its sloping edges), which is what a top view keeps; the axonometric view shows their heights. The chosen solid is drawn in the accent in both views, with dashed guides from its centre to both axes and its coordinates on the rulers. Solids snap to the grid and cannot overlap.

向いている場面

  • Teach how a plan (top view) relates to a 3D view of the same objects.
  • Read and set coordinates on a plan.

向かない場面

  • The room and the three solids are fixed; for a real floor plan with your own objects use a drawing tool.

使い方

import { TwinViewExhibitLayout } from './TwinViewExhibitLayout.jsx'

export function Lesson({ save }) {
  return <TwinViewExhibitLayout defaultPositions={[{ id: '02', x: 4.5, y: 1.5 }]} onChange={save} />
}

プロパティ

プロパティ型既定値説明
titlestring'Plan and axonometric view'Heading of the card.
titlesstring[]—Names of the cube, the cylinder and the pyramid, in that order.
labelsobject—Text overrides: caption, plan, model, move, left, up, down, right, instructions, position and reset. move and position take {name}; position also takes {x} and {y}.
defaultPositionsArray<{ id: string, x: number, y: number }>—Starting centres in metres from the back-left corner of the 8 × 3 m room. IDs are '01' (cube), '02' (cylinder) and '03' (pyramid); a missing one keeps its default.
step0.25 | 0.50.25Grid step in metres for dragging, the arrow keys and the pad.
onChange(positions: Array<{ id: string, x: number, y: number }>) => void—Receives all three centres after a drag, a pad press, Enter, a change of solid, leaving the card or Reset. Escape and a cancelled touch put the solid back and do not call it.
localestring'en'Locale for the coordinate numbers.
classNamestring—Extra class on the root.

アクセシビリティ

  • Each footprint on the plan is a button: Tab reaches it and selects it, the arrow keys move it one grid step, Enter confirms and Escape puts it back. Changing solid or leaving the card also confirms.
  • The arrow pad works for touch and switch users and shows when a move is blocked by a wall or another solid. A status line reads the chosen solid and its coordinates. A cancelled touch puts the solid back.

モーション

Both views redraw directly as a solid moves, so the 3D view tracks the finger. Only colours and the pressed scale of buttons transition, and reduced motion removes those.

プロジェクトに追加

Pro メンバーはプロンプトをコピーし、コーディングエージェントが無料コンポーネントと同じ手順でソースを導入します。

TwinViewExhibitLayout.jsxtwin-view-exhibit-layout.csstokens.cssREADME.md

2 つのファイルを一緒に導入します。スタイルは tokens.css の変数を読み、予備の値も持つため、単体でも表示できます。

フォーム入力
「空き時間グリッド」は Pro に含まれます。解除するとプレビューが表示されます。
「図形のブール演算」は Pro に含まれます。解除するとプレビューが表示されます。
「カスケード選択」は Pro に含まれます。解除するとプレビューが表示されます。