how to inspect element in Generic JavaScript View node

I found this thread which helps me to import other JS libs. It works with one vis library so far. However, when I tried to import another library to compute stat to show with vis, it might work as it doen't complain anything but I'm not sure how I can inspect the value or print it out to check or show the values. I tried 'document.write();' but no luck. Any help will be appreciated.

 

code below

//  work
require.config({
    paths: {
        'Plotly': 'https://cdn.plot.ly/plotly-latest.min'
    }
});
require(['Plotly'], function(Plotly) {
    document.write('Hello world');

});

 

//not work
require.config({
    paths: {
        'Stat': 'https://unpkg.com/simple-statistics@4.1.0/dist/simple-statistics.min.js'
    }
});
require(['Stat'], function(Stat) {
    document.write('Hello world');

});

Cheers,

 

Hi,

after a quick look at your code, I noticed that in the second case you added the .js file ending to the paths configuration. RequireJS is a little picky about that. If you leave away the file ending it should work.

Cheers,

Christian