You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@imc-trading/react-pivottable

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@imc-trading/react-pivottable

This is a fork of [plotly/react-pivottable](https://github.com/plotly/react-pivottable). The original implementation is no longer maintained and has [a bug](https://github.com/plotly/react-pivottable/issues/150) if used with React 18.

0.2.13
latest
npmnpm
Version published
Weekly downloads
114
67.65%
Maintainers
3
Weekly downloads
 
Created
Source

@imc-trading/react-pivottable

This is a fork of plotly/react-pivottable.
The original implementation is no longer maintained and has a bug if used with React 18.

Differences

  • Internally it uses dnd-kit instead of react-draggable and react-sortablejs.
  • Exports are now ESM/named instead of separate files. Check usage section for how to import.

Added functionality

  • hideControls prop allows you to hide controls.

Installing

npm install @imc-trading/react-pivottable react-plotly.js

Usage

import { createRoot } from "react-dom/client";
import Plotly from "react-plotly.js";

import {
  PivotTableUI,
  createPlotlyRenderers,
  TableRenderers,
} from "@imc-trading/react-pivottable";

import "@imc-trading/react-pivottable/pivottable.css";

const PlotlyRenderers = createPlotlyRenderers(Plotly); // or createPlotlyRenderers(window.Plotly)

const data = [
  ["attribute", "attribute2"],
  ["value1", "value2"],
];

function App() {
  const [pivottableState, setPivottableState] = useState({});

  return (
    <PivotTableUI
      data={data}
      onChange={(s) => setPivottableState(s)}
      renderers={{ ...TableRenderers, ...PlotlyRenderers }}
      {...pivottableState}
    />
  );
}

createRoot(document.getElementById("root")!).render(<App />);

FAQs

Package last updated on 28 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts