- 知识库页拆分出 wiki 组件(侧边栏/目录树/Markdown 阅读器等) - 知识图谱页拆分出 knowledge-graph 组件并增强交互 - 新增发布广场选择弹窗 publish-square-picker-dialog - config.yaml 新增 MiniMax-M2.5 / Ling-flash-2.0 / DeepSeek-V4-Pro 模型 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
58 lines
1.7 KiB
TypeScript
58 lines
1.7 KiB
TypeScript
import type { NodeKind } from "./graphTypes";
|
|
import { getEdgeInfo, NODE_KIND_META, NODE_KIND_ORDER } from "./graphUtils";
|
|
|
|
interface GraphFooterProps {
|
|
nodeKindCounts: Map<NodeKind, number>;
|
|
edgeLabels: string[];
|
|
zoomLevel: number;
|
|
selectedTitle: string | null;
|
|
visibleNodes: number;
|
|
visibleEdges: number;
|
|
}
|
|
|
|
export function GraphFooter(props: GraphFooterProps) {
|
|
const kinds = NODE_KIND_ORDER.filter((k) => (props.nodeKindCounts.get(k) ?? 0) > 0);
|
|
|
|
return (
|
|
<footer className="kg-footer">
|
|
<div className="kg-legend">
|
|
{kinds.map((kind) => (
|
|
<span key={kind} className="kg-legend-item">
|
|
<span
|
|
className="kg-legend-dot"
|
|
style={{ background: NODE_KIND_META[kind].color }}
|
|
/>
|
|
{NODE_KIND_META[kind].label}
|
|
</span>
|
|
))}
|
|
{props.edgeLabels.slice(0, 6).map((label) => {
|
|
const info = getEdgeInfo(label);
|
|
return (
|
|
<span key={label} className="kg-legend-item">
|
|
<span
|
|
className="kg-legend-line"
|
|
style={{
|
|
borderTopColor: info.color,
|
|
borderTopStyle: info.dashed ? "dashed" : "solid",
|
|
}}
|
|
/>
|
|
{info.zh}
|
|
</span>
|
|
);
|
|
})}
|
|
</div>
|
|
<div className="kg-footer-status">
|
|
{props.selectedTitle ? (
|
|
<span className="kg-footer-selected" title={props.selectedTitle}>
|
|
选中:{props.selectedTitle}
|
|
</span>
|
|
) : null}
|
|
<span>
|
|
显示 {props.visibleNodes} 节点 · {props.visibleEdges} 关系
|
|
</span>
|
|
<span>缩放 {Math.round(props.zoomLevel * 100)}%</span>
|
|
</div>
|
|
</footer>
|
|
);
|
|
}
|