DataV-Board provides a custom development feature for creating complex and flexible dashboard effects. This feature is only available to Premium Edition users.
Scenarios
If the built-in features of DataV-Board do not meet your business requirements, you can write JavaScript code (Hook scripts) for custom development. This feature offers more freedom and flexibility than the Blueprint Editor, which lets you customize dashboards as needed.
Display effect optimization: Use Hook scripts to customize CSS styles for enhanced visual effects.
Data processing and transformation: Use Hook scripts to process and transform data on the frontend to meet specific business logic requirements.
Dynamic content updates: Use Hook scripts to enable dynamic content updates and real-time data display on your dashboards.
Advanced animation effects: Use Hook scripts to add complex animation effects and enhance the visual appeal of your dashboards.
Event Response: Responds to user interactions, such as clicks and hovers, to enhance dashboard interactivity.
Limits
This feature is only available to Premium Edition users. If you are not a Premium Edition user, you must first upgrade your product.
Procedure
Access the DataV console.
On the target dashboard page, click global search, and enter the keyword
hookto open the hook editor.NoteOnly Premium Edition users can access the editor. Ensure that you are subscribed to the Premium Edition.
On the custom development code editor page, write your code, and click Save.
Go to the preview page to check the result. If you are satisfied with the result, publish the dashboard.
Hook API
Function body
By default, Hook code uses the CommonJS structure. You must expose an execution function globally. The function body is as follows:
/**
* @param {IStage} stage
*/
module.exports = (stage) => {
};
The stage utility object
The input parameter `stage` is a utility object passed during the dashboard runtime. Its type is as follows: