2022-01-17 03:23:35 -05:00
# <%= packageName %>
2020-05-13 16:51:43 -04:00
2022-01-17 03:23:35 -05:00
This is the <%= description %> Superset Chart Plugin.
2020-05-13 16:51:43 -04:00
### Usage
2022-01-17 03:23:35 -05:00
To build the plugin, run the following commands:
2020-05-13 16:51:43 -04:00
2022-01-17 03:23:35 -05:00
```
2022-01-18 05:37:09 -05:00
npm ci
2022-01-17 03:23:35 -05:00
npm run build
```
Alternatively, to run the plugin in development mode (=rebuilding whenever changes are made), start the dev server with the following command:
2020-05-13 16:51:43 -04:00
2022-01-17 03:23:35 -05:00
```
npm run dev
```
To add the package to Superset, go to the `superset-frontend` subdirectory in your Superset source folder (assuming both the `<%= packageName %>` plugin and `superset` repos are in the same root directory) and run
```
npm i -S ../../<%= packageName %>
2020-05-13 16:51:43 -04:00
```
2022-01-17 03:23:35 -05:00
After this edit the `superset-frontend/src/visualizations/presets/MainPreset.js` and make the following changes:
2020-05-13 16:51:43 -04:00
```js
2022-01-17 03:23:35 -05:00
import { <%= packageLabel %> } from '<%= packageName %>';
```
to import the plugin and later add the following to the array that's passed to the `plugins` property:
```js
new <%= packageLabel %>().configure({ key: '<%= packageName %>' }),
```
After that the plugin should show up when you run Superset, e.g. the development server:
```
npm run dev-server
2021-11-15 04:57:37 -05:00
```