Skip to content

Instantly share code, notes, and snippets.

{
"2017" : {
"locked": false,
"hours": 1000,
"quarters" : {
"1" : {
"locked": false,
"hours_budgeted": 250,
"hours_actual": 200,
"months": {
{
"years" : {
"2017" : {
"hours_budgeted" : 500,
"hours_actual" : 250
},
"2018" : {
"hours_budgeted" : 500,
"hours_actual" : 0
}
@jgeryk
jgeryk / index.html
Created January 18, 2017 17:16
Dates/Hours Prototype w/ Area Fill
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Date/Hours Sculpter</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.4.0/d3.min.js" charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3-legend/2.19.0/d3-legend.min.js" charset="utf-8"></script>
<style>
@jgeryk
jgeryk / index.html
Created January 18, 2017 04:55
Dates/Hours Prototype w/ Multiple Roles
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Date/Hours Sculpter</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.4.0/d3.min.js" charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3-legend/2.19.0/d3-legend.min.js" charset="utf-8"></script>
<style>
@jgeryk
jgeryk / index.html
Last active January 17, 2017 05:39
Date/Hours Prototype Spline w/ Balance+Locking (double click points)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Volume Control</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.4.0/d3.min.js" charset="utf-8"></script>
<style>
body {
def merge_sort(list):
if len(list) <=1:
return list
mid = len(list) // 2
left = merge_sort(list[:mid])
right = merge_sort(list[mid:])
return merge(left, right)
def merge(left, right):
if not left:
@jgeryk
jgeryk / index.html
Last active January 13, 2017 18:29
Date/Hours Prototype Spline w/ Balancing
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Volume Control</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.4.0/d3.min.js" charset="utf-8"></script>
<style>
body {
@jgeryk
jgeryk / index.html
Last active January 13, 2017 17:17
Date/Hours Prototype "Freeform spline"
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Volume Control</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.4.0/d3.min.js" charset="utf-8"></script>
<style>
body {
@jgeryk
jgeryk / index.html
Created January 12, 2017 21:15
Date/Hours Prototype With Dragging
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Volume Control</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.4.0/d3.min.js" charset="utf-8"></script>
<style>
body {
/**
* Maintains a sum of 100(%) in an array by updating the remaining values in relative proportion when one value is changed.
* @function balance
* @param {array} array - array of numbers who sum to 100(%)
* @param {number} index - The index of the number in the array whose value was changed.
* @param {number} oldPct - The previous value of the changed number.
*/
function balance(array, index, oldPct){
var div = 1 - oldPct / 100
var balancedPct = array[index]