Overview
Widgets are the building blocks of VizBoard dashboards. Each widget represents a data visualization or content element that displays information from your connected databases. VizBoard supports multiple widget types with various subtypes for different visualization needs.Widget Types
VizBoard provides six main widget categories:Data Tables
Display tabular data with sorting and filtering
Area Charts
Visualize trends over time with filled area charts
Bar Charts
Compare values with vertical and horizontal bars
Line Charts
Show trends and changes over time
Pie Charts
Display proportions and percentages
Text Blocks
Add titles, descriptions, and formatted text
Widget Subtypes
Each widget type has multiple subtypes for specific use cases:src/lib/widget.ts
Widget Structure
Every widget in VizBoard has a consistent structure:Configuration Object
Theconfigs field stores widget-specific settings:
- Chart Widgets
- Data Table Widgets
- Text Widgets
Creating Widgets
Widgets are created using Server Actions and automatically added to the project’s dashboard.Widget Creation Process
When you create a widget, VizBoard:- Normalizes the type and subtype values
- Creates the widget record in the database
- Adds the widget ID to the project’s
orderedWidgetIdsarray
src/app/actions/dashboard/crudWidgets.ts
Updating Widgets
Update existing widgets with new configuration or data:When updating widget configs, the entire
configs object is replaced, not merged. Include all necessary configuration fields in the update.Configuration Updates
The update process replaces the entire configuration:src/app/actions/dashboard/crudWidgets.ts
Deleting Widgets
Remove widgets from a project:Deletion Process
Widget deletion removes the widget and updates the project’s widget order:src/app/actions/dashboard/crudWidgets.ts
Widget Rendering
Widgets are rendered dynamically based on their type and subtype:src/components/dashboard/layouts/dashboardLayout.tsx
Widget Ordering
Widgets are displayed in the order specified by the project’sorderedWidgetIds array.
Default Order
New widgets are appended to the end of the order:Custom Order
Update the display order by reordering theorderedWidgetIds array:
Retrieving Widgets
Get a specific widget by ID:Project Widgets
Widgets are typically retrieved as part of the project data:Data Model
Widgets are stored in the Prisma schema:prisma/schema.prisma
Widget Types Reference
Data Tables
Data Tables
Type:
datatablesSubtypes:simple_dataTable- Basic table with sorting and filteringintegrated_datatable- Advanced table with aggregations and grouping
- Display raw data from database tables
- Create sortable and filterable data views
- Show detailed records with pagination
Area Charts
Area Charts
Type:
area_chartsSubtypes:basic_area- Standard filled area chartlinear_area- Linear interpolation between pointsstep_area- Step-function area chart
- Visualize cumulative data over time
- Show trends with emphasis on volume
- Compare multiple data series
Bar Charts
Bar Charts
Type:
bar_chartsSubtypes:basic_bar- Simple vertical barsstacked_bar- Stacked bars for compositionhorizontal_bar- Horizontal orientation
- Compare values across categories
- Show composition with stacked bars
- Display rankings and comparisons
Line Charts
Line Charts
Type:
line_chartsSubtypes:basic_line- Standard line chartlinear_line- Linear interpolationstep_line- Step-function line
- Track changes over time
- Show trends and patterns
- Compare multiple time series
Pie Charts
Pie Charts
Type:
pie_chartsSubtypes:basic_pie- Standard pie chartdonut_pie- Pie chart with center cutoutstacked_pie- Multi-level pie chart
- Show proportions and percentages
- Display composition of a whole
- Highlight distribution patterns
Text Blocks
Text Blocks
Type:
text_titlesSubtypes:section_title- Large heading for dashboard sectionstext_block- Formatted text content
- Add context to dashboards
- Organize dashboard sections
- Provide descriptions and notes
Best Practices
Descriptive Titles
Use clear, descriptive titles that explain what the widget shows
Consistent Colors
Use consistent color schemes across related widgets
Appropriate Types
Choose widget types that match your data and message
Performance
Limit data points and use aggregations for large datasets
Next Steps
Dashboards
Organize widgets in dashboards
Projects
Manage your projects
Database Connections
Configure data sources
