Repository navigation
Phase 3: 出力品質(保存 DPI・図サイズの単位・欧文フォント・プリセット・クリップボード) - #3
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…section Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Multiplying by 1 / 2.54 turned 20.32 cm into 7.999... inches, so saved images lost a pixel (2399 px instead of 2400 at 300 dpi). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
script_json generates the script from the loaded data without running it, so the code tab can follow save settings. raster_pixels used ceil, but Agg truncates, so the too-large message now shows the real pixel size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sync with save settings The Latin font (Arimo / Tinos) is fetched only when selected. The save section gains DPI, SVG text mode and a PDF note. Save-setting changes now regenerate the displayed code without re-rendering the image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
要件定義書9章の Phase 3(出力品質。C1–C6)と、6章の左パネルの整理を実装しました。Phase 2 から残っていた漏れ(保存設定を変えても、表示中のコードとダウンロードする
.pyが古いまま)も直しています。変更内容
保存 DPI(C1)
fig.savefigと GUI の「保存」は、同じformats.savefig_kwargsを使う。dpi は PNG / JPG のときだけ書く。図のサイズの単位と、文字の扱い(C2)
figsize=(8.5 / CM_PER_INCH, 6.4 / CM_PER_INCH)のように割り算でインチに直す。1 / 2.54を掛けると 20.32 cm が 7.999… inch になり、300 dpi の画像が 2399 px になるため。pdf.fonttype=42で文字を埋め込む(Illustrator などで文字を編集できる)。SVG は「パスに変換」(既定)と「テキストのまま」を選べる。rcParams の値はformats.savefig_rcの1か所で決め、生成コードにも同じ値を書く。欧文フォント(C3)
プリセットとカラーパレット(C4)
クリップボードへのコピー(C5)
ClipboardItemにPromise<Blob>として渡してコピーする(Safari の制約に合わせ、クリックの中でnavigator.clipboard.writeを呼ぶ)。Chrome / Edge 98 以降、Safari 13.1 以降、Firefox 127 以降。非対応の環境では「保存する」を案内する。数式の案内(C6)
$で囲んだ数式・上付き・下付きの書き方と、matplotlib の説明ページ(版を固定)へのリンクを置いた。左パネルの整理(6章)
<details>で折りたためるようにした。状態は localStorage に保持する。既存の要素 id は変えていない。設定スキーマ v2
plot.figure.unit、plot.latinFont、plot.palette、save.dpi、save.svgTextを追加した。v1 からの移行(settings.migrate_settings)では、v1 の保存が常に 120 dpi だったためsave.dpiを 120 にする。JS と Python の既定値の一致はテストで確認している。Phase 2 からの漏れの修正
scriptで、図は描き直さずにコードだけを作り直すようにした。計測値(
docs/PERFORMANCE.md「Phase 3 後」)悪くなった2項目(300 dpi の保存、編集モードの実行)は、どちらも既定の DPI が 120 から 300 になり、画素数が 6.25 倍になったため。120 dpi では Phase 2 後と同じ値。
オーナーが決めたこと(2026-10-08。AGENTS.md §13.2、要件定義書 §2.3 に記録)
テスト
uv run pytest)uv run pytest tests/e2e)注意点
🤖 Generated with Claude Code