Example #1
0
const start = () => {
  const newState = decodeStateFromURL(objParams.state);
  Object.assign(TOOL_DEFAULT_STATE.tool, newState);

  const initialState = Object.assign({}, TOOL_DEFAULT_STATE, APP_DEFAULT_STATE);

  const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

  var store = createStore(combineReducers({
    app: AppReducer,
    tool: ToolReducer
  }), initialState, composeEnhancers(applyMiddleware(analyticsMiddleware, thunk)));

  new FlowContentContainer(store);
  new SankeyContainer(store);
  new MapContainer(store);
  new MapDimensionsContainer(store);
  new MapContextContainer(store);
  new MapLegendContainer(store);
  new MapBasemapsContainer(store);
  new TitlebarContainer(store);
  new NodesTitlesContainer(store);
  new SearchContainer(store);
  new TooltipContainer(store);
  new ModalContainer(store);

  new NavComponent();
  render(
    <Provider store={store}>
      <NavContainer />
    </Provider>,
    document.getElementById('js-flows-nav-react')
  );
  render(
    <Provider store={store}>
      <ColumnsSelectorContainer />
    </Provider>,
    document.getElementById('js-columns-selector-react')
  );


  store.dispatch(loadDisclaimer());
  store.dispatch(loadInitialData());
  store.dispatch(resize());

  window.addEventListener('resize', () => {
    store.dispatch(resize());
  });
};
 onColumnSelected: (columnIndex, columnId) => {
   dispatch(selectColumn(columnIndex, columnId));
 }
 onSelected: (filterNode) => {
   dispatch(selectBiomeFilter(filterNode));
 }
 onNodeSelected: node => searchNode(parseInt(node.id, 10)),
 onClearClick: () => resetState()
 onSelected: (resizeBy) => {
   dispatch(selectResizeBy(resizeBy));
 }
 onProfileLinkClicked: (id) => navigateToProfile(id),
 onCloseNodeClicked: (id) => selectNode(id),
 onSelected: (contextId) => {
   dispatch(selectContext(parseInt(contextId)));
 }
 onDimensionClick: (uid) => toggleMapDimension(uid)
 onToggleGroup: (id) => toggleMapSidebarGroup(id),