superset/superset-frontend/temporary_superset_ui/superset-ui/packages/generator-superset/generators/plugin-chart/templates
Yongjie Zhao 66b5b2cf9f chore: add Apache License for superset-ui (#1444)
* chore: add rat script

* add license

wip
2021-11-26 11:47:36 +08:00
..
src fix(generator-superset): update plugin template to 0.17 standards (#1013) 2021-11-26 11:47:00 +08:00
test chore: add Apache License for superset-ui (#1444) 2021-11-26 11:47:36 +08:00
types chore: add Apache License for superset-ui (#1444) 2021-11-26 11:47:36 +08:00
package.erb chore: upgrade to emotion@11 (#1086) 2021-11-26 11:47:07 +08:00
README.erb chore(core): remove queryData and replace with queriesData (#874) 2021-11-26 11:46:47 +08:00
tsconfig.json fix(generator-superset): add fixes to viz plugin generator (#803) 2021-11-26 11:46:41 +08:00

## @superset-ui/plugin-chart-<%= packageName %>

<%if (addBadges) { %>[![Version](https://img.shields.io/npm/v/@superset-ui/plugin-chart-<%= packageName %>.svg?style=flat-square)](https://www.npmjs.com/package/@superset-ui/plugin-chart-<%= packageName %>)<% } %>

This plugin provides <%= description %> for Superset.

### Usage

Configure `key`, which can be any `string`, and register the plugin. This `key` will be used to lookup this chart throughout the app.

```js
import <%= packageLabel %>ChartPlugin from '@superset-ui/plugin-chart-<%= packageName %>';

new <%= packageLabel %>ChartPlugin()
  .configure({ key: '<%= packageName %>' })
  .register();
```

Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/superset-ui/?selectedKind=plugin-chart-<%= packageName %>) for more details.

```js
<SuperChart
  chartType="<%= packageName %>"
  width={600}
  height={600}
  formData={...}
  queriesData={[{
    data: {...},
  }]}
/>
```

### File structure generated

```
├── package.json
├── README.md
├── tsconfig.json
├── src
│   ├── <%= packageLabel %>.tsx
│   ├── images
│   │   └── thumbnail.png
│   ├── index.ts
│   ├── plugin
│   │   ├── buildQuery.ts
│   │   ├── controlPanel.ts
│   │   ├── index.ts
│   │   └── transformProps.ts
│   └── types.ts
├── test
│   └── index.test.ts
└── types
    └── external.d.ts
```