or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

chart-component.mdconfiguration-types.mdindex.mdpivot-table-engine.mdplugin-registration.mdprops-transformation.mdquery-building.md

plugin-registration.mddocs/

0

# Plugin Registration

1

2

Main plugin class for registering the pivot table chart type with Superset, including chart metadata, behaviors, and configuration options.

3

4

## Capabilities

5

6

### PivotTableChartPlugin Class

7

8

The main plugin class that extends ChartPlugin to register the pivot table chart type.

9

10

```typescript { .api }

11

/**

12

* Main plugin class for registering pivot table chart with Superset

13

* Extends ChartPlugin with pivot table specific configuration

14

*/

15

export default class PivotTableChartPlugin extends ChartPlugin<

16

PivotTableQueryFormData,

17

ChartProps<QueryFormData>

18

> {

19

constructor();

20

}

21

```

22

23

**Usage Example:**

24

25

```typescript

26

import { PivotTableChartPlugin } from "@superset-ui/plugin-chart-pivot-table";

27

28

// Create and register the plugin

29

const plugin = new PivotTableChartPlugin();

30

plugin.configure({ key: 'pivot-table-v2' }).register();

31

32

// Plugin is now registered with Superset registry

33

```

34

35

### Chart Metadata

36

37

The plugin includes comprehensive chart metadata that defines its capabilities and appearance in Superset.

38

39

```typescript { .api }

40

interface ChartMetadata {

41

behaviors: [Behavior.INTERACTIVE_CHART, Behavior.DRILL_TO_DETAIL];

42

category: string; // 'Table'

43

description: string;

44

exampleGallery: { url: string }[];

45

name: string; // 'Pivot Table'

46

tags: string[]; // ['Additive', 'Report', 'Tabular', 'Popular']

47

thumbnail: string;

48

}

49

```

50

51

### Plugin Configuration

52

53

The plugin is configured with essential components for chart functionality.

54

55

```typescript { .api }

56

interface PluginConfiguration {

57

buildQuery: (formData: PivotTableQueryFormData) => QueryContext;

58

controlPanel: ControlPanelConfig;

59

loadChart: () => Promise<ChartComponent>;

60

metadata: ChartMetadata;

61

transformProps: (chartProps: ChartProps<QueryFormData>) => PivotTableProps;

62

}

63

```

64

65

### Chart Behaviors

66

67

Defines the interactive capabilities supported by the pivot table chart.

68

69

```typescript { .api }

70

enum Behavior {

71

INTERACTIVE_CHART = 'INTERACTIVE_CHART',

72

DRILL_TO_DETAIL = 'DRILL_TO_DETAIL'

73

}

74

```

75

76

**Behavior Details:**

77

- `INTERACTIVE_CHART`: Enables cross-filtering and interactive selection

78

- `DRILL_TO_DETAIL`: Supports drilling down to underlying data records