mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-20 00:12:51 +00:00
79 tests across 6 test files covering: - SpatialIndex: grid rebuild, queryPoint hit-testing, boundary cells, hash detection - ViewportState: worldToScreen/screenToWorld roundtrip, pan, zoomImmediate, zoomTo animation, fitToNodes, centerOn, inertia decay - ForceSimulation: init/destroy lifecycle, update hot-swap, reheat/coolDown - VersionChainIndex: chain building via parentMemoryId, caching, rebuild - Graph data utils: normalizeDocCoordinates, getMemoryBorderColor, getEdgeVisualProps, screenToBackendCoords, calculateBackendViewport - Mock data: deterministic seeded output, correct counts, valid edge references Also exports pure utility functions from use-graph-data.ts for testability. |
||
|---|---|---|
| .. | ||
| public | ||
| src/app | ||
| .gitignore | ||
| next-env.d.ts | ||
| next.config.ts | ||
| package.json | ||
| postcss.config.mjs | ||
| README.md | ||
| tsconfig.json | ||
Memory Graph Playground
A demo app showcasing the @supermemory/memory-graph package.
Getting Started
bun install
bun dev
Open http://localhost:3000 and enter your Supermemory API key.
Usage Example
import { MemoryGraph, type DocumentWithMemories } from '@supermemory/memory-graph'
function App() {
const [documents, setDocuments] = useState<DocumentWithMemories[]>([])
return (
<MemoryGraph
documents={documents}
isLoading={false}
isLoadingMore={false}
error={null}
hasMore={false}
loadMoreDocuments={() => {}}
totalLoaded={documents.length}
variant="console"
showSpacesSelector={true}
>
<div>No memories found</div>
</MemoryGraph>
)
}
Props
| Prop | Type | Description |
|---|---|---|
documents |
DocumentWithMemories[] |
Array of documents to display |
isLoading |
boolean |
Initial loading state |
isLoadingMore |
boolean |
Loading more documents state |
error |
Error | null |
Error to display |
hasMore |
boolean |
Whether more documents can be loaded |
loadMoreDocuments |
() => void |
Callback to load more documents |
totalLoaded |
number |
Total number of loaded documents |
variant |
"default" | "console" |
Visual theme variant |
showSpacesSelector |
boolean |
Show space filter dropdown |