Displaying Image from Image Column in Tooltip of Lead Discovery ChemCharts SAR Map Visualization
I have a data table that has an image column (data type is binary) that is rendered accordingly (as an image, can see images in table as expected/ desired). I have performed R group decomposition using the Chemistry function from Lead Discovery ChemCharts, and I am using the resulting R1, R2, and Core columns in my table to create a SAR Map Visualization.
I would like to use the image column of the same table in the tooltips for this SAR Map. The images in the column are not from a url. The image column comes from a table generated using a python data function in the spotfire analysis and joining this table with another to create the final table that has the R1, R2, core, and image columns.
What is the best way to do this?
-
Tooltips only allows to add an image from a URL or depictions of molecules in the configured column in the SAR Map.
To add these images: Properties > Tooltips and check Use form-based tooltips box > Edit local form-based tooltips. Then in Control section select Add > Image.
0 -
In tooltips, display structures from the loaded data: The majority of visualizations support displaying images from a binary image column, a shape file, or a chemical.
0 -
I have the same solution with Monica:
To include these photos: Use form-based tooltips is enabled under Properties > Tooltips. Edit tooltips for local forms. then choose Add > Image under Control.
0 -
To display the images from the binary image column in the tooltips of the SAR Map Visualization, you will need to:
1. Base64 encode the binary data from the image column. This will convert the binary data into ASCII text that can be used in tooltips.
2. Create a calculated column that concatenates "data:image/format;base64," with the Base64 encoded string from the first step. For example, if the images are PNG, the concatenation would be:
"data:image/png;base64," + Base64_Encoded_String3. Use this calculated column in the SAR Map Visualization as the Tooltip Content.
4. In the tooltip, set the HTML rendering to true.
5. Add an <img> tag in the tooltip that sources the data URI created in step 2. For example:
<img src="{{Lead Discovery ChemCharts SAR Map Visualization.Tooltip Content}}">This should display the images from your binary column in the SAR Map Visualization tooltips.
0
Please sign in to leave a comment.
Comments
4 comments