Skip to main content

Configure the tools

The tools are located on the left of the application, when the user is viewing a dashboard.

By default, they include:

note

@activeviam/activeui-sdk exports additional tools which can be plugged into Atoti UI:

To learn how to make these tools available in your application, see activate the query editor.

Prerequisites

Before you read this page, you must complete Setup.

Add a tool

To add a tool (for example the Query editor), go to your index.ts and make the following change:

import { toolQueryEditor } from "@activeviam/activeui-sdk";

const extension: ExtensionModule = {
activate: async (configuration) => {
configuration.tools.push(toolQueryEditor);
},
};

Remove a tool

Similarly, you can remove a tool like this:

const extension: ExtensionModule = {
activate: async (configuration) => {
configuration.tools = configuration.tools.filter(
({ key }) => key !== "widgets",
);
},
};

Create a custom tool

You can also create custom tools.

This can be done by creating a Tool and adding it to configuration.tools.

Create a file named myTool.tsx with the following content:

import { CheckOutlined } from "@ant-design/icons";
import React, { FC } from "react";

import { EditorProps, Tool } from "@activeviam/activeui-sdk";

const MyToolComponent: FC<EditorProps> = () => <div>Hello world</div>;
const MyToolIcon: FC = () => <CheckOutlined />;

export const myTool: Tool = {
key: "my-tool",
component: MyToolComponent,
type: "single",
icon: MyToolIcon,
};
info

MyToolComponent has access to the state of the dashboard and to those of the selected widget. It can also update these pieces of state. See EditorProps for more information.

Finally, go to your index.ts and make the following change:

import { myTool } from "./myTool";

const extension: ExtensionModule = {
activate: async (configuration) => {
configuration.tools.push(myTool);
},
};