@mogura/moguchart-core 1.3.0 → 1.4.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 +50 -0
- package/CHANGELOG.md +49 -0
- package/README.ja.md +85 -4
- package/README.md +84 -4
- package/dist/components/gantt-bar.d.ts +2 -0
- package/dist/core/i18n.d.ts +8 -0
- package/dist/core/types.d.ts +51 -0
- package/dist/core/utils.d.ts +27 -0
- package/dist/index.d.ts +1 -1
- package/dist/moguchart-core.mjs +349 -133
- package/dist/moguchart-core.umd.js +126 -37
- package/package.json +3 -3
package/CHANGELOG.ja.md
CHANGED
|
@@ -5,6 +5,54 @@ 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.4.0] - 2026-10-11
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **予実管理機能(Baseline / 計画 vs 実績の比較可視化)**:
|
|
13
|
+
- タスクに当初計画(`task.baseline: GanttTaskBaseline`)を持たせることで、計画日程と現在の実績日程を同一レーン上に同時描画・比較できる機能を追加
|
|
14
|
+
- **3つの柔軟な配置レイアウト (`option.baseline.position`)**:
|
|
15
|
+
- `'bottom'` (デフォルト): 実績バーの下部にスマート分割して配置。行の高さや仮想スクロールのキャッシュ計算を壊さず、滑らかに表示
|
|
16
|
+
- `'top'`: 実績バーの上部に配置
|
|
17
|
+
- `'overlay'`: 実績バーの背後に同一高さで重ねて描画
|
|
18
|
+
- **遅延ハイライト可視化 (`highlightDelay`, `delayColor`)**:
|
|
19
|
+
- 実績終了日が計画終了日を超過(`task.end > baseline.end`)しているタスクを自動検知し、遅延アクセント線(`.task-delayed`)で視覚的に強調
|
|
20
|
+
- **ツールチップの予実連携**:
|
|
21
|
+
- タスクバーおよびベースラインバーへのホバー時、ツールチップに計画日程(期間・進捗率)および遅延/前倒し状況(「3日遅延」「2日前倒し」等)を多言語(日本語・英語)で自動表示
|
|
22
|
+
- **サマリータスク(WBS階層)のベースライン自動集計 (`autoSummary`)**:
|
|
23
|
+
- 配下の子タスク群が持つベースライン日程(最小開始日〜最大終了日)および加重平均進捗率を親のサマリータスクへ自動集計
|
|
24
|
+
- **ミニマップ(Minimap)描画の完全同期**:
|
|
25
|
+
- 全体鳥瞰ミニマップ(2D Canvas)にもベースラインバーを同期描画
|
|
26
|
+
- **公開ユーティリティ関数**:
|
|
27
|
+
- `calculateTaskDelay(task: GanttTask)`: 個別タスクの遅延・前倒しミリ秒/日数を計算
|
|
28
|
+
- `calculateProjectBaselineSummary(rows: GanttRow[])`: プロジェクト全体の計画タスク数、遅延タスク数、前倒しタスク数、最大遅延日数等の統計を集計
|
|
29
|
+
- **行ヘッダーダブルクリック時のコンテンツ要素提供 (`contentTarget`)**:
|
|
30
|
+
- `row-header-dblclick` イベントの detail に `contentTarget?: HTMLElement` を追加
|
|
31
|
+
- インデントスペーサーやツリートグルアイコンを除いた行名表示領域のDOM要素を直接取得可能にし、行名のインライン編集入力欄の配置やカスタムポップオーバーの配置を容易に改善
|
|
32
|
+
- **フォント倍率に応じたWBSツリーUIの連動スケーリング (`--moguchart-font-scale`)**:
|
|
33
|
+
- CSS変数 `--moguchart-font-scale`(`option.fontScale`)の値に応じて、ツリートグルボタン(`.tree-toggle-btn`)およびスペーサー(`.tree-toggle-spacer`)の幅、高さ、マージン、角丸、アイコンフォントサイズが動的にスケールするよう改善
|
|
34
|
+
- **WBSサマリータスクへの半透明・フィルタアウト状態の自動連動**:
|
|
35
|
+
- サマリー行(親行)配下のタスクがフィルタ等で全て半透明化(`_isFilteredOut === true` または `style` に `opacity: 0.x`)されている場合、親のサマリータスク(およびそのベースラインバー)に対しても自動的に半透明スタイル(`opacity: 0.2`)および `labelStyle: 'opacity: 0.2;'` を適用
|
|
36
|
+
- 遅延ハイライト線(`.task-delayed`)やバーラベル、進捗ラベルも半透明表示(`.filtered-out`)に連動
|
|
37
|
+
- **`scrollToTask` スクロール挙動の最適化 & Vue ラッパーへの公開**:
|
|
38
|
+
- `packages/vue` の `GanttChart` コンポーネントの公開 API(`GanttChartPublicApi`)に `scrollToTask(taskId: string): void` を追加し、`ref` から目的のタスクへ直接スクロール可能に改善
|
|
39
|
+
- `scrollToTask` のスクロール挙動を最適化:縦方向と横方向のスクロールが必要な場合に単一の `container.scrollTo` を呼び出し、滑らかに同時スクロール(`behavior: 'smooth'`)するよう改善
|
|
40
|
+
- 横スクロール時、行ヘッダー幅に加えて左側マージン(40px)を確保し、タスクの開始位置が明瞭に見えるよう視認性を向上
|
|
41
|
+
- **デモ画面へのコントロール追加**:
|
|
42
|
+
- デモページの操作パネルにベースライン表示切替(ON/OFF)、遅延ハイライト切替(ON/OFF)、配置位置(下部 / 上部 / 重ねて表示)のリアルタイム操作UIを追加
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## [1.3.1] - 2026-10-01
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
|
|
50
|
+
- **読み取り専用モードにおける進捗率リサイズの制御を修正**:
|
|
51
|
+
- `readOnly: true` が有効な場合でも、タスク単位で `progressResizable: true` が指定されている場合に、進捗率のリサイズ・変更操作が反映されるよう修正
|
|
52
|
+
- `task.progressResizable === false` が明示指定されたタスクについて、進捗率の変更操作が確実に無効化されるガード処理を追加
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
8
56
|
## [1.3.0] - 2026-09-27
|
|
9
57
|
|
|
10
58
|
### Added
|
|
@@ -469,6 +517,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
469
517
|
- UMD / ESM 両形式のビルド出力
|
|
470
518
|
- TypeScript 型定義の同梱
|
|
471
519
|
|
|
520
|
+
[1.4.0]: https://github.com/hiro-murakami/moguchart-core/compare/v1.3.1...v1.4.0
|
|
521
|
+
[1.3.1]: https://github.com/hiro-murakami/moguchart-core/compare/v1.3.0...v1.3.1
|
|
472
522
|
[1.3.0]: https://github.com/hiro-murakami/moguchart-core/compare/v1.2.0...v1.3.0
|
|
473
523
|
[1.2.0]: https://github.com/hiro-murakami/moguchart-core/compare/v1.1.1...v1.2.0
|
|
474
524
|
[1.1.1]: https://github.com/hiro-murakami/moguchart-core/compare/v1.1.0...v1.1.1
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,53 @@ 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.4.0] - 2026-10-11
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Baseline & Schedule Variance Tracking (Plan vs. Actual Comparison)**:
|
|
13
|
+
- Added support for baseline schedules (`task.baseline: GanttTaskBaseline`) allowing concurrent rendering and variance tracking of planned vs. actual project timelines within each row lane.
|
|
14
|
+
- **Flexible Layout Positions (`option.baseline.position`)**:
|
|
15
|
+
- `'bottom'` (default): Smartly splits the lane height to render the baseline bar underneath the actual bar without affecting row heights or virtual scrolling performance.
|
|
16
|
+
- `'top'`: Renders the baseline bar above the actual task bar.
|
|
17
|
+
- `'overlay'`: Renders the baseline bar directly behind the actual task bar with full height.
|
|
18
|
+
- **Delay & Variance Highlighting (`highlightDelay`, `delayColor`)**:
|
|
19
|
+
- Automatically identifies delayed tasks (`task.end > baseline.end`) and displays a distinctive delay accent indicator line (`.task-delayed`).
|
|
20
|
+
- **Interactive Tooltip Integration**:
|
|
21
|
+
- 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).
|
|
22
|
+
- **WBS Parent Summary Aggregation (`autoSummary`)**:
|
|
23
|
+
- Parent summary rows automatically aggregate earliest start date, latest end date, and duration-weighted average progress from all descendant task baselines.
|
|
24
|
+
- **Minimap 2D Canvas Synchronization**:
|
|
25
|
+
- Baseline bars are rendered smoothly onto the bird's-eye overview minimap canvas.
|
|
26
|
+
- **Exported Utility Functions**:
|
|
27
|
+
- `calculateTaskDelay(task: GanttTask)`: Calculates schedule variance (delay/ahead in ms and days) for an individual task.
|
|
28
|
+
- `calculateProjectBaselineSummary(rows: GanttRow[])`: Aggregates project-wide statistics including total baseline tasks, delayed tasks count, ahead tasks count, and max delay days.
|
|
29
|
+
- **Row Header Double-Click Content Target (`contentTarget`)**:
|
|
30
|
+
- 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.
|
|
31
|
+
- **WBS Tree Toggle & Spacer Font Scaling (`--moguchart-font-scale`)**:
|
|
32
|
+
- 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.
|
|
33
|
+
- **WBS Parent Summary Opacity & Filter State Linking**:
|
|
34
|
+
- 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;'`.
|
|
35
|
+
- Delay accent lines (`.task-delayed`) and progress/task labels also respect the semi-transparent state (`.filtered-out`).
|
|
36
|
+
- **`scrollToTask` Optimization & Vue Wrapper Exposure**:
|
|
37
|
+
- Added `scrollToTask(taskId: string): void` to the public API (`GanttChartPublicApi`) of `@mogura/moguchart-vue`, enabling direct programmatic scrolling to any task via template `ref`.
|
|
38
|
+
- Optimized `scrollToTask` scrolling behavior by consolidating simultaneous vertical and horizontal scrolls into a single `container.scrollTo({ behavior: 'smooth' })` call, eliminating scroll stutter.
|
|
39
|
+
- Added a 40px left-side margin alongside row header width during horizontal scroll for improved task visibility.
|
|
40
|
+
- **Interactive Demo Controls**:
|
|
41
|
+
- Added live toggle controls to the demo page for Baseline visibility (ON/OFF), Delay Highlighting (ON/OFF), and Placement Position (`bottom` / `top` / `overlay`).
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## [1.3.1] - 2026-10-01
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
|
|
49
|
+
- **Fix Task Progress Resize Control in Read-Only Mode**:
|
|
50
|
+
- Allowed task progress changes when `task.progressResizable` is explicitly set to `true`, even if `readOnly` mode is enabled.
|
|
51
|
+
- Added a guard to prevent progress changes if `task.progressResizable` is explicitly `false`.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
8
55
|
## [1.3.0] - 2026-09-27
|
|
9
56
|
|
|
10
57
|
### Added
|
|
@@ -500,6 +547,8 @@ This milestone introduces comprehensive support for **WBS (Hierarchical Tree Str
|
|
|
500
547
|
- UMD and ESM dual bundle outputs.
|
|
501
548
|
- Bundled TypeScript type definitions.
|
|
502
549
|
|
|
550
|
+
[1.4.0]: https://github.com/hiro-murakami/moguchart-core/compare/v1.3.1...v1.4.0
|
|
551
|
+
[1.3.1]: https://github.com/hiro-murakami/moguchart-core/compare/v1.3.0...v1.3.1
|
|
503
552
|
[1.3.0]: https://github.com/hiro-murakami/moguchart-core/compare/v1.2.0...v1.3.0
|
|
504
553
|
[1.2.0]: https://github.com/hiro-murakami/moguchart-core/compare/v1.1.1...v1.2.0
|
|
505
554
|
[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,34 @@ 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`)関数
|
|
70
82
|
- ⌨️ **キーボード操作**: 矢印キーでのナビゲーション・選択・Shift+矢印キーでのタスク移動・Deleteキーでのタスク/依存関係線削除・Undo/Redo・ズームショートカット
|
|
71
83
|
|
|
72
84
|
## パッケージ一覧(エコシステム)
|
|
@@ -716,6 +728,55 @@ chart.addEventListener('row-toggle-collapse', (e) => {
|
|
|
716
728
|
})
|
|
717
729
|
```
|
|
718
730
|
|
|
731
|
+
### 予実管理(Baseline / 計画 vs 実績の比較可視化)
|
|
732
|
+
|
|
733
|
+
タスクに当初計画(`task.baseline`)を設定することで、計画日程と現在の実績日程を視覚的に比較できます。
|
|
734
|
+
行の高さや仮想スクロールのキャッシュ計算を崩さず、実績バーの下部または上部・背後にスマートにレイアウトされます。
|
|
735
|
+
|
|
736
|
+
```javascript
|
|
737
|
+
import { calculateTaskDelay, calculateProjectBaselineSummary } from '@mogura/moguchart-core'
|
|
738
|
+
|
|
739
|
+
const rows = [
|
|
740
|
+
{
|
|
741
|
+
id: 'row-1',
|
|
742
|
+
name: '機能開発',
|
|
743
|
+
tasks: [
|
|
744
|
+
{
|
|
745
|
+
id: 'task-1',
|
|
746
|
+
name: 'UIコンポーネント実装',
|
|
747
|
+
start: new Date('2026-04-01'),
|
|
748
|
+
end: new Date('2026-04-14'), // 実績: 4/14まで延長
|
|
749
|
+
progress: 80,
|
|
750
|
+
baseline: {
|
|
751
|
+
start: new Date('2026-04-01'),
|
|
752
|
+
end: new Date('2026-04-10'), // 計画: 4/10完了予定だった(4日遅延)
|
|
753
|
+
progress: 100,
|
|
754
|
+
},
|
|
755
|
+
},
|
|
756
|
+
],
|
|
757
|
+
},
|
|
758
|
+
]
|
|
759
|
+
|
|
760
|
+
const option = {
|
|
761
|
+
baseline: {
|
|
762
|
+
enabled: true, // ベースライン表示を有効化 (デフォルト: false)
|
|
763
|
+
position: 'bottom', // 'bottom' (下部分割) | 'top' (上部) | 'overlay' (重ねて表示)
|
|
764
|
+
highlightDelay: true, // 実績が計画を超過した場合にハイライト表示 (デフォルト: true)
|
|
765
|
+
delayColor: '#ef4444', // 遅延ハイライト色
|
|
766
|
+
showTooltip: true, // ツールチップに計画日程と遅延日数を表示 (デフォルト: true)
|
|
767
|
+
autoSummary: true, // WBS親タスクに子タスクの計画日程を自動集計 (デフォルト: true)
|
|
768
|
+
},
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
// 個別タスクの遅延・前倒し計算
|
|
772
|
+
const delayInfo = calculateTaskDelay(rows[0].tasks[0])
|
|
773
|
+
console.log(`遅延判定: ${delayInfo.isDelayed}, 遅延日数: ${delayInfo.delayDays}日`)
|
|
774
|
+
|
|
775
|
+
// プロジェクト全体の予実統計サマリー
|
|
776
|
+
const summary = calculateProjectBaselineSummary(rows)
|
|
777
|
+
console.log(`計画タスク数: ${summary.totalBaselineTasks}, 遅延タスク数: ${summary.delayedTasksCount}, 最大遅延: ${summary.maxDelayDays}日`)
|
|
778
|
+
```
|
|
779
|
+
|
|
719
780
|
### パブリックメソッド
|
|
720
781
|
|
|
721
782
|
#### selectTask
|
|
@@ -740,6 +801,26 @@ document.addEventListener('mousemove', (e) => {
|
|
|
740
801
|
})
|
|
741
802
|
```
|
|
742
803
|
|
|
804
|
+
#### scrollToTask
|
|
805
|
+
|
|
806
|
+
指定したIDのタスクが表示領域外にある場合、タスクが見える位置までスムーズにスクロールします(縦方向は中央付近、横方向は行ヘッダー幅とマージンを考慮)。
|
|
807
|
+
|
|
808
|
+
```javascript
|
|
809
|
+
chart.scrollToTask('task-1')
|
|
810
|
+
```
|
|
811
|
+
|
|
812
|
+
#### scrollToPosition / resetScroll
|
|
813
|
+
|
|
814
|
+
指定したスクロール座標への移動や、スクロール位置の初期化を行います。
|
|
815
|
+
|
|
816
|
+
```javascript
|
|
817
|
+
// スムーズスクロール
|
|
818
|
+
chart.scrollToPosition({ left: 400, top: 200, behavior: 'smooth' })
|
|
819
|
+
|
|
820
|
+
// 左上 (0, 0) にリセット
|
|
821
|
+
chart.resetScroll()
|
|
822
|
+
```
|
|
823
|
+
|
|
743
824
|
#### エクスポートプラグイン (`@mogura/moguchart-plugin-export`)
|
|
744
825
|
|
|
745
826
|
ガントチャート全体を PNG 画像または PDF 形式でエクスポートします。エクスポート機能はプラグイン(`@mogura/moguchart-plugin-export`)として提供されており、必要な場合のみ導入することでコア本体を超軽量に保てます。
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ A lightweight yet feature-rich Gantt chart Web Component built with Lit. Works s
|
|
|
23
23
|
- Marquee selection (rubberband drag selection) for batch task selection (with Shift / Ctrl / Cmd additive selection support)
|
|
24
24
|
- Multi-task selection and synchronized batch dragging (Ctrl / Cmd + click, marquee selection)
|
|
25
25
|
- Safe drag cancellation and snapback when cursor exits chart boundaries
|
|
26
|
-
- Double-click and right-click event handling
|
|
26
|
+
- Double-click (exposing row name DOM container via `contentTarget`) and right-click event handling
|
|
27
27
|
- 🎨 **Highly Customizable**:
|
|
28
28
|
- Custom rendering for task bars, row headers, row header tooltips, tooltips, and drag info overlays
|
|
29
29
|
- Light / Dark / System theme switching + custom color palettes
|
|
@@ -42,7 +42,7 @@ A lightweight yet feature-rich Gantt chart Web Component built with Lit. Works s
|
|
|
42
42
|
- Custom holiday detection logic
|
|
43
43
|
- Configurable week start day
|
|
44
44
|
- Built-in internationalization (Japanese, English, and custom locale extensibility)
|
|
45
|
-
- 🔤 **Font Scaling (`fontScale`)**: Scale all text font sizes throughout the Gantt chart uniformly via `fontScale` option or `--moguchart-font-scale` CSS variable,
|
|
45
|
+
- 🔤 **Font Scaling (`fontScale`)**: Scale all text font sizes throughout the Gantt chart uniformly via `fontScale` option or `--moguchart-font-scale` CSS variable; calendar headers, task bars, as well as WBS tree toggle buttons and spacers scale dynamically to guarantee optimal layouts across display densities.
|
|
46
46
|
- 🏁 **Milestones**: Display key milestones with vertical markers and customizable badges.
|
|
47
47
|
- 📍 **Markers**: Place labeled triangle marker indicators on individual row timelines.
|
|
48
48
|
- 🗺️ **Overview Minimap**: Floating bird's-eye canvas preview of the entire chart, interactive pan & scroll synchronization, click-to-jump, drag-to-move, edge drag-resizing, opacity slider, and collapsible window state.
|
|
@@ -54,14 +54,16 @@ A lightweight yet feature-rich Gantt chart Web Component built with Lit. Works s
|
|
|
54
54
|
- `task-progress-change` custom event
|
|
55
55
|
- Progress calculation utility functions (simple & duration-weighted row/project averages)
|
|
56
56
|
- Automatic progress visualization on the overview minimap
|
|
57
|
-
- 🧩 **Plugin Architecture**: Modular architecture keeping the core bundle ultra-lightweight (tens of KBs) while allowing rich extensions like
|
|
58
|
-
- 📷 **Export Plugin**: Full Gantt chart PNG image and multi-page PDF export powered by `@mogura/moguchart-plugin-export` (with automatic zoom normalization `normalizeZoom`, scroll position preservation, and auto-download support).
|
|
57
|
+
- 🧩 **Plugin Architecture**: Modular architecture keeping the core bundle ultra-lightweight (tens of KBs) while allowing rich extensions like exports.
|
|
58
|
+
- 📷 **Image & PDF Export Plugin**: Full Gantt chart PNG image and multi-page PDF export powered by `@mogura/moguchart-plugin-export` (with automatic zoom normalization `normalizeZoom`, scroll position preservation, and auto-download support).
|
|
59
|
+
- 📊 **Excel Spreadsheet Export Plugin**: Styled Excel (.xlsx) schedule and timeline export powered by `@mogura/moguchart-plugin-excel` (multi-language support `ja`/`en`/`zh`, WBS hierarchy preservation, cell-shaded task duration bars, and holiday formatting).
|
|
59
60
|
- ✨ **Advanced Integration**:
|
|
60
61
|
- External drag & drop for task creation
|
|
61
62
|
- Task move / copy modes
|
|
62
63
|
- Snap feature (time unit grid snapping, automatic monthly boundary snap in month view)
|
|
63
64
|
- `hitTest` method for calculating row ID and datetime from screen coordinates
|
|
64
65
|
- Programmatic task selection + auto-scroll (`selectTask`)
|
|
66
|
+
- Smooth programmatic scroll to any specific task (`scrollToTask`)
|
|
65
67
|
- Row layout coordinates inspection (`getRowPositions`)
|
|
66
68
|
- 🌳 **WBS (Hierarchical Tree & Collapsible Rows)**:
|
|
67
69
|
- Unlimited parent-child hierarchy via `parentId`
|
|
@@ -70,9 +72,18 @@ A lightweight yet feature-rich Gantt chart Web Component built with Lit. Works s
|
|
|
70
72
|
- Configurable summary task bar colors (chart default `summaryColor` and row-level `summaryColor` overrides)
|
|
71
73
|
- Coexistence of summary task bars and normal tasks within parent rows (two-lane rendering)
|
|
72
74
|
- Configurable progress label display on summary task bars (`showSummaryLabel`)
|
|
75
|
+
- Automated opacity & dimmed styling linking when all child tasks are filtered out
|
|
73
76
|
- Collapsing seamlessly integrated with virtual scrolling and overview minimap
|
|
74
77
|
- Safe drag & drop reordering preserving hierarchy (prevents circular nesting, moves subtrees together)
|
|
75
78
|
- Programmatic expand/collapse methods (`toggleRowCollapse`, `collapseAll`, `expandAll`)
|
|
79
|
+
- 📈 **Baseline & Schedule Variance Tracking (Plan vs. Actual)**:
|
|
80
|
+
- Concurrent rendering of planned baseline schedules (`task.baseline`) and actual timelines within each row lane
|
|
81
|
+
- Three versatile placement layouts: smart split below actual bar (`bottom`), above (`top`), or behind (`overlay`)
|
|
82
|
+
- Delay highlighting: automatically marks delayed tasks (`task.end > baseline.end`) with an accent line indicator (`.task-delayed`)
|
|
83
|
+
- Rich tooltip integration with planned duration, progress, and delay/early schedule variance badges
|
|
84
|
+
- WBS parent summary aggregation of descendant task baselines
|
|
85
|
+
- Synchronized bird's-eye rendering on the overview minimap (2D Canvas)
|
|
86
|
+
- Helper functions for individual task variance (`calculateTaskDelay`) and project-wide statistics (`calculateProjectBaselineSummary`)
|
|
76
87
|
- ⌨️ **Keyboard Navigation & Shortcuts**: Arrow key navigation & selection, Shift + Arrow task movement, Delete / Backspace task & dependency deletion, Undo / Redo (`Ctrl+Z` / `Ctrl+Y`), and zoom controls.
|
|
77
88
|
|
|
78
89
|
## Packages (Ecosystem)
|
|
@@ -735,6 +746,55 @@ chart.addEventListener('row-toggle-collapse', (e) => {
|
|
|
735
746
|
})
|
|
736
747
|
```
|
|
737
748
|
|
|
749
|
+
### Baseline & Variance Tracking (Plan vs. Actual Comparison)
|
|
750
|
+
|
|
751
|
+
Configure baseline schedules on tasks (`task.baseline`) to compare planned dates and progress against actual performance side-by-side.
|
|
752
|
+
The layout seamlessly adapts without altering overall row heights or impacting virtual scrolling performance.
|
|
753
|
+
|
|
754
|
+
```javascript
|
|
755
|
+
import { calculateTaskDelay, calculateProjectBaselineSummary } from '@mogura/moguchart-core'
|
|
756
|
+
|
|
757
|
+
const rows = [
|
|
758
|
+
{
|
|
759
|
+
id: 'row-1',
|
|
760
|
+
name: 'Feature Engineering',
|
|
761
|
+
tasks: [
|
|
762
|
+
{
|
|
763
|
+
id: 'task-1',
|
|
764
|
+
name: 'UI Implementation',
|
|
765
|
+
start: new Date('2026-04-01'),
|
|
766
|
+
end: new Date('2026-04-14'), // Actual: extended to April 14
|
|
767
|
+
progress: 80,
|
|
768
|
+
baseline: {
|
|
769
|
+
start: new Date('2026-04-01'),
|
|
770
|
+
end: new Date('2026-04-10'), // Planned: scheduled for April 10 (4 days delay)
|
|
771
|
+
progress: 100,
|
|
772
|
+
},
|
|
773
|
+
},
|
|
774
|
+
],
|
|
775
|
+
},
|
|
776
|
+
]
|
|
777
|
+
|
|
778
|
+
const option = {
|
|
779
|
+
baseline: {
|
|
780
|
+
enabled: true, // Enable baseline rendering (default: false)
|
|
781
|
+
position: 'bottom', // 'bottom' (split below) | 'top' (above) | 'overlay' (layered behind)
|
|
782
|
+
highlightDelay: true, // Highlight tasks where actual end exceeds baseline end (default: true)
|
|
783
|
+
delayColor: '#ef4444', // Highlight color for delayed tasks
|
|
784
|
+
showTooltip: true, // Show baseline dates and delay variance in tooltips (default: true)
|
|
785
|
+
autoSummary: true, // Automatically aggregate child baselines in WBS parent summary rows (default: true)
|
|
786
|
+
},
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
// Calculate delay or early completion for an individual task
|
|
790
|
+
const delayInfo = calculateTaskDelay(rows[0].tasks[0])
|
|
791
|
+
console.log(`Is delayed: ${delayInfo.isDelayed}, Delay in days: ${delayInfo.delayDays}`)
|
|
792
|
+
|
|
793
|
+
// Aggregate project-wide baseline statistics
|
|
794
|
+
const summary = calculateProjectBaselineSummary(rows)
|
|
795
|
+
console.log(`Total: ${summary.totalBaselineTasks}, Delayed: ${summary.delayedTasksCount}, Max delay: ${summary.maxDelayDays} days`)
|
|
796
|
+
```
|
|
797
|
+
|
|
738
798
|
### Public Methods
|
|
739
799
|
|
|
740
800
|
#### selectTask
|
|
@@ -759,6 +819,26 @@ document.addEventListener('mousemove', (e) => {
|
|
|
759
819
|
})
|
|
760
820
|
```
|
|
761
821
|
|
|
822
|
+
#### scrollToTask
|
|
823
|
+
|
|
824
|
+
Smoothly scrolls the Gantt chart container so that the specified task comes into view (centered vertically, with row header width and an extra 40px margin applied horizontally).
|
|
825
|
+
|
|
826
|
+
```javascript
|
|
827
|
+
chart.scrollToTask('task-1')
|
|
828
|
+
```
|
|
829
|
+
|
|
830
|
+
#### scrollToPosition / resetScroll
|
|
831
|
+
|
|
832
|
+
Scrolls to specific coordinates or resets scroll back to origin.
|
|
833
|
+
|
|
834
|
+
```javascript
|
|
835
|
+
// Smooth scroll to position
|
|
836
|
+
chart.scrollToPosition({ left: 400, top: 200, behavior: 'smooth' })
|
|
837
|
+
|
|
838
|
+
// Reset scroll to top-left (0, 0)
|
|
839
|
+
chart.resetScroll()
|
|
840
|
+
```
|
|
841
|
+
|
|
762
842
|
#### Export Plugin (`@mogura/moguchart-plugin-export`)
|
|
763
843
|
|
|
764
844
|
Export the entire Gantt chart to a PNG image or PDF document. The export feature is packaged as a dedicated modular plugin (`@mogura/moguchart-plugin-export`) to keep the core bundle ultra-lightweight.
|
|
@@ -35,6 +35,8 @@ export declare class GanttBarElement extends LitElement {
|
|
|
35
35
|
private onMouseMoveOnBar;
|
|
36
36
|
private onMouseEnter;
|
|
37
37
|
private onMouseLeave;
|
|
38
|
+
private onBaselineMouseEnter;
|
|
39
|
+
private onBaselineMouseLeave;
|
|
38
40
|
private onDblClick;
|
|
39
41
|
private onClick;
|
|
40
42
|
private onConnectorDragStart;
|
package/dist/core/i18n.d.ts
CHANGED
|
@@ -33,6 +33,14 @@ export interface MoguchartLocale {
|
|
|
33
33
|
duration: (days: number) => string;
|
|
34
34
|
/** 進捗率の表示 (例: 75 → "進捗: 75%" / "Progress: 75%") (オプション) */
|
|
35
35
|
progress?: (percent: number) => string;
|
|
36
|
+
/** ベースラインの表示 (例: "計画: 2024/1/1 - 2024/1/10 (10日)") */
|
|
37
|
+
baseline?: (startStr: string, endStr: string, days: number) => string;
|
|
38
|
+
/** 遅延の表示 (例: "+3日遅れ" / "+3 days delay") */
|
|
39
|
+
delay?: (days: number) => string;
|
|
40
|
+
/** 前倒しの表示 (例: "-2日前倒し" / "2 days ahead") */
|
|
41
|
+
ahead?: (days: number) => string;
|
|
42
|
+
/** 計画通りの表示 (例: "計画通り" / "On schedule") */
|
|
43
|
+
onSchedule?: string;
|
|
36
44
|
};
|
|
37
45
|
/** ドラッグオーバーレイの文字列 */
|
|
38
46
|
dragOverlay: {
|
package/dist/core/types.d.ts
CHANGED
|
@@ -47,6 +47,23 @@ export interface GanttMarker {
|
|
|
47
47
|
/** マーカーのカスタムスタイル (CSS文字列) */
|
|
48
48
|
style?: string;
|
|
49
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* タスクの当初計画(ベースライン)を表すインターフェース
|
|
52
|
+
*/
|
|
53
|
+
export interface GanttTaskBaseline {
|
|
54
|
+
/** 計画開始日時 */
|
|
55
|
+
start: Date;
|
|
56
|
+
/** 計画終了日時 */
|
|
57
|
+
end: Date;
|
|
58
|
+
/** 計画進捗率 (0〜100、省略可能) */
|
|
59
|
+
progress?: number;
|
|
60
|
+
/** ベースラインバーのカスタムスタイル (CSS文字列) */
|
|
61
|
+
style?: string;
|
|
62
|
+
/** ベースラインバーのカスタム色 (CSSカラー文字列) */
|
|
63
|
+
color?: string;
|
|
64
|
+
/** ベースライン名またはメモ(省略可能) */
|
|
65
|
+
name?: string;
|
|
66
|
+
}
|
|
50
67
|
/**
|
|
51
68
|
* ガントチャート上の個々のタスクを表すインターフェース
|
|
52
69
|
*/
|
|
@@ -87,6 +104,8 @@ export interface GanttTask {
|
|
|
87
104
|
progressResizable?: boolean;
|
|
88
105
|
/** タスクの種別 ('task': 通常, 'summary': 親サマリー集計バー, 'milestone': マイルストーン) */
|
|
89
106
|
type?: 'task' | 'summary' | 'milestone';
|
|
107
|
+
/** 当初計画(ベースライン)の日程情報 */
|
|
108
|
+
baseline?: GanttTaskBaseline;
|
|
90
109
|
}
|
|
91
110
|
/**
|
|
92
111
|
* ガントチャートの行を表すインターフェース
|
|
@@ -418,6 +437,36 @@ export interface GanttChartOption {
|
|
|
418
437
|
plugins?: GanttPlugin[];
|
|
419
438
|
/** 操作履歴・Undo/Redoの設定 */
|
|
420
439
|
history?: GanttChartOptionHistory;
|
|
440
|
+
/** 予実管理(ベースライン)の設定 */
|
|
441
|
+
baseline?: GanttChartOptionBaseline;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* ベースライン(予実管理)機能に関するオプション
|
|
445
|
+
*/
|
|
446
|
+
export interface GanttChartOptionBaseline {
|
|
447
|
+
/** ベースライン表示を有効にするかどうか (デフォルト: false) */
|
|
448
|
+
enabled?: boolean;
|
|
449
|
+
/**
|
|
450
|
+
* ベースラインバーの配置位置
|
|
451
|
+
* - 'bottom': 実績タスクバーの下部に配置(デフォルト)
|
|
452
|
+
* - 'top': 実績タスクバーの上部に配置
|
|
453
|
+
* - 'overlay': 実績タスクバーと重なるように背後に配置
|
|
454
|
+
*/
|
|
455
|
+
position?: 'bottom' | 'top' | 'overlay';
|
|
456
|
+
/** ベースラインバーの高さ (px)。未指定時は自動計算(bottom/top時は 6px程度、overlay時は barHeight と同等) */
|
|
457
|
+
height?: number;
|
|
458
|
+
/** ベースラインバーのデフォルト色 (CSSカラー文字列、デフォルト: '#94a3b8') */
|
|
459
|
+
color?: string;
|
|
460
|
+
/** ベースラインバーの角丸半径 (px)。未指定時は 2px */
|
|
461
|
+
cornerRadius?: number;
|
|
462
|
+
/** 遅延タスク(実績終了日 > 計画終了日)のハイライトを行うかどうか (デフォルト: true) */
|
|
463
|
+
highlightDelay?: boolean;
|
|
464
|
+
/** 遅延ハイライト時の強調色 (CSSカラー文字列、デフォルト: '#ef4444') */
|
|
465
|
+
delayColor?: string;
|
|
466
|
+
/** ツールチップに計画日程と遅延日数を表示するかどうか (デフォルト: true) */
|
|
467
|
+
showTooltip?: boolean;
|
|
468
|
+
/** サマリータスク(親行)のベースラインを配下タスクから自動計算するかどうか (デフォルト: true) */
|
|
469
|
+
autoSummary?: boolean;
|
|
421
470
|
}
|
|
422
471
|
/**
|
|
423
472
|
* ズーム機能に関するオプション
|
|
@@ -725,6 +774,8 @@ export interface RowHeaderDblClickEventDetail {
|
|
|
725
774
|
event: MouseEvent;
|
|
726
775
|
/** ダブルクリックされたヘッダー要素 */
|
|
727
776
|
target: HTMLElement;
|
|
777
|
+
/** ダブルクリックされた行名コンテンツ要素(インデントやトグルアイコンを除いた領域) */
|
|
778
|
+
contentTarget?: HTMLElement;
|
|
728
779
|
}
|
|
729
780
|
/**
|
|
730
781
|
* 行ヘッダー右クリックイベントの詳細
|
package/dist/core/utils.d.ts
CHANGED
|
@@ -82,3 +82,30 @@ export declare function calculateWeightedRowProgress(rowOrTasks: GanttRow | Gant
|
|
|
82
82
|
* @returns プロジェクト全体の加重平均進捗率 (0〜100)
|
|
83
83
|
*/
|
|
84
84
|
export declare function calculateProjectProgress(rows: GanttRow[]): number;
|
|
85
|
+
/**
|
|
86
|
+
* タスクの当初計画(ベースライン)に対する遅延・前倒し状況を計算します。
|
|
87
|
+
*
|
|
88
|
+
* @param task 対象タスク
|
|
89
|
+
* @returns 遅延状況オブジェクト
|
|
90
|
+
*/
|
|
91
|
+
export declare function calculateTaskDelay(task: GanttTask): {
|
|
92
|
+
isDelayed: boolean;
|
|
93
|
+
delayMs: number;
|
|
94
|
+
delayDays: number;
|
|
95
|
+
isAhead: boolean;
|
|
96
|
+
aheadMs: number;
|
|
97
|
+
aheadDays: number;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* プロジェクト全体(全行)のベースラインに対する進捗・遅延の要約を計算します。
|
|
101
|
+
*
|
|
102
|
+
* @param rows ガントチャートの全行
|
|
103
|
+
* @returns 要約統計オブジェクト
|
|
104
|
+
*/
|
|
105
|
+
export declare function calculateProjectBaselineSummary(rows: GanttRow[]): {
|
|
106
|
+
totalBaselineTasks: number;
|
|
107
|
+
delayedTasksCount: number;
|
|
108
|
+
aheadTasksCount: number;
|
|
109
|
+
onScheduleTasksCount: number;
|
|
110
|
+
maxDelayDays: number;
|
|
111
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export * from './core/patterns';
|
|
|
9
9
|
export * from './core/i18n';
|
|
10
10
|
export * from './core/plugin';
|
|
11
11
|
export * from './core/history';
|
|
12
|
-
export { clampProgress, calculateRowProgress, calculateWeightedRowProgress, calculateProjectProgress, getThemeColors, } from './core/utils';
|
|
12
|
+
export { clampProgress, calculateRowProgress, calculateWeightedRowProgress, calculateProjectProgress, calculateTaskDelay, calculateProjectBaselineSummary, getThemeColors, } from './core/utils';
|
|
13
13
|
export { computeCriticalPath } from './core/critical-path';
|
|
14
14
|
export { computeRowLevels, computeRowWbsCodes, computeChildRowIds, computeVisibleTreeRows, computeSummaryTask, canDropRow, } from './core/wbs';
|