I have reproduced all the steps as listed in the above webpage including
Using NetworkData folder
Creating subfolders in MainProject/WebUI/resources
Creating the js files
Trying to add the the widget (after refreshing page)
I want to use the custom widget for two functions
Visualization for javascript d3 library
Embedding an html file in the widget
Is anyone facing a similar problem/ or is aware of a solution (or an easier alternative)?
Page 1 / 1
@vyomthakker
The example included in Integrate AIMMS with R — AIMMS How-To uses a custom iframe-widget. See a folder with same under in the MainProject//WebUI//resources//javascript folder.
You can use this to display HTML files in AIMMS WebUI. Perhaps this will also help you in your attempt to build a different custom widget ?
@vyomthakker
Future plans but maybe good you are aware.
It would help us if you could add your thoughts to this post.
Thanks in advance.
Thank you @mohansx. Just to clarify: In the post, the custom iframe-widget is in R which can be accessed via a docker or Plumber API. Do you think that’s the best way to have my own html/ javascript embedded onto the webUI?
Also I am not sure how the WebUI/resources/javascript in the example was created. It isn’t mentioned in the page, wondering whether it was created automatically? Also the sankey diagram does not actually show up on the webUI (although its present in the folder)
Thank you @Patrick. Is there an estimated date for when this feature will be made available?
@vyomthakker you are confusing between two different items. In your original request, you mentioned
I want to use the custom widget for two functions
Visualization for javascript d3 library
Embedding an html file in the widget
It is your responsibility to write the javascript code that
takes data from AIMMS and generates the visualization
works with the AIMMS custom widget framework
The example I shared is an example of one custom widget. The sourcecode WebUI/resources/javascript/iframe was developed to display a iframe window in AIMMS WebUI. You can embed any HTML file/code in another web page using a <iframe> </iframe> block in html. By adding this folder to your AIMMS project, you will see an additional “iframe” item in the drop down when you are creating a new widget.
The example only uses R, plumbR etc., because I do not know enough javascript to do all that but I know R instead. So, using the networkd3 library (which is an R wrapper around d3) I create the HTML visualizations.
Attached is a version of the example that has the iframe widget included.
Reply
Sign up
Already have an account? Login Please use your business or academic e-mail address to register