Built with blockbuilder.org
Last active
October 28, 2015 12:55
-
-
Save alandunning/86ed245f9e511efc2b0b to your computer and use it in GitHub Desktop.
X and Y line points on click
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Id | Client | Project ID | Project | Project Owner | Project Open? | Project Budget | Project Created | Project Closed | Task ID | Task | Task Budget | Task Billable | Task Closed On | Date | User | Hours | Notes | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
48305408 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792116 | Admin | 1 | 2015-10-12 | Emma Riley | 0.5 | [email protected] | ||||||
48305760 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792116 | Admin | 1 | 2015-10-12 | Emma Riley | 0.3275 | [email protected] | ||||||
48306453 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792121 | Purchasing (inc research) | 1 | 2015-10-12 | Emma Riley | 0.716043 | [email protected] | ||||||
48306867 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792123 | Internal Events (inc planning, organising and execution) | 1 | 2015-10-12 | Emma Riley | 0.341737 | [email protected] | ||||||
48308937 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-12 | Emma Riley | 1.90778 | [email protected] | ||||||
48308941 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792116 | Admin | 1 | 2015-10-12 | Emma Riley | 0.4 | [email protected] | ||||||
48310649 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-12 | Emma Riley | 1.0 | [email protected] | ||||||
48324241 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792123 | Internal Events (inc planning, organising and execution) | 1 | 2015-10-12 | Emma Riley | 7.5 | [email protected] | ||||||
48328667 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792123 | Internal Events (inc planning, organising and execution) | 1 | 2015-10-13 | Emma Riley | 1.0 | [email protected] | ||||||
48329102 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792116 | Admin | 1 | 2015-10-13 | Emma Riley | 0.75 | [email protected] | ||||||
48329398 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792123 | Internal Events (inc planning, organising and execution) | 1 | 2015-10-13 | Emma Riley | 0.187778 | [email protected] | ||||||
48330981 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792118 | Film Work (inc planning, prep, filming and post filming) | 1 | 2015-10-13 | Emma Riley | 2.31193 | [email protected] | ||||||
48351828 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792121 | Purchasing (inc research) | 1 | 2015-10-14 | Emma Riley | 0.416597 | [email protected] | ||||||
48353807 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792135 | Internal Meetings | 1 | 2015-10-14 | Emma Riley | 2.0 | [email protected] | ||||||
48359585 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-14 | Emma Riley | 2.39694 | [email protected] | ||||||
48362816 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792119 | CRM | 1 | 2015-10-14 | Emma Riley | 3.28333 | [email protected] | ||||||
48373179 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792116 | Admin | 1 | 2015-10-15 | Emma Riley | 0.388333 | [email protected] | ||||||
48373247 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792186 | Attending Internal Hack Days, Away Days and Ninja Days Out | 1 | 2015-10-13 | Emma Riley | 4.0 | [email protected] | ||||||
48374062 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792694 | HR | 1 | 2015-10-15 | Emma Riley | 1.0 | [email protected] | ||||||
48374876 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792694 | HR | 1 | 2015-10-15 | Emma Riley | 1.21803 | [email protected] | ||||||
48376017 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-15 | Emma Riley | 1.0 | [email protected] | ||||||
48376947 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792694 | HR | 1 | 2015-10-15 | Emma Riley | 0.819829 | [email protected] | ||||||
48378169 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-15 | Emma Riley | 0.644149 | [email protected] | ||||||
48380745 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792121 | Purchasing (inc research) | 1 | 2015-10-15 | Emma Riley | 1.49169 | [email protected] | ||||||
48396378 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792121 | Purchasing (inc research) | 1 | 2015-10-16 | Emma Riley | 0.01 | [email protected] | ||||||
48396550 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792694 | HR | 1 | 2015-10-16 | Emma Riley | 0.358333 | [email protected] | ||||||
48396552 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792135 | Internal Meetings | 1 | 2015-10-16 | Emma Riley | 0.3 | [email protected] | ||||||
48396835 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792117 | Finance | 1 | 2015-10-16 | Emma Riley | 0.461944 | [email protected] | ||||||
48396932 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-16 | Emma Riley | 0.129603 | [email protected] | ||||||
48398813 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792122 | Blogs (inc writing your own) | 1 | 2015-10-16 | Emma Riley | 1.47 | [email protected] | ||||||
48398815 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792121 | Purchasing (inc research) | 1 | 2015-10-16 | Emma Riley | 0.311389 | [email protected] | ||||||
48398886 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792122 | Blogs (inc writing your own) | 1 | 2015-10-16 | Emma Riley | 0.6 | [email protected] | ||||||
48404928 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792185 | Personal Development (inc further learning) | 1 | 2015-10-16 | Emma Riley | 2.0 | [email protected] | ||||||
48404936 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-16 | Emma Riley | 1.0 | [email protected] | ||||||
48421765 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792121 | Purchasing (inc research) | 1 | 2015-10-16 | Emma Riley | 0.5 | [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Id | Client | Project ID | Project | Project Owner | Project Open? | Project Budget | Project Created | Project Closed | Task ID | Task | Task Budget | Task Billable | Task Closed On | Date | User | Hours | Notes | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
48429387 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792116 | Admin | 1 | 2015-10-19 | Emma Riley | 0.401944 | [email protected] | ||||||
48430297 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792694 | HR | 1 | 2015-10-19 | Emma Riley | 0.904456 | [email protected] | ||||||
48430895 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792694 | HR | 1 | 2015-10-19 | Emma Riley | 0.511326 | [email protected] | ||||||
48431099 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792694 | HR | 1 | 2015-10-19 | Emma Riley | 0.210108 | [email protected] | ||||||
48432215 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792118 | Film Work (inc planning, prep, filming and post filming) | 1 | 2015-10-19 | Emma Riley | 1.03167 | [email protected] | ||||||
48435459 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-19 | Emma Riley | 2.45028 | [email protected] | ||||||
48438587 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792694 | HR | 1 | 2015-10-19 | Emma Riley | 0.6 | [email protected] | ||||||
48440942 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-19 | Emma Riley | 0.491781 | [email protected] | ||||||
48441205 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792118 | Film Work (inc planning, prep, filming and post filming) | 1 | 2015-10-19 | Emma Riley | 0.108889 | [email protected] | ||||||
48442388 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-19 | Emma Riley | 0.385833 | [email protected] | ||||||
48456168 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792116 | Admin | 1 | 2015-10-20 | Emma Riley | 0.413322 | [email protected] | ||||||
48456744 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792121 | Purchasing (inc research) | 1 | 2015-10-20 | Emma Riley | 0.934167 | [email protected] | ||||||
48461300 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-20 | Emma Riley | 4.58613 | [email protected] | ||||||
48461312 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792116 | Admin | 1 | 2015-10-20 | Emma Riley | 0.127778 | [email protected] | ||||||
48461315 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792121 | Purchasing (inc research) | 1 | 2015-10-20 | Emma Riley | 0.251944 | [email protected] | ||||||
48477984 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792185 | Personal Development (inc further learning) | 1 | 2015-10-20 | Emma Riley | 1.0 | [email protected] | ||||||
48478205 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792116 | Admin | 1 | 2015-10-21 | Emma Riley | 0.300278 | [email protected] | ||||||
48478506 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-21 | Emma Riley | 1.0 | [email protected] | ||||||
48479680 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792119 | CRM | 1 | 2015-10-21 | Emma Riley | 1.25 | [email protected] | ||||||
48481928 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792136 | External Meetings | 1 | 2015-10-21 | Emma Riley | 0.6 | [email protected] | ||||||
48481946 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792124 | Interns/ Erasmus/ Managing Work Experience | 1 | 2015-10-21 | Emma Riley | 0.7 | [email protected] | ||||||
48482886 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-21 | Emma Riley | 0.463333 | [email protected] | ||||||
48485602 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792121 | Purchasing (inc research) | 1 | 2015-10-21 | Emma Riley | 0.4 | [email protected] | ||||||
48498488 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-21 | Emma Riley | 3.0 | [email protected] | ||||||
48498490 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792135 | Internal Meetings | 1 | 2015-10-21 | Emma Riley | 0.5 | [email protected] | ||||||
48498511 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792186 | Attending Internal Hack Days, Away Days and Ninja Days Out | 1 | 2015-10-21 | Emma Riley | 1.0 | [email protected] | ||||||
48499129 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792124 | Interns/ Erasmus/ Managing Work Experience | 1 | 2015-10-22 | Emma Riley | 0.719444 | [email protected] | ||||||
48500128 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792135 | Internal Meetings | 1 | 2015-10-22 | Emma Riley | 1.53167 | [email protected] | ||||||
48500130 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792116 | Admin | 1 | 2015-10-22 | Emma Riley | 0.396389 | [email protected] | ||||||
48511074 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-22 | Emma Riley | 7.26 | [email protected] | ||||||
48519433 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792117 | Finance | 1 | 2015-10-23 | Emma Riley | 0.4 | [email protected] | ||||||
48520093 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792121 | Purchasing (inc research) | 1 | 2015-10-23 | Emma Riley | 0.434722 | [email protected] | ||||||
48520234 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792121 | Purchasing (inc research) | 1 | 2015-10-23 | Emma Riley | 0.103333 | [email protected] | ||||||
48520616 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792116 | Admin | 1 | 2015-10-23 | Emma Riley | 0.581667 | [email protected] | ||||||
48521032 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792121 | Purchasing (inc research) | 1 | 2015-10-23 | Emma Riley | 0.609639 | [email protected] | ||||||
48521157 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-23 | Emma Riley | 0.75 | [email protected] | ||||||
48522301 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792124 | Interns/ Erasmus/ Managing Work Experience | 1 | 2015-10-23 | Emma Riley | 0.34 | [email protected] | ||||||
48522312 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792117 | Finance | 1 | 2015-10-23 | Emma Riley | 1.0 | [email protected] | ||||||
48522575 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792124 | Interns/ Erasmus/ Managing Work Experience | 1 | 2015-10-23 | Emma Riley | 0.2475 | [email protected] | ||||||
48530212 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792120 | Comms (inc all social media) | 1 | 2015-10-23 | Emma Riley | 1.0 | [email protected] | ||||||
48530237 | Red Ninja | 1239421 | Day-to-Day Tasks Emma | [email protected] | 1 | 2015-10-02 | 7792185 | Personal Development (inc further learning) | 1 | 2015-10-23 | Emma Riley | 2.0 | [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> | |
<style> | |
body { | |
font-family: "Helvetica Neue Light", "Helvetica Neue", Helvetica, sans-serif; | |
} | |
.axis path, | |
.axis line { | |
fill: none; | |
stroke: #aaa; | |
} | |
#svg-container{ | |
position: absolute; top: 10px; left: 10px; | |
width: 720px; height: 480px; | |
} | |
.dot { | |
stroke: #4EA234; stroke-width: 4px; | |
fill: #fff; | |
cursor: pointer; | |
} | |
.to-from-lines { stroke: #4EA234; stroke-width: 4px; } | |
#info-sidebar-container { | |
position: absolute; top: 10px; right: 20px; | |
width: 210px; | |
} | |
#info-sidebar-container p { text-align: center; } | |
#sidebar-hour-text { font-size: 48px; } | |
</style> | |
<body> | |
<div id="svg-container"></div> | |
<div id="info-sidebar-container"></div> | |
<script> | |
var margin = {top: 20, right: 20, bottom: 30, left: 50}, | |
width = 720 - margin.left - margin.right, | |
height = 460 - margin.top - margin.bottom; | |
var weekTotal = 0; | |
var i; | |
var selectDates = [ | |
{week: "2015-10-05_2015-10-09", file: "tick_2015-10-05_2015-10-09.csv"}, | |
{week: "2015-10-12_2015-10-18", file: "tick_2015-10-12_2015-10-18.csv"}, | |
{week: "2015-10-19_2015-10-25", file: "tick_2015-10-19_2015-10-25.csv"}, | |
{week: "2015-10-12_2015-10-18-1", file: "tick_2015-10-12_2015-10-18-1.csv"}, | |
{week: "Emma-12-18-October-2015", file: "Emma-12-18-October-2015.csv"}, | |
{week: "Emma-19-25-October-2015", file: "Emma-19-25-October-2015.csv"} | |
]; | |
var selectMenu = d3.select("#info-sidebar-container").append("select") | |
.on("change", selectMenuChange); | |
var options = selectMenu.selectAll('option') | |
.data(selectDates) | |
.enter() | |
.append("option") | |
.text(function(d) { return d.week; }); | |
// Sidebar container and text elems | |
var sidebarContainer = d3.select("#info-sidebar-container") | |
var timeAtLogText = sidebarContainer.append("p").attr("id", "sidebar-hour-text"); | |
var personaNameText = sidebarContainer.append("p").attr("id", "sidebar-person"); | |
var dayTotalText = sidebarContainer.append("p").attr("id", "sidebar-day-total"); | |
var weeklyTotalText = sidebarContainer.append("p").attr("id", "sidebar-weekly"); | |
var projectNametext = sidebarContainer.append("p").attr("id", "sidebar-project"); | |
var taskNametext = sidebarContainer.append("p").attr("id", "sidebar-task"); | |
var formatDate = d3.time.format("%Y-%m-%d").parse; | |
var x = d3.time.scale().range([0, width]); | |
var y = d3.scale.linear().range([height, 0]); | |
var xAxis = d3.svg.axis().scale(x) | |
.orient("bottom").ticks(4) | |
.innerTickSize(-height) | |
.tickPadding(10); | |
var yAxis = d3.svg.axis().scale(y) | |
.orient("left").ticks(4) | |
.innerTickSize(-width) | |
.tickPadding(10); | |
var svg = d3.select("#svg-container").append("svg") | |
.attr("width", width + margin.left + margin.right) | |
.attr("height", height + margin.top + margin.bottom) | |
.append("g") | |
.attr("transform", "translate(" + (margin.left-10) + "," + margin.top + ")"); | |
// X and Y to and from lines. | |
var xLine = svg.append("line").attr("class", "to-from-lines"); | |
var yLine = svg.append("line").attr("class", "to-from-lines"); | |
// Initial file | |
var file = "tick_2015-10-05_2015-10-09.csv"; | |
// Initial graph | |
d3.csv(file, function(error, data) { | |
if (error) throw error; | |
data.forEach(function(d) { | |
d.Date = formatDate(d.Date) | |
d.Hours = +d.Hours; | |
}); | |
var nest = groupHoursByDay(data); | |
for(i = 0; i < nest.length; i += 1) { | |
weekTotal += nest[i].values | |
} | |
timeAtLogText.text(decimalToTime(weekTotal)); | |
x.domain(d3.extent(data, function(d) { return d.Date; })); | |
y.domain([0, d3.max(data, function(d) { return (d.Hours) + 1; })]); | |
svg.append("g") | |
.attr("class", "x axis") | |
.attr("transform", "translate(0," + height + ")") | |
.call(xAxis); | |
svg.append("g") | |
.attr("class", "y axis") | |
.call(yAxis); | |
var circles = svg.selectAll(".dot").data(data); | |
circles.enter().append("circle") | |
.attr("class", "dot") | |
.attr("r", 10) | |
.attr("cx", function(d) { return x(d.Date); }) | |
.attr("cy", function(d) { return y(d.Hours); }); | |
circles.on("click", function(d) { | |
var clickedCiclre = d3.select(this); | |
d3.selectAll(".dot").style("fill", "#FFF"); | |
clickedCiclre.style("fill", "#4EA234"); | |
addText(d, nest); | |
drawLines(d, clickedCiclre); | |
}); | |
}); | |
function updateGraph(file) { | |
var dataFile = file; | |
weekTotal = 0; | |
clearText(); | |
d3.csv(dataFile, function(error, data) { | |
if (error) throw error; | |
data.forEach(function(d) { | |
d.Date = formatDate(d.Date) | |
d.Hours = +d.Hours; | |
}); | |
var nest = groupHoursByDay(data); | |
for(i = 0; i < nest.length; i += 1) { | |
weekTotal += nest[i].values | |
} | |
timeAtLogText.text(decimalToTime(weekTotal)); | |
// Reset X and L to from lines | |
xLine.attr("x1", 0).attr("y1", 0).attr("x2", 0).attr("y2", 0); | |
yLine.attr("x1", 0).attr("y1", 0).attr("x2", 0).attr("y2", 0); | |
// Set axis domains | |
x.domain(d3.extent(data, function(d) { return d.Date; })); | |
y.domain([0, d3.max(data, function(d) { return (d.Hours) + 1; })]); | |
// Transition axis | |
var update = d3.select("body").transition(); | |
update.select(".x.axis") | |
.duration(500) | |
.call(xAxis); | |
update.select(".y.axis") | |
.duration(500) | |
.call(yAxis); | |
// Draw circles data join | |
var circles = svg.selectAll(".dot").data(data); | |
circles.enter() | |
.append("circle") | |
.attr("class", "dot") | |
.attr("r", 10) | |
.attr("cx", function(d) { return x(d.Date); }) | |
.attr("cy", function(d) { return y(d.Hours); }); | |
// Update circles | |
circles.transition().duration(750) | |
.style("fill", "#FFF") | |
.attr("cx", function(d) { return x(d.Date); }) | |
.attr("cy", function(d) { return y(d.Hours); }); | |
// Exit unused circles | |
circles.exit().remove(); | |
circles.on("click", function(d) { | |
d3.selectAll(".dot").style("fill", "#FFF"); | |
var clickedCiclre = d3.select(this); | |
clickedCiclre.style("fill", "#4EA234"); | |
addText(d, nest); | |
drawLines(d, clickedCiclre); | |
}); | |
}); | |
} | |
function groupHoursByDay(data) { | |
var nest = d3.nest() | |
.key(function(d) { return d.Date; }) | |
.rollup(function(d) { | |
return d3.sum(d, function(g) { return g.Hours; }) | |
}).entries(data); | |
return nest | |
} | |
function drawLines(data, clickedCiclre) { | |
xLine | |
.attr("x1", clickedCiclre[0][0].cx.animVal.value) | |
.attr("y1", clickedCiclre[0][0].cy.animVal.value) | |
.attr("x2", 0) | |
.attr("y2", clickedCiclre[0][0].cy.animVal.value); | |
yLine | |
.attr("x1", clickedCiclre[0][0].cx.animVal.value) | |
.attr("y1", clickedCiclre[0][0].cy.animVal.value) | |
.attr("x2", clickedCiclre[0][0].cx.animVal.value) | |
.attr("y2", height); | |
} | |
function addText(d, nest) { | |
timeAtLogText.text(decimalToTime(d.Hours)); | |
personaNameText.text(d.User); | |
dayTotalText.text("Day Total: " + dailyTotal(d, nest)); | |
weeklyTotalText.text("Week Total: " + decimalToTime(weekTotal)); | |
projectNametext.text(d.Project); | |
taskNametext.text(d.Task); | |
} | |
function clearText() { | |
personaNameText.text(""); | |
dayTotalText.text(""); | |
weeklyTotalText.text(""); | |
projectNametext.text(""); | |
taskNametext.text(""); | |
personaNameText.text(""); | |
} | |
function decimalToTime(time) { | |
var hours = Math.floor(Math.abs(time)) | |
var mins = Math.floor((Math.abs(time) * 60) % 60); | |
return hours + "h " + mins + "m"; | |
} | |
function dailyTotal(d, nest) { | |
var i; | |
var dayTotal; | |
for (i = 0; i < nest.length; i += 1) { | |
if (nest[i].key == d.Date) { | |
dayTotal = decimalToTime(nest[i].values); | |
return dayTotal; | |
} | |
} | |
} | |
function selectMenuChange() { | |
var selectedIndex = selectMenu.property('selectedIndex'); | |
var file = options[0][selectedIndex].__data__.file; | |
updateGraph(file); | |
} | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Project | Task | Date | User | Hours | Notes | |
---|---|---|---|---|---|---|
New Website | Backend Development | 2015-10-06 | Alan Dunning | 8.23 | ||
New Website | Backend Development | 2015-10-07 | Alan Dunning | 11.2155 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Id | Client | Project ID | Project | Project Owner | Project Open? | Project Budget | Project Created | Project Closed | Task ID | Task | Task Budget | Task Billable | Task Closed On | Date | User | Hours | Notes | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
48430321 | Red Ninja | 1176575 | Red Ninja - Blog | [email protected] | 1 | 2015-04-17 | 7794143 | October blog post | 1 | 2015-10-16 | Lewis Dohren | 1.0 | [email protected] | November Blog Post | |||||
48396813 | Red Ninja | 1239424 | Day-to-Day Tasks Lewis | [email protected] | 1 | 2015-10-02 | 7792177 | Internal Meetings | 1 | 2015-10-15 | Lewis Dohren | 0.5 | [email protected] | Mersey fire stuff | |||||
48362906 | Red Ninja | 1239424 | Day-to-Day Tasks Lewis | [email protected] | 1 | 2015-10-02 | 7792180 | Filming (inc research, preparation, execution and post production) | 1 | 2015-10-12 | Lewis Dohren | 1.5 | [email protected] | ML - Meet up Video Prep | |||||
48362913 | Red Ninja | 1239424 | Day-to-Day Tasks Lewis | [email protected] | 1 | 2015-10-02 | 7792180 | Filming (inc research, preparation, execution and post production) | 1 | 2015-10-12 | Lewis Dohren | 3.0 | [email protected] | Meet-up filming | |||||
48363029 | Red Ninja | 1239424 | Day-to-Day Tasks Lewis | [email protected] | 1 | 2015-10-02 | 7792180 | Filming (inc research, preparation, execution and post production) | 1 | 2015-10-14 | Lewis Dohren | 5.5 | [email protected] | Meet-up Editing | |||||
48396805 | Red Ninja | 1239424 | Day-to-Day Tasks Lewis | [email protected] | 1 | 2015-10-02 | 7792180 | Filming (inc research, preparation, execution and post production) | 1 | 2015-10-15 | Lewis Dohren | 5.0 | [email protected] | ML Meet up Video | |||||
48430326 | Red Ninja | 1239424 | Day-to-Day Tasks Lewis | [email protected] | 1 | 2015-10-02 | 7792180 | Filming (inc research, preparation, execution and post production) | 1 | 2015-10-16 | Lewis Dohren | 2.5 | [email protected] | ML Video Editing | |||||
48396802 | Red Ninja | 1239424 | Day-to-Day Tasks Lewis | [email protected] | 1 | 2015-10-02 | 7792182 | Last minutes design tasks (presentations etc) | 1 | 2015-10-15 | Lewis Dohren | 3.0 | [email protected] | Jordy PDF & Lee Presentation for Lydia Project | |||||
48430310 | Red Ninja | 1239424 | Day-to-Day Tasks Lewis | [email protected] | 1 | 2015-10-02 | 7792182 | Last minutes design tasks (presentations etc) | 1 | 2015-10-16 | Lewis Dohren | 1.5 | [email protected] | Jordy PDF | |||||
48362963 | Red Ninja | 1239424 | Day-to-Day Tasks Lewis | [email protected] | 1 | 2015-10-02 | 7792183 | Away Days, Hack Days, Ninja Days out | 1 | 2015-10-13 | Lewis Dohren | 3.5 | [email protected] | Water-Sports Team Building Afternoon | |||||
48430334 | Red Ninja | 1239424 | Day-to-Day Tasks Lewis | [email protected] | 1 | 2015-10-02 | 7792184 | Personal Development (inc further learning) | 1 | 2015-10-16 | Lewis Dohren | 3.0 | [email protected] | Treehouse | |||||
48362899 | Red Ninja | 1239424 | Day-to-Day Tasks Lewis | [email protected] | 1 | 2015-10-02 | 7792234 | Current project work (projects with no individual tickspot) | 1 | 2015-10-12 | Lewis Dohren | 6.5 | [email protected] | Alcohol Awareness Branding | |||||
48362922 | Red Ninja | 1239424 | Day-to-Day Tasks Lewis | [email protected] | 1 | 2015-10-02 | 7792234 | Current project work (projects with no individual tickspot) | 1 | 2015-10-13 | Lewis Dohren | 2.5 | [email protected] | Alcohol Awareness Branding | |||||
48363020 | Red Ninja | 1239424 | Day-to-Day Tasks Lewis | [email protected] | 1 | 2015-10-02 | 7792234 | Current project work (projects with no individual tickspot) | 1 | 2015-10-14 | Lewis Dohren | 3.0 | [email protected] | Let's Talk - Patient App | |||||
48362944 | Imagine Independence | 1130156 | Imagine Independence RN0018 - Tablet App Pilot | [email protected] | 1 | 608.0 | 2014-12-01 | 6705770 | Design | 160.0 | 1 | 2015-10-13 | Lewis Dohren | 1.0 | [email protected] | Assets | |||
48362999 | Imagine Independence | 1130156 | Imagine Independence RN0018 - Tablet App Pilot | [email protected] | 1 | 608.0 | 2014-12-01 | 6705770 | Design | 160.0 | 1 | 2015-10-14 | Lewis Dohren | 1.0 | [email protected] | assets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Project | Task | Date | User | Hours | Notes | |
---|---|---|---|---|---|---|
New Website | Backend Development | 2015-10-13 | Alan Dunning | 3.0 | ||
New Website | Backend Development | 2015-10-14 | Alan Dunning | 4.0 | ||
New Website | Backend Development | 2015-10-14 | Alan Dunning | 9.98648 | ||
New Website | Backend Development | 2015-10-16 | Alan Dunning | 5.56058 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Project | Task | Date | User | Hours | Notes | |
---|---|---|---|---|---|---|
Day-to-Day Tasks Alan | Personal Development inc Further Learning) | 2015-10-21 | Alan Dunning | 4.69584 | ||
New Website | Planning & Scheduling | 2015-10-21 | Alan Dunning | 8.93667 | ||
New Website | Backend Development | 2015-10-22 | Alan Dunning | 1.0 | ||
New Website | Backend Development | 2015-10-22 | Alan Dunning | 4.99166 | ||
Day-to-Day Tasks Alan | Blogs | 2015-10-23 | Alan Dunning | 0.5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment