Yeoman generator that scaffolds Superset visualization plugins and packages with proper structure and boilerplate code
63
Build a Python application that creates and manages interactive sales data visualizations using a business intelligence platform.
You are building a sales analytics application that needs to programmatically create interactive visualizations from sales data stored in a SQLite database. The application should create multiple chart types to analyze sales performance from different perspectives.
Your application should:
Create a bar chart visualization that displays total sales by product category, with categories on the x-axis and sales amounts on the y-axis.
Create a line chart visualization that shows sales trends over time (monthly), displaying the progression of total sales across months.
Create a pie chart visualization that represents the percentage distribution of sales across different regions.
Export chart data from one of the created charts to CSV format for external analysis.
All charts should be created programmatically and properly configured with appropriate metadata (chart type, data source, aggregations, etc.).
@generates
def create_bar_chart(database_id: int, dataset_id: int, chart_name: str) -> int:
"""
Creates a bar chart showing total sales by product category.
Args:
database_id: The ID of the connected database
dataset_id: The ID of the dataset containing sales data
chart_name: The name to give the chart
Returns:
The ID of the created chart
"""
pass
def create_line_chart(database_id: int, dataset_id: int, chart_name: str) -> int:
"""
Creates a line chart showing sales trends over time (monthly).
Args:
database_id: The ID of the connected database
dataset_id: The ID of the dataset containing sales data
chart_name: The name to give the chart
Returns:
The ID of the created chart
"""
pass
def create_pie_chart(database_id: int, dataset_id: int, chart_name: str) -> int:
"""
Creates a pie chart showing sales distribution by region.
Args:
database_id: The ID of the connected database
dataset_id: The ID of the dataset containing sales data
chart_name: The name to give the chart
Returns:
The ID of the created chart
"""
pass
def export_chart_data(chart_id: int, output_path: str) -> None:
"""
Exports the data from a chart to CSV format.
Args:
chart_id: The ID of the chart to export data from
output_path: The file path where the CSV should be saved
"""
passProvides business intelligence and data visualization capabilities including chart creation, data querying, and export functionality.
Install with Tessl CLI
npx tessl i tessl/npm-superset-ui--generator-supersetdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10