All Projects → learn-anything → React Mindmap

learn-anything / React Mindmap

Licence: mit
React component for MindNode maps

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Mindmap

React Horizontal Scrolling Menu
Horizontal scrolling menu component for React.
Stars: ✭ 289 (-19.05%)
Mutual labels:  react-component
React Snakke
🐍 Reading position indicator for React
Stars: ✭ 306 (-14.29%)
Mutual labels:  react-component
React Tags
⚛️ A fantastically simple tagging component for your React projects
Stars: ✭ 321 (-10.08%)
Mutual labels:  react-component
Rpt
A physically-based path tracer
Stars: ✭ 296 (-17.09%)
Mutual labels:  rendering
Nativerenderingplugin
C++ Rendering Plugin example for Unity
Stars: ✭ 299 (-16.25%)
Mutual labels:  rendering
Tween One
Animate One React Element
Stars: ✭ 310 (-13.17%)
Mutual labels:  react-component
Game Programmer Study Notes
⚓ 我的游戏程序员生涯的读书笔记合辑。你可以把它看作一个加强版的Blog。涉及图形学、实时渲染、编程实践、GPU编程、设计模式、软件工程等内容。Keep Reading , Keep Writing , Keep Coding.
Stars: ✭ 6,050 (+1594.68%)
Mutual labels:  rendering
React Hint
Tooltip component for React, Preact, Inferno
Stars: ✭ 338 (-5.32%)
Mutual labels:  react-component
Echarts For React
⛳️ Apache ECharts components for React wrapper. 一个简单的 Apache echarts 的 React 封装。
Stars: ✭ 3,441 (+863.87%)
Mutual labels:  react-component
React Router Util
Useful components and utilities for working with React Router
Stars: ✭ 320 (-10.36%)
Mutual labels:  react-component
Pigeon Maps
ReactJS Maps without external dependencies
Stars: ✭ 3,198 (+795.8%)
Mutual labels:  react-component
Minpt
A path tracer in 300 lines of C++
Stars: ✭ 299 (-16.25%)
Mutual labels:  rendering
Particles Bg
React particles animation background component
Stars: ✭ 309 (-13.45%)
Mutual labels:  react-component
Formsy React Components
Bootstrap components for a formsy-react form.
Stars: ✭ 290 (-18.77%)
Mutual labels:  react-component
Gpu Pro Books Source Code
💿 Source Code Collection of Book <GPU Pro> 1~ 7 | 《GPU Pro》1~ 7 书本源代码珍藏
Stars: ✭ 323 (-9.52%)
Mutual labels:  rendering
React New Window
🔲 Pop new windows in React, using `window.open`.
Stars: ✭ 281 (-21.29%)
Mutual labels:  react-component
React Js Pagination
Stars: ✭ 308 (-13.73%)
Mutual labels:  react-component
React Tabtab
💃 Make your react tab dance🕺
Stars: ✭ 347 (-2.8%)
Mutual labels:  react-component
3dtilesrendererjs
Renderer for 3D Tiles in Javascript using three.js
Stars: ✭ 333 (-6.72%)
Mutual labels:  rendering
React Native Card Stack Swiper
Tinder like react-native card stack swiper
Stars: ✭ 315 (-11.76%)
Mutual labels:  react-component

React Mindmap [UNMAINTAINED]

React component for MindNode maps (or other mindmaps)

This project is no longer maintained. The component is still usable, but if you find any problem or if you want to improve it, please fork it.

Install

npm install react-mindmap --save

Usage

import { Component } from "react";
import { render } from "react-dom";
import MindMap from "react-mindmap";
import { nodes, connections } from "./my-map.json";

class Example extends Component {
  render() {
    return (
      <MindMap nodes={this.props.nodes} connections={this.props.connections} />
    );
  }
}

render(
  <Example nodes={nodes} connections={connections} />,
  document.getElementById("target")
);

img

Testing

To test this repository run these commands

git clone https://github.com/learn-anything/react-mindmap
cd react-mindmap
npm install && npm run test

and connect to http://localhost:3000/

Parser

This repo also has a parser that automates the conversion of JSON maps from MindNode to the format used by this component. To use it run:

npm run parse path/to/mindnode/maps path/to/converted/maps

Props

Prop Type Default Description
nodes Array [] Array of objects used to render nodes.
connections Array [] Array of objects used to render connections.
subnodes Array [] Array of objects used to render subnodes.
editable Boolean false Enable editor mode, which allows to move around nodes.

nodes

Array of objects used to render nodes. Below an example of the node structure.

{
  "text": "python",
  "url": "http://www.wikiwand.com/en/Python_(programming_language)",
  "fx": -13.916222252976013,
  "fy": -659.1641376795345,
  "category": "wiki",
  "note": ""
}

The possible attributes are:

  • text: title of the node
  • url: url contained in the node
  • fx and fy: coordinates (if not present they'll be generated)
  • category: category used to generate an emoji
  • note: note that will be visible on hover

connections

Array of objects used to render connections. Below an example of the connection structure.

{
  "source": "python",
  "target": "basics",
  "curve": {
    "x": -43.5535,
    "y": 299.545
  }
}

The possible attributes are:

  • source: title of the node where the connection starts
  • target: title of the node where the connection ends
  • curve.x and curve.y: coordinates of the control point of a quadratic bezier curve (if not specified the connection will be straight)

subnodes

Array of objects used to render subnodes. The structure is the same as for nodes with two additional attributes:

  • parent: title of the parent node
  • color: used for the margin color, needs to be a valid CSS color

Styling

Here's a list of all CSS classes for styling:

  • .mindmap-svg: main svg element containing the map;
  • .mindmap-node: foreignObject element representing a node;
  • .mindmap-node--editable: foreignObject element representing a node in editor mode;
  • .mindmap-subnode-group-text: foreignObject element containing all subnodes of a given node;
  • .mindmap-subnode-text: div element containing a subnode;
  • .mindmap-connection: path element for each connection;
  • .mindmap-emoji: img tag for emoji
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].