Plug-in tool views
A tool view is a custom web page that provides the user interface for an i2 Notebook plug-in. The i2 Notebook web client loads and displays tool views right alongside its own user interface elements.
The code in a tool view can get access to data in the application through the tool view API, making tool views a convenient way for a plug-in to provide extra functionality to users. You can read, present, and allow users to interact with data all from the same part of your project.
What a tool view can do
Tool views have direct access to the data on the chart, including the visual elements and the underlying record data. As a result, they can process and analyze that data however you choose.
For example, you might create a tool view that uses custom processing to filter the items on a chart, or performs complex data analysis, or integrates with a third-party user interface.
Creating a tool view
A tool view consists of one or more HTML pages, as well as any resources that those pages require. The tutorials in this SDK provide worked examples of how you might add a tool view to your i2 Notebook plug-in.
Note: The tutorials use the Angular, React, and Vue frameworks to simplify some aspects of writing tool views.
When you have the source code for a tool view in place, you create it in the plug-in entry point by calling the createToolView()
method on the IEntryPointApi
interface.
A plug-in can create as many tool views as it needs. To enable users to display a tool view, you must create and register a command for doing so, and then surface that command in the i2 Notebook web client user interface.
Tool view lifecycle
i2 Notebook web client users can open and close a tool view whenever they choose. As a result, a single tool view HTML page might be reloaded multiple times in the course of a single session. A tool view is also reloaded when it is floated or docked, or moved from one part of the user interface to another.
Without intervention, any state that a user has built up inside a tool view is lost when it is reloaded. When the lifetime of a particular instance of a tool view is potentially quite short, this behavior is likely to frustrate users. To maintain the state of a tool view, the i2 Notebook Web API provides a volatile store that can save and recover state in response to reload events.