From 6a9d8da15a0843ad8a2f73ea6a74a3b459f7c68b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 21 Jun 2026 09:55:44 +0000 Subject: [PATCH 1/3] feat(muix): implement line-stress-strain --- .../implementations/javascript/muix.tsx | 183 ++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 plots/line-stress-strain/implementations/javascript/muix.tsx diff --git a/plots/line-stress-strain/implementations/javascript/muix.tsx b/plots/line-stress-strain/implementations/javascript/muix.tsx new file mode 100644 index 0000000000..a9f33e46f0 --- /dev/null +++ b/plots/line-stress-strain/implementations/javascript/muix.tsx @@ -0,0 +1,183 @@ +// anyplot.ai +// line-stress-strain: Engineering Stress-Strain Curve +// Library: MUI X Charts | React | Node 22 +// License: @mui/x-charts — MIT (community). Pro/Premium are out of scope. +// Quality: pending | Created: 2026-06-21 + +import { LineChart } from "@mui/x-charts/LineChart"; +import { ChartsReferenceLine } from "@mui/x-charts/ChartsReferenceLine"; +import Box from "@mui/material/Box"; +import Typography from "@mui/material/Typography"; + +const t = window.ANYPLOT_TOKENS; + +// --- Piecewise stress-strain models ----------------------------------------- + +const E_STEEL = 200000; // Young's modulus, mild steel (MPa) +const E_AL = 69000; // Young's modulus, Al 6061-T6 (MPa) + +function steelCurve(eps) { + const epsY = 250 / E_STEEL; // elastic limit ≈ 0.00125 + if (eps <= epsY) return E_STEEL * eps; + if (eps <= 0.010) { // Lüders yield plateau + const f = (eps - epsY) / (0.010 - epsY); + return 250 + 7 * Math.sin(f * Math.PI); + } + if (eps <= 0.200) { // strain hardening + const f = (eps - 0.010) / 0.190; + return 250 + 165 * Math.pow(f, 0.40); + } + if (eps <= 0.250) { // necking + const f = (eps - 0.200) / 0.050; + return 415 - 130 * Math.pow(f, 0.60); + } + return null; +} + +function alCurve(eps) { + if (eps > 0.120) return null; + if (eps <= 0.003) return E_AL * eps; // elastic (σ → ~207 MPa) + if (eps <= 0.006) { // elastic-plastic transition + const f = (eps - 0.003) / 0.003; + return 207 + 69 * Math.sin(f * Math.PI / 2); + } + if (eps <= 0.085) { // strain hardening + const f = (eps - 0.006) / 0.079; + return 276 + 34 * Math.pow(f, 0.55); + } + const f = (eps - 0.085) / 0.035; // necking to fracture + return 310 - 90 * Math.pow(f, 0.65); +} + +// 0.2% offset line for mild steel — elastic slope shifted 0.002 to the right +function offsetLine(eps) { + if (eps < 0.002) return null; + const s = E_STEEL * (eps - 0.002); + return s <= 258 ? s : null; // stop just past the yield intersection +} + +// --- Dataset: 240 uniform samples on ε ∈ [0, 0.250] ------------------------ + +const N = 240; +const dataset = Array.from({ length: N }, (_, i) => { + const eps = (i / (N - 1)) * 0.250; + return { + strain: eps, + steel: steelCurve(eps), + aluminum: alCurve(eps), + offset: offsetLine(eps), + }; +}); + +// --- Title (scale font size for 71-char string vs 67-char baseline) ---------- + +const TITLE = "Steel vs Aluminum · line-stress-strain · javascript · muix · anyplot.ai"; +const titleFontSize = Math.max(17, Math.round(22 * 67 / TITLE.length)); + +// --- Component --------------------------------------------------------------- + +export default function Chart() { + const W = window.ANYPLOT_SIZE.width; + const H = window.ANYPLOT_SIZE.height; + const TITLE_H = 58; + + return ( + + + + {TITLE} + + + + v.toFixed(3), + tickLabelStyle: { fontSize: 14, fill: t.inkSoft }, + labelStyle: { fontSize: 16, fill: t.ink, fontWeight: "500" }, + }]} + yAxis={[{ + label: "Engineering Stress (MPa)", + min: 0, + max: 460, + tickNumber: 10, + tickLabelStyle: { fontSize: 14, fill: t.inkSoft }, + labelStyle: { fontSize: 16, fill: t.ink, fontWeight: "500" }, + }]} + series={[ + { + dataKey: "steel", + label: "Mild Steel", + showMark: false, + connectNulls: false, + color: t.palette[0], + }, + { + dataKey: "aluminum", + label: "Al 6061-T6", + showMark: false, + connectNulls: false, + color: t.palette[2], + }, + { + dataKey: "offset", + label: "0.2% Offset Line", + showMark: false, + connectNulls: false, + color: t.inkSoft, + }, + ]} + slotProps={{ + legend: { + direction: "column", + position: { vertical: "top", horizontal: "right" }, + itemMarkWidth: 20, + itemMarkHeight: 4, + padding: { top: 20, right: 20 }, + labelStyle: { fontSize: 14, fill: t.inkSoft }, + }, + }} + margin={{ left: 90, right: 80, top: 30, bottom: 80 }} + > + + + + + + ); +} From c833f36d91c75ddecbdac43eae8a7e512d6f0d2c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 21 Jun 2026 09:55:56 +0000 Subject: [PATCH 2/3] chore(muix): add metadata for line-stress-strain --- .../metadata/javascript/muix.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 plots/line-stress-strain/metadata/javascript/muix.yaml diff --git a/plots/line-stress-strain/metadata/javascript/muix.yaml b/plots/line-stress-strain/metadata/javascript/muix.yaml new file mode 100644 index 0000000000..3696557f63 --- /dev/null +++ b/plots/line-stress-strain/metadata/javascript/muix.yaml @@ -0,0 +1,21 @@ +# Per-library metadata for muix implementation of line-stress-strain +# Auto-generated by impl-generate.yml + +library: muix +language: javascript +specification_id: line-stress-strain +created: '2026-06-21T09:55:56Z' +updated: '2026-06-21T09:55:56Z' +generated_by: claude-sonnet +workflow_run: 27900516528 +issue: 4413 +language_version: 22.22.3 +library_version: 7.29.1 +preview_url_light: https://storage.googleapis.com/anyplot-images/plots/line-stress-strain/javascript/muix/plot-light.png +preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/line-stress-strain/javascript/muix/plot-dark.png +preview_html_light: https://storage.googleapis.com/anyplot-images/plots/line-stress-strain/javascript/muix/plot-light.html +preview_html_dark: https://storage.googleapis.com/anyplot-images/plots/line-stress-strain/javascript/muix/plot-dark.html +quality_score: null +review: + strengths: [] + weaknesses: [] From c8c1e6392b2540439b0ab1874e1622cb412f1e4e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 21 Jun 2026 10:00:12 +0000 Subject: [PATCH 3/3] chore(muix): update quality score 80 and review feedback for line-stress-strain --- .../implementations/javascript/muix.tsx | 5 ++- .../metadata/javascript/muix.yaml | 33 +++++++++++++++---- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/plots/line-stress-strain/implementations/javascript/muix.tsx b/plots/line-stress-strain/implementations/javascript/muix.tsx index a9f33e46f0..ddd3806b18 100644 --- a/plots/line-stress-strain/implementations/javascript/muix.tsx +++ b/plots/line-stress-strain/implementations/javascript/muix.tsx @@ -1,8 +1,7 @@ // anyplot.ai // line-stress-strain: Engineering Stress-Strain Curve -// Library: MUI X Charts | React | Node 22 -// License: @mui/x-charts — MIT (community). Pro/Premium are out of scope. -// Quality: pending | Created: 2026-06-21 +// Library: muix 7.29.1 | JavaScript 22.22.3 +// Quality: 80/100 | Created: 2026-06-21 import { LineChart } from "@mui/x-charts/LineChart"; import { ChartsReferenceLine } from "@mui/x-charts/ChartsReferenceLine"; diff --git a/plots/line-stress-strain/metadata/javascript/muix.yaml b/plots/line-stress-strain/metadata/javascript/muix.yaml index 3696557f63..e34adedb5e 100644 --- a/plots/line-stress-strain/metadata/javascript/muix.yaml +++ b/plots/line-stress-strain/metadata/javascript/muix.yaml @@ -1,11 +1,8 @@ -# Per-library metadata for muix implementation of line-stress-strain -# Auto-generated by impl-generate.yml - library: muix language: javascript specification_id: line-stress-strain created: '2026-06-21T09:55:56Z' -updated: '2026-06-21T09:55:56Z' +updated: '2026-06-21T10:00:12Z' generated_by: claude-sonnet workflow_run: 27900516528 issue: 4413 @@ -15,7 +12,29 @@ preview_url_light: https://storage.googleapis.com/anyplot-images/plots/line-stre preview_url_dark: https://storage.googleapis.com/anyplot-images/plots/line-stress-strain/javascript/muix/plot-dark.png preview_html_light: https://storage.googleapis.com/anyplot-images/plots/line-stress-strain/javascript/muix/plot-light.html preview_html_dark: https://storage.googleapis.com/anyplot-images/plots/line-stress-strain/javascript/muix/plot-dark.html -quality_score: null +quality_score: 80 review: - strengths: [] - weaknesses: [] + strengths: + - Technically accurate piecewise stress-strain models with Lüders yield plateau + for mild steel — excellent engineering realism + - Two-material overlay (Mild Steel vs Al 6061-T6) with correct material properties + enables meaningful engineering comparison + - Good use of ChartsReferenceLine for UTS and yield reference lines — idiomatic + MUI X feature + - Proper theme-adaptive chrome through pageBg/ink/inkSoft tokens — both renders + correct + - Descriptive title prefix with font scaling for the 71-char title + - Clean, fully deterministic pure-math data generation with no randomness + weaknesses: + - Missing region labels — spec requires annotating elastic, plastic (strain hardening), + and necking regions on the curve with visible text labels + - Missing Young's modulus annotation — spec requires a visible slope line or text + annotation showing the elastic modulus in the elastic region + - 0.2% offset line functionally invisible — line spans only ~0.5% of x-axis width + due to steel's high E-modulus; at this scale the offset segment is a few pixels + and cannot demonstrate the offset yield method + - Fracture point not explicitly annotated — curves simply end without a marker or + label at the fracture strain + - 'Aluminum uses t.palette[2] (blue #4467A3) instead of t.palette[1] (lavender #C475FD), + skipping one position in the Imprint canonical order' + verdict: APPROVED