Skip to content

πŸš€ Getting StartedΒΆ

<VisualliRenderer /> is a React component that renders interactive, hierarchical mindmap visualizations from .visualli files.

πŸ“¦ InstallationΒΆ

npm install @visualli-sdk/react
yarn add @visualli-sdk/react
pnpm add @visualli-sdk/react

That's the only install command you need. It automatically pulls in the major dependencies:

  • 🧱 @visualli-sdk/core β€” the parsing engine and document model
  • βš›οΈ React & React DOM (β‰₯ 18.3) β€” peer dependencies for your app

⚑ Usage¢

Provide exactly one data source β€” visualliFile or visualliString:

  • visualliFile β€” a File object (from <input type="file">) or a string path. The component fetches, reads, and parses it automatically.
  • visualliString β€” raw JSONL content as a string. No preprocessing needed.

From a file pathΒΆ

import { VisualliRenderer } from '@visualli-sdk/react';

function App() {
  return (
    <VisualliRenderer
      visualliFile="/data/document.visualli"
      theme="light"
      width="100%"
      height="600px"
    />
  );
}

From a stringΒΆ

const data = `{"type":"meta","version":"1.0","title":"My Mind Map"}
{"type":"layer","id":"root","level":0,"nodes":[{"id":"1","position":{"x":0,"y":0},"data":{"label":"Central Idea","summary":"The main concept"}}]}`;

<VisualliRenderer visualliString={data} theme="auto" />

From a file uploadΒΆ

import { useState } from 'react';
import { VisualliRenderer } from '@visualli-sdk/react';

function FileViewer() {
  const [file, setFile] = useState<File | null>(null);

  return (
    <div>
      <input
        type="file"
        accept=".visualli"
        onChange={(e) => setFile(e.target.files?.[0] || null)}
      />
      {file && (
        <VisualliRenderer
          visualliFile={file}
          theme="light"
          width="100%"
          height="80vh"
        />
      )}
    </div>
  );
}

✨ Features¢

  • 🎨 Beautiful visualizations β€” sketchy, hand-drawn aesthetic with smooth animations
  • πŸš€ High performance β€” spatial indexing keeps 10,000+ nodes smooth
  • πŸŒ“ Themes β€” light, dark, or auto (follows system preference)
  • ⚑ Web Worker parsing β€” non-blocking parsing, on by default
  • πŸ—ΊοΈ Interactive navigation β€” pan, zoom, auto layer navigation, breadcrumbs
  • πŸ”§ Fully typed β€” complete TypeScript definitions included

⚠️ Error Handling¢

The renderer shows built-in states so you don't have to:

State What the user sees
πŸ“­ No data "No .visualli file provided" with a hint to pass visualliFile or visualliString
⏳ Loading Animated indicator while fetching/parsing
❌ Error Clear message on parse failure, e.g. "Failed to parse JSON at line 5: Unexpected token"

🌐 Browser Support¢

Browser Version
Chrome β‰₯ 90
Firefox β‰₯ 88
Safari β‰₯ 14
Edge β‰₯ 90

Requires ES2020, Canvas API, and CSS Grid/Flexbox. Web Workers and prefers-color-scheme are optional (used by useWorker and theme="auto").

➑️ Next steps¢

  • Reference β€” every prop <VisualliRenderer /> accepts
  • Examples β€” themes, immersion, large documents, styling