mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-07 08:26:15 +00:00
add support for merges relation in the graph (#590)
new relation called "merges" we use orange dashed line to represent it works just like how extends, updates, etc are displayed
This commit is contained in:
parent
47a2179208
commit
bb3ab0271e
5 changed files with 10 additions and 4 deletions
|
|
@ -241,7 +241,8 @@ export const GraphCanvas = memo<GraphCanvasProps>(
|
|||
connectionColor = colors.connection.medium;
|
||||
} else if (edge.edgeType === "version") {
|
||||
// Version chains: Double line effect with relation-specific colors
|
||||
dashPattern = [];
|
||||
// Special dashed pattern for "merges" relation
|
||||
dashPattern = edge.relationType === "merges" ? [8, 4] : [];
|
||||
connectionColor = edge.color || colors.relations.updates;
|
||||
opacity = 0.8;
|
||||
lineWidth = 2;
|
||||
|
|
|
|||
|
|
@ -229,11 +229,15 @@ export const Legend = memo(function Legend({
|
|||
["updates", colors.relations.updates],
|
||||
["extends", colors.relations.extends],
|
||||
["derives", colors.relations.derives],
|
||||
["merges", colors.relations.merges],
|
||||
].map(([label, color]) => (
|
||||
<div className={styles.legendItem} key={label}>
|
||||
<div
|
||||
className={styles.relationLine}
|
||||
style={{ borderColor: color }}
|
||||
style={{
|
||||
borderColor: color,
|
||||
borderStyle: label === "merges" ? "dashed" : "solid"
|
||||
}}
|
||||
/>
|
||||
<span
|
||||
className={styles.legendText}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ export const colors = {
|
|||
updates: "rgba(147, 77, 253, 0.5)", // purple
|
||||
extends: "rgba(16, 185, 129, 0.5)", // green
|
||||
derives: "rgba(147, 197, 253, 0.5)", // blue
|
||||
merges: "rgba(251, 165, 36, 0.5)", // orange
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export interface GraphNode {
|
|||
isDragging: boolean;
|
||||
}
|
||||
|
||||
export type MemoryRelation = "updates" | "extends" | "derives";
|
||||
export type MemoryRelation = "updates" | "extends" | "derives" | "merges";
|
||||
|
||||
export interface GraphEdge {
|
||||
id: string;
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ export const SpaceSchema = z.object({
|
|||
})
|
||||
export type Space = z.infer<typeof SpaceSchema>
|
||||
|
||||
export const MemoryRelationEnum = z.enum(["updates", "extends", "derives"])
|
||||
export const MemoryRelationEnum = z.enum(["updates", "extends", "derives", "merges"])
|
||||
export type MemoryRelation = z.infer<typeof MemoryRelationEnum>
|
||||
|
||||
export const MemoryEntrySchema = z.object({
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue