openmolecules.org

 
Home » DataWarrior » Functionality » FlyingObjects.dwar's picture and description fields (How to create a visualization like flyingobjects.dwar?)
Re: FlyingObjects.dwar's picture and description fields [message #2034 is a reply to message #2033] Thu, 23 November 2023 11:24 Go to previous message
helloWorld22 is currently offline  helloWorld22
Messages: 13
Registered: June 2022
Junior Member
Hi Norwid,
Thanks for pointing out the file in examples folder.
I can find the image in embedded in the flyingObjects.dwar file.

I can now render images from a link inside datawarrior without embedding it.
For anyone who wants to render images dynamically inside datawarrior:

And if your row has a variable, based on which you want to render the image, mention %s
So, for example, the row shows a link and the image in the link needs to be rendered inside datawarrior and also want to show an html page, following changes need to be done in the dwar file:

<columnName="Image URL">
<columnProperty="lookupName0 IC50 IMAGE">
<columnProperty="lookupURL0 <BASE_URL=?>%s">
<columnProperty="lookupCount 1">
<columnProperty="detailType0 image/jpeg">
<columnProperty="detailName0 Picture">
<columnProperty="detailType1 text/html">
<columnProperty="detailName1 Description">
<columnProperty="detailSource1 url/response:%s">
<columnProperty="detailSource0 url/response:<BASE_URL=?>%s">
<columnProperty="detailCount 2">

And the image url column will look like
70199_2_1|#|0:70199_2_1|#|1:<HTML_URL>

<BASE_URL=?> will have the base path and is the end point URI and final url after rendering will be
<BASE_URL=?>70199_2_1

<HTML_URL> is an html page that can be rendered inside DW(remember, javascript will not be rendered and only static html file will be rendered

inside SDK,
you can achieve this by mentioning like this
dwInterface.setColumnProperty(colImage, CompoundTableConstants.cColumnPropertyLookupCount, "1");
dwInterface.setColumnProperty(colImage, CompoundTableConstants.cColumnPropertyLookupName+"0", "IC50 Image");
dwInterface.setColumnProperty(colImage, CompoundTableConstants.cColumnPropertyLookupURL+"0", BASE_IMAGE_URL+"%s");
dwInterface.setColumnProperty(colImage, CompoundTableConstants.cColumnPropertyDetailCount, "2");

dwInterface.setColumnProperty(colImage, CompoundTableConstants.cColumnPropertyDetailType+"0", "image/jpeg");
dwInterface.setColumnProperty(colImage, CompoundTableConstants.cColumnPropertyDetailName+"0", "Picture");
dwInterface.setColumnProperty(colImage, CompoundTableConstants.cColumnPropertyDetailSource+"0", "url/response:"+BASE_IMAGE_URL+"%s");

dwInterface.setColumnProperty(colImage, CompoundTableConstants.cColumnPropertyDetailType+"1", "text/html");
dwInterface.setColumnProperty(colImage, CompoundTableConstants.cColumnPropertyDetailName+"1", "Description");
dwInterface.setColumnProperty(colImage, CompoundTableConstants.cColumnPropertyDetailSource+"1", "url/response:%s");

FYI for others who want to render image inside datawarrior dynamically.

Awesome cheminformatics tool.
Cheers.

[Updated on: Thu, 23 November 2023 17:54]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: feature suggest: array cleaning by delete button
Next Topic: Generate Explanation view based on the data from table
Goto Forum:
  


Current Time: Fri Nov 22 06:29:03 CET 2024

Total time taken to generate the page: 0.04116 seconds