StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
StackGenVis/frontend/node_modules/plotly.js/tasks/util/make_schema.js

25 lines
915 B

var fs = require('fs');
var path = require('path');
var JSDOM = require('jsdom').JSDOM;
module.exports = function makeSchema(plotlyPath, schemaPath) {
return function() {
var plotlyjsCode = fs.readFileSync(plotlyPath, 'utf-8');
var w = new JSDOM('', {runScripts: 'dangerously'}).window;
// jsdom by itself doesn't support getContext, and adding the npm canvas
// package is annoying and platform-dependent.
// see https://github.com/tmpvar/jsdom/issues/1782
w.HTMLCanvasElement.prototype.getContext = function() { return null; };
w.URL.createObjectURL = function() { return null; };
w.eval(plotlyjsCode);
var plotSchema = w.Plotly.PlotSchema.get();
var plotSchemaStr = JSON.stringify(plotSchema, null, 4);
fs.writeFileSync(schemaPath, plotSchemaStr);
console.log('ok ' + path.basename(schemaPath));
};
};