Skip to content

Conversation

@yawn-c111
Copy link
Collaborator

@yawn-c111 yawn-c111 commented Nov 27, 2025

概要

グラフ表示で使用する共通コンポーネントを追加しました。

関連イシュー

追加したコンポーネント

  • GraphContainer - グラフをラップするレイアウトコンテナ
  • EChartsGraph - EChartsグラフ描画コンポーネント(SSR対策済み)
  • GraphStatusFilter - ステータスフィルター(全て/公開中/評価中/非公開)
  • GraphSizeLegend - バブルサイズの凡例(インプレッション等)

追加したライブラリ

  • echarts: 6.0.0
  • echarts-for-react: 3.0.2

定数

  • STATUS_COLORS - ステータス別の色定義
  • GRAPH_STYLES - ECharts用のスタイル定数

その他

  • app.css にグラフボーダー用のCSS変数を追加
  • テスト用ページ(test.tsx, test2.tsx)を追加

実装結果

image

…nd update GraphContainer to use children for flexibility
…ponents and update GraphStatusFilter to remove unused prop
@vercel
Copy link

vercel bot commented Nov 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
birdxplorer-viewer Ready Ready Preview Comment Nov 27, 2025 0:18am

…le breakpoint handling and adjusting layouts in GraphContainer, GraphSizeLegend, and GraphStatusFilter
Copy link
Collaborator

@kur00 kur00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

対応ありがとうございます!

Comment on lines +32 to +39
// クライアントサイドでのみecharts-for-reactをロード(SSR対策)
useEffect(() => {
const loadECharts = async () => {
const mod = await import("echarts-for-react");
setReactECharts(() => mod.default);
};
void loadECharts();
}, []);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

期間選択などの動的なデータローディングの関係でフロントでやっている感じですか?

Comment on lines +8 to +23
/** ラベルテキスト(例: "インプレッション") */
label: string;
/** 最小値 */
min: number;
/** 最大値 */
max: number;
/** 表示するステップ数(デフォルト: 5) */
steps?: number;
/** 値のフォーマット関数 */
formatValue?: (value: number) => string;
/** バブルの最小サイズ(px)(デフォルト: 8) */
minBubbleSize?: number;
/** バブルの最大サイズ(px)(デフォルト: 32) */
maxBubbleSize?: number;
/** バブルの色(デフォルト: "#666") */
bubbleColor?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここら辺、コード見たら大体わかるやつはコメント無しでいいっすよ!
デフォルト情報とかも次のコード見たらわかるので!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

逆にstepsとかどういうステップなのかあると良いかもっすね。折れ線以外にも当てはまるやつですよね?色々、考えちゃいそうで

Comment on lines +1 to +31
/**
* ステータスカラー定数
* グラフやフィルターコンポーネントで使用
*/
export const STATUS_COLORS = {
published: "#42a5f5",
evaluating: "#ab47bc",
unpublished: "#ec407a",
} as const;

export type StatusColorKey = keyof typeof STATUS_COLORS;

/**
* グラフスタイル定数
* EChartsはCanvas/SVGベースのためCSS変数が使えないので、ここで定義
*/
export const GRAPH_STYLES = {
/** テキスト色(軸ラベル、凡例など) */
textColor: "#999999",
/** 軸線の色 */
axisColor: "#666666",
/** グリッド線の色 */
gridColor: "#333333",
/** ボーダー色 */
borderColor: "#555555",
/** ツールチップ背景色 */
tooltipBgColor: "rgba(30, 30, 30, 0.9)",
/** ツールチップボーダー色 */
tooltipBorderColor: "#444444",
} as const;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここら辺、良いっすね!
constantsディレクトリに収めちゃっても良いなとも思いました!
そしたら、コンポーネントとその他で分離ができるかと

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そうなんですよね!
実は次の #218 の作業をやってる最中にそれに気が付きましたorz
なので、一旦マージしてからリファクタリングするしかないかなぁと考えております…!

Comment on lines +27 to +34
/** 現在選択中のステータス */
value: StatusValue;
/** ステータス変更時のコールバック */
onChange: (value: StatusValue) => void;
/** カスタムステータス設定 */
statuses?: StatusConfig[];
/** ラベルテキスト(デフォルト: "ステータス") */
label?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここのコメントもそうですね!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants