https://github.com/plotly/plotly.js
Tip revision: 561eac54d7c5bef832508e2738a5254ec006f178 authored by Mojtaba Samimi on 15 July 2022, 18:54:46 UTC
fix 6263 - avoid conflict of sankey mocked x and y with cartesian xy
fix 6263 - avoid conflict of sankey mocked x and y with cartesian xy
Tip revision: 561eac5
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() {};
// see: Building node modules with AMD or RequireJS https://requirejs.org/docs/node.html
if(typeof define !== 'function') {
var define = require('amdefine')(module);
}
define(function(require) {
var plotly = require('../dist/plotly.min.js');
if(plotly) {
console.log(plotly);
} else {
throw 'Error: loading with requirejs';
}
// The value returned from the function is
// used as the module export visible to Node.
return function() {};
});