supermemory/apps/memory-graph-playground
Vorflux AI e7676763a9 Add comprehensive unit tests for memory-graph package
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.
2026-03-27 00:06:21 +00:00
..
public runtime styles injection + let user proxy requests for data in graph package + new playground (#588) 2025-11-22 07:04:05 +00:00
src/app Rewrite @supermemory/memory-graph with perf optimizations and consolidate consumers 2026-03-26 17:58:28 +00:00
.gitignore runtime styles injection + let user proxy requests for data in graph package + new playground (#588) 2025-11-22 07:04:05 +00:00
next-env.d.ts Add comprehensive unit tests for memory-graph package 2026-03-27 00:06:21 +00:00
next.config.ts add spaces selector with search (#600) 2025-12-02 18:37:24 +00:00
package.json one more try 2026-03-05 14:30:57 -08:00
postcss.config.mjs add spaces selector with search (#600) 2025-12-02 18:37:24 +00:00
README.md runtime styles injection + let user proxy requests for data in graph package + new playground (#588) 2025-11-22 07:04:05 +00:00
tsconfig.json add spaces selector with search (#600) 2025-12-02 18:37:24 +00:00

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