or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

chart-plugin.mdindex.mdvisualization-component.md

chart-plugin.mddocs/

0

# Chart Plugin

1

2

The `ParallelCoordinatesChartPlugin` class is the main entry point for integrating the parallel coordinates visualization with Apache Superset. It extends the ChartPlugin base class and provides all necessary metadata and configuration.

3

4

## Capabilities

5

6

### ParallelCoordinatesChartPlugin Class

7

8

Main plugin class that handles registration and configuration of the parallel coordinates chart with Superset.

9

10

```javascript { .api }

11

/**

12

* Parallel Coordinates Chart Plugin class for Superset integration

13

* Extends ChartPlugin from @superset-ui/core

14

*/

15

class ParallelCoordinatesChartPlugin extends ChartPlugin {

16

/**

17

* Creates a new ParallelCoordinatesChartPlugin instance

18

* Initializes with metadata, transformProps, controlPanel, and lazy-loaded chart component

19

*/

20

constructor();

21

}

22

```

23

24

**Usage Examples:**

25

26

```javascript

27

import ParallelCoordinatesChartPlugin from '@superset-ui/legacy-plugin-chart-parallel-coordinates';

28

29

// Basic plugin registration

30

const plugin = new ParallelCoordinatesChartPlugin();

31

plugin.configure({ key: 'parallel-coordinates' }).register();

32

33

// Registration with custom key

34

new ParallelCoordinatesChartPlugin()

35

.configure({ key: 'my-parallel-coords' })

36

.register();

37

```

38

39

### Plugin Configuration

40

41

The plugin is automatically configured with the following components:

42

43

#### Chart Metadata

44

45

```javascript { .api }

46

/**

47

* Chart metadata defining plugin characteristics

48

*/

49

interface ChartMetadata {

50

/** Chart category in Superset UI */

51

category: string; // "Ranking"

52

/** External credits and attribution */

53

credits: string[];

54

/** Description of chart functionality */

55

description: string;

56

/** Example gallery images */

57

exampleGallery: Array<{ url: string }>;

58

/** Display name for the chart */

59

name: string; // "Parallel Coordinates"

60

/** Tags for categorization and search */

61

tags: string[]; // ["Coordinates", "Directional", "Legacy", "Relational"]

62

/** Thumbnail image for chart selection */

63

thumbnail: string;

64

/** Whether to use legacy Superset API */

65

useLegacyApi: boolean; // true

66

}

67

```

68

69

#### Lazy Loading

70

71

The plugin uses dynamic imports to lazy-load the chart component:

72

73

```javascript { .api }

74

/**

75

* Lazy loading configuration for chart component

76

* @returns Promise resolving to the React chart component

77

*/

78

loadChart: () => Promise<React.ComponentType>;

79

```

80

81

The chart component is loaded from `./ReactParallelCoordinates` when first needed, improving initial bundle size and loading performance.

82

83

### Inherited Methods

84

85

From the ChartPlugin base class:

86

87

```typescript { .api }

88

/**

89

* Configure the plugin with options

90

* @param config - Plugin configuration options

91

* @returns Plugin instance for method chaining

92

*/

93

configure(config: { key: string }): ParallelCoordinatesChartPlugin;

94

95

/**

96

* Register the plugin with Superset's chart registry

97

* @returns Plugin instance for method chaining

98

*/

99

register(): ParallelCoordinatesChartPlugin;

100

```

101

102

## Plugin Integration

103

104

### Registration Process

105

106

1. **Import**: Import the plugin class from the package

107

2. **Instantiate**: Create a new instance with `new ParallelCoordinatesChartPlugin()`

108

3. **Configure**: Set a unique key for the chart type

109

4. **Register**: Register with Superset's plugin system

110

111

### Chart Usage

112

113

Once registered, the chart can be used in Superset through:

114

115

- **Explore Interface**: Available in chart type selection dropdown

116

- **SuperChart Component**: Programmatic usage with the configured key

117

- **Dashboard Integration**: Add to dashboards through standard Superset workflow

118

119

### Legacy API Support

120

121

This plugin uses Superset's legacy API (`useLegacyApi: true`), which means:

122

123

- Compatible with older Superset installations

124

- Uses traditional query response format

125

- May require migration for newer Superset versions

126

- Designed for backwards compatibility with existing workflows