Skip to content

Custom Widgets

The Robotic Data Automation Fabric (RDAF) platform allows users to create dashboards by defining them in JSON. With the release of version 8.0, RDAF now supports Micro-frontends, enabling users to incorporate new widgets and dashboards using popular UI frameworks like Vue, React, or others. This upgrade offers a more flexible and scalable architecture, making it easier to build and customize dashboards to meet specific needs.

Dashboard Structure

A dashboard is built using multiple parts, including attachments and custom widgets (also called micro-frontends). Attachments can be various file types, such as JSON, HTML/CSS, JavaScript, or any other text-based formats. These components work together to create the dashboard's functionality and design.

1. Custom Widgets

Custom widgets are added to a dashboard by defining them in the custom_widgets section of the dashboard's JSON structure. These widgets can include various resources, such as HTML templates, JavaScript files, and other assets needed to display and function properly. This setup allows for flexible and reusable components that can be tailored to specific dashboard needs.

2. Creating Custom Widgets

Important

Each custom widget must have one artifact named main, which typically contains an HTML attachment. This HTML file serves as the starting point of the widget and is essential for proper functionality. This HTML file serves as the starting point of the widget.

Creating Custom Widgets involves developing personalized components that enhance user interaction and display tailored data or functionality. These widgets are built to meet specific requirements within an application or interface.

For a wide variety of custom widgets and examples click here.

"custom_widgets": {
    "gauge_display": {
        "artifacts": {
            "main": {
                "attachment": "index.html",
                "content_type": "text/html",
                "is_template": false
            },
            "main.js": {
                "attachment": "main.js",
                "content_type": "text/javascript",
                "is_template": false
            }
        }
    }
}

Explanation of Attributes

Attributes
Description
custom_widgets This defines the custom widgets used in the dashboard. Here's a breakdown of how it works:
gauge_display This is an example of a widget name. Each widget must have a unique identifier to distinguish it from others.
artifacts This section contains references to the widget's resources, such as HTML files, JavaScript files, or other assets needed for the widget to function.
attachment Specifies the filename of the asset (e.g., script.js or template.html).
content_type Defines the MIME type of the asset, such as text/html for HTML files or text/javascript for JavaScript files.
is_template A true/false flag that indicates whether the asset is a template. If true, it means the asset supports dynamic content processing.

3. Using Custom Widget in the Dashboard

The following code snippet shows how to include a custom widget in the dashboard definition. By adding this widget, user can enhance the dashboard’s functionality with personalized features. This process allows user to integrate their own widgets seamlessly into the dashboard layout.

"dashboard_sections": [
    {
        "title": "Gauge Display",
        "widgets": [
            {
                "title": "Gauge Display",
                "widget_type": "custom_widget",
                "widget_implementation": "run_pipeline/run_pipeline",
                "min_width": 6,
                "max_width": 12,
                "height": 12,
                "widget_id": "4e2d534c",
                "fixed_variables": {}
            }
        ]
    }
]

Explanation of Attributes

Attributes
Description
dashboard_sections Defines the different sections or areas within the dashboard. Each section acts as a container for related widgets, allowing for logical grouping and organization of content.
title Provides a title or heading for a specific dashboard section. This helps users quickly understand what the section is about. For example, a section called 'Customer Insights' would include widgets displaying customer-related data.
widgets Contains a list of widgets included in the section. Widgets are individual components or visual elements (e.g., charts, tables, or custom UI elements) that display specific data or functionality.
widget_type Specifies the type of widget (in this case, custom_widget). In this case, the type is custom_widget, which indicates that the widget is not a standard or pre-built component but rather a custom implementation tailored to specific needs.
widget_implementation The path reference to the widget's implementation. This could be a file path, URL, or other reference pointing to the code or resource that defines how the widget functions and appears.
min_width / max_width Defines the minimum and maximum width for the widget. These properties ensure the widget maintains a consistent and usable size within the dashboard layout.
height Specifies the height of the widget. This ensures the widget has a consistent vertical size, which is important for maintaining a clean and organized dashboard layout.
widget_id A unique identifier for the widget. This ID is used to distinguish the widget from others in the dashboard, enabling specific interactions, updates, or references in the code.
fixed_variables A dictionary of inputs passed to the widget. These variables provide the widget with the necessary data or configuration to function correctly.

4. Attachments

  • Each dashboard can include various attachments that help define the look and behavior of the widgets.

  • Attachments can be JSON, HTML, CSS, JavaScript, or any other text-based content required for rendering the dashboard.

  • These Attachments are linked to the dashboard or its widgets, providing the necessary resources for rendering and functionality.

  • They are typically referenced in the dashboard configuration or widget definitions, helps in creating dynamic, interactive, and visually appealing dashboards tailored to user's specific requirements.

5. Micro-frontend Support

With the adoption of micro-frontend, users gain the flexibility to:

  • Leverage any UI framework (such as Vue, React, or Angular or plain HTML/CSS) to develop and integrate widgets, enabling teams to use the tools they are most comfortable with.

  • Define custom widgets through the custom_widgets attribute, allowing for tailored functionality and design to meet specific needs.

  • Attach necessary assets (HTML, JavaScript, and CSS) to ensure the widget operates seamlessly and aligns with the application’s visual style.

This enables effortless extensibility and customization of dashboards within RDAF, allowing new UI components to be integrated seamlessly without the need to alter the core platform. This modular approach enhances flexibility, accelerates development, and ensures the platform remains future-proof.

6. Custom Widgets Examples

a) Sequence Diagram Widget: Static data loading during initialization, with group/time filters, uses an external JS library.

b) Gantt Chart (Project Plan): Dynamic data loading, external CSS, and JS from an attachment — more interactive.

c) Workflow Designer Widget: Relies on an external JS library but doesn’t use dynamic JS loading, RDAF interaction, or attachments.

Feature
Sequence Diagram Gantt Chart Workflow Designer
Uses external JS library Yes Yes
Uses JS code from attachment Yes
Interacts with RDAF UI Yes
Loads Data During init time Yes
Loads data Dynamically in JS Yes
Uses Group and Time Filters Yes
Uses CSS as additional attachment Yes

6.1 Sequence Diagram Widget

Sequence Diagram

1) Features Used by Sequence Diagram Widget

  • External Javascript Library.

  • Data coming from RDAF Persistent Stream.

  • Data Populated into Widget during Widget Loading time.

  • Apply group filters and Time filters for custom widgets.

2) Data Used by this example

  • Uses Stream rda_microservices_traces

  • This Stream is part of every RDAF System

Widget Ddefinition

Group Time Filters

Mermaidjs Compatible

Mermaidjs Compatible

Using The Widget

6.2 Gantt Chart

Gantt Chart

1) Key Features used in Gantt Chart

Prebuilt JavaScript Code: A ready-to-use JavaScript implementation is provided as part of the attachment.

Real-Time Data Streaming: Data is sourced from the RDAF Persistent Stream for continuous updates.

Dynamic Data Loading: Data is fetched from the backend on-demand, ensuring up-to-date information.

Seamless Dashboard Integration: Supports cross-launching other RDAF Dashboards based on user interactions.

2) Data Used by the Gantt Chart example

Custom data in a stream with following columns

  • name

  • status

  • start_date

  • end_date

Features Used

Query_json

Gantt Chart Example1

Gantt Chart Example2

Gantt Chart Example3

Gantt Chart Example4

Gantt Chart Example5

6.3 Workflow Designer

Workflow Designer

Features Utilized in This Example:

  • External JavaScript Library: The example integrates an external JavaScript library to enhance functionality, such as handling UI interactions, data visualization, or utility functions.

  • Self-Contained Example: The example is designed as a standalone implementation, containing all necessary code, assets, and logic within itself.

Data Utilized in This Example:

  • Hard-Coded Data: The example includes static or predefined data embedded directly within the code.

  • User-Editable Data (Through UI): The example allows users to input or modify data dynamically via the user interface.

Workflow Designer

Workflow Designer

Workflow Designer