Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
795d2f8
Add requirements document and Pages config
Oct 7, 2026
bd0122c
Add dev environment and synthetic test fixtures
Oct 7, 2026
26bfdb9
Add E2E smoke test for current version
Oct 7, 2026
ca53701
Add baseline performance benchmark and results
Oct 7, 2026
3259373
Fix wording in PERFORMANCE.md
Oct 7, 2026
f0cd8d1
Migrate to PyScript 2026.7.3 and pyscript.toml
Oct 7, 2026
0236c0a
Pin dev dependencies to Pyodide 314 versions
Oct 7, 2026
30aee0d
Log suppressed parentNode errors via console.warn
Oct 7, 2026
8f0f995
Record performance after PyScript migration
Oct 7, 2026
dbe2eb5
Split CSS, JS and Python out of index.html
Oct 7, 2026
6c5aa2d
Configure Pages include/exclude, add publish check and unit tests
Oct 7, 2026
612d032
Remove parentNode error suppression (A9)
Oct 7, 2026
d2d7d31
Move UI state to a JS settings object; make Python logic pure functions
Oct 7, 2026
3891a4c
Add E2E test that changes drawing settings and checks each re-render
Oct 7, 2026
e6de3e6
Pin UI web font to fontsource 5.3.0, pin Noto CJK URL, add CDN pin sc…
Oct 7, 2026
19fda50
A1/A2: row numbers and skipped rows in data preview; reset file input…
Oct 7, 2026
0e83eb3
A6/B5: Cache Storage font loader with progress, single warning on fai…
Oct 7, 2026
b28939e
A3/A4: coalesced render pipeline with generations; keep file and sett…
Oct 7, 2026
246bafd
Status kinds, ARIA tabs/labels (B6), render-busy state, B7 tests
Oct 7, 2026
b220934
A5: detect UTF-8 BOM / CP932 / EUC-JP and report the encoding
Oct 7, 2026
728d336
A7: warn about values dropped as non-numeric
Oct 7, 2026
0f70b52
B7: Japanese error messages for all user errors
Oct 7, 2026
d26ebfc
A10: narrow warning filters (pyarrow DeprecationWarning, missing-glyp…
Oct 7, 2026
14cc0a5
E2E: encodings, dropped-value warning, Japanese setting error and rec…
Oct 7, 2026
be30180
A6: font download stall detection and bounded first-render wait
Oct 7, 2026
579c09a
Avoid redundant draw in savefig after tight_layout
Oct 7, 2026
d9f04ed
Load openpyxl lazily and skip micropip at startup
Oct 7, 2026
a84da6b
Add GitHub Actions CI (unit on push, E2E on PR) with Pages sub-path s…
Oct 7, 2026
fcfab52
Raise test server listen backlog to stop E2E connection resets
Oct 7, 2026
b314022
Tell the user when page scripts fail to load
Oct 7, 2026
4c19731
Record Phase 1 performance and add .xlsx first-load benchmark
Oct 7, 2026
678e372
Rewrite README for the Phase 1 state
Oct 7, 2026
ae0e606
Rewrite AGENTS.md for the Phase 1 implementation
Oct 7, 2026
6758283
Explain the first-plot difference in PERFORMANCE.md
Oct 7, 2026
1ffd926
Keep non-ASCII characters intact when decoding the delimiter
Oct 7, 2026
2a362ac
Show staged startup progress from Resource Timing entries
Oct 7, 2026
3866607
Record owner decisions on parentNode suppression and startup baseline
Oct 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: tests

on:
push:
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
unit:
name: unit
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
enable-cache: true
- run: uv sync --locked
- run: uv run pytest

e2e:
name: e2e
# push では実行しない(pull_request と手動実行のみ)
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# GitHub Pages (legacy build) と同じ Jekyll ビルドで _site を作る
- uses: actions/jekyll-build-pages@44a6e6beabd48582f863aeeb6cb2151cc1716697 # v1.0.13
with:
source: ./
destination: ./_site
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
enable-cache: true
- run: uv sync --locked
- run: uv run playwright install --with-deps chromium
# Pages と同じ /matplotlib_gui/ サブパス配下で配信して検証する
- name: Run E2E tests
env:
E2E_SERVE_DIR: _site
E2E_BASE_PATH: /matplotlib_gui/
run: uv run pytest tests/e2e --tracing retain-on-failure --output test-results
- name: Upload Playwright traces
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: test-results
path: test-results/
if-no-files-found: ignore
retention-days: 7
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.venv/
__pycache__/
.pytest_cache/
test-results/
*.pyc
.DS_Store
# ベンチマークの出力・生成データ
tests/perf/out/
tests/perf/.tmp/
_site/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14
257 changes: 137 additions & 120 deletions AGENTS.md

Large diffs are not rendered by default.

60 changes: 51 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,57 @@
# matplotlib browser GUI
# Matplotlib GUI

`index.html`をブラウザで開くだけで、`matplotlib`をGUI操作できます。
CSV / TXT / XLSX のデータから、ブラウザ上の操作だけで matplotlib の図を作るツールです。サーバーを使わず、Python(PyScript / Pyodide)をブラウザの中で実行します。

## 使い方

1. `index.html` をブラウザで開く
2. `.xlsx/.csv/.txt` を選択
3. 必要なら区切り文字や列を指定
4. `描画する` を押す
https://mioupa.github.io/matplotlib_gui/ を開いてください。`index.html` を `file://` で直接開く使い方には対応していません。

## 注意
1. 「入力ファイル」で `.csv` / `.txt` / `.xlsx` を選びます。
2. 読み込みと描画は自動で行われます(「描画する」ボタンはありません)。設定を変えると、すぐ再描画されます。
3. 「描画系列」でX列・Y列・色などを選び、必要なら系列を追加します。
4. 「保存設定」でファイル名と形式を選び、「保存する」で書き出します。

- 初回はブラウザ側のPythonパッケージ読込で時間がかかることがあります。
- 完全ブラウザ実行のため、サーバー起動は不要です。
対応する文字コードは UTF-8、UTF-8(BOM付き)、Shift_JIS(CP932)、EUC-JP です。判定した文字コードは、読み込み後に画面へ表示されます。

## 主な機能

- 系列カード(複数系列、X/Y列、色、線幅、線種、点サイズ、凡例名)と、第2Y軸
- プロット種別: line / scatter / bar
- 軸の対数表示と範囲指定、余白指定、主目盛線・副目盛線、凡例位置
- 保存: png / jpg / svg / pdf、背景透過
- データ確認タブ: 先頭100行を表示し、描画から除外される先頭行をグレーで表示
- Pythonコード(beta)タブ: 描画用コードの確認と実行(Phase 2 で作り替え予定)
- 数値に変換できず除外した値の警告、日本語のエラーメッセージ

## プライバシー

読み込んだデータの処理はすべてブラウザの中で行い、外部には送信しません。外部への通信は、ライブラリ(PyScript / Pyodide / pandas / matplotlib など)とフォントの取得だけです。通信先は次のとおりです。

| ホスト | 取得するもの |
|---|---|
| `pyscript.net` | PyScript 本体 |
| `cdn.jsdelivr.net` | Pyodide 本体と同梱パッケージ(pandas / matplotlib など)、画面用フォント(Noto Sans JP)、グラフ用の日本語フォント(Noto Sans CJK JP) |
| `files.pythonhosted.org` | openpyxl の wheel(`.xlsx` を初めて開くときだけ) |

初回の訪問では、Pyodide とライブラリ(数十 MB)と、日本語フォント(約 16 MB)をダウンロードするため、時間がかかります。2回目以降はキャッシュを使います(フォントはブラウザの Cache Storage に保存し、再ダウンロードしません)。

## 開発

開発用の依存は [uv](https://docs.astral.sh/uv/) で管理します(実行時には使いません)。

```sh
uv sync
uv run playwright install chromium
uv run pytest # 単体テスト
uv run pytest tests/e2e # E2E テスト(Chromium で実際に動かす)
uv run python -m http.server # ローカルで確認: http://localhost:8000/
uv run python tests/perf/bench.py --reps 5 # 起動・描画の計測(結果は docs/PERFORMANCE.md)
```

CI(GitHub Actions)は、push のたびに単体テストを、プルリクエストのたびに E2E テストを実行します。E2E は Pages と同じ Jekyll ビルドの結果を `/matplotlib_gui/` 配下で配信して検証します。

要件は `docs/REQUIREMENTS.md`、AI エージェント向けの引き継ぎ情報は `AGENTS.md` にあります。

## ライセンス

[LICENSE.md](LICENSE.md)(MIT License)を参照してください。
13 changes: 13 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# GitHub Pages (Jekyll) の配信設定
# Jekyll は "_" で始まるファイルを既定で配信しないため、Python パッケージの __init__.py だけ明示的に含める
include:
- __init__.py
# 開発用のファイルはリポジトリには置くが、Pages では配信しない
exclude:
- docs/
- AGENTS.md
- tests/
- pyproject.toml
- uv.lock
- .python-version
- .github/
Loading
Loading