Canvas Widget

    In the 20.19.0 release, we introduced the Canvas widget, designed to showcase a range of graphical illustrations and bespoke designs. This widget allows the integration of new charts and column renderers via external libraries, making it possible to exhibit pie charts, spectrums, and dose-response curves, among others. Additionally, this widget is interactive, accepting mouse and keyboard inputs. Another enhancement is the Canvas Cell Renderer, which facilitates custom drawings within tables using Java user code. The configuration for these visualizations is achieved through JSON map format settings.

    The Canvas widget taps into user-generated code for data retrieval and depiction. Users can employ either a Groovy script or a Java handler from a plugin for this purpose, and both are compatible with grid and form views of the Canvas widget. In the context of a form view, adding the Canvas widget follows a familiar procedure, mirroring the addition of other widgets. Users can drag and drop the Canvas icon (images/download/thumbnails/20426846/Canvas_icon.png), located on the right sidebar, to their preferred spot within the form. Alternatively, they can right-click within the form and select the Canvas icon from the ensuing menu. Subsequently, the widget's settings must be customized, and this involves inputting the Groovy script or specifying the Handler class in the widget customizer's Visual properties segment.

    images/download/attachments/20426846/Customize_settings.png)

    By default, a sample Groovy script is provided, which captures mouse actions and clicks. However, users can switch this out with a bespoke script, such as one that plots a chart. Several such script samples are accessible in the api-examples, downloadable as a .zip file from the IJC download section.

    Alternatively, users can utilize a plugin to realize the visualization features. The plugin can be integrated via the IJC's main menu pathway: Tools > Plugins. Upon successful installation, the plugin's name will be listed under the installed plugins section. Within the Canvas widget, this plugin can be invoked using the relevant Java handler. It's also compatible with a grid view or a table widget by adjusting the cell renderer to the Canvas Cell Renderer. If the handler class name is correctly specified, the Canvas searches for the class and runs it. However, in the absence of the class or if the row is vacant, the default Groovy script is initiated.

    Tutorials for building plugins in IJC can be found on the documentation page here.

    Possibilities, which Canvas Widget offers are shown in the examples here