Dashboard Module
Overview
The dashboard
module provides a framework for building and managing interactive dashboards within the Akala ecosystem. It supports customizable widgets, layouts, and data integrations.
Installation
To install the dashboard
module, use the following command:
npm install @akala/dashboard
Usage
Import the module and use its features as follows:
import * as dashboard from '@akala/dashboard';
// Example usage
dashboards.create('myDashboard', { widgets: [] });
API Reference
Method | Description |
---|---|
create(name: string, options: DashboardOptions): Dashboard | Creates a new dashboard with the specified name and options. |
addWidget(dashboard: Dashboard, widget: Widget): void | Adds a widget to the specified dashboard. |
removeWidget(dashboard: Dashboard, widgetId: string): void | Removes a widget from the specified dashboard by its ID. |
Examples
Create a Dashboard
import * as dashboard from '@akala/dashboard';
// Create a new dashboard
dashboards.create('myDashboard', { widgets: [] });
console.log('Dashboard created');
Add a Widget
import * as dashboard from '@akala/dashboard';
const myDashboard = dashboards.create('myDashboard', { widgets: [] });
const widget = { id: 'widget1', type: 'chart', data: {} };
dashboards.addWidget(myDashboard, widget);
console.log('Widget added');
Remove a Widget
import * as dashboard from '@akala/dashboard';
const myDashboard = dashboards.create('myDashboard', { widgets: [] });
dashboards.removeWidget(myDashboard, 'widget1');
console.log('Widget removed');
Contributing
Contributions are welcome! Please follow the guidelines in the main repository.
License
This module is licensed under the MIT License. See the LICENSE file for details.