From c3c555789cb00684757d3f016e7a3050b969d4b8 Mon Sep 17 00:00:00 2001 From: LV-426 Date: Sun, 23 Nov 2014 11:42:44 +0200 Subject: gantt -> timeline rename --- src/rz_core.js | 16 ++++++++-------- src/view/timeline.js | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/rz_core.js b/src/rz_core.js index 34969b8a..1bf7ab0c 100644 --- a/src/rz_core.js +++ b/src/rz_core.js @@ -10,7 +10,7 @@ var vis; var graphstate = "GRAPH"; var graphinterval = 0; -var ganttTimer = 0; +var timeline_timer = 0; var deliverables = []; @@ -39,7 +39,7 @@ var initDrawingArea = function () { if (graphstate === "GRAPH") { vis.attr("transform", "translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")"); } - if (graphstate === "GANTT") { + if (graphstate === "TIMELINE") { vis.attr("transform", "translate(0,0)scale(1)"); } } @@ -366,7 +366,7 @@ function update_view__graph(no_relayout) { update_view__graph(true); }); - //if(graphstate==="GANTT"){ + //if(graphstate==="TIMELINE"){ nodeEnter.append("svg:image") .attr("class", "status graph") .attr('x', -7) @@ -470,7 +470,7 @@ function tick(e) { return "translate(" + d.x + "," + d.y + ")"; } - if (graphstate === "GANTT") { + if (graphstate === "TIMELINE") { var k = 20 * e.alpha; var today = new Date(); var missingcounter = 0; @@ -488,9 +488,9 @@ function tick(e) { //var min= 150+graphinterval*Math.ceil(Math.abs(d.start.getTime() - today.getTime()) / (1000 * 3600 * 24)) - $('.gantbox').scrollLeft(); //var max= 150+graphinterval*Math.ceil(Math.abs(d.end.getTime() - d.start.getTime()) / (1000 * 3600 * 24)) - $('.gantbox').scrollLeft(); //d.x = min+Math.sin(today.getTime()/1000*Math.PI*2/10)*max; - ganttTimer++; - if (ganttTimer < 3000) { - d.x = 150 + graphinterval * Math.ceil(Math.abs(d.start.getTime() - today.getTime()) / (1000 * 3600 * 24)) * ganttTimer / 3000; + timeline_timer++; + if (timeline_timer < 3000) { + d.x = 150 + graphinterval * Math.ceil(Math.abs(d.start.getTime() - today.getTime()) / (1000 * 3600 * 24)) * timeline_timer / 3000; d.y = 150 + d.start.getHours() * 17; } else { d.x = 150 + graphinterval * Math.ceil(Math.abs(d.start.getTime() - today.getTime()) / (1000 * 3600 * 24)); @@ -542,7 +542,7 @@ function tick(e) { dy = d.__dst.y - d.__src.y, dr = Math.sqrt(dx * dx + dy * dy); d_val = "M" + d.__src.x + "," + d.__src.y + "A" + dr + "," + dr + " 0 0,1 " + d.__dst.x + "," + d.__dst.y; - } else if (graphstate === "GANTT") { + } else if (graphstate === "TIMELINE") { if (d.state === "enter" || d.state === "exit") { var dx = d.__dst.x - d.__src.x, dy = d.__dst.y - d.__src.y, diff --git a/src/view/timeline.js b/src/view/timeline.js index fcc7c53f..0a26c0a7 100644 --- a/src/view/timeline.js +++ b/src/view/timeline.js @@ -6,7 +6,7 @@ function ($, rz_core) { function checkSwitch(checkswitch) { if (checkswitch.checked) { - vis.selectAll(".gantt").remove(); + vis.selectAll(".timeline").remove(); $('.missingdates').fadeOut(300); scrollValue = $('body').scrollLeft(); @@ -19,14 +19,14 @@ function checkSwitch(checkswitch) { //boxedin=false; } else { - ganttTimer=0; + timelineTimer=0; $('.missingdates').fadeIn(300); graph.recenterZoom(); $('body').scrollLeft(scrollValue); - graphstate = "GANTT"; + graphstate = "TIMELINE"; rz_core.update_view__graph(); @@ -42,7 +42,7 @@ function checkSwitch(checkswitch) { ///For some reason JQuery's $('body').scroll never worked, so I found something else. $('body').bind('DOMMouseScroll', function(e){ - if(graphstate==="GANTT"){ + if(graphstate==="TIMELINE"){ if(e.originalEvent.detail !== 0) { $('.overlay').hide(); }else{ @@ -55,7 +55,7 @@ $('body').bind('DOMMouseScroll', function(e){ //IE, Opera, Safari $('body').bind('mousewheel', function(e){ - if(graphstate==="GANTT"){ + if(graphstate==="TIMELINE"){ if(e.originalEvent.wheelDelta !== 0) { $('.overlay').hide(); }else{ @@ -117,7 +117,7 @@ function initAxis() { .attr("x2", xScale) .attr("y1", paddingTop + 30) .attr("y2", h - 50) - .attr("class", "gantt") + .attr("class", "timeline") .style("stroke", "#ccc"); var y = function (i) { @@ -139,7 +139,7 @@ function initAxis() { .attr("x", -1000) .attr("width", 100) .attr("height", bar_height) - .attr("class", "company-bar gantt") + .attr("class", "company-bar timeline") .on("mouseover", function (d) { d3.select(this).style("fill", "#F5AF00"); getCompanyData(String(d.uid)) @@ -154,7 +154,7 @@ function initAxis() { });; label.enter().append("text") - .attr("class", "bar-label gantt") + .attr("class", "bar-label timeline") // .attr("text-anchor","end") .attr("x", paddingLeft - 10) .attr("y", function (d, i) { @@ -166,13 +166,13 @@ function initAxis() { // Bottom Axis var btmAxis = svg.append("g") .attr("transform", "translate(0," + (h - 25) + ")") - .attr("class", "axis gantt") + .attr("class", "axis timeline") .call(xAxis); // Top Axis var topAxis = svg.append("g") .attr("transform", "translate(0," + paddingTop + ")") - .attr("class", "axis gantt") + .attr("class", "axis timeline") .call(xAxis); } -- cgit v1.3.1