Skip to content

Commit

Permalink
close #16, close #17, close #19, close #20, close#22
Browse files Browse the repository at this point in the history
  • Loading branch information
Koushikphy committed Dec 26, 2019
1 parent b013071 commit 62320d8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
15 changes: 7 additions & 8 deletions html/spreadsheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
const { dialog, BrowserWindow, Menu } = remote;
var full = document.getElementById("fullS");
var xcol = [], data = [], hot, columns = [], xName, mytable;
var btn = document.getElementById("btn");
btn.style.visibility = "hidden";
// var btn = document.getElementById("btn");
// btn.style.visibility = "hidden";
var event, th_in = 0, $ch = $("#custom-handle"), $slider = $("#slider");

ipcRenderer.on("slider", function (e, d) {
Expand Down Expand Up @@ -76,10 +76,11 @@
allowRenameColumn : false,
updateTable:function(_, cell, _, _, _, label, _) {cell.style.color = parseFloat(label)!=label ? 'red' : '#000000'},
onload:_=>setTimeout(_=>{let tt=$('.jexcel_content'); tt.height(window.innerHeight-tt.offset().top-10)},1),
onchange:_=>btn.style.visibility = "visible",
onsort:_=>{data[th_in] = mytable.records.map(x=>x.map(y=>y.innerHTML));btn.style.visibility = "visible"}
// onchange:_=>btn.style.visibility = "visible",
// oninsertrow:_=>btn.style.visibility = "visible",
onsort:_=>{data[th_in] = mytable.records.map(x=>x.map(y=>y.innerHTML))}//;btn.style.visibility = "visible"}
})
mytable.setData(data[0])
mytable.setData(data[0])
})


Expand All @@ -93,10 +94,8 @@
return m[0].map((_, i) => m.map(x => x[i]));
};



function updateData() { //parse the formulas during the return
btn.style.visibility = "hidden";
// btn.style.visibility = "hidden";
var dat = data.map(blocks=> blocks.map(line=>line.map(elem=>{
if (('' + elem).substr(0,1) == '=') return mytable.executeFormula(elem); return elem
})))
Expand Down
2 changes: 1 addition & 1 deletion lib/init.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/dataOp.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ function dataFiller() {
for (let i = 0; i < data[0].length; i++) if (i != col.y) cols_wo_y.push(i)
}

for(let dt of data){
for(let dt of data[0][col.y]){
if(dt[0]>=dt[1]){
console.log(dt[0],dt[1])
alert('Monotonically increasing values required for interpolation.\n NOTE: You can use the spreadsheet to sort the data')
return
}
Expand Down
5 changes: 2 additions & 3 deletions src/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function updateData() {
col2dChanged()
};
fullDataCols[0] = JSON.parse(JSON.stringify(col));
updatePlot(1);
updatePlot();
makeRows();
startDragBehavior();
updateOnServer();
Expand Down Expand Up @@ -88,7 +88,6 @@ function fileReader(fname) {
buttons: ['Yes', "No"]
});
if (res) return;

// parse the file and data
data = parseData(fs.readFileSync(fname, "utf8"))
if(data==undefined) return
Expand Down Expand Up @@ -120,7 +119,7 @@ function fileReader(fname) {
if (window["pJSDom"] instanceof Array) window["pJSDom"][0].pJS.fn.vendors.destroypJS();
$("#full").show();
$('#jsoneditor').height(window.innerHeight - jsoneditor.offsetTop)
if (figurecontainer.data.length > 2){
if (figurecontainer.data.length > 1){
let tt = [];
for(let i=1;i<figurecontainer.data.length;i++){
tt.push(i)
Expand Down
2 changes: 1 addition & 1 deletion src/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function closeNav2() {

function updateJSON() {
if (!$('#sidebar2').width()) return // dont call if its not visible
console.log('called')
// console.log('called')
var Plots = [];
var tmpLeg = []
for (let trace of figurecontainer.data) {
Expand Down

0 comments on commit 62320d8

Please sign in to comment.