Creating a custom plugin
Adnerw opened this issue · 0 comments
Adnerw commented
Hi
I am new and i am trying to learn Superset.
I would like to create a new plugin.
I did yarn install && yarn build
and after running yarn storybook
but when I open the localhost:9001 in the preview appears this:
ERROR chartType="my-chart" —Error: Item with key "my-chart" is not registered.
This is a file Stories.tsx
import React from 'react'
import { SuperChart } from '@superset-ui/chart'
export default [
{
renderStory: () => (
<SuperChart
chartType="my-chart"
width={800}
height={500}
/>
),
storyName: 'Basic',
storyPath: 'plugin-my-Chart|myChartPlugin',
},
];
and this is a my index.js
import ChartMyPlugin from '../../../../superset-ui-plugin-chart-my/src';
import Stories from './Stories';
new ChartMyPlugin().configure({ key: 'my-chart' }).register();
export default {
examples: [...Stories],
};
what should I do?
Thanks in advance
Andrea