mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-02 02:11:20 +00:00
The graph control surfaces had a few screen-reader gaps in the published
component:
- The zoom in/out buttons rendered only a "+"/"−" glyph with no text, so they
had no accessible name. Added aria-label ("Zoom in"/"Zoom out") and marked the
glyphs aria-hidden.
- The Legend header and the expandable "Connections" row are disclosure
buttons but never exposed aria-expanded, so assistive tech could not tell
whether the section was open. Wired aria-expanded to the actual state.
- The loading indicator was a plain div, so the loading message was not
announced. Switched it to an output element (implicit status role) with
aria-live="polite".
Adds a mounted test covering the accessible names, the toggling aria-expanded,
and the loading live region.
|
||
|---|---|---|
| .. | ||
| scripts | ||
| src | ||
| .gitignore | ||
| .npmignore | ||
| CHANGELOG.md | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| vite.config.ts | ||
@supermemory/memory-graph
Interactive graph visualization for documents and their memory connections.
Installation
npm install @supermemory/memory-graph
# or
bun add @supermemory/memory-graph
# or
pnpm add @supermemory/memory-graph
Quick Start
import { MemoryGraph } from '@supermemory/memory-graph';
import type { DocumentWithMemories } from '@supermemory/memory-graph';
function App() {
const [documents, setDocuments] = useState<DocumentWithMemories[]>([]);
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
fetch('/api/graph')
.then(res => res.json())
.then(data => {
setDocuments(data.documents);
setIsLoading(false);
});
}, []);
return (
<div style={{ height: '100vh' }}>
<MemoryGraph
documents={documents}
isLoading={isLoading}
variant="console"
/>
</div>
);
}
Features
- Interactive canvas visualization - Pan, zoom, and drag nodes using Canvas 2D rendering
- Document and memory nodes - Documents as rectangles, memories as hexagons
- Relationship visualization - Edges show document similarity and memory version chains
- Space filtering - Filter by workspace or view all memories
- Two variants - Full-featured console mode or embedded consumer mode
- Pagination support - Load more documents on demand
- TypeScript support - Full type definitions included
Essential Props
| Prop | Type | Description |
|---|---|---|
documents |
DocumentWithMemories[] |
Array of documents with their memory entries |
isLoading |
boolean |
Show loading state |
variant |
"console" | "consumer" |
Display mode (default: "console") |
error |
Error | null |
Error to display |
loadMoreDocuments |
() => Promise<void> |
Function to load more data |
highlightDocumentIds |
string[] |
IDs of documents to highlight |
Documentation
Full documentation available at docs.supermemory.ai:
- Overview - What it is and when to use it
- Installation - Setup and requirements
- Quick Start - Get running in 2 minutes
- API Reference - Complete API documentation
- Examples - Common use cases
- Troubleshooting - Common issues
Requirements
- React 18+
- Modern browser
License
MIT