@mogura/moguchart-core 0.9.1 → 0.11.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/README.en.md +1 -0
- package/README.md +1 -0
- package/dist/components/gantt-bar.d.ts +1 -0
- package/dist/components/gantt-chart.d.ts +5 -0
- package/dist/components/gantt-minimap.d.ts +105 -0
- package/dist/core/types.d.ts +92 -0
- package/dist/index.d.ts +1 -0
- package/dist/moguchart-core.mjs +1052 -211
- package/dist/moguchart-core.umd.js +400 -8
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -32,6 +32,7 @@ A lightweight yet feature-rich Gantt chart Web Component built with Lit. Works w
|
|
|
32
32
|
- Locale support (Japanese, English, and custom locales)
|
|
33
33
|
- 🏁 **Milestones**: Display milestones (vertical line + name badge) on the chart
|
|
34
34
|
- 📍 **Markers**: Show triangle icons with labels on row timelines
|
|
35
|
+
- 🗺️ **Overview Minimap**: Bird's-eye preview of the entire chart, interactive pan & scroll synchronization, click-to-jump, and collapsible floating window
|
|
35
36
|
- ✨ **Advanced Integration**:
|
|
36
37
|
- External drag & drop for task creation
|
|
37
38
|
- Task move/copy mode
|
package/README.md
CHANGED
|
@@ -32,6 +32,7 @@ Vue, React, Angular, Svelte など、どのフレームワークでも動作す
|
|
|
32
32
|
- ロケール対応(日本語・英語、カスタムロケールも可能)
|
|
33
33
|
- 🏁 **マイルストーン**: チャート上にマイルストーン(縦線+名前バッジ)を表示
|
|
34
34
|
- 📍 **マーカー**: 行のタイムライン上に三角形アイコンとラベルで目印を表示
|
|
35
|
+
- 🗺️ **ミニマップ(Overview Minimap)**: チャート全体の鳥瞰プレビュー表示、ドラッグによるスクロール同期・パン操作、クリックジャンプ、折りたたみ対応
|
|
35
36
|
- ✨ **高度な連携**:
|
|
36
37
|
- 外部からのドラッグ&ドロップによるタスク作成
|
|
37
38
|
- タスクの移動/コピーモード
|
|
@@ -2,6 +2,7 @@ import type { GanttChartOption, GanttRow, GanttTask } from '../core/types';
|
|
|
2
2
|
import { LitElement, type PropertyValues } from 'lit';
|
|
3
3
|
import './gantt-calendar';
|
|
4
4
|
import './gantt-row';
|
|
5
|
+
import './gantt-minimap';
|
|
5
6
|
import { type ExportImageOptions } from './gantt-chart-export';
|
|
6
7
|
export declare class GanttChartElement extends LitElement {
|
|
7
8
|
rows: GanttRow[];
|
|
@@ -14,6 +15,9 @@ export declare class GanttChartElement extends LitElement {
|
|
|
14
15
|
private selectedTasks;
|
|
15
16
|
private lastClickedRowId;
|
|
16
17
|
private virtualScrollTop;
|
|
18
|
+
private currentScrollLeft;
|
|
19
|
+
private currentScrollTop;
|
|
20
|
+
private viewportWidth;
|
|
17
21
|
private dragTargetRowIndex;
|
|
18
22
|
private draggingTask;
|
|
19
23
|
private draggingTaskIds;
|
|
@@ -77,6 +81,7 @@ export declare class GanttChartElement extends LitElement {
|
|
|
77
81
|
private stopCurrentTimeTimer;
|
|
78
82
|
private handleHeaderResizeStart;
|
|
79
83
|
private handleScroll;
|
|
84
|
+
private handleMinimapScroll;
|
|
80
85
|
private updateScrollTop;
|
|
81
86
|
private handleContainerMouseMove;
|
|
82
87
|
private handleContainerMouseLeave;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { LitElement, type PropertyValues } from 'lit';
|
|
2
|
+
import type { GanttChartOption, GanttRow, MinimapCollapseEventDetail, MinimapMoveEventDetail, MinimapResizeEventDetail } from '../core/types';
|
|
3
|
+
/**
|
|
4
|
+
* ミニマップスクロールイベントの詳細データ
|
|
5
|
+
*/
|
|
6
|
+
export interface MinimapScrollEventDetail {
|
|
7
|
+
scrollLeft: number;
|
|
8
|
+
scrollTop: number;
|
|
9
|
+
}
|
|
10
|
+
export type { MinimapCollapseEventDetail, MinimapMoveEventDetail, MinimapResizeEventDetail };
|
|
11
|
+
/**
|
|
12
|
+
* ガントチャートの全体俯瞰およびナビゲーションを行うフローティング小窓コンポーネント
|
|
13
|
+
*/
|
|
14
|
+
export declare class GanttMinimapElement extends LitElement {
|
|
15
|
+
rows: GanttRow[];
|
|
16
|
+
option: GanttChartOption;
|
|
17
|
+
theme: 'light' | 'dark';
|
|
18
|
+
scrollLeft: number;
|
|
19
|
+
scrollTop: number;
|
|
20
|
+
viewportWidth: number;
|
|
21
|
+
viewportHeight: number;
|
|
22
|
+
contentWidth: number;
|
|
23
|
+
contentHeight: number;
|
|
24
|
+
calendarHeight: number;
|
|
25
|
+
rowHeaderWidth: number;
|
|
26
|
+
currentTime: Date;
|
|
27
|
+
private isCollapsed;
|
|
28
|
+
private isDragging;
|
|
29
|
+
private isHeaderDragging;
|
|
30
|
+
private isResizing;
|
|
31
|
+
private customWidth;
|
|
32
|
+
private customHeight;
|
|
33
|
+
private position;
|
|
34
|
+
private canvasEl?;
|
|
35
|
+
private dragStartX;
|
|
36
|
+
private dragStartY;
|
|
37
|
+
private dragStartScrollLeft;
|
|
38
|
+
private dragStartScrollTop;
|
|
39
|
+
private headerDragStartX;
|
|
40
|
+
private headerDragStartY;
|
|
41
|
+
private headerDragOriginRight;
|
|
42
|
+
private headerDragOriginBottom;
|
|
43
|
+
private resizeHandleType;
|
|
44
|
+
private resizeStartPointerX;
|
|
45
|
+
private resizeStartPointerY;
|
|
46
|
+
private resizeStartWidth;
|
|
47
|
+
private resizeStartHeight;
|
|
48
|
+
private resizeStartOriginRight;
|
|
49
|
+
private resizeStartOriginBottom;
|
|
50
|
+
private lastParentWidth;
|
|
51
|
+
private lastParentHeight;
|
|
52
|
+
private lastMinimapWidth;
|
|
53
|
+
private lastMinimapHeight;
|
|
54
|
+
private parentResizeObserver;
|
|
55
|
+
static styles: import("lit").CSSResult;
|
|
56
|
+
connectedCallback(): void;
|
|
57
|
+
private initPositionFromOption;
|
|
58
|
+
firstUpdated(changedProperties: PropertyValues): void;
|
|
59
|
+
disconnectedCallback(): void;
|
|
60
|
+
private getParentTarget;
|
|
61
|
+
private getParentDimensions;
|
|
62
|
+
private setupParentResizeObserver;
|
|
63
|
+
private handleParentResize;
|
|
64
|
+
willUpdate(changedProperties: PropertyValues): void;
|
|
65
|
+
updated(changedProperties: PropertyValues): void;
|
|
66
|
+
private updateHostPosition;
|
|
67
|
+
private handleHeaderPointerDown;
|
|
68
|
+
private handleHeaderPointerMove;
|
|
69
|
+
private handleHeaderPointerUp;
|
|
70
|
+
private get isResizable();
|
|
71
|
+
private get minMinimapWidth();
|
|
72
|
+
private get maxMinimapWidth();
|
|
73
|
+
private get minMinimapHeight();
|
|
74
|
+
private get baseMinimapWidth();
|
|
75
|
+
private get baseMinimapHeight();
|
|
76
|
+
private get maxMinimapHeight();
|
|
77
|
+
private get preserveAspectRatio();
|
|
78
|
+
/**
|
|
79
|
+
* アスペクト比維持(等倍スケーリング)時の共通スケール
|
|
80
|
+
* baseMinimapWidth x baseMinimapHeight の最大バウンディングボックスに収まる最大の等倍縮尺
|
|
81
|
+
*/
|
|
82
|
+
private get uniformScale();
|
|
83
|
+
private get scaleX();
|
|
84
|
+
private get scaleY();
|
|
85
|
+
private get minimapWidth();
|
|
86
|
+
private get minimapHeight();
|
|
87
|
+
private handleResizePointerDown;
|
|
88
|
+
private handleResizePointerMove;
|
|
89
|
+
private handleResizePointerUp;
|
|
90
|
+
private get effectiveContentWidth();
|
|
91
|
+
private get effectiveContentHeight();
|
|
92
|
+
private renderCanvas;
|
|
93
|
+
private handleBodyPointerDown;
|
|
94
|
+
private handleViewportPointerDown;
|
|
95
|
+
private handleViewportPointerMove;
|
|
96
|
+
private handleViewportPointerUp;
|
|
97
|
+
private dispatchScroll;
|
|
98
|
+
private toggleCollapse;
|
|
99
|
+
render(): import("lit").TemplateResult<1>;
|
|
100
|
+
}
|
|
101
|
+
declare global {
|
|
102
|
+
interface HTMLElementTagNameMap {
|
|
103
|
+
'gantt-minimap': GanttMinimapElement;
|
|
104
|
+
}
|
|
105
|
+
}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -355,6 +355,8 @@ export interface GanttChartOption {
|
|
|
355
355
|
customTheme?: Partial<ThemeColorPalette>;
|
|
356
356
|
/** 行の並び替えを有効にするかどうか */
|
|
357
357
|
enableRowReordering?: boolean;
|
|
358
|
+
/** タスクの行間移動を有効にするかどうか (デフォルト: true) */
|
|
359
|
+
enableCrossRowMove?: boolean;
|
|
358
360
|
/** スナップする時間単位(分)。デフォルトは1440(1日) */
|
|
359
361
|
snapDuration?: number;
|
|
360
362
|
/** 非表示に設定された行を表示するかどうか (デフォルト: false) */
|
|
@@ -383,6 +385,76 @@ export interface GanttChartOption {
|
|
|
383
385
|
/** ホイール1回あたりのズーム倍率 (デフォルト: 1.2) */
|
|
384
386
|
step?: number;
|
|
385
387
|
};
|
|
388
|
+
/** ミニマップ(Overview Minimap)機能の設定 */
|
|
389
|
+
minimap?: GanttChartOptionMinimap;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* ミニマップ(Overview Minimap)に関するオプション
|
|
393
|
+
*/
|
|
394
|
+
export interface GanttChartOptionMinimap {
|
|
395
|
+
/** ミニマップを表示するかどうか (デフォルト: false) */
|
|
396
|
+
enabled?: boolean;
|
|
397
|
+
/** ミニマップの幅 (px)。デフォルト: 200 */
|
|
398
|
+
width?: number;
|
|
399
|
+
/** ミニマップの高さ (px)。デフォルト: 120 */
|
|
400
|
+
height?: number;
|
|
401
|
+
/** 縦横比維持時の最大高さ (px)。デフォルト: height または 120 */
|
|
402
|
+
maxHeight?: number;
|
|
403
|
+
/** ガントチャートコンテンツの縦横比(アスペクト比)に合わせて描画するかどうか (デフォルト: true) */
|
|
404
|
+
preserveAspectRatio?: boolean;
|
|
405
|
+
/** ユーザーによるドラッグリサイズ(サイズ変更)を許可するかどうか (デフォルト: true) */
|
|
406
|
+
resizable?: boolean;
|
|
407
|
+
/** リサイズ時の最小幅 (px)。デフォルト: 120 */
|
|
408
|
+
minWidth?: number;
|
|
409
|
+
/** リサイズ時の最大幅 (px)。デフォルト: 600 */
|
|
410
|
+
maxWidth?: number;
|
|
411
|
+
/** リサイズ時の最小高さ (px)。デフォルト: 60 */
|
|
412
|
+
minHeight?: number;
|
|
413
|
+
/** 折りたたみ(最小化)ボタンを表示するかどうか (デフォルト: true) */
|
|
414
|
+
collapsible?: boolean;
|
|
415
|
+
/** 初期状態で折りたたまれているかどうか (デフォルト: false) */
|
|
416
|
+
collapsed?: boolean;
|
|
417
|
+
/** マイルストーンを表示するかどうか (デフォルト: true) */
|
|
418
|
+
showMilestones?: boolean;
|
|
419
|
+
/** 現在時刻線を表示するかどうか (デフォルト: true) */
|
|
420
|
+
showCurrentTime?: boolean;
|
|
421
|
+
/** ミニマップの初期位置(親要素に対する右下基準の座標 px) */
|
|
422
|
+
position?: MinimapPosition;
|
|
423
|
+
/** ミニマップの不透明度 (0.1 〜 1.0)。デフォルト: 1.0 */
|
|
424
|
+
opacity?: number;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* ミニマップの表示位置(親要素の右端・下端からのオフセット距離 px)
|
|
428
|
+
*/
|
|
429
|
+
export interface MinimapPosition {
|
|
430
|
+
/** 親要素の右端からミニマップ右端までの距離 (px) */
|
|
431
|
+
right: number;
|
|
432
|
+
/** 親要素の下端からミニマップ下端までの距離 (px) */
|
|
433
|
+
bottom: number;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* ミニマップの移動イベントの詳細データ
|
|
437
|
+
*/
|
|
438
|
+
export interface MinimapMoveEventDetail {
|
|
439
|
+
/** 親要素の右端からミニマップ右端までの距離 (px) */
|
|
440
|
+
right: number;
|
|
441
|
+
/** 親要素の下端からミニマップ下端までの距離 (px) */
|
|
442
|
+
bottom: number;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* ミニマップのリサイズイベントの詳細データ
|
|
446
|
+
*/
|
|
447
|
+
export interface MinimapResizeEventDetail {
|
|
448
|
+
width: number;
|
|
449
|
+
height: number;
|
|
450
|
+
position?: MinimapPosition;
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* ミニマップの折りたたみ(最小化)イベントの詳細データ
|
|
454
|
+
*/
|
|
455
|
+
export interface MinimapCollapseEventDetail {
|
|
456
|
+
/** 最小化されているかどうか */
|
|
457
|
+
collapsed: boolean;
|
|
386
458
|
}
|
|
387
459
|
/**
|
|
388
460
|
* タスク更新イベントの詳細データ
|
|
@@ -400,10 +472,20 @@ export interface TaskUpdateEventDetail extends GanttTask {
|
|
|
400
472
|
x?: number;
|
|
401
473
|
/** マウスのY座標(ドラッグ中のみ) */
|
|
402
474
|
y?: number;
|
|
475
|
+
/** タスクバーの中心X座標(ドラッグ中のみ) */
|
|
476
|
+
barX?: number;
|
|
477
|
+
/** タスクバーの上端Y座標(ドラッグ中のみ) */
|
|
478
|
+
barTop?: number;
|
|
479
|
+
/** タスクバーの下端Y座標(ドラッグ中のみ) */
|
|
480
|
+
barBottom?: number;
|
|
403
481
|
/** タスク移動モード(move/copy) */
|
|
404
482
|
mode: GanttTaskMoveMode;
|
|
405
483
|
/** 複数選択移動時の対象タスクID配列 */
|
|
406
484
|
selectedTaskIds?: string[];
|
|
485
|
+
/** ガントチャート外にカーソルがあるかどうか */
|
|
486
|
+
isOutside?: boolean;
|
|
487
|
+
/** ドラッグがキャンセルされたかどうか */
|
|
488
|
+
isCancel?: boolean;
|
|
407
489
|
}
|
|
408
490
|
/**
|
|
409
491
|
* バーのホバーイベント詳細
|
|
@@ -590,6 +672,16 @@ export interface ThemeColorPalette {
|
|
|
590
672
|
friday?: string;
|
|
591
673
|
/** クリティカルパスの色 (オプション) */
|
|
592
674
|
criticalPath?: string;
|
|
675
|
+
/** ミニマップの背景色 (オプション) */
|
|
676
|
+
minimapBg?: string;
|
|
677
|
+
/** ミニマップの枠線色 (オプション) */
|
|
678
|
+
minimapBorder?: string;
|
|
679
|
+
/** ミニマップのビューポート枠背景色 (オプション) */
|
|
680
|
+
minimapViewport?: string;
|
|
681
|
+
/** ミニマップのビューポート枠ボーダー色 (オプション) */
|
|
682
|
+
minimapViewportBorder?: string;
|
|
683
|
+
/** ミニマップのタスク描画色 (オプション) */
|
|
684
|
+
minimapTask?: string;
|
|
593
685
|
}
|
|
594
686
|
/**
|
|
595
687
|
* テーマセット (light/dark)
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './components/gantt-bar';
|
|
|
2
2
|
export * from './components/gantt-calendar';
|
|
3
3
|
export * from './components/gantt-chart';
|
|
4
4
|
export * from './components/gantt-row';
|
|
5
|
+
export * from './components/gantt-minimap';
|
|
5
6
|
export * from './core/types';
|
|
6
7
|
export * from './core/patterns';
|
|
7
8
|
export * from './core/i18n';
|