[ Launch: Tributary inlet ] 6151399 by BruceHubbard
-
-
Save BruceHubbard/6151399 to your computer and use it in GitHub Desktop.
Tributary inlet
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
{"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"} |
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
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