GoodData.UI AFM Redux Connector
This package may help to build react-redux apps with GoodData.UI faster. Use at your own risk.
Usage
-
Install gdc-afm-connect yarn add '@gooddata/gdc-afm-connect'
-
Import AFM reducers and combine
import { createStore, combineReducers } from 'redux';
import { AfmReducers } from '@gooddata/gdc-afm-connect';
const configureStore = () => {
const store = createStore(
combineReducers({
...AfmReducers
})
);
return store;
};
-
Wrap regular components with afmConnect
import { ColumnChart as ColumnChartOrig } from '@gooddata/react-components';
import { afmConnect } from '@gooddata/gdc-afm-connect';
const ColumnChart = afmConnect(ColumnChartOrig);
<ColumnChart
projectId="<project-id"
filterGroup="<filter-group>"
measures="<measures>"
/>
-
Wrap AFM components with afmWrapper
import { AfmComponents } from '@gooddata/react-components';
import { afmWrapper } from '@gooddata/gdc-afm-connect';
const ColumnChart = afmWrapper(AfmComponents.ColumnChart);
<ColumnChart
projectId="<project-id"
filterGroup="<filter-group>"
afm="<afm>"
/>
❗️Please note that AFM components are being DEPRECATED. Use regular components as shown above.
Available Actions
UPDATE_POSITIVE_ATTRIBUTE_FILTER
updatePositiveAttributeFilter(
filterGroup: '<string>',
attributeDisplayForm: '<string>',
inValues: '<array>'
)
UPDATE_NEGATIVE_ATTRIBUTE_FILTER
updateNegativeAttributeFilter(
filterGroup: '<string>',
attributeDisplayForm: '<string>',
notInValues: '<array>'
)
REMOVE_ATTRIBUTE_FILTER
removeAttributeFilter(
filterGroup: '<string>',
attributeDisplayForm: '<string>'
)
UPDATE_DATE_FILTER
updateDateFilter(
filterGroup: '<string>',
dataSet: '<string>',
grain: '<string>',
start: '<string>',
end: '<string>'
)
REMOVE_DATE_FILTER
Development
yarn validate
yarn build
Releasing / Publishing
- Bump [major|minor|patch] version in
package.json
accordingly - Git commit
npm publish --access=restricted