Cómo funciona
A textbook figure of Faraday's law. A bar magnet slides along the axis of a coil wired to a centre-zero voltmeter; the voltage induced is ε = −dΦ/dt, where Φ is the flux of the magnet through the coil. The needle and the trace under it show what the law predicts: no voltage while the magnet is still, a pulse one way while it approaches and the other way while it leaves, taller and shorter pulses for a faster pass, and the mirror image when the magnet is flipped. Each movement is kept as a trace, the current one in the accent colour and up to three before it in grey, and the line under the plot reads the two peaks of the last pass. Drag the magnet (or anywhere on the figure), or run a slow or a fast pass.
Úsalo para
- Teach Faraday's and Lenz's laws: the voltage depends on how fast the flux changes, not on how much flux there is.
- Compare a slow and a fast pass, or a flipped magnet, side by side on the same plot.
Busca otra opción cuando
- For real measurements from a data logger, use a time-series chart: this figure is an ideal model with a fixed coil and magnet.
Uso
import React from 'react'
import { MagneticTagRecorder } from './MagneticTagRecorder.jsx'
export function InductionLesson() {
return (
<MagneticTagRecorder
defaultPosition={-10}
onPass={({ peaks }) => console.log('peaks in mV', peaks)}
labels={{ title: 'Pass a magnet through a coil' }}
/>
)
}Propiedades
| Propiedad | Tipo | Por defecto | Qué hace |
|---|---|---|---|
defaultPosition | number | -10 | Dónde empieza el imán y adónde vuelve al restablecer, en centímetros desde el centro de la bobina, de −12 a 12. |
defaultFlipped | boolean | false | Empieza con el imán invertido, con el polo sur hacia la derecha. Restablecer vuelve a este estado. |
onPass | ({ peaks, samples }) => void | — | Se llama al terminar un movimiento (medio segundo sin moverse): peaks enumera las mayores tensiones negativa y positiva en mV en el orden en que ocurrieron; samples es la traza como { t, v } en segundos y mV. |
labels | object | — | Sustituye cualquier texto integrado: title, caption, magnet, positionText ('{x}', '{v}'), north, south, voltage, earlier, slow, fast, flip, hint, result ('{first}', '{second}'), single ('{first}'), none, voltUnit, timeUnit y reset. |
locale | string | 'en' | Etiqueta de idioma para las cifras. |
className | string | — | Clase extra para la tarjeta, por ejemplo para fijar su ancho (30rem por defecto, nunca más que su contenedor). |
Accesibilidad
- The magnet is a slider: its value is the position in centimetres and its value text reads the position and the voltage. Arrow keys glide it 1 cm (Shift 4 cm), Home and End to the ends of the track, so a keyboard user produces a pass at a steady speed.
- Slow pass and Fast pass are buttons that run the magnet through the coil to the far side. The flip button is a toggle with aria-pressed and a name. Reset is a button, marked unavailable while nothing has changed.
- The line under the plot is a polite live region: it reads the two peak voltages of the last pass in the order they happened. The pass buttons point to it with aria-describedby.
- Dragging uses pointer capture and moves the magnet by the pointer's horizontal travel from anywhere on the figure, so it never jumps. The figure sets touch-action: pan-y, so a vertical swipe still scrolls the page; a cancelled gesture puts the magnet back and drops its trace.
- Colour is not the only key: the poles carry N and S, the meter has − and + ends and a number, and the legend names the current and the earlier traces.
Movimiento
The magnet moves at the speed of the pass (8 or 24 cm/s, 12 cm/s for keys) and the needle and the trace follow it frame by frame; a drag follows the pointer directly. With reduced motion a pass or a key move lands at once with its whole trace drawn, and nothing in the card transitions.
Añádelo a tu proyecto
Los miembros Pro copian un prompt y su agente de programación instala el código, igual que con los gratuitos.
MagneticTagRecorder.jsxmagnetic-tag-recorder.csstokens.cssREADME.md
Los dos archivos se instalan juntos. La hoja de estilos lee las variables de tokens.css y lleva valores de reserva, así que también funciona sola.



