score:0

const state = {...this.state};
state['data'] = dataDic[this.state.selectedOption];
return (
  <PivotTableUI
      onChange={s => this.setState(s)}
      {...state}
  />
)

score:0


import TableRenderers from 'react-pivottable/TableRenderers';
import PivotTableUI from 'react-pivottable/PivotTableUI';
import Plot from 'react-plotly.js';
import createPlotlyRenderers from 'react-pivottable/PlotlyRenderers';
import 'react-pivottable/pivottable.css';

const PlotlyRenderers = createPlotlyRenderers(Plot);


function DataExploration() {

    const { dashboardData: { data } } = useSelector((state) => state.dashboardData)
    
    const ExpComp = (props) => {
        const [state, setState] = useState(props);
        return (
            <div className="row">
                <div className="col-md-12">
                    {
                        <PivotTableUI
                            style={
                                {
                                    width: "100%",
                                    height: "100%"
                                }
                            }
                            onChange={(s) => setState(s)}
                            renderers={{ ...TableRenderers, ...PlotlyRenderers }}
                            {...state}
                        />

                    }
                </div>
            </div>
        )
    }
    return (

        <ExpComp data={data} />
    )
}

From more details check the doc: https://github.com/plotly/react-pivottable

score:1

<PivotTableUI
  data = {[{}]}
  onChange={ s =>{ 
    delete s.data
    this.setState(s)
  }}
  {...this.state}
/>

Related Query

More Query from same tag