0.3.5 • Published 5 years ago

@operational/grid v0.3.5

Weekly downloads
19
License
MIT
Repository
github
Last release
5 years ago

Operational PivotGrid Build Status Netlify Status

This component is used to show pivot table. Cells can be simple text (classical pivot table) or charts, to do the trick it uses cell render prop, which will get frame as param (as well as other params).

Installation

yarn add @operational/frame

Usage

import * as React from "react";
import AutoSizer from "react-virtualized-auto-sizer";
import { DataFrame } from "@operational/frame";
import { PivotGrid } from "@operational/grid";

const frame = new DataFrame(/* ... */);
const pivotedFrame = frame.pivot({
  /* ... */
});

const App = () => (
  <AutoSizer style={{ minHeight: "500px", height: "100%" }}>
    {({ width, height }) => <PivotGrid width={width} height={height} data={pivotedFrame} measures={/* ... */} />}
  </AutoSizer>
);

Required params

PivotGrid expects width and height as params, because it uses virtual scrolling, so it needs to know dimensions. You can use react-virtualized-auto-sizer to make <PivotGrid /> to use all available space.

PivotGrid expects PivotFrame as data param. It will provide information about which values to use as rows and columns and the actual data.

PivotGrid expects measures as param. For text-based pivot table it is required, for pivot table of charts it is optional.

PivotGrid expects cell render property, which will render content of cells. For text-based pivot table it is optional.

Optional params

accessors.width, accessors.height - accessors (basically callbacks) responsible for detecting width and height of cells.

style.cell - styles of cell, you can use it to provide padding for example

style.border - style of border

measuresPlacement - if we want to place measures in rows or columns. Defaults to column.

0.3.6-alpha.10

5 years ago

0.3.6-alpha.5

5 years ago

0.3.6-alpha.7

5 years ago

0.3.6-alpha.4

5 years ago

0.3.5

5 years ago

0.3.5-alpha.101

5 years ago

0.3.4-alpha.101

5 years ago

0.3.3-467d68c

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0-eab6fc8

5 years ago

0.3.0-e7e2925

5 years ago

0.2.0-ee2fce5

5 years ago

0.2.0-5ec6bc4

5 years ago

0.1.0

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago