0.1.4 • Published 4 years ago

mindx v0.1.4

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

Mindx

CI Azure Static Web Apps CI/CD Quality Gate Status

Mindx is a free, open source mindmap editor based on React.

npm.io

Try it on https://mindx.applet.ink

Installation

npm i mindx

Quick Start

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Mindmap } from 'mindx';

const App = () => {
  function onChange(root) {
    console.log(root)
  }
  return (
    <div>
      <Mindmap onChange={onChange} />
    </div>
  );
};

ReactDOM.render(<App />, document.getElementById('root'));

API

Mindmap props

proptypedescriptiondefaultoptional
valueTopicDatacontrol mindmap value-true
readonlybooleanis mindmap readonlyfalsetrue
onChange(value: TopicData) => voidlisten to mindmap value change-true
locale'en' | 'cn' | 'ja'language localizationentrue
themeThemecustom theme-true

TopicData

interface TopicData {
  id: string;
  title: string;
  side?: 'left' | 'right';
  children?: {
      attached: Array<TopicData>;
  };
}

Theme

interface Theme {
  link: {
    stroke: string;
    strokeWidth: number;
  };
  topic: {
    borderColor: string;
  };
  canvasWidth: number;
  canvasHeight: number;
}

License

MIT License