Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jsgantt-improved

Package Overview
Dependencies
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsgantt-improved - npm Package Compare versions

Comparing version 2.0.6 to 2.0.7

docs/fixes/bigdata.json

35

dist/src/draw.js

@@ -52,2 +52,3 @@ "use strict";

this.vAdditionalHeaders = {};
this.vDebug = false;
this.vShowSelector = new Array('top');

@@ -206,3 +207,4 @@ this.vDateInputFormat = 'yyyy-mm-dd';

};
this.DrawDependencies = function () {
this.DrawDependencies = function (vDebug) {
if (vDebug === void 0) { vDebug = false; }
if (this.getShowDeps() == 1) {

@@ -222,2 +224,4 @@ //First recalculate the x,y

if (vList[vTask].getVisible() == 1) {
if (vDebug)
console.log("init drawDependency", new Date());
if (vDependType[k] == 'SS')

@@ -302,6 +306,11 @@ this.drawDependency(vList[vTask].getStartX() - 1, vList[vTask].getStartY(), vList[i].getStartX() - 1, vList[i].getStartY(), 'SS', 'gDepSS');

// var vParDiv;
var bd;
if (this.vDebug) {
bd = new Date();
console.log('before draw', bd);
}
if (this.vTaskList.length > 0) {
// Process all tasks, reset parent date and completion % if task list has altered
if (this.vProcessNeeded)
task_1.processRows(this.vTaskList, 0, -1, 1, 1, this.getUseSort());
task_1.processRows(this.vTaskList, 0, -1, 1, 1, this.getUseSort(), this.vDebug);
this.vProcessNeeded = false;

@@ -657,2 +666,7 @@ // get overall min/max dates plus padding

var j = 0;
var bd_1;
if (this.vDebug) {
bd_1 = new Date();
console.log('before tasks loop', bd_1);
}
for (i = 0; i < this.vTaskList.length; i++) {

@@ -817,2 +831,6 @@ var curTaskStart = this.vTaskList[i].getStart() ? this.vTaskList[i].getStart() : this.vTaskList[i].getPlanStart();

}
if (this.vDebug) {
var ad = new Date();
console.log('after tasks loop', ad, (ad.getTime() - bd_1.getTime()));
}
if (!vSingleCell)

@@ -859,4 +877,17 @@ vTmpTBody.appendChild(vDateRow.cloneNode(true));

this.vTodayPx = -1;
var bdd = void 0;
if (this.vDebug) {
bdd = new Date();
console.log('before DrawDependencies', bdd);
}
this.DrawDependencies();
if (this.vDebug) {
var ad = new Date();
console.log('after DrawDependencies', ad, (ad.getTime() - bdd.getTime()));
}
}
if (this.vDebug) {
var ad = new Date();
console.log('after draw', ad, (ad.getTime() - bd.getTime()));
}
}; //this.draw

@@ -863,0 +894,0 @@ this.drawSelector = function (pPos) {

@@ -9,3 +9,4 @@ "use strict";

*/
exports.parseJSON = function (pFile, pGanttVar) {
exports.parseJSON = function (pFile, pGanttVar, vDebug) {
if (vDebug === void 0) { vDebug = false; }
var xhttp;

@@ -20,4 +21,18 @@ if (window.XMLHttpRequest) {

xhttp.send(null);
var jsonObj = eval('(' + xhttp.response + ')');
var bd;
if (vDebug) {
bd = new Date();
console.log('before jsonparse', bd);
}
var jsonObj = JSON.parse(xhttp.response);
if (vDebug) {
var ad = new Date();
console.log('after jsonparse', ad, (ad.getTime() - bd.getTime()));
bd = new Date();
}
exports.addJSONTask(pGanttVar, jsonObj);
if (this.vDebug) {
var ad = new Date();
console.log('after addJSONTask', ad, (ad.getTime() - bd.getTime()));
}
};

@@ -24,0 +39,0 @@ exports.parseJSONString = function (pStr, pGanttVar) {

@@ -118,2 +118,3 @@ "use strict";

this.setAdditionalHeaders = function (headers) { this.vAdditionalHeaders = headers; };
this.setDebug = function (debug) { this.vDebug = debug; };
/**

@@ -120,0 +121,0 @@ * GETTERS

@@ -29,3 +29,12 @@ "use strict";

}
ganttObj.DrawDependencies();
var bd;
if (this.vDebug) {
bd = new Date();
console.log('after drawDependency', bd);
}
ganttObj.DrawDependencies(this.vDebug);
if (this.vDebug) {
var ad = new Date();
console.log('after drawDependency', ad, (ad.getTime() - bd.getTime()));
}
};

@@ -236,2 +245,3 @@ exports.hide = function (pID, ganttObj) {

this.getOriginalID = function () { return _id; };
this.getGantt = function () { return vGantt; };
this.getName = function () { return vName; };

@@ -486,3 +496,4 @@ this.getStart = function () {

// Recursively process task tree ... set min, max dates of parent tasks and identfy task level.
exports.processRows = function (pList, pID, pRow, pLevel, pOpen, pUseSort) {
exports.processRows = function (pList, pID, pRow, pLevel, pOpen, pUseSort, vDebug) {
if (vDebug === void 0) { vDebug = false; }
var vMinDate = new Date();

@@ -555,3 +566,12 @@ var vMaxDate = new Date();

if (pID == 0 && pUseSort == 1) {
var bd = void 0;
if (vDebug) {
bd = new Date();
console.log('before afterTasks', bd);
}
exports.sortTasks(pList, 0, 0);
if (vDebug) {
var ad = new Date();
console.log('after afterTasks', ad, (ad.getTime() - bd.getTime()));
}
pList.sort(function (a, b) { return a.getSortIdx() - b.getSortIdx(); });

@@ -564,3 +584,12 @@ }

vComb = true;
var bd = void 0;
if (vDebug) {
bd = new Date();
console.log('before sortTasks', bd);
}
exports.sortTasks(pList, pList[i].getID(), pList[i].getSortIdx() + 1);
if (vDebug) {
var ad = new Date();
console.log('after sortTasks', ad, (ad.getTime() - bd.getTime()));
}
}

@@ -567,0 +596,0 @@ }

@@ -7,4 +7,6 @@ function start(e) {

const dataurl = document.getElementById('dataurl').value ? document.getElementById('dataurl').value : './fixes/data.json';
const vDebug = document.getElementById('debug').value === 'true' ? true : false;
// Parameters (pID, pName, pStart, pEnd, pStyle, pLink (unused) pLink: pMilpMile: e, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption, pNotes, pGantt)
JSGantt.parseJSON('./fixes/data.json', g);
JSGantt.parseJSON(dataurl, g, vDebug);

@@ -14,2 +16,3 @@ // SET LANG FROM INPUT

delay = document.getElementById('delay').value;

@@ -69,2 +72,4 @@ vUseSingleCell = document.getElementById('useSingleCell').value;

vTooltipDelay: delay,
vDebug,
// vUseSort: false,
vFormatArr: ['Day', 'Week', 'Month', 'Quarter'], // Even with setUseSingleCell using Hour format on such a large chart can cause issues in some browsers

@@ -74,4 +79,11 @@ });

if (vDebug) {
bd = new Date();
console.log('before reloading', bd);
}
g.Draw();
if (vDebug) {
const ad = new Date();
console.log('after reloading: total time', ad, (ad.getTime() - bd.getTime()));
}

@@ -78,0 +90,0 @@ } else {

108

Documentation.md

@@ -45,20 +45,22 @@

g.AddTaskItemObject({
"pID": 1,
"pName": "Define Chart API",
"pStart": "2017-02-25",
"pEnd": "2017-03-17",
"pPlanStart": "2017-04-01",
"pPlanEnd": "2017-04-15 12:00",
"pClass": "ggroupblack",
"pLink": "",
"pMile": 0,
"pRes": "Brian",
"pComp": 0,
"pGroup": 1,
"pParent": 0,
"pOpen": 1,
"pDepend": "",
"pCaption": "",
"pCost": 1000,
"pNotes": "Some Notes text"
pID: 1,
pName: "Define Chart <strong>API</strong>",
pStart: "2017-02-25",
pEnd: "2017-03-17",
pPlanStart: "2017-04-01",
pPlanEnd: "2017-04-15 12:00",
pClass: "ggroupblack",
pLink: "",
pMile: 0,
pRes: "Brian",
pComp: 0,
pGroup: 1,
pParent: 0,
pOpen: 1,
pDepend: "",
pCaption: "",
pCost: 1000,
pNotes: "Some Notes text",
category: "My Category",
sector: "Finance"
});

@@ -94,3 +96,3 @@

|_pGantt:_|(required) javascript JSGantt.GanttChart object from which to take settings. Defaults to "g" for backwards compatibility|
|_pCost:_|(required) cost of that task, numeric
|_pCost:_| cost of that task, numeric

@@ -127,3 +129,5 @@ <sup>*</sup> Combined group tasks show all sub-tasks on one row. The information displayed in the task list and row caption are taken from the parent task. Tool tips are generated individually for each sub-task from its own information. Milestones are not valid as sub-tasks of a combined group task and will not be displayed. No bounds checking of start and end dates of sub-tasks is performed therefore it is possible for these task bars to overlap. Dependencies can be set to and from sub-tasks only.

"pCost": "",
"pNotes": "Some Notes text"
"pNotes": "Some Notes text",
"category": "My Category",
"sector": "Finance"
}

@@ -249,2 +253,3 @@ ```

|_setShowCost():_|Controls whether the Cost column is displayed in the task list, defaults to 1 (show column)|
|_setAdditionalHeaders():_|Set the object with additional headers to be displayed in the data table. ex : { category: { title: 'Category' } }|
|_setShowTaskInfoRes():_|Controls whether the Resource information is displayed in the task tool tip, defaults to 1 (show information)|

@@ -259,3 +264,8 @@ |_setShowTaskInfoDur():_|Controls whether the Task Duration information is displayed in the task tool tip, defaults to 1 (show information)|

|_setShowDeps():_ |Controls display of dependancy lines, defaults to 1 (show dependencies)|
|_setEvents():_ |Controls events when a task is click in table data. You have to pass an object with the column and function. ex.: ` { taskname: console.log, res: console.log }`|
|_setEventClickRow():_ |Controls events when a task row is cliked. Pass a function to exercute ex.: `function(e){console.log(e)}`|
|_pAdditionalHeaders:_| object with headers values for additional columns . ex : `{ category: { title: 'Category' }` }|
|_setDebug():_ |Set with true if you want to see debug in console|
## Key Values ##

@@ -420,2 +430,10 @@ The following options enable functionality using a set of specific key values

vLang: lang,
vAdditionalHeaders: { // Add data columns to your table
category: {
title: 'Category'
},
sector: {
title: 'Sector'
}
},
vShowTaskInfoLink: 1, // Show link in tool tip (0/1)

@@ -425,2 +443,14 @@ vShowEndWeekDate: 0, // Show/Hide the date for the last day of the week in header for daily view (1/0)

vFormatArr: ['Day', 'Week', 'Month', 'Quarter'], // Even with setUseSingleCell using Hour format on such a large chart can cause issues in some browsers
vEvents: {
taskname: console.log,
res: console.log,
dur: console.log,
comp: console.log,
startdate: console.log,
enddate: console.log,
planstartdate: console.log,
planenddate: console.log,
cost: console.log
},
vEventClickRow: console.log
});

@@ -433,20 +463,22 @@

g.AddTaskItemObject({
"pID": 1,
"pName": "Define Chart API",
"pStart": "2017-02-25",
"pEnd": "2017-03-17",
"pPlanStart": "2017-04-01",
"pPlanEnd": "2017-04-15 12:00",
"pClass": "ggroupblack",
"pLink": "",
"pMile": 0,
"pRes": "Brian",
"pComp": 0,
"pGroup": 1,
"pParent": 0,
"pOpen": 1,
"pCost": 100,
"pDepend": "",
"pCaption": "",
"pNotes": "Some Notes text"
pID: 1,
pName: "Define Chart <strong>API</strong>",
pStart: "2017-02-25",
pEnd: "2017-03-17",
pPlanStart: "2017-04-01",
pPlanEnd: "2017-04-15 12:00",
pClass: "ggroupblack",
pLink: "",
pMile: 0,
pRes: "Brian",
pComp: 0,
pGroup: 1,
pParent: 0,
pOpen: 1,
pDepend: "",
pCaption: "",
pCost: 1000,
pNotes: "Some Notes text",
category: "My Category",
sector: "Finance"
});

@@ -453,0 +485,0 @@

{
"name": "jsgantt-improved",
"version": "2.0.6",
"version": "2.0.7",
"description": "jsgantt-improved",

@@ -9,4 +9,4 @@ "main": "dist/index.js",

"build": "tsc",
"watch": "onchange 'src/**' '*.*' -- npm run build",
"watch:dist": "onchange 'src/**' '*.ts' -- npm run dist",
"watch:build": "onchange 'src/**' '*.*' -- npm run build",
"watch": "onchange 'src/**' '*.ts' -- npm run dist",
"watch:test": "onchange 'src/**/*.ts' '*.ts' -- npm run test",

@@ -13,0 +13,0 @@ "test": "node node_modules/.bin/protractor protractor.conf.js",

@@ -141,1 +141,11 @@ [![Build Status](https://travis-ci.com/jsGanttImproved/jsgantt-improved.svg?branch=master)](https://travis-ci.com/jsGanttImproved/jsgantt-improved)

For testing use `npm run test` with e2e tests.
Or help us donating...
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="S7B43P63C5QEN" />
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />
<img alt="" border="0" src="https://www.paypal.com/en_BR/i/scr/pixel.gif" width="1" height="1" />
</form>

@@ -59,2 +59,3 @@ import * as lang from './lang';

this.vAdditionalHeaders = {};
this.vDebug = false;
this.vShowSelector = new Array('top');

@@ -226,3 +227,3 @@ this.vDateInputFormat = 'yyyy-mm-dd';

this.DrawDependencies = function () {
this.DrawDependencies = function (vDebug = false) {
if (this.getShowDeps() == 1) {

@@ -244,2 +245,3 @@ //First recalculate the x,y

if (vList[vTask].getVisible() == 1) {
if (vDebug) console.log(`init drawDependency`, new Date());
if (vDependType[k] == 'SS') this.drawDependency(vList[vTask].getStartX() - 1, vList[vTask].getStartY(), vList[i].getStartX() - 1, vList[i].getStartY(), 'SS', 'gDepSS');

@@ -317,6 +319,10 @@ else if (vDependType[k] == 'FF') this.drawDependency(vList[vTask].getEndX(), vList[vTask].getEndY(), vList[i].getEndX(), vList[i].getEndY(), 'FF', 'gDepFF');

// var vParDiv;
let bd;
if (this.vDebug) {
bd = new Date();
console.log('before draw', bd);
}
if (this.vTaskList.length > 0) {
// Process all tasks, reset parent date and completion % if task list has altered
if (this.vProcessNeeded) processRows(this.vTaskList, 0, -1, 1, 1, this.getUseSort());
if (this.vProcessNeeded) processRows(this.vTaskList, 0, -1, 1, 1, this.getUseSort(), this.vDebug);
this.vProcessNeeded = false;

@@ -353,4 +359,4 @@

if (this.vShowCost == 1) this.newNode(vTmpRow, 'td', null, 'gspanning gcost', '\u00A0');
if(this.vAdditionalHeaders){
for(const key in this.vAdditionalHeaders){
if (this.vAdditionalHeaders) {
for (const key in this.vAdditionalHeaders) {
const header = this.vAdditionalHeaders[key];

@@ -373,6 +379,6 @@ const css = header.class ? header.class : `gadditional-${key}`;

if (this.vShowCost == 1) this.newNode(vTmpRow, 'td', null, 'gtaskheading gcost', this.vLangs[this.vLang]['cost']);
if(this.vAdditionalHeaders){
for(const key in this.vAdditionalHeaders){
if (this.vAdditionalHeaders) {
for (const key in this.vAdditionalHeaders) {
const header = this.vAdditionalHeaders[key];
const text = header.translate ? this.vLangs[this.vLang][header.translate] : header.title;
const text = header.translate ? this.vLangs[this.vLang][header.translate] : header.title;
const css = header.class ? header.class : `gadditional-${key}`;

@@ -471,10 +477,10 @@ this.newNode(vTmpRow, 'td', null, `gtaskheading gadditional ${css}`, text);

}
if(this.vAdditionalHeaders){
for(const key in this.vAdditionalHeaders){
if (this.vAdditionalHeaders) {
for (const key in this.vAdditionalHeaders) {
const header = this.vAdditionalHeaders[key];
const css = header.class ? header.class : `gadditional-${key}`;
const data = this.vTaskList[i].getDataObject();
if(data)
vTmpCell = this.newNode(vTmpRow, 'td', null,`gadditional ${css}`);
vTmpDiv = this.newNode(vTmpCell, 'div', null, null, data ? data[key]: '' );
if (data)
vTmpCell = this.newNode(vTmpRow, 'td', null, `gadditional ${css}`);
vTmpDiv = this.newNode(vTmpCell, 'div', null, null, data ? data[key] : '');
}

@@ -499,4 +505,4 @@ }

if (this.vShowCost == 1) this.newNode(vTmpRow, 'td', null, 'gspanning gcost', '\u00A0');
if(this.vAdditionalHeaders){
for(const key in this.vAdditionalHeaders){
if (this.vAdditionalHeaders) {
for (const key in this.vAdditionalHeaders) {
const header = this.vAdditionalHeaders[key];

@@ -669,2 +675,7 @@ const css = header.class ? header.class : `gadditional-${key}`;

var j = 0;
let bd;
if (this.vDebug) {
bd = new Date();
console.log('before tasks loop', bd);
}
for (i = 0; i < this.vTaskList.length; i++) {

@@ -838,3 +849,6 @@ var curTaskStart = this.vTaskList[i].getStart() ? this.vTaskList[i].getStart() : this.vTaskList[i].getPlanStart();

}
if (this.vDebug) {
const ad = new Date();
console.log('after tasks loop', ad, (ad.getTime() - bd.getTime()));
}
if (!vSingleCell) vTmpTBody.appendChild(vDateRow.cloneNode(true));

@@ -880,4 +894,17 @@

else this.vTodayPx = -1;
let bdd
if (this.vDebug) {
bdd = new Date();
console.log('before DrawDependencies', bdd);
}
this.DrawDependencies();
if (this.vDebug) {
const ad = new Date();
console.log('after DrawDependencies', ad, (ad.getTime() - bdd.getTime()));
}
}
if (this.vDebug) {
const ad = new Date();
console.log('after draw', ad, (ad.getTime() - bd.getTime()));
}
}; //this.draw

@@ -884,0 +911,0 @@

@@ -8,3 +8,3 @@ import { TaskItem } from "./task";

*/
export const parseJSON = function (pFile, pGanttVar) {
export const parseJSON = function (pFile, pGanttVar, vDebug = false) {
let xhttp;

@@ -18,5 +18,21 @@ if ((<any>window).XMLHttpRequest) {

xhttp.send(null);
let jsonObj = eval('(' + xhttp.response + ')');
let bd;
if (vDebug) {
bd = new Date();
console.log('before jsonparse', bd);
}
let jsonObj = JSON.parse(xhttp.response);
if (vDebug) {
const ad = new Date();
console.log('after jsonparse', ad, (ad.getTime() - bd.getTime()));
bd = new Date();
}
addJSONTask(pGanttVar, jsonObj);
if (this.vDebug) {
const ad = new Date();
console.log('after addJSONTask', ad, (ad.getTime() - bd.getTime()));
}
};

@@ -23,0 +39,0 @@

@@ -112,3 +112,3 @@ import { parseDateFormatStr } from "./utils";

this.setAdditionalHeaders = function (headers) { this.vAdditionalHeaders = headers; };
this.setDebug = function(debug) {this.vDebug = debug;}
/**

@@ -115,0 +115,0 @@ * GETTERS

@@ -34,3 +34,12 @@ import { parseDateStr, isIE, stripUnwanted, getOffset, formatDateStr, hashKey } from "./utils";

}
ganttObj.DrawDependencies();
let bd;
if (this.vDebug) {
bd = new Date();
console.log('after drawDependency', bd);
}
ganttObj.DrawDependencies(this.vDebug);
if (this.vDebug) {
const ad = new Date();
console.log('after drawDependency', ad, (ad.getTime() - bd.getTime()));
}
};

@@ -269,3 +278,3 @@

this.getOriginalID = function () { return _id; };
this.getGantt = function () { return vGantt; }
this.getName = function () { return vName; };

@@ -469,3 +478,3 @@ this.getStart = function () {

// Recursively process task tree ... set min, max dates of parent tasks and identfy task level.
export const processRows = function (pList, pID, pRow, pLevel, pOpen, pUseSort) {
export const processRows = function (pList, pID, pRow, pLevel, pOpen, pUseSort, vDebug = false) {
var vMinDate = new Date();

@@ -546,3 +555,12 @@ var vMaxDate = new Date();

if (pID == 0 && pUseSort == 1) {
let bd;
if (vDebug) {
bd = new Date();
console.log('before afterTasks', bd);
}
sortTasks(pList, 0, 0);
if (vDebug) {
const ad = new Date();
console.log('after afterTasks', ad, (ad.getTime() - bd.getTime()));
}
pList.sort(function (a, b) { return a.getSortIdx() - b.getSortIdx(); });

@@ -555,3 +573,12 @@ }

vComb = true;
let bd;
if (vDebug) {
bd = new Date();
console.log('before sortTasks', bd);
}
sortTasks(pList, pList[i].getID(), pList[i].getSortIdx() + 1);
if (vDebug) {
const ad = new Date();
console.log('after sortTasks', ad, (ad.getTime() - bd.getTime()));
}
}

@@ -558,0 +585,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc