cancel
Showing results for 
Search instead for 
Did you mean: 

I want to include d3 as a resource, but SAPUI5 on HANA cannot resolve it

Former Member
0 Kudos

Hi,

I have 2 javascript files in the same directory as the index.html file under WebContent running on HANA. But despite using

createContent : function(oController) {
jQuery.sap.require("d3");
jQuery.sap.require("d3.layout.cloud");

...

I get

GET http://54.72.75.155:8000/sap/ui5/1/resources/d3-dbg.js 404 (Not Found)

sap-ui-core-dbg.js:8103 GET http://54.72.75.155:8000/sap/ui5/1/resources/d3.js 404 (Not Found)

sap-ui-core-dbg.js:14438 Uncaught Error: failed to load 'd3.js' from /sap/ui5/1/resources/d3.js: 404 - Not Found

I also tried locating both these d3 javascript files the directory 'util' and added this

<script>
sap.ui.localResources("view");
sap.ui.localResources("util");
var app = new sap.m.App({initialPage:"testui5"});

...

This got the same error message.

So how do you use other javascript resources in your app?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

In the end I just used a sap.ui.core.HTML to encapsulate the d3 requirement.

But would be interested in how you include your own local resources in general.

Thanks,

David

Former Member
0 Kudos

Hi David,

             Please use a script tag ex:-

  <script src="WebContent/d3.js"></script>

or use jQuery.sap.includeScript("WebContent/d3.js");


Thank you.

Regards,

             Pruthvi.

former_member182862
Active Contributor
0 Kudos

HI David

You can do this

jQuery.sap.require("sap/ui/thirdparty/d3");


Thanks

-D