# @gooddata/gdc-afm-connect

> GoodData.UI AFM Redux Connector

Latest version **1.0.24** (published 2019-06-16) · SEE LICENSE IN LICENSE.txt license · 0 weekly downloads

## Install

```sh
npm install @gooddata/gdc-afm-connect
pnpm add @gooddata/gdc-afm-connect
yarn add @gooddata/gdc-afm-connect
bun add @gooddata/gdc-afm-connect
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.24 |
| Published | 2019-06-16 |
| First published | 2018-05-10 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE.txt |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 41.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | GoodData Corporation |
| Maintainers | bertold8, bugsbunny338, gooddata-ci, ivan.mjartan, jakub-sterba, jaroslav.tomecek, jkittler, khanh.le, langhamp, lanhuynh, linhhong, lpearce, lupko, martin.mosko, michal.marsal, nadtan, naibinh, nikolacech, no23reason, pbenes, petrjanu, ptquang86, qduval, rodri360, sarfy, sitina, sondo, strouhaljan, tomas.bouma, tomas.kratochvil, tomasreichmann, tomsatgd, tu.ngo, vlastikcz, vlckomi1, xmort, yanlipnican |

## Links

- npm: https://www.npmjs.com/package/@gooddata/gdc-afm-connect
- Repository: https://github.com/gooddata/gdc-poc
- Homepage: https://github.com/gooddata/gdc-poc#readme
- Issues: https://github.com/gooddata/gdc-poc/issues
- npm.io page: https://npm.io/package/@gooddata/gdc-afm-connect

## Dependencies (6)

- [react](https://npm.io/package/react.md) ^16.8.6
- [redux](https://npm.io/package/redux.md) ^4.0.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.10
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [react-redux](https://npm.io/package/react-redux.md) ^7.1.0
- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ^6.24.1

## Recent versions

- 1.0.24 (latest) — 2019-06-16
- 1.0.19-bugsbunny338-master-2018-09-08T17-53-05-646Z (beta) — 2018-09-08
- 1.0.23 — 2019-05-23
- 1.0.22 — 2018-10-27
- 1.0.21 — 2018-10-26
- 1.0.20 — 2018-09-08
- 1.0.19-bugsbunny338-master-2018-09-08T17-37-36-380Z — 2018-09-08
- 1.0.19-bugsbunny338-master-2018-09-08T17-21-36-546Z — 2018-09-08
- 1.0.19 — 2018-07-23
- 1.0.18 — 2018-07-20
- 1.0.17 — 2018-07-20
- 1.0.16 — 2018-07-16
- 1.0.15 — 2018-07-15
- 1.0.14 — 2018-07-13
- 1.0.13 — 2018-05-18
- … 13 more at https://npm.io/package/@gooddata/gdc-afm-connect/versions

## README

# GoodData.UI AFM Redux Connector

This package may help to build react-redux apps with GoodData.UI faster. Use at your own risk.

## Usage

1. Install gdc-afm-connect `yarn add '@gooddata/gdc-afm-connect'`
1. Import AFM reducers and combine

    ```jsx
    import { createStore, combineReducers } from 'redux';
    import { AfmReducers } from '@gooddata/gdc-afm-connect';

    const configureStore = () => {
      const store = createStore(
        combineReducers({
          ...AfmReducers
        })
      );

      return store;
    };
    ```

1. Wrap regular components with afmConnect

    ```jsx
    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>"
    />
    ```

1. Wrap AFM components with afmWrapper

    ```jsx
    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
```js
updatePositiveAttributeFilter(
  filterGroup: '<string>',          // name of the filter group context
  attributeDisplayForm: '<string>', // uri or identifier of attribute display form
  inValues: '<array>'               // array of attribute element uris
)
```

UPDATE_NEGATIVE_ATTRIBUTE_FILTER
```js
updateNegativeAttributeFilter(
  filterGroup: '<string>',          // name of the filter group context
  attributeDisplayForm: '<string>', // uri or identifier of attribute display form
  notInValues: '<array>'            // array of attribute element uris
)
```

REMOVE_ATTRIBUTE_FILTER
```js
removeAttributeFilter(
  filterGroup: '<string>',          // name of the filter group context
  attributeDisplayForm: '<string>'  // uri or identifier of attribute display form
)
```

UPDATE_DATE_FILTER
```js
updateDateFilter(
  filterGroup: '<string>', // name of the filter group context
  dataSet: '<string>',     // uri or identifier of date display form
  grain: '<string>',       // date granularity, currently only 'GDC.time.date' is supported
  start: '<string>',       // start date, can be absolute (i.e. 'YYYY-MM-DD') or relative (e.g. 0)
  end: '<string>'          // end date, can be absolute (i.e. 'YYYY-MM-DD') or relative (e.g. -1)
)
```

REMOVE_DATE_FILTER
```js
  // TODO not yet implemented
```

## Development

1. `yarn validate`
1. `yarn build`

### Releasing / Publishing

1. Bump [major|minor|patch] version in `package.json` accordingly
1. Git commit
1. `npm publish --access=restricted`

---
_Source: https://npm.io/package/@gooddata/gdc-afm-connect · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
