react-planner

:pencil2: A React Component for plans design. Draw a 2D floorplan and navigate it in 3D mode.

Github stars Tracking Chart

react-planner

react-planner is a React component which can be used to draw model buildings. Drag & drop from a catalog of customizable and ready-to-use objects, you can start from 2D wireframes and land on 3D models. As a developer you can provide your users with new objects by adding them to the catalog.

npm
javascript
react-version

Demo

Demo

react-planner

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import {Map} from 'immutable';
import {createStore} from 'redux';
import {Provider} from 'react-redux';

//download this demo catalog https://github.com/cvdlab/react-planner/tree/master/demo/src/catalog
import MyCatalog from './catalog/mycatalog';

import {
  Models as PlannerModels,
  reducer as PlannerReducer,
  ReactPlanner,
  Plugins as PlannerPlugins,
} from 'react-planner';


//define state
let AppState = Map({
  'react-planner': new PlannerModels.State()
});

//define reducer
let reducer = (state, action) => {
  state = state, AppState;
  state = state.update('react-planner', plannerState => PlannerReducer(plannerState, action));
  return state;
};

let store = createStore(reducer, null, window.devToolsExtension ? window.devToolsExtension() : f => f);

let plugins = [
  PlannerPlugins.Keyboard(),
  PlannerPlugins.Autosave('react-planner_v0'),
  PlannerPlugins.ConsoleDebugger(),
];

//render
ReactDOM.render(
  (
    <Provider store={store}>
      <ReactPlanner
        catalog={MyCatalog}
        width={800}
        height={600}
        plugins={plugins}
        stateExtractor={state => state.get('react-planner')}
      />
    </Provider>
  ),
  document.getElementById('app')
);

Docs

Authors

Developed @ CVDLAB

Contributing

Your contributions (issues and pull request) are very appreciated!

Contributors

License

MIT

Main metrics

Overview
Name With Ownercvdlab/react-planner
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2016-06-27 15:30:52
Pushed At2024-04-20 01:42:13
Last Commit At2019-11-04 00:56:57
Release Count106
Last Release Namev2.0.6 (Posted on 2019-11-04 00:56:57)
First Release Namev0.1.0 (Posted on 2016-10-06 18:03:15)
用户参与
Stargazers Count1.4k
Watchers Count55
Fork Count469
Commits Count1.5k
Has Issues Enabled
Issues Count207
Issue Open Count77
Pull Requests Count6
Pull Requests Open Count26
Pull Requests Close Count31
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private