source: node_modules/recharts/es6/state/rootPropsSlice.js@ ba17441

Last change on this file since ba17441 was a762898, checked in by istevanoska <ilinastevanoska@…>, 6 months ago

Added visualizations

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[a762898]1import { createSlice } from '@reduxjs/toolkit';
2
3/**
4 * These are chart options that users can choose - which means they can also
5 * choose to change them which should trigger a re-render.
6 */
7
8export var initialState = {
9 accessibilityLayer: true,
10 barCategoryGap: '10%',
11 barGap: 4,
12 barSize: undefined,
13 className: undefined,
14 maxBarSize: undefined,
15 stackOffset: 'none',
16 syncId: undefined,
17 syncMethod: 'index',
18 baseValue: undefined,
19 reverseStackOrder: false
20};
21var rootPropsSlice = createSlice({
22 name: 'rootProps',
23 initialState,
24 reducers: {
25 updateOptions: (state, action) => {
26 var _action$payload$barGa;
27 state.accessibilityLayer = action.payload.accessibilityLayer;
28 state.barCategoryGap = action.payload.barCategoryGap;
29 state.barGap = (_action$payload$barGa = action.payload.barGap) !== null && _action$payload$barGa !== void 0 ? _action$payload$barGa : initialState.barGap;
30 state.barSize = action.payload.barSize;
31 state.maxBarSize = action.payload.maxBarSize;
32 state.stackOffset = action.payload.stackOffset;
33 state.syncId = action.payload.syncId;
34 state.syncMethod = action.payload.syncMethod;
35 state.className = action.payload.className;
36 state.baseValue = action.payload.baseValue;
37 state.reverseStackOrder = action.payload.reverseStackOrder;
38 }
39 }
40});
41export var rootPropsReducer = rootPropsSlice.reducer;
42export var {
43 updateOptions
44} = rootPropsSlice.actions;
Note: See TracBrowser for help on using the repository browser.