@mogura/moguchart-core 1.3.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.ja.md +85 -0
- package/CHANGELOG.md +84 -0
- package/README.ja.md +174 -4
- package/README.md +173 -5
- package/dist/components/gantt-bar.d.ts +2 -0
- package/dist/components/gantt-calendar.d.ts +12 -1
- package/dist/components/gantt-chart.d.ts +23 -1
- package/dist/components/gantt-row.d.ts +12 -1
- package/dist/core/grid.d.ts +53 -0
- package/dist/core/history.d.ts +1 -1
- package/dist/core/i18n.d.ts +23 -0
- package/dist/core/types.d.ts +209 -0
- package/dist/core/utils.d.ts +27 -0
- package/dist/index.d.ts +2 -1
- package/dist/moguchart-core.mjs +1582 -346
- package/dist/moguchart-core.umd.js +454 -81
- package/package.json +3 -3
package/CHANGELOG.ja.md
CHANGED
|
@@ -5,6 +5,89 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.5.0] - 2026-10-17
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **マルチカラムデータグリッド対応(Multi-Column Data Grid / WBS テーブル)**:
|
|
13
|
+
- 行ヘッダー領域を本格的な複数カラムのテーブルとして表示・操作できる新オプション `option.grid` を追加
|
|
14
|
+
- **標準組み込みカラムプリセット**:
|
|
15
|
+
- `wbs`: WBS階層コード(例: 1, 1.1, 1.2.1)
|
|
16
|
+
- `name`: タスク名・行名(階層ツリーインデント+展開・折りたたみボタン内包)
|
|
17
|
+
- `startDate` / `startMonth` / `startDateTime`: タスク開始日・開始月・開始日時(単一タスクは開始日時、サマリー行・複数タスク行は最小開始日時を自動集計)
|
|
18
|
+
- `endDate` / `endMonth` / `endDateTime`: タスク終了日・終了月・終了日時(単一タスクは終了日時、サマリー行・複数タスク行は最大終了日時を自動集計)
|
|
19
|
+
- `duration`: 期間・工数(カレンダー日数スパン、時間単位モード時は時間・分フォーマット)
|
|
20
|
+
- `progress`: 進捗率(サマリー行・複数タスク行は期間加重平均進捗率を自動算出)
|
|
21
|
+
- **表示モードに応じた自動カラム適応**:
|
|
22
|
+
- 月単位モード(`pxPerMonth` 指定時)では `startDate` / `endDate` のヘッダーが自動的に「開始月」「終了月」(`Start Month` / `End Month`)に切り替わり、`YYYY/M` 形式で表示(終了月は前月表記に自動調整)
|
|
23
|
+
- 時間単位モード(`showTime: true` 時)では `startDate` / `endDate` のヘッダーが自動的に「開始日時」「終了日時」(`Start Date/Time` / `End Date/Time`)に切り替わり、時刻付き表示および時間単位の期間表示に連動
|
|
24
|
+
- **グリッドセルのインライン編集機能 (`option.grid.editable`, `cell-edit`)**:
|
|
25
|
+
- セルのダブルクリック(またはクリック:`editTrigger: 'dblclick' | 'click'`)による直感的なインライン編集に対応
|
|
26
|
+
- 組み込みエディタ種別(`text`, `number`, `date`, `datetime`, `month`, `select`)および独自の `HTMLElement` をマウントできるカスタムエディタ関数(`editor: (context) => HTMLElement`)をサポート
|
|
27
|
+
- セレクトボックス用選択肢(`editorOptions`)、数値入力の最小・最大・ステップ値(`editorMin`, `editorMax`, `editorStep`)、行・タスクごとの編集可否判定(`editable`)、カスタムセッター(`valueSetter`)に対応
|
|
28
|
+
- 単一タスクの `resizable`(`false` 時は日付・期間編集不可)、`movable`(`'none'` 時は日付・期間編集不可)、`progressResizable`(`false` 時は進捗率編集不可)の設定を考慮したセル編集可否判定に対応
|
|
29
|
+
- **編集可能セルと読み取り専用セルの視覚的区別**: インライン編集有効時、編集可能なセル(`.grid-cell-editable`: テキストカーソル・ホバーハイライト)と編集不可のセル(`.grid-cell-readonly`: サマリー行・複数タスク行の集計セルやWBS番号セル等のグレーアウト背景・半透明表示)を視覚的に区別(画像・PDFエクスポート時は自動的に通常表示へ正規化)
|
|
30
|
+
- グリッド有効時は行のドラッグ並び替えおよび行ヘッダーツールチップの表示対象をタスク名(ツリー)セル(`.grid-cell-name`, `.grid-tree-cell`)に限定し、インライン編集中は行のドラッグ並び替えを一時的に無効化することで入力欄内でのテキスト選択操作がスムーズに行えるよう改善
|
|
31
|
+
- 編集確定時に `cell-edit` および `rows-change` イベントを発火し、操作履歴(Undo / Redo: `command.type === 'cell-edit'`)と完全連動
|
|
32
|
+
- プログラムからセル編集を制御するパブリックメソッド `startCellEdit(rowId, columnId)`, `commitCellEdit(overrideValue?)`, `cancelCellEdit()` を追加
|
|
33
|
+
- **`cornerContent` とグリッドヘッダーの2段レイアウト共存**:
|
|
34
|
+
- グリッド有効時に `customRendering.cornerContent` が指定されている場合、左上コーナー領域を上段(`cornerContent`)と下段(グリッドカラムヘッダー)の2段構成で同時表示するよう対応
|
|
35
|
+
- **カスタムカラム & 自由なデータマッピング**:
|
|
36
|
+
- `field` による任意オブジェクトプロパティのバインド、および `valueGetter(row, tasks, wbsCode)` / `valueSetter(row, newValue, tasks, column)` による高度なカスタム値の取得・更新に対応
|
|
37
|
+
- `formatter` による文字列整形、および `renderCell(value, row, tasks, locale)` による `HTMLElement` / HTML 文字列のカスタムレンダリングに対応
|
|
38
|
+
- **カラム幅のドラッグリサイズ (`column-resize`)**:
|
|
39
|
+
- カラムヘッダー右端のドラッグ操作により、各カラムの幅を直感的に個別リサイズ可能。リサイズ中・完了時に `column-resize` カスタムイベントを発火し、行クリックやオプション更新時もユーザーのリサイズ幅を保持しつつ、`option.grid.columns` からの明示的な列幅変更にも追従
|
|
40
|
+
- **スプリッターリサイズ & グリッド内独立横スクロール同期**:
|
|
41
|
+
- グリッド領域とタイムライン領域を仕切るスプリッターリサイズを完全サポート
|
|
42
|
+
- カラム合計幅が表示枠を超える場合、トラックパッド横スワイプ、`Shift + ホイール`、またはグリッドヘッダー上のマウスホイール操作による独立横スクロールに対応。ヘッダーセルと各行セルが1pxのズレもなく同期して横スクロール
|
|
43
|
+
- **React / Vue ラッパーおよび公開ユーティリティの拡充**:
|
|
44
|
+
- `@mogura/moguchart-react` に `onColumnResize`, `onCellEdit`, `onRowsChange` イベント Props を追加
|
|
45
|
+
- `@mogura/moguchart-vue` に `@column-resize`, `@cell-edit`, `@rows-change` イベントおよび `startCellEdit`, `commitCellEdit`, `cancelCellEdit` 公開メソッドを追加
|
|
46
|
+
- グリッド計算・編集用ヘルパー関数(`calculateRowSummaryDates`, `normalizeGridColumns`, `getGridCellValue`, `formatGridCellValue`, `resolveColumnEditorType`, `isGridCellEditable`, `formatGridCellEditValue`, `applyGridCellEdit`)をエクスポート
|
|
47
|
+
- **多言語(i18n)自動連動 & 完全な後方互換性**:
|
|
48
|
+
- 日本語(`jaLocale`)および英語(`enLocale`)の言語切り替えと標準カラム名・期間単位が自動連動
|
|
49
|
+
- `option.grid` 未指定時は、従来の単一ヘッダー表示(`row.name`)として完全互換動作
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## [1.4.0] - 2026-10-11
|
|
54
|
+
|
|
55
|
+
### Added
|
|
56
|
+
|
|
57
|
+
- **予実管理機能(Baseline / 計画 vs 実績の比較可視化)**:
|
|
58
|
+
- タスクに当初計画(`task.baseline: GanttTaskBaseline`)を持たせることで、計画日程と現在の実績日程を同一レーン上に同時描画・比較できる機能を追加
|
|
59
|
+
- **3つの柔軟な配置レイアウト (`option.baseline.position`)**:
|
|
60
|
+
- `'bottom'` (デフォルト): 実績バーの下部にスマート分割して配置。行の高さや仮想スクロールのキャッシュ計算を壊さず、滑らかに表示
|
|
61
|
+
- `'top'`: 実績バーの上部に配置
|
|
62
|
+
- `'overlay'`: 実績バーの背後に同一高さで重ねて描画
|
|
63
|
+
- **遅延ハイライト可視化 (`highlightDelay`, `delayColor`)**:
|
|
64
|
+
- 実績終了日が計画終了日を超過(`task.end > baseline.end`)しているタスクを自動検知し、遅延アクセント線(`.task-delayed`)で視覚的に強調
|
|
65
|
+
- **ツールチップの予実連携**:
|
|
66
|
+
- タスクバーおよびベースラインバーへのホバー時、ツールチップに計画日程(期間・進捗率)および遅延/前倒し状況(「3日遅延」「2日前倒し」等)を多言語(日本語・英語)で自動表示
|
|
67
|
+
- **サマリータスク(WBS階層)のベースライン自動集計 (`autoSummary`)**:
|
|
68
|
+
- 配下の子タスク群が持つベースライン日程(最小開始日〜最大終了日)および加重平均進捗率を親のサマリータスクへ自動集計
|
|
69
|
+
- **ミニマップ(Minimap)描画の完全同期**:
|
|
70
|
+
- 全体鳥瞰ミニマップ(2D Canvas)にもベースラインバーを同期描画
|
|
71
|
+
- **公開ユーティリティ関数**:
|
|
72
|
+
- `calculateTaskDelay(task: GanttTask)`: 個別タスクの遅延・前倒しミリ秒/日数を計算
|
|
73
|
+
- `calculateProjectBaselineSummary(rows: GanttRow[])`: プロジェクト全体の計画タスク数、遅延タスク数、前倒しタスク数、最大遅延日数等の統計を集計
|
|
74
|
+
- **行ヘッダーダブルクリック時のコンテンツ要素提供 (`contentTarget`)**:
|
|
75
|
+
- `row-header-dblclick` イベントの detail に `contentTarget?: HTMLElement` を追加
|
|
76
|
+
- インデントスペーサーやツリートグルアイコンを除いた行名表示領域のDOM要素を直接取得可能にし、行名のインライン編集入力欄の配置やカスタムポップオーバーの配置を容易に改善
|
|
77
|
+
- **フォント倍率に応じたWBSツリーUIの連動スケーリング (`--moguchart-font-scale`)**:
|
|
78
|
+
- CSS変数 `--moguchart-font-scale`(`option.fontScale`)の値に応じて、ツリートグルボタン(`.tree-toggle-btn`)およびスペーサー(`.tree-toggle-spacer`)の幅、高さ、マージン、角丸、アイコンフォントサイズが動的にスケールするよう改善
|
|
79
|
+
- **WBSサマリータスクへの半透明・フィルタアウト状態の自動連動**:
|
|
80
|
+
- サマリー行(親行)配下のタスクがフィルタ等で全て半透明化(`_isFilteredOut === true` または `style` に `opacity: 0.x`)されている場合、親のサマリータスク(およびそのベースラインバー)に対しても自動的に半透明スタイル(`opacity: 0.2`)および `labelStyle: 'opacity: 0.2;'` を適用
|
|
81
|
+
- 遅延ハイライト線(`.task-delayed`)やバーラベル、進捗ラベルも半透明表示(`.filtered-out`)に連動
|
|
82
|
+
- **`scrollToTask` スクロール挙動の最適化 & Vue ラッパーへの公開**:
|
|
83
|
+
- `packages/vue` の `GanttChart` コンポーネントの公開 API(`GanttChartPublicApi`)に `scrollToTask(taskId: string): void` を追加し、`ref` から目的のタスクへ直接スクロール可能に改善
|
|
84
|
+
- `scrollToTask` のスクロール挙動を最適化:縦方向と横方向のスクロールが必要な場合に単一の `container.scrollTo` を呼び出し、滑らかに同時スクロール(`behavior: 'smooth'`)するよう改善
|
|
85
|
+
- 横スクロール時、行ヘッダー幅に加えて左側マージン(40px)を確保し、タスクの開始位置が明瞭に見えるよう視認性を向上
|
|
86
|
+
- **デモ画面へのコントロール追加**:
|
|
87
|
+
- デモページの操作パネルにベースライン表示切替(ON/OFF)、遅延ハイライト切替(ON/OFF)、配置位置(下部 / 上部 / 重ねて表示)のリアルタイム操作UIを追加
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
8
91
|
## [1.3.1] - 2026-10-01
|
|
9
92
|
|
|
10
93
|
### Fixed
|
|
@@ -479,6 +562,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
479
562
|
- UMD / ESM 両形式のビルド出力
|
|
480
563
|
- TypeScript 型定義の同梱
|
|
481
564
|
|
|
565
|
+
[1.4.0]: https://github.com/hiro-murakami/moguchart-core/compare/v1.3.1...v1.4.0
|
|
566
|
+
[1.3.1]: https://github.com/hiro-murakami/moguchart-core/compare/v1.3.0...v1.3.1
|
|
482
567
|
[1.3.0]: https://github.com/hiro-murakami/moguchart-core/compare/v1.2.0...v1.3.0
|
|
483
568
|
[1.2.0]: https://github.com/hiro-murakami/moguchart-core/compare/v1.1.1...v1.2.0
|
|
484
569
|
[1.1.1]: https://github.com/hiro-murakami/moguchart-core/compare/v1.1.0...v1.1.1
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,88 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.5.0] - 2026-10-17
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Multi-Column Data Grid Support (WBS Table)**:
|
|
13
|
+
- Added new option `option.grid` to display and interact with the row header area as a full-featured multi-column data table.
|
|
14
|
+
- **Built-in Standard Columns**:
|
|
15
|
+
- `wbs`: WBS hierarchical numbering code (e.g. 1, 1.1, 1.2.1).
|
|
16
|
+
- `name`: Task / row title with embedded hierarchical tree indentation and expand/collapse toggle.
|
|
17
|
+
- `startDate` / `startMonth` / `startDateTime`: Task start date, month, or date/time (automatically computes earliest start date for summary rows and multi-task rows).
|
|
18
|
+
- `endDate` / `endMonth` / `endDateTime`: Task end date, month, or date/time (automatically computes latest end date for summary rows and multi-task rows).
|
|
19
|
+
- `duration`: Duration / work span in calendar days (or formatted hours/minutes in hourly view mode).
|
|
20
|
+
- `progress`: Task progress percentage (automatically computes duration-weighted average progress for summary rows and multi-task rows).
|
|
21
|
+
- **Automatic View-Mode Column Adaptation**:
|
|
22
|
+
- In Monthly mode (`pxPerMonth` specified), `startDate` / `endDate` headers automatically switch to `Start Month` / `End Month` (`開始月` / `終了月`) and format values as `YYYY/M` (automatically adjusting exclusive end boundary dates to display the previous month).
|
|
23
|
+
- In Hourly / Time mode (`showTime: true`), `startDate` / `endDate` headers automatically switch to `Start Date/Time` / `End Date/Time` (`開始日時` / `終了日時`), displaying timestamps and time-based duration spans.
|
|
24
|
+
- **Inline Cell Editing (`option.grid.editable`, `cell-edit`)**:
|
|
25
|
+
- Support interactive inline cell editing triggered by double-click or single-click (`editTrigger: 'dblclick' | 'click'`).
|
|
26
|
+
- Built-in editor types (`'text'`, `'number'`, `'date'`, `'datetime'`, `'month'`, `'select'`) as well as custom DOM editor factories (`editor: (context) => HTMLElement`).
|
|
27
|
+
- Configurable select options (`editorOptions`), numeric bounds (`editorMin`, `editorMax`, `editorStep`), per-row/task editability predicates (`editable`), and custom value setters (`valueSetter`).
|
|
28
|
+
- Automatic linkage with single-task editability settings (`task.resizable === false` or `task.movable === 'none'` disables date/duration editing; `task.progressResizable === false` disables progress editing).
|
|
29
|
+
- Visual distinction between editable cells (`.grid-cell-editable`: text cursor and hover highlight) and read-only cells (`.grid-cell-readonly`: dimmed background and semi-transparent text for summary/multi-task aggregated cells and WBS codes; automatically normalized during PNG/PDF export).
|
|
30
|
+
- Restricts row drag-and-drop reordering and row header tooltips in grid mode to the task name / tree cell (`.grid-cell-name`, `.grid-tree-cell`), and temporarily suppresses row reordering while inline cell editing is active to allow smooth mouse drag text selection.
|
|
31
|
+
- Dispatches `cell-edit` and `rows-change` custom events upon committing changes, with full Undo / Redo history integration (`command.type === 'cell-edit'`).
|
|
32
|
+
- Added programmatic editing control methods: `startCellEdit(rowId, columnId)`, `commitCellEdit(overrideValue?)`, and `cancelCellEdit()`.
|
|
33
|
+
- **Custom Columns & Flexible Data Mapping**:
|
|
34
|
+
- Bind arbitrary row properties using `field`, or extract and update custom values using `valueGetter(row, tasks, wbsCode)` and `valueSetter(row, newValue, tasks, column)`.
|
|
35
|
+
- Format text outputs with `formatter(value, row, tasks, locale)`, or render rich `HTMLElement` / HTML strings with `renderCell(value, row, tasks, locale)`.
|
|
36
|
+
- **Two-Tier Corner Header Coexistence**:
|
|
37
|
+
- When both `option.grid` and `customRendering.cornerContent` are configured, the top-left corner automatically renders in a 2-tier layout with `cornerContent` in the upper row and grid column headers in the lower row.
|
|
38
|
+
- **Interactive Column Drag Resizing (`column-resize`)**:
|
|
39
|
+
- Intuitive drag-to-resize handles on column headers. Fires `column-resize` custom events during and upon completing resize operations, preserving user-resized widths across row interactions while also tracking programmatic `option.grid.columns` width updates.
|
|
40
|
+
- **Splitter Resizing & Synchronized Independent Grid Horizontal Scrolling**:
|
|
41
|
+
- Seamlessly works with the split pane resizer dividing the grid and timeline areas.
|
|
42
|
+
- When column widths exceed the grid area width, independent horizontal scrolling activates via trackpad swipe, `Shift + wheel`, or vertical wheel scrolling over the grid header area, with pixel-perfect synchronization (`transform: translateX(-gridScrollLeft)`) across header and row cells.
|
|
43
|
+
- **React / Vue Wrapper & Exported Utility Enhancements**:
|
|
44
|
+
- Added `onColumnResize`, `onCellEdit`, and `onRowsChange` event props to `@mogura/moguchart-react`.
|
|
45
|
+
- Added `@column-resize`, `@cell-edit`, and `@rows-change` emits plus `startCellEdit`, `commitCellEdit`, and `cancelCellEdit` public methods to `@mogura/moguchart-vue`.
|
|
46
|
+
- Exported grid calculation and editing helper utilities (`calculateRowSummaryDates`, `normalizeGridColumns`, `getGridCellValue`, `formatGridCellValue`, `resolveColumnEditorType`, `isGridCellEditable`, `formatGridCellEditValue`, `applyGridCellEdit`).
|
|
47
|
+
- **Multi-language (i18n) Synchronization & Complete Backward Compatibility**:
|
|
48
|
+
- Built-in Japanese (`jaLocale`) and English (`enLocale`) column headers and duration units adapt automatically to the active chart locale.
|
|
49
|
+
- When `option.grid` is omitted or disabled, the chart operates in classic single-header row name mode with zero breaking changes.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## [1.4.0] - 2026-10-11
|
|
54
|
+
|
|
55
|
+
### Added
|
|
56
|
+
|
|
57
|
+
- **Baseline & Schedule Variance Tracking (Plan vs. Actual Comparison)**:
|
|
58
|
+
- Added support for baseline schedules (`task.baseline: GanttTaskBaseline`) allowing concurrent rendering and variance tracking of planned vs. actual project timelines within each row lane.
|
|
59
|
+
- **Flexible Layout Positions (`option.baseline.position`)**:
|
|
60
|
+
- `'bottom'` (default): Smartly splits the lane height to render the baseline bar underneath the actual bar without affecting row heights or virtual scrolling performance.
|
|
61
|
+
- `'top'`: Renders the baseline bar above the actual task bar.
|
|
62
|
+
- `'overlay'`: Renders the baseline bar directly behind the actual task bar with full height.
|
|
63
|
+
- **Delay & Variance Highlighting (`highlightDelay`, `delayColor`)**:
|
|
64
|
+
- Automatically identifies delayed tasks (`task.end > baseline.end`) and displays a distinctive delay accent indicator line (`.task-delayed`).
|
|
65
|
+
- **Interactive Tooltip Integration**:
|
|
66
|
+
- Hovering over actual or baseline bars displays the baseline duration span, planned progress, and schedule variance badges (e.g. "+3 days delayed", "2 days ahead") with multi-language support (English and Japanese).
|
|
67
|
+
- **WBS Parent Summary Aggregation (`autoSummary`)**:
|
|
68
|
+
- Parent summary rows automatically aggregate earliest start date, latest end date, and duration-weighted average progress from all descendant task baselines.
|
|
69
|
+
- **Minimap 2D Canvas Synchronization**:
|
|
70
|
+
- Baseline bars are rendered smoothly onto the bird's-eye overview minimap canvas.
|
|
71
|
+
- **Exported Utility Functions**:
|
|
72
|
+
- `calculateTaskDelay(task: GanttTask)`: Calculates schedule variance (delay/ahead in ms and days) for an individual task.
|
|
73
|
+
- `calculateProjectBaselineSummary(rows: GanttRow[])`: Aggregates project-wide statistics including total baseline tasks, delayed tasks count, ahead tasks count, and max delay days.
|
|
74
|
+
- **Row Header Double-Click Content Target (`contentTarget`)**:
|
|
75
|
+
- Added `contentTarget?: HTMLElement` to the `row-header-dblclick` event detail, exposing the specific row name content DOM element (excluding indentation spacers and collapse toggle icons) to simplify positioning inline rename inputs and custom floating popovers.
|
|
76
|
+
- **WBS Tree Toggle & Spacer Font Scaling (`--moguchart-font-scale`)**:
|
|
77
|
+
- Improved `.tree-toggle-btn` and `.tree-toggle-spacer` dimensions, margins, border radius, and icon font size to dynamically scale with the CSS variable `--moguchart-font-scale` (`option.fontScale`), providing proportional WBS tree layouts under custom display scales.
|
|
78
|
+
- **WBS Parent Summary Opacity & Filter State Linking**:
|
|
79
|
+
- When all leaf/child tasks of a summary row are filtered out (marked with `_isFilteredOut === true` or styled with `opacity: 0.x`), the parent summary task (and its baseline bar) automatically inherits a dimmed semi-transparent style (`opacity: 0.2`) and `labelStyle: 'opacity: 0.2;'`.
|
|
80
|
+
- Delay accent lines (`.task-delayed`) and progress/task labels also respect the semi-transparent state (`.filtered-out`).
|
|
81
|
+
- **`scrollToTask` Optimization & Vue Wrapper Exposure**:
|
|
82
|
+
- Added `scrollToTask(taskId: string): void` to the public API (`GanttChartPublicApi`) of `@mogura/moguchart-vue`, enabling direct programmatic scrolling to any task via template `ref`.
|
|
83
|
+
- Optimized `scrollToTask` scrolling behavior by consolidating simultaneous vertical and horizontal scrolls into a single `container.scrollTo({ behavior: 'smooth' })` call, eliminating scroll stutter.
|
|
84
|
+
- Added a 40px left-side margin alongside row header width during horizontal scroll for improved task visibility.
|
|
85
|
+
- **Interactive Demo Controls**:
|
|
86
|
+
- Added live toggle controls to the demo page for Baseline visibility (ON/OFF), Delay Highlighting (ON/OFF), and Placement Position (`bottom` / `top` / `overlay`).
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
8
90
|
## [1.3.1] - 2026-10-01
|
|
9
91
|
|
|
10
92
|
### Fixed
|
|
@@ -510,6 +592,8 @@ This milestone introduces comprehensive support for **WBS (Hierarchical Tree Str
|
|
|
510
592
|
- UMD and ESM dual bundle outputs.
|
|
511
593
|
- Bundled TypeScript type definitions.
|
|
512
594
|
|
|
595
|
+
[1.4.0]: https://github.com/hiro-murakami/moguchart-core/compare/v1.3.1...v1.4.0
|
|
596
|
+
[1.3.1]: https://github.com/hiro-murakami/moguchart-core/compare/v1.3.0...v1.3.1
|
|
513
597
|
[1.3.0]: https://github.com/hiro-murakami/moguchart-core/compare/v1.2.0...v1.3.0
|
|
514
598
|
[1.2.0]: https://github.com/hiro-murakami/moguchart-core/compare/v1.1.1...v1.2.0
|
|
515
599
|
[1.1.1]: https://github.com/hiro-murakami/moguchart-core/compare/v1.1.0...v1.1.1
|
package/README.ja.md
CHANGED
|
@@ -22,7 +22,7 @@ Vue, React, Angular, Svelte など、どのフレームワークでも動作す
|
|
|
22
22
|
- 列ヘッダーの幅リサイズ
|
|
23
23
|
- 矩形範囲選択(ラバーバンドドラッグ選択)による複数タスク一括選択(Shift/Ctrl/Cmdキーでの追加選択対応)
|
|
24
24
|
- 複数タスクの選択&一括ドラッグ(Ctrl/Cmd + クリック、矩形選択)
|
|
25
|
-
-
|
|
25
|
+
- ダブルクリック(`contentTarget` で行名DOM要素の直接参照に対応)や右クリックイベントのハンドリング
|
|
26
26
|
- 🎨 **高度なカスタマイズ**:
|
|
27
27
|
- タスクバー、行ヘッダー、ツールチップ、ドラッグ情報のコンテンツを自由にレンダリング可能
|
|
28
28
|
- ライト/ダーク/システムテーマの切り替え+カスタムカラーテーマ
|
|
@@ -40,7 +40,7 @@ Vue, React, Angular, Svelte など、どのフレームワークでも動作す
|
|
|
40
40
|
- 祝日判定のカスタムロジック
|
|
41
41
|
- 週の始まり曜日の設定
|
|
42
42
|
- ロケール対応(日本語・英語、カスタムロケールも可能)
|
|
43
|
-
- 🔤 **フォントサイズ倍率 (`fontScale`)**: `fontScale` オプションや CSS 変数 `--moguchart-font-scale`
|
|
43
|
+
- 🔤 **フォントサイズ倍率 (`fontScale`)**: `fontScale` オプションや CSS 変数 `--moguchart-font-scale` でチャート全体のフォントサイズを一括スケーリング。カレンダーヘッダーやタスクバーだけでなく、WBSツリートグルボタンやスペーサーの寸法も連動し、高DPIや高密度表示に最適化
|
|
44
44
|
- 🏁 **マイルストーン**: チャート上にマイルストーン(縦線+名前バッジ)を表示
|
|
45
45
|
- 📍 **マーカー**: 行のタイムライン上に三角形アイコンとラベルで目印を表示
|
|
46
46
|
- 🗺️ **ミニマップ(Overview Minimap)**: チャート全体の鳥瞰プレビュー表示、ドラッグによるスクロール同期・パン操作、クリックジャンプ、ドラッグ移動・リサイズ、折りたたみ対応
|
|
@@ -51,22 +51,42 @@ Vue, React, Angular, Svelte など、どのフレームワークでも動作す
|
|
|
51
51
|
- サマリータスク(親集計バー)への進捗ラベル自動表示および専用カスタム色(`summaryColor`)対応
|
|
52
52
|
- 進捗変更イベント(`task-progress-change`)の発火
|
|
53
53
|
- 行・プロジェクト全体の進捗率計算ユーティリティ関数
|
|
54
|
-
- 🧩 **プラグインアーキテクチャ**: コア本体を超軽量(数十KB
|
|
55
|
-
- 📷
|
|
54
|
+
- 🧩 **プラグインアーキテクチャ**: コア本体を超軽量(数十KB)に保ちつつ、エクスポート等の機能をプラグインとして柔軟に拡張可能
|
|
55
|
+
- 📷 **画像・PDFエクスポート(プラグイン)**: `@mogura/moguchart-plugin-export` による PNG画像およびPDF形式でのガントチャート全体エクスポート(自動ダウンロード対応、エクスポート時のズーム正規化 `normalizeZoom`、スクロール位置保持)
|
|
56
|
+
- 📊 **Excelタイムラインエクスポート(プラグイン)**: `@mogura/moguchart-plugin-excel` によるカレンダー日付列にタスク期間が色塗りされた工程表・タイムライン付き Excel (.xlsx) エクスポート(多言語対応 `ja`/`en`/`zh`、WBS階層構造保持、土日祝日の色分け)
|
|
57
|
+
- ✨ **高度なインテグレーション**:
|
|
56
58
|
- 外部からのドラッグ&ドロップによるタスク作成
|
|
57
59
|
- タスクの移動/コピーモード
|
|
58
60
|
- スナップ機能(時間単位でのグリッドスナップ)
|
|
59
61
|
- 座標から行・日時を取得する `hitTest` メソッド
|
|
60
62
|
- プログラムによるタスク選択+自動スクロール (`selectTask`)
|
|
63
|
+
- 目的のタスクへスムーズに移動するスクロールメソッド (`scrollToTask`)
|
|
61
64
|
- 🌳 **WBS(階層ツリー・展開/折りたたみ)**:
|
|
62
65
|
- `parentId` による無制限の親子階層構造
|
|
63
66
|
- インデント表示と開閉トグルボタン(▶/▼)
|
|
64
67
|
- 配下の子タスクから自動計算されるサマリータスクバー(ブラケット形状)
|
|
65
68
|
- サマリータスクバーの色設定(プロジェクト既定色および行単位の個別色指定)
|
|
66
69
|
- 親行におけるサマリータスクと通常タスクの共存・同時描画
|
|
70
|
+
- 子タスクの半透明化(フィルタアウト)に連動したサマリータスク・ベースラインの自動半透明化
|
|
67
71
|
- 仮想スクロールやミニマップと完全に連動する折りたたみ
|
|
68
72
|
- 階層を壊さない安全なD&D並び替え(子タスクのブロック連動移動・循環参照防止)
|
|
69
73
|
- プログラムからの開閉操作(`toggleRowCollapse`, `collapseAll`, `expandAll`)
|
|
74
|
+
- 📈 **予実管理(Baseline / 計画 vs 実績)**:
|
|
75
|
+
- タスクの当初計画(`task.baseline`)と実績日程を同一レーン上に同時描画
|
|
76
|
+
- 3つの配置レイアウト(下部分割 `bottom` / 上部 `top` / 重ねて表示 `overlay`)
|
|
77
|
+
- 遅延タスク(実績終了日 > 計画終了日)の自動検知と遅延アクセント線(`.task-delayed`)でのハイライト表示
|
|
78
|
+
- ツールチップでの計画期間・進捗率および遅延/前倒し状況(多言語対応)の表示
|
|
79
|
+
- WBSサマリータスクにおける配下子タスクの計画日程・進捗率の自動集計
|
|
80
|
+
- 全体鳥瞰ミニマップ(2D Canvas)との同期描画
|
|
81
|
+
- タスク遅延計算(`calculateTaskDelay`)およびプロジェクト予実統計集計(`calculateProjectBaselineSummary`)関数
|
|
82
|
+
- 📋 **マルチカラムデータグリッド(WBS テーブル)**:
|
|
83
|
+
- 行ヘッダー領域を本格的な複数列のテーブルとして表示・操作
|
|
84
|
+
- 標準組み込みカラム(WBS番号 `wbs`、タスク名 `name`、開始日・開始月・開始日時 `startDate`/`startMonth`/`startDateTime`、終了日・終了月・終了日時 `endDate`/`endMonth`/`endDateTime`、期間 `duration`、進捗率 `progress`)および表示モード(日・週・月・時間)に応じた自動ヘッダー名・フォーマット切り替え
|
|
85
|
+
- サマリー行・複数タスク行の最小開始日〜最大終了日、カレンダー期間、加重平均進捗率を自動算出
|
|
86
|
+
- **インラインセル編集**(`option.grid.editable: true`):ダブルクリックまたはクリックによる直接編集、`text` / `number` / `date` / `datetime` / `month` / `select` の組み込みエディタおよびカスタムエディタ関数、単一タスクの `movable` / `resizable` / `progressResizable` 設定との自動連動、編集可能セル(`.grid-cell-editable`)と読み取り専用セル(`.grid-cell-readonly`)の視覚的区別、Undo/Redo 履歴連動、`cell-edit` イベントに対応
|
|
87
|
+
- カスタムカラム(`field`、`valueGetter`、`valueSetter`、`formatter`、`renderCell` によるHTML/DOMの直接描画)および `customRendering.cornerContent` との上下2段レイアウト共存
|
|
88
|
+
- カラム境界ドラッグによる幅のリサイズ(`column-resize` イベント)
|
|
89
|
+
- グリッド領域とタイムライン領域のスプリッターリサイズ&グリッド内独立横スクロール同期(トラックパッド横スワイプ、Shift+ホイール、ヘッダー上のホイールに対応)
|
|
70
90
|
- ⌨️ **キーボード操作**: 矢印キーでのナビゲーション・選択・Shift+矢印キーでのタスク移動・Deleteキーでのタスク/依存関係線削除・Undo/Redo・ズームショートカット
|
|
71
91
|
|
|
72
92
|
## パッケージ一覧(エコシステム)
|
|
@@ -716,6 +736,121 @@ chart.addEventListener('row-toggle-collapse', (e) => {
|
|
|
716
736
|
})
|
|
717
737
|
```
|
|
718
738
|
|
|
739
|
+
### 予実管理(Baseline / 計画 vs 実績の比較可視化)
|
|
740
|
+
|
|
741
|
+
タスクに当初計画(`task.baseline`)を設定することで、計画日程と現在の実績日程を視覚的に比較できます。
|
|
742
|
+
行の高さや仮想スクロールのキャッシュ計算を崩さず、実績バーの下部または上部・背後にスマートにレイアウトされます。
|
|
743
|
+
|
|
744
|
+
```javascript
|
|
745
|
+
import { calculateTaskDelay, calculateProjectBaselineSummary } from '@mogura/moguchart-core'
|
|
746
|
+
|
|
747
|
+
const rows = [
|
|
748
|
+
{
|
|
749
|
+
id: 'row-1',
|
|
750
|
+
name: '機能開発',
|
|
751
|
+
tasks: [
|
|
752
|
+
{
|
|
753
|
+
id: 'task-1',
|
|
754
|
+
name: 'UIコンポーネント実装',
|
|
755
|
+
start: new Date('2026-04-01'),
|
|
756
|
+
end: new Date('2026-04-14'), // 実績: 4/14まで延長
|
|
757
|
+
progress: 80,
|
|
758
|
+
baseline: {
|
|
759
|
+
start: new Date('2026-04-01'),
|
|
760
|
+
end: new Date('2026-04-10'), // 計画: 4/10完了予定だった(4日遅延)
|
|
761
|
+
progress: 100,
|
|
762
|
+
},
|
|
763
|
+
},
|
|
764
|
+
],
|
|
765
|
+
},
|
|
766
|
+
]
|
|
767
|
+
|
|
768
|
+
const option = {
|
|
769
|
+
baseline: {
|
|
770
|
+
enabled: true, // ベースライン表示を有効化 (デフォルト: false)
|
|
771
|
+
position: 'bottom', // 'bottom' (下部分割) | 'top' (上部) | 'overlay' (重ねて表示)
|
|
772
|
+
highlightDelay: true, // 実績が計画を超過した場合にハイライト表示 (デフォルト: true)
|
|
773
|
+
delayColor: '#ef4444', // 遅延ハイライト色
|
|
774
|
+
showTooltip: true, // ツールチップに計画日程と遅延日数を表示 (デフォルト: true)
|
|
775
|
+
autoSummary: true, // WBS親タスクに子タスクの計画日程を自動集計 (デフォルト: true)
|
|
776
|
+
},
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
// 個別タスクの遅延・前倒し計算
|
|
780
|
+
const delayInfo = calculateTaskDelay(rows[0].tasks[0])
|
|
781
|
+
console.log(`遅延判定: ${delayInfo.isDelayed}, 遅延日数: ${delayInfo.delayDays}日`)
|
|
782
|
+
|
|
783
|
+
// プロジェクト全体の予実統計サマリー
|
|
784
|
+
const summary = calculateProjectBaselineSummary(rows)
|
|
785
|
+
console.log(`計画タスク数: ${summary.totalBaselineTasks}, 遅延タスク数: ${summary.delayedTasksCount}, 最大遅延: ${summary.maxDelayDays}日`)
|
|
786
|
+
```
|
|
787
|
+
|
|
788
|
+
### マルチカラムデータグリッド(WBSテーブル & インライン編集)
|
|
789
|
+
|
|
790
|
+
行ヘッダー領域を本格的な複数カラムのテーブルとして表示できます。WBS階層コード、タスク名、期間、進捗率、カスタム列を柔軟に構成できるほか、`editable: true` を設定することでセルのダブルクリック(またはクリック)によるインライン編集が可能です(編集可能セルには `.grid-cell-editable`、サマリー行や複数タスク行の集計セル・`wbs` 列などの読み取り専用セルには `.grid-cell-readonly` クラスが付与され視覚的に区別されます。単一タスク行の日付・期間・進捗セルはタスクの `movable` / `resizable` / `progressResizable` 設定とも自動連動します)。
|
|
791
|
+
|
|
792
|
+
表示モードに応じて、`startDate` / `endDate` の列タイトルや表示フォーマット・エディタ種別は自動的に切り替わります(月単位モード時は「開始月」「終了月」、時間単位モード時は「開始日時」「終了日時」)。また、`customRendering.cornerContent` と併用した場合は、左上コーナー領域の上段に `cornerContent`、下段にグリッドカラムヘッダーが2段構成で表示されます。
|
|
793
|
+
|
|
794
|
+
```javascript
|
|
795
|
+
const option = {
|
|
796
|
+
// グリッド表示設定
|
|
797
|
+
grid: {
|
|
798
|
+
enabled: true, // グリッド表示を有効化 (デフォルト: columns 指定時は true)
|
|
799
|
+
width: 700, // グリッド領域全体の初期幅 (px)
|
|
800
|
+
splitterResizable: true, // スプリッターによるグリッド幅変更を許可 (デフォルト: true)
|
|
801
|
+
showBorders: true, // セル罫線を表示 (デフォルト: true)
|
|
802
|
+
editable: true, // セルのインライン編集を有効化 (デフォルト: false)
|
|
803
|
+
editTrigger: 'dblclick', // 編集開始トリガー ('dblclick' | 'click'、デフォルト: 'dblclick')
|
|
804
|
+
columns: [
|
|
805
|
+
{ id: 'wbs', width: 60 }, // WBS番号 (1, 1.1, 1.2 など)
|
|
806
|
+
{ id: 'name', width: 220 }, // タスク名 (ツリー開閉トグル付き・テキスト編集)
|
|
807
|
+
{ id: 'startDate', width: 125 }, // 開始日 (日/月/日時エディタに自動連動)
|
|
808
|
+
{ id: 'endDate', width: 125 }, // 終了日 (日/月/日時エディタに自動連動)
|
|
809
|
+
{ id: 'duration', width: 80 }, // 期間 (数値エディタ)
|
|
810
|
+
{ id: 'progress', width: 70 }, // 進捗率 (0〜100% 数値エディタ)
|
|
811
|
+
{
|
|
812
|
+
id: 'assignee',
|
|
813
|
+
title: '担当者',
|
|
814
|
+
width: 100,
|
|
815
|
+
field: 'assignee', // row.assignee を参照・更新
|
|
816
|
+
editor: 'select', // 'text' | 'number' | 'date' | 'datetime' | 'month' | 'select' またはカスタム関数
|
|
817
|
+
editorOptions: [
|
|
818
|
+
{ label: '山田', value: '山田' },
|
|
819
|
+
{ label: '佐藤', value: '佐藤' },
|
|
820
|
+
{ label: '鈴木', value: '鈴木' },
|
|
821
|
+
],
|
|
822
|
+
renderCell: (value) => {
|
|
823
|
+
// カスタムDOM要素のレンダリング
|
|
824
|
+
const badge = document.createElement('span')
|
|
825
|
+
badge.className = 'badge'
|
|
826
|
+
badge.textContent = value || '未設定'
|
|
827
|
+
return badge
|
|
828
|
+
},
|
|
829
|
+
},
|
|
830
|
+
],
|
|
831
|
+
},
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
// セルのインライン編集確定イベントの購読
|
|
835
|
+
chart.addEventListener('cell-edit', (event) => {
|
|
836
|
+
const { rowId, columnId, oldValue, newValue, row, rows } = event.detail
|
|
837
|
+
console.log(`行 ${rowId} の ${columnId} が更新されました:`, oldValue, '->', newValue)
|
|
838
|
+
})
|
|
839
|
+
|
|
840
|
+
// カラム幅リサイズイベントの購読
|
|
841
|
+
chart.addEventListener('column-resize', (event) => {
|
|
842
|
+
const { columnId, width, previousWidth, isFinal } = event.detail
|
|
843
|
+
if (isFinal) {
|
|
844
|
+
console.log(`カラム ${columnId} の幅が ${width}px に変更されました`)
|
|
845
|
+
}
|
|
846
|
+
})
|
|
847
|
+
|
|
848
|
+
// プログラムからのセル編集制御
|
|
849
|
+
chart.startCellEdit('row-1', 'name') // 編集開始
|
|
850
|
+
chart.commitCellEdit('新しいタスク名') // 編集確定
|
|
851
|
+
chart.cancelCellEdit() // 編集キャンセル
|
|
852
|
+
```
|
|
853
|
+
|
|
719
854
|
### パブリックメソッド
|
|
720
855
|
|
|
721
856
|
#### selectTask
|
|
@@ -740,6 +875,26 @@ document.addEventListener('mousemove', (e) => {
|
|
|
740
875
|
})
|
|
741
876
|
```
|
|
742
877
|
|
|
878
|
+
#### scrollToTask
|
|
879
|
+
|
|
880
|
+
指定したIDのタスクが表示領域外にある場合、タスクが見える位置までスムーズにスクロールします(縦方向は中央付近、横方向は行ヘッダー幅とマージンを考慮)。
|
|
881
|
+
|
|
882
|
+
```javascript
|
|
883
|
+
chart.scrollToTask('task-1')
|
|
884
|
+
```
|
|
885
|
+
|
|
886
|
+
#### scrollToPosition / resetScroll
|
|
887
|
+
|
|
888
|
+
指定したスクロール座標への移動や、スクロール位置の初期化を行います。
|
|
889
|
+
|
|
890
|
+
```javascript
|
|
891
|
+
// スムーズスクロール
|
|
892
|
+
chart.scrollToPosition({ left: 400, top: 200, behavior: 'smooth' })
|
|
893
|
+
|
|
894
|
+
// 左上 (0, 0) にリセット
|
|
895
|
+
chart.resetScroll()
|
|
896
|
+
```
|
|
897
|
+
|
|
743
898
|
#### エクスポートプラグイン (`@mogura/moguchart-plugin-export`)
|
|
744
899
|
|
|
745
900
|
ガントチャート全体を PNG 画像または PDF 形式でエクスポートします。エクスポート機能はプラグイン(`@mogura/moguchart-plugin-export`)として提供されており、必要な場合のみ導入することでコア本体を超軽量に保てます。
|
|
@@ -927,6 +1082,18 @@ import {
|
|
|
927
1082
|
calculateRowProgress,
|
|
928
1083
|
calculateWeightedRowProgress,
|
|
929
1084
|
calculateProjectProgress,
|
|
1085
|
+
// 予実管理(ベースライン)計算
|
|
1086
|
+
calculateTaskDelay,
|
|
1087
|
+
calculateProjectBaselineSummary,
|
|
1088
|
+
// マルチカラムグリッド計算・インライン編集ヘルパー
|
|
1089
|
+
calculateRowSummaryDates,
|
|
1090
|
+
normalizeGridColumns,
|
|
1091
|
+
getGridCellValue,
|
|
1092
|
+
formatGridCellValue,
|
|
1093
|
+
resolveColumnEditorType,
|
|
1094
|
+
isGridCellEditable,
|
|
1095
|
+
formatGridCellEditValue,
|
|
1096
|
+
applyGridCellEdit,
|
|
930
1097
|
} from '@mogura/moguchart-core'
|
|
931
1098
|
|
|
932
1099
|
// 1. 各行のツリー階層レベル(深さ)の計算
|
|
@@ -950,6 +1117,9 @@ const isSafe = canDropRow('source-row-id', 'target-row-id', rows) // boolean
|
|
|
950
1117
|
|
|
951
1118
|
// 7. クリティカルパス(最長依存関係チェーン)の計算
|
|
952
1119
|
const criticalTaskIds = computeCriticalPath(allTasks) // Set<string>
|
|
1120
|
+
|
|
1121
|
+
// 8. 行内のタスク配列から最小開始日・最大終了日・期間日数を算出
|
|
1122
|
+
const summaryDates = calculateRowSummaryDates(rows[0].tasks) // { start, end, durationDays }
|
|
953
1123
|
```
|
|
954
1124
|
|
|
955
1125
|
### キーボード操作
|