cancel
Showing results for 
Search instead for 
Did you mean: 

Lumira 1.25 VizPacker plugin in WebIDE question

mike_howles4
Active Contributor
0 Kudos

Hey guys.  I tried searching but came up short.  Maybe someone can point me to the answer or give one here

I'm in the midst of trying to port over a Design Studio Extension to Lumira for fun.  In order for me to get this to work, I need to load a few d3 plugins along the way, just as I must in Design Studio.  I've gotten it working in WebIDE just fine, however it appears that the paths are not the same when packing it up and running it local.

My basic question is, what is the approach for loading additional .js files in a Lumira Extension?  These files are generally AMD-aware so I can use require.js if that's a best practice... My attempts have come up short and are probably bad attempts

Below is my code snippet in WebIDE showing off my ignorance (Click to enlarge)

I've added 2 files (shown in blue).  One is a d3 hexbin plugin and the other is d3 v3 (d3v3 is AMD-compliant and doesn't interfere w/CVOM, I've already been down that path)....  The section in green shows a successful (albeit primitive) output...

The code in orange is where I'm unsure if is the right way of loading extra modules or if there's a better way I'm missing.  Anyways, it works fine on WebIDE but when I pack it up and install on Lumira Desktop, I get a blank visualization.  When I check HTTP traffic with Fiddler, it appears that the require paths are different:

The first line is fine and is just there to show one path example, and the next 2 lines show the incorrect path that my require call is using and 404ing on me.

Is there a way to make this work in WebIDE (which is AWESOME, by the way!) as well as Lumira Desktop without having to toggle paths?  I hope I'm just missing something easy.

Thanks for any help!

Accepted Solutions (1)

Accepted Solutions (1)

Robert_Russell
Contributor
0 Kudos

Hi Michael,

The way I get around the vizpacker and Lumira path issue is to follow the require documented process of adding multiple paths in an array as per the link below. For my extensions this approach works and I don't have to change paths while working with vizpacker or Lumira.

Regards Robert

http://requirejs.org/docs/api.html#pathsfallbacks

mike_howles4
Active Contributor
0 Kudos

Robert,

This is perfect!  Thank you so much.  I'll also be able to use this in my Design Studio extensions also!  Thanks again!!!

Answers (1)

Answers (1)

mike_howles4
Active Contributor
0 Kudos

Well, until someone gives me an assist, I have a workaround for now...  It's probably still not the right approach so I hope someone can chime in.  I am now just using a boolean value that I set to true before Packing to toggle between the two paths.  Good enough for now I guess...

Yippe!

Now it's time to pretty it up, etc...

former_member183750
Active Contributor
0 Kudos

Hi Michael

I have not had time to look at the extensions at all yet. But I have I did listed to a really good presentation on it, so just throwing this out there as a possible help...

Create Cool SAP Lumira Visualization Extensions with SAP Web IDE - YouTube

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow me on Twitter

mike_howles4
Active Contributor
0 Kudos

Thanks Ludek for the link - That video I'm sure is helpful for most cases for getting started.  However for me, I'd like to use require.js (or some AMD loader mechanism) to load a few module dependencies so that information specifically is what I am after.

former_member183750
Active Contributor
0 Kudos

I pinged the presenter in the video to see if he can provide a bit of help. Let's keep our fingers crossed

- Ludek