plotly / react-pivottable

React-based drag'n'drop pivot table with Plotly.js charts
https://react-pivottable.js.org/
MIT License
972 stars 248 forks source link

Support Treemap #141

Open Tomtomgo opened 2 years ago

Tomtomgo commented 2 years ago

As far as I can tell, Plotly supports treemaps (https://plotly.com/javascript/treemaps/).

The default Plotly renderers don't include a treemap though:

function createPlotlyRenderers(PlotlyComponent) {
  return {
    'Grouped Column Chart': makeRenderer(PlotlyComponent, { type: 'bar' }, { barmode: 'group' }),
    'Stacked Column Chart': makeRenderer(PlotlyComponent, { type: 'bar' }, { barmode: 'relative' }),
    'Grouped Bar Chart': makeRenderer(PlotlyComponent, { type: 'bar', orientation: 'h' }, { barmode: 'group' }, true),
    'Stacked Bar Chart': makeRenderer(PlotlyComponent, { type: 'bar', orientation: 'h' }, { barmode: 'relative' }, true),
    'Line Chart': makeRenderer(PlotlyComponent),
    'Dot Chart': makeRenderer(PlotlyComponent, { mode: 'markers' }, {}, true),
    'Area Chart': makeRenderer(PlotlyComponent, { stackgroup: 1 }),
    'Scatter Chart': makeScatterRenderer(PlotlyComponent),
    'Multiple Pie Chart': makeRenderer(PlotlyComponent, { type: 'pie', scalegroup: 1, hoverinfo: 'label+value', textinfo: 'none' }, {}, true)
  };
}

I tried adding a Treemap renderer like this:

    'Treemap': makeRenderer(PlotlyComponent, {type: 'treemap'})

But that only showed a standard line chart.

Is it possible to add a Treemap renderer?