teach me how to create a dataiku plugin that creates a new chart type
Assistant
Creating a Dataiku plugin that creates a new chart type involves several steps. I'll guide you through the process using a simple example of a new chart type called "HistogramDonutChart". This chart type will combine the features of both a histogram and a donut chart.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
First, make sure you have Dataiku DSS and the plugin development kit (PDK) installed on your computer. If you don't, you can find the installation instructions in the Dataiku Developer Portal.
Create a new directory for your plugin project and navigate to it in the terminal or command prompt:
mkdir HistogramDonutChart
cd HistogramDonutChart
Initialize the plugin project with the PDK:
pdk init --template=typescript
This will create a new TypeScript project with the necessary boilerplate code.
Define the new chart type:
Open the src/HistogramDonutChartPlugin.ts file and update the metadata parameter in the Plugin class to include the new chart type:
import { Plugin } from '@dataiku/plugin-kit';
export default class HistogramDonutChartPlugin extends Plugin {
metadata() {
return {
id: 'HistogramDonutChartPlugin',
name: 'HistogramDonutChart',
type: 'chart',
description: 'A new chart type that combines the features of a histogram and a donut chart.',
icon: 'icon-custom',
category: 'Custom',
dependencies: [],
inputs: [],
outputs: [],
config: {},
};
}
// ...
}
Create the chart type:
Now, you need to implement the new chart type. Create a new TypeScript file in the src/chartTypes directory:
touch src/chartTypes/HistogramDonutChart.ts
Add the following code to the HistogramDonutChart.ts file to define the new chart: