Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var jQ = require("jquery");
require("tipsy-browserify")(jQ);
var d3 = require("d3");
var _ = require("lodash");
var Processor = require("dataproofer").Processing;
var gsheets = require("gsheets");
var ipc = require("electron").ipcRenderer;
// libraries required to run test inline
// var requireFromString = require("require-from-string");
var DataprooferTest = require("dataproofertest-js");
var uuid = require("uuid");
console.log("dataproofer app version", require("./package.json").version);
console.log("dataproofer lib version", require("dataproofer").version);
// keep track of global renderer
var renderer;
var SUITES = [
require("dataproofer-info-suite"),
var jQ = require("jquery");
require("tipsy-browserify")(jQ);
var d3 = require("d3");
var _ = require("lodash");
var Processor = require("dataproofer").Processing;
var gsheets = require("gsheets");
var ipc = require("electron").ipcRenderer;
// libraries required to run test inline
// var requireFromString = require("require-from-string");
var DataprooferTest = require("dataproofertest-js");
var uuid = require("uuid");
console.log("dataproofer app version", require("./package.json").version);
console.log("dataproofer lib version", require("dataproofer").version);
// keep track of global renderer
var renderer;
var SUITES = [
require("dataproofer-info-suite"),
require("dataproofer-core-suite"),
require("dataproofer-stats-suite"),
require("dataproofer-geo-suite")
];
// turn on all tests by default
SUITES.forEach(function(suite) {
suite.tests.forEach(function(test) {
if (test.active === false) return; // don't overwrite a test's default setting if it's set to false
test.active = true;
function rerunStep3(processorConfig) {
// make sure we can scroll enough to hide the loader/logo
d3.select(".test-sets").style('min-height', "100%");
var loadConfig = processorConfig.loaded.config;
var loaded = Processor.load(loadConfig);
processorConfig.loaded = loaded;
renderer = Processor.run(processorConfig);
// make sure the tests ares still scrolled to the top
var topBar = d3.select(".top-bar").property("scrollHeight");
var offsetTop = d3.select("#info-top-bar").property("offsetTop") - topBar;
var column1 = d3.select(".column-1");
column1.node().scrollTop = offsetTop;
}
function rerunStep3(processorConfig) {
// make sure we can scroll enough to hide the loader/logo
d3.select(".test-sets").style('min-height', "100%");
var loadConfig = processorConfig.loaded.config;
var loaded = Processor.load(loadConfig);
processorConfig.loaded = loaded;
renderer = Processor.run(processorConfig);
// make sure the tests ares still scrolled to the top
var topBar = d3.select(".top-bar").property("scrollHeight");
var offsetTop = d3.select("#info-top-bar").property("offsetTop") - topBar;
var column1 = d3.select(".column-1");
column1.node().scrollTop = offsetTop;
}
function renderStep3(processorConfig) {
// rerun if there's more rows
if (rerunFlag) {
rerunStep3(processorConfig);
return;
}
// set the flag to true after the first run if there's more rows
if (processorConfig.loaded.sampleProgress < 1) rerunFlag = true;
// make sure we can scroll enough to hide the loader/logo
d3.select(".test-sets").style('min-height', "100%");
// var loaded = Processor.load(loadConfig);
// processorConfig.loaded = loaded;
renderer = Processor.run(processorConfig);
// make sure the tests ares still scrolled to the top
var topBar = d3.select(".top-bar").property("scrollHeight");
var offsetTop = d3.select("#info-top-bar").property("offsetTop") - topBar;
var column1 = d3.select(".column-1");
column1.node().scrollTop = offsetTop;
}
ipc.on("last-file-selected", function(event, file) {
var loadConfig = {
ext: file.name.split(".").pop(),
filepath: file.path,
filename: file.name,
sampleOpts: {
sampleSize: 0.25,
sampleMin: 1000,
sampleMax: 10000
}
};
var loaded = Processor.load(loadConfig);
lastProcessorConfig = {
suites: SUITES,
renderer: HTMLRenderer,
input: {},
loaded: loaded
};
});
var _ = require("lodash");
var d3 = require("d3");
var Renderer = require("dataproofer").Rendering;
var util = require("dataproofertest-js/util");
function HTMLRenderer(config) {
Renderer.call(this, config);
var rows = window.rows = config.rows;
this.rows = rows;
this.columnHeads = config.columnHeads;
var resultList = [];
this.resultList = resultList;
d3.select(".grid-footer").classed("hidden", false);
d3.selectAll(".test:not(.active)")
.classed("hidden", true);
d3.selectAll(".toggle").classed("hidden", true);
d3.selectAll(".test label").style("pointer-events", "none");
d3.selectAll(".suite-hed").classed("hidden", true);
function HTMLRenderer(config) {
Renderer.call(this, config);
var rows = window.rows = config.rows;
this.rows = rows;
this.columnHeads = config.columnHeads;
var resultList = [];
this.resultList = resultList;
d3.select(".grid-footer").classed("hidden", false);
d3.selectAll(".test:not(.active)")
.classed("hidden", true);
d3.selectAll(".toggle").classed("hidden", true);
d3.selectAll(".test label").style("pointer-events", "none");
d3.selectAll(".suite-hed").classed("hidden", true);
d3.select(".column-3")
.classed("hidden", false)
.select("#grid")
.selectAll("*")
handsOnTable.selectCell(row, col);
}
}
var searchTimeout;
this.searchHandler = function (event) {
if(searchTimeout) clearTimeout(searchTimeout);
setTimeout(function() {
handsOnTable.search.query(event.target.value);
handsOnTable.render();
}, 500)
}
var searchField = document.getElementById("search-field");
Handsontable.Dom.addEvent(searchField, "keydown", this.searchHandler);
};
HTMLRenderer.prototype = Object.create(Renderer.prototype, {});
HTMLRenderer.prototype.constructor = HTMLRenderer;
HTMLRenderer.prototype.addResult = function(suite, test, result) {
this.resultList.push({ suite: suite, test: test, result: result || {} });
};
HTMLRenderer.prototype.destroy = function() {
var searchField = document.getElementById("search-field");
Handsontable.Dom.removeEvent(searchField, "keydown", this.searchHandler)
this.handsOnTable.destroy();
d3.select("#grid").selectAll("*").remove();
}
HTMLRenderer.prototype.done = function() {
var columnHeads = this.columnHeads;
var rows = this.rows;