Integrate Graphics with D3 JS

Integrate Graphics with D3 JS

  
Hi,

I want to know if threre is some method to put the graphics of the

www.d3js.org

on a eSpace, I tried to create the webblocks but i still confused

Thanks

Hi Eduardo,

The most common way in which javascript components are used in OutSystems applications is:
  • creating a webblock that bundles up the library javascript (copying the javascript content to the webblock's javascript property);
  • attaching extra files to the eSpace as resources;
  • tweaking paths to point to the correct resource locations.
The webblock can then be dropped in any Web Screens where the library is needed.

In the case of d3js, since it consists of a single JavaScript file* 
with no external resources there is another way.
*
which you can get directly from a CDN :)

By using the 
HTTPRequestHandler AddJavascriptScriptTag action you can add any script to a web screen (it will add a <script/> tag inside the head tag):

You can add that action to any screen Preparation or if you want the script available in all of the application create a Preparation action on the Layout_Normal webblock and add the action there.

To call/use the library you should either add your custom javascript on the Web Screen javascript property or include it on a Expression with property "Escape Content" set to "No".

Let me know if you need more help moving forward. ;)

Cheers!
Davide