Skip to content

Instantly share code, notes, and snippets.

@BruceHubbard
Created August 4, 2013 18:44
Show Gist options
  • Save BruceHubbard/6151399 to your computer and use it in GitHub Desktop.
Save BruceHubbard/6151399 to your computer and use it in GitHub Desktop.
Tributary inlet
{"description":"Tributary inlet","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/Oy5sRXI.png"}
var learningNewTech = {
title: "Trying to learn new Tech",
problemTypes: [
{ type: "Simple", know_how_to_solve: true, should_try: 'Yes' },
{ type: "Simple", know_how_to_solve: false, should_try: 'Maybe' },
{ type: "Complex", know_how_to_solve: true, should_try: 'Maybe' },
{ type: "Complex", know_how_to_solve: false, should_try: 'Hell No' }
]
};
/*
var attackingNewProblem = {
title: "Attacking a new problem",
problemTypes: [
{ type: "Simple", know_how_to_solve: true, should_try: 'Yes' },
{ type: "Simple", know_how_to_solve: false, should_try: 'Maybe' },
{ type: "Complex", know_how_to_solve: true, should_try: 'Maybe' },
{ type: "Complex", know_how_to_solve: false, should_try: 'Hell No' }
]
};
*/
var problem_color = function(problemType) {
switch(problemType.should_try)
{
case "Yes":
return "#00FF00";
case "Maybe":
return "yellow";
case "Hell No":
return "red";
default:
return "black";
}
}
var svg = d3.select('svg');
svg.selectAll('circle')
.data(learningNewTech.problemTypes)
.enter()
.append('circle')
.attr('cx', function(d,i) { return (i+1) * 30; })
.attr('cy', function(d,i) { return (i+1) * 30; })
.attr('r', 10)
.attr('fill', problem_color)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment