https://github.com/plotly/plotly.js
Raw File
Tip revision: a5577d994ea06785be100f9e7decff3e6cd8ab1f authored by Mojtaba Samimi on 24 August 2023, 17:00:34 UTC
2.26.0
Tip revision: a5577d9
test_requirejs.js
var JSDOM = require('jsdom').JSDOM;
global.document = new JSDOM('<!DOCTYPE html><head></head><html><body></body></html>').window.document;
global.window = document.defaultView;
global.window.document = global.document;
global.self = global.window;
global.Blob = global.window.Blob;
global.DOMParser = global.window.DOMParser;
global.getComputedStyle = global.window.getComputedStyle;
global.window.URL.createObjectURL = function() {};

var requirejs = require('requirejs');

requirejs.config({
    paths: {
        'plotly': '../dist/plotly.min'
    }
});

requirejs(['plotly'],
function(plotly) {
    if(plotly) {
        console.log(plotly);
    } else {
        throw 'Error: loading with requirejs';
    }
});
back to top