mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-05-05 15:30:40 +00:00
Rewrite @supermemory/memory-graph with perf optimizations + consolidate consumers (#809)
Co-authored-by: Vorflux AI <noreply@vorflux.com>
This commit is contained in:
parent
38282a37d6
commit
851b8cfe86
92 changed files with 6791 additions and 12118 deletions
|
|
@ -85,6 +85,8 @@ function StaticGraphPreview({
|
|||
height={height}
|
||||
className="absolute inset-0"
|
||||
viewBox={`0 0 ${width} ${height}`}
|
||||
role="img"
|
||||
aria-label="Memory graph preview"
|
||||
>
|
||||
{edges.map((e, i) => (
|
||||
<line
|
||||
|
|
@ -116,9 +118,8 @@ export const GraphCard = memo<GraphCardProps>(
|
|||
({ containerTags, width = 216, height = 220, className }) => {
|
||||
const { setViewMode } = useViewMode()
|
||||
|
||||
const { data, isLoading, error } = useGraphApi({
|
||||
const { documents, isLoading, error } = useGraphApi({
|
||||
containerTags,
|
||||
limit: 20,
|
||||
enabled: true,
|
||||
})
|
||||
|
||||
|
|
@ -139,11 +140,8 @@ export const GraphCard = memo<GraphCardProps>(
|
|||
)
|
||||
}
|
||||
|
||||
const documentCount = data.stats?.documentsWithSpatial ?? 0
|
||||
const memoryCount = data.documents.reduce(
|
||||
(sum, d) => sum + d.memories.length,
|
||||
0,
|
||||
)
|
||||
const documentCount = documents.length
|
||||
const memoryCount = documents.reduce((sum, d) => sum + d.memories.length, 0)
|
||||
|
||||
return (
|
||||
<button
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue