This guide provides step-by-step instructions for installing IJC plugins for Canvas Widget and illustrates their use through practical examples.
The Canvas Widget is a powerful tool for dynamic data visualization, turning numbers and texts into interactive graphs, diagrams, and other easy-to-read graphics. It's a great helper in instrumental analysis, allowing you to individually pick, parameter-select (e.g. selecting the top 5 peaks), zoom, modify or compare data points and much more. Accessible in both grid and form views, the Canvas Widget provides the convenience of analyzing all your data on a single screen.
The following examples provide just a quick glimpse into the Canvas Widget's capabilities. If this tool catches your eye, check out the IJC plugin quickstart guide to build your own plugins.
Should you require a solution precisely tailored to your specific needs, the Instant JChem support team is ready to assist. Contact us via Chemaxon Freshdesk for custom-designed plugins.
Exemplary plugins are located on the Instant JChem download page.
On the aforementioned page, the Browse previous versions
option provides access to various version selections.
Choose the desired version and download ijc-api-examples.zip
file located inside the version folder.
Once the ijc-api-examples.zip
file has been downloaded, extract the contents.
After launching Instant JChem (IJC), click Tools > Plugins option in the Main menu to open plugin interface.
In the newly displayed window, choose Downloaded
tab and click Add Plugins...
.
Navigate to the plugins
folder found within the previously extracted ijc-api-examples directory.
Once here, select com.chemaxon.ijc.canvas.examples.rings
and com.chemaxon.ijc.canvas.examples.demo
plugins and click install.
Upon successful installation, the plugins will be ready-to-use in both grid and form views.
The demo plugin contains renderers for Boolean and datetime fields.
com.chemaxon.ijc.canvas.examples.demo.BooleanCell
is designed to present a graphical designs into Boolean field.
com.chemaxon.ijc.canvas.examples.demo.ClockCell
is designed to present a graphical designs into datetime field.
The rings-plugin contains renderer for calculated field.
com.chemaxon.ijc.canvas.examples.rings.RingsCell
is designed to present grap for a calculated field
com.chemaxon.ijc.canvas.examples.rings.RingsWidget
- for a Form view Canvas widget.
Be aware that the .RingsCell
class is utilized in Grid view, while the .RingsWidget
class is employed in Form view. This applies to all previously mentioned handler classes.
Leveraging graphical elements for Boolean fields in IJC's grid view offers multiple benefits. Not only it enhances the interface's visual appeal, but also simplifies the process of data analysis. Collectively, the employment of visual elements contributes to a more intuitive and efficient user experience while scanning through the datasets
Create a new Boolean field in a grid view.
Fill in a few checks and crosses by clicking into the empty cells (this is solely for observing the changes that occur after implementing the Canvas renderer). Right click on the field and choose Customize Widget Settings.
Change Cell Renderer:
option to Canvas cell renderer
. Paste the following handler com.chemaxon.ijc.canvas.examples.demo.BooleanCell
into Handler class. Close the Table Widget Settings wizard.
The Boolean field value is now displayed as an image.
Various graphic elements (e.g. a green check mark for “true”, a red “x” for “false”) can be used for displaying the Boolean field value. Their shape, colour and size can be easily changed by using a JSON map in the Config field.
Create new date field and fill in few random dates.
Right click on the field and choose Customize Widget Settings. Change Cell Renderer:
option to Canvas cell renderer
.
Enter com.chemaxon.ijc.canvas.examples.demo.ClockCell
into Handler class, as in previous example, click OK and close the Customize Widget Settings wizard.
Date time is now displayed as clocks.
For a clearer understanding of the following example, it would be helpful to have a foundational knowledge of parent-child entity relations. Please refer to the Pivoting tutorial for a comprehensive guide on establishing such relationships.
Suppose we want to visually display results from a random experiment conducted on every structure in the dataset three times. With each repetition, the concentration was elevated (for instance, 50mM, 100mM, and 200mM). In simpler terms, each molecule is associated with three measurement outcomes we wish to display.
Create New Calculated field as Calculated text field
type.
Choose name for the new field.
Click Add
. In the child entity, select the field you wish to display. For our demonstration, we're aiming to show the values in the Result 1
field. Confirm by clicking OK.
Set the variable Type to List
. This configuration ensures that all three result values are enumerated.
Enter the Variable name
as Expression
and click Validate
. You should see [1]
as a Test Result
.
Click Finish. The values in the field are now visible in [x1,x2,x3] format.
Open Customize Widget Settings and switch to Canvas cell renderer
.
Open Handler Class and copy paste com.chemaxon.ijc.canvas.examples.rings.RingsCell
. Click OK and close Widget settings.
The values in the field Result 1 are now displayed as rings. Diameters of the rings are proportional to the measured values. The bigger the value, the bigger the ring. For higher values, it may be necessary to zoom out to see the corresponding ring.
To visualize the rings in a form view, we need to use Wombat data tree since the com.chemaxon.ijc.canvas.examples.rings.RingsWidget
serves solely as an example and is designed specifically for Wombat data tree.
Open Wombat data tree and select Wombat(compound view) compounds
.
Once there, switch to the design mode and drag and drop Canvas Widget from the sidebar to any empty place in the form.
Right click on the widget and select Customize Widget Settings. Fill in the handler class com.chemaxon.ijc.canvas.examples.rings.RingsWidget
, click OK and close the widget settings.
The rings are now visible. In the form view, the widget is interactive and can be modified as pleased.
For a brief overview of Canvas widget in Instant JChem click here.
For additional Canvas widget examples click here.
Interested in building your own plugins? Click here.
In conclusion, the Canvas Widget stands as a potent tool for dynamic data visualization, transforming numerical and textual data into interactive and easily interpretable graphics. This capability significantly enhances workflow, allowing users to selectively analyze, modify, or compare data. By incorporating plugins, one can tailor the visualizations to specific needs, whether it's displaying spectra or graphs of any kind or complex parent-child entity relations.