@gooddata/gdc-afm-connect

1.0.24 • Public • Published

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'

  2. 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;
    };
  3. 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>"
    />
  4. 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>',          // 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

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

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

UPDATE_DATE_FILTER

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

  // TODO not yet implemented

Development

  1. yarn validate
  2. yarn build

Releasing / Publishing

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

Readme

Keywords

none

Package Sidebar

Install

npm i @gooddata/gdc-afm-connect

Weekly Downloads

4

Version

1.0.24

License

SEE LICENSE IN LICENSE.txt

Unpacked Size

42.3 kB

Total Files

18

Last publish

Collaborators

  • ondrejvelisekgd
  • adam.stulpa.gdc
  • ondrej.kvinta
  • hkad98
  • vasek.zmrhal
  • david.zoufaly
  • lienpham95
  • hoaimy
  • amilieta
  • kirill.kazakov.gd
  • bertold8
  • mkoldus
  • bich.nguyen
  • nghi.lam
  • good-andy
  • pjiranek
  • phong.nguyen
  • martin.milicka
  • hung.cao
  • artsiom.yeliseyenka.gooddata
  • rodri360
  • jaceksan
  • ivan.mjartan
  • lupko
  • tomas.kratochvil
  • jakub-sterba
  • stanislavhacker
  • vojtasii
  • pbenes
  • gooddata-ci
  • nikolacech
  • petrjanu
  • xmort
  • no23reason
  • matyas.kandl
  • utdnah
  • tuqt1005
  • tu.bui
  • my.duong
  • hang.ngo
  • scavnickyj
  • thao-luong
  • thuong.nguyen
  • huyen.nguyen
  • nestor_encinas
  • tmuchka
  • gdjan
  • tuan.tran_gd