1.7.30 • Published 6 years ago
react-planner-viewer v1.7.30
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.
Demo
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
Cooming soon!
Contributing
Your contributions (issues and pull request) are very appreciated!
Authors
Developed @ CVDLAB
License
MIT
1.7.30
6 years ago
1.7.29
6 years ago
1.7.28
6 years ago
1.7.27
6 years ago
1.7.26
6 years ago
1.7.25
6 years ago
1.7.23
6 years ago
1.7.22
6 years ago
1.7.21
6 years ago
1.7.20
6 years ago
1.7.19
6 years ago
1.7.17
6 years ago
1.7.16
6 years ago
1.7.15
6 years ago
1.7.14
6 years ago
1.7.13
6 years ago
1.7.12
6 years ago
1.7.11
6 years ago
1.7.10
6 years ago
1.7.9
6 years ago
1.7.8
6 years ago
1.7.7
6 years ago
1.7.6
6 years ago
1.7.5
6 years ago
1.7.4
6 years ago
1.7.3
6 years ago
1.7.2
6 years ago
1.7.0
6 years ago