added blip name on blip hovering, fixed rings in the example
authorBruno Trecenti <btrecent@thoughtworks.com>
Tue, 1 Sep 2015 19:28:34 +0000 (16:28 -0300)
committerBruno Trecenti <btrecent@thoughtworks.com>
Tue, 1 Sep 2015 19:32:23 +0000 (16:32 -0300)
examples/base.css
examples/index.html
examples/tech-radar.min.js
examples/tech-radar.min.js.map
src/graphing/radar.js
src/stylesheets/base.scss

index 3ea04e8..cb1ac4f 100644 (file)
@@ -3,14 +3,6 @@ body {
 
 svg {
   padding: 20px; }
-  svg .first {
-    fill: #83ad78; }
-  svg .second {
-    fill: #3db5be; }
-  svg .third {
-    fill: #e88744; }
-  svg .fourth {
-    fill: #8d2145; }
   svg circle:nth-child(1) {
     stroke: none;
     fill: #eaeaea; }
@@ -23,10 +15,30 @@ svg {
   svg circle:nth-child(4) {
     stroke: none;
     fill: #bababa; }
-  svg circle, svg polygon {
+  svg .blip-group {
+    cursor: pointer; }
+  svg circle.first, svg polygon.first {
+    fill: #83ad78;
+    stroke: #fff; }
+  svg circle.second, svg polygon.second {
+    fill: #3db5be;
+    stroke: #fff; }
+  svg circle.third, svg polygon.third {
+    fill: #e88744;
+    stroke: #fff; }
+  svg circle.fourth, svg polygon.fourth {
+    fill: #8d2145;
     stroke: #fff; }
   svg line {
     stroke: rgba(255, 255, 255, 0.3); }
+  svg text.first {
+    fill: #83ad78; }
+  svg text.second {
+    fill: #3db5be; }
+  svg text.third {
+    fill: #e88744; }
+  svg text.fourth {
+    fill: #8d2145; }
   svg text.first, svg text.second, svg text.third, svg text.fourth {
     font-size: 16px;
     font-weight: bold; }
@@ -34,6 +46,11 @@ svg {
     font-size: 9px;
     font-style: italic;
     fill: #fff; }
+  svg text.blip-name {
+    font-size: 12px;
+    font-weight: bold;
+    fill: #000;
+    display: none; }
   svg text.line-text {
     font-weight: bold;
     text-transform: uppercase;
index 43fff19..c7de8b8 100644 (file)
@@ -16,8 +16,8 @@
 </body>
 <script>
   var adopt = new tr.models.Cycle('Adopt', 0);
-  var assess = new tr.models.Cycle('Assess', 1);
-  var trial = new tr.models.Cycle('Trial', 2);
+  var trial = new tr.models.Cycle('Trial', 1);
+  var assess = new tr.models.Cycle('Assess', 2);
   var hold = new tr.models.Cycle('Hold', 3);
 
   var radar = new tr.models.Radar();
index f2cf450..4f576e2 100644 (file)
@@ -1,2 +1,2 @@
-var tr=tr||{};tr.models={},tr.graphing={},tr.util={},tr.graphing.Radar=function(t,n){function r(){return Math.round(t/2)}function e(){h.append("line").attr("x1",r()).attr("y1",0).attr("x2",r()).attr("y2",t).attr("stroke-width",14),h.append("line").attr("x1",0).attr("y1",r()).attr("x2",t).attr("y2",r()).attr("stroke-width",14)}function a(t,n){var e=(l.sequence(t.length),l.sum(t.length)),a=l.sum(n);return r()-r()*a/e}function u(t){t.forEach(function(n,e){h.append("circle").attr("cx",r()).attr("cy",r()).attr("r",a(t,e))})}function c(t){var n;n=Math.round(r()/t.length),t.forEach(function(n,e){h.append("text").attr("class","line-text").attr("y",r()+4).attr("x",r()-a(t,e)+10).text(n.name()),h.append("text").attr("class","line-text").attr("y",r()+4).attr("x",r()+a(t,e)-10).attr("text-anchor","end").text(n.name())})}function o(t,n,r){var e,a,u,c,o,i;return e=13,a=n-e,u=t-e+1,c=t+e+1,o=n+e-e/2.5,i=t+1+","+a+" "+u+","+o+" "+c+","+o,h.append("polygon").attr("points",i).attr("class",r).attr("stroke-width",1.5)}function i(t,n,r){h.append("circle").attr("cx",t).attr("cy",n).attr("class",r).attr("stroke-width",1.5).attr("r",10)}function s(t,n,e,u,c){var s;s=n.blips(),t.forEach(function(n,f){var d,l,p;d=a(t,f),l=f==t.length-1?0:a(t,f+1);var p=s.filter(function(t){return t.cycle()==n});p.forEach(function(t){var a,s,f=t.name().split(""),p=f.reduce(function(t,n){return t+n.charCodeAt(0)},0);chance=new Chance(p*n.name().length*t.number()),a=Math.PI*chance.integer({min:13,max:85})/180,s=chance.floating({min:l+25,max:d-10});var I=r()+s*Math.cos(a)*e,m=r()+s*Math.sin(a)*u;t.isNew()?o(I,m,c):i(I,m,c),h.append("text").attr("x",I).attr("y",m+4).attr("class","blip-text").attr("text-anchor","middle").text(t.number())})})}function f(n){function r(t,n,r,e,a){h.append("text").attr("x",r).attr("y",e).attr("class",a).attr("text-anchor",n).text(t)}r(n.I.name(),"end",t-10,10,"first"),r(n.II.name(),"start",10,10,"second"),r(n.III.name(),"start",10,t-10,"third"),r(n.IV.name(),"end",t-10,t-10,"fourth")}var d,l,h;return l=new tr.util.Fib,d={},d.svg=function(){return h},d.init=function(t){return h=d3.select(t||"body").append("svg"),d},d.plot=function(){var r,a;r=n.cycles().reverse(),a=n.quadrants(),h.attr("width",t).attr("height",t),u(r),e(),c(r),n.hasQuadrants()&&(f(a),s(r,a.I,1,-1,"first"),s(r,a.II,-1,-1,"second"),s(r,a.III,-1,1,"third"),s(r,a.IV,1,1,"fourth"))},d},tr.graphing.RefTable=function(t){function n(){var n={};t.cycles().map(function(t){return{order:t.order(),name:t.name()}}).sort(function(t,n){return t.order===n.order?0:t.order<n.order?-1:1}).forEach(function(t){n[t.name]=[]});var r=[],e=t.quadrants();return Object.keys(e).forEach(function(t){r=r.concat(e[t].blips())}),r.forEach(function(t){n[t.cycle().name()].push(t)}),n}var r,e={};return e.init=function(t){return r=document.querySelector(t||"body"),e},e.render=function(){var t=n(),e='<table class="radar-ref-table">';Object.keys(t).forEach(function(n){e+='<tr class="radar-ref-status-group"><td colspan="3">'+n+"</td></tr>",t[n].forEach(function(t){e+="<tr><td>"+t.number()+"</td><td>"+t.name()+"</td><td>"+t.description()+"</td></tr>"})}),e+="</table>",r.innerHTML=e},e},tr.models.Blip=function(t,n,r,e){var a,u;return a={},u=-1,a.name=function(){return t},a.description=function(){return e||""},a.isNew=function(){return r},a.cycle=function(){return n},a.number=function(){return u},a.setNumber=function(t){u=t},a},tr.models.Cycle=function(t,n){var r={};return r.name=function(){return t},r.order=function(){return n},r},tr.models.Quadrant=function(t){var n,r;return n={},r=[],n.name=function(){return t},n.add=function(t){Array.isArray(t)?r=r.concat(t):r.push(t)},n.blips=function(){return r.slice(0)},n},tr.models.Radar=function(){function t(t){t.forEach(function(t){t.setNumber(++u)})}function n(){var t=[];for(var n in a)a.hasOwnProperty(n)&&null!=a[n]&&t.push(a[n]);return t}function r(){return n().reduce(function(t,n){return t.concat(n.blips())},[])}var e,a,u;return u=0,a={I:null,II:null,III:null,IV:null},e={},e.setFirstQuadrant=function(n){a.I=n,t(a.I.blips())},e.setSecondQuadrant=function(n){a.II=n,t(a.II.blips())},e.setThirdQuadrant=function(n){a.III=n,t(a.III.blips())},e.setFourthQuadrant=function(n){a.IV=n,t(a.IV.blips())},e.hasQuadrants=function(){return!!(a.I||a.II||a.III||a.IV)},e.cycles=function(){var t,n;n=[],t={},r().forEach(function(n){t[n.cycle().name()]=n.cycle()});for(var e in t)t.hasOwnProperty(e)&&n.push(t[e]);return n.slice(0).sort(function(t,n){return t.order()-n.order()})},e.quadrants=function(){return a},e},tr.util.Fib=function(){var t={};return t.sequence=function(t){for(var n=[0,1],r=2;t>r;r++)n[r]=n[r-2]+n[r-1];return n},t.sum=function(n){return 0===n?0:1===n?1:t.sequence(n+1).reduce(function(t,n){return t+n},0)},t};
+var tr=tr||{};tr.models={},tr.graphing={},tr.util={},tr.graphing.Radar=function(t,n){function r(){return Math.round(t/2)}function e(){p.append("line").attr("x1",r()).attr("y1",0).attr("x2",r()).attr("y2",t).attr("stroke-width",14),p.append("line").attr("x1",0).attr("y1",r()).attr("x2",t).attr("y2",r()).attr("stroke-width",14)}function a(t,n){var e=(l.sequence(t.length),l.sum(t.length)),a=l.sum(n);return r()-r()*a/e}function u(t){t.forEach(function(n,e){p.append("circle").attr("cx",r()).attr("cy",r()).attr("r",a(t,e))})}function c(t){var n;n=Math.round(r()/t.length),t.forEach(function(n,e){p.append("text").attr("class","line-text").attr("y",r()+4).attr("x",r()-a(t,e)+10).text(n.name()),p.append("text").attr("class","line-text").attr("y",r()+4).attr("x",r()+a(t,e)-10).attr("text-anchor","end").text(n.name())})}function o(t,n,r,e){var a,u,c,o,i,s;return a=13,u=n-a,c=t-a+1,o=t+a+1,i=n+a-a/2.5,s=t+1+","+u+" "+c+","+i+" "+o+","+i,(e||p).append("polygon").attr("points",s).attr("class",r).attr("stroke-width",1.5)}function i(t,n,r,e){return(e||p).append("circle").attr("cx",t).attr("cy",n).attr("class",r).attr("stroke-width",1.5).attr("r",10)}function s(t,n,e,u,c){var s;s=n.blips(),t.forEach(function(n,f){var d,l,I;d=a(t,f),l=f==t.length-1?0:a(t,f+1);var I=s.filter(function(t){return t.cycle()==n});I.forEach(function(t){var a,s,f=t.name().split(""),I=f.reduce(function(t,n){return t+n.charCodeAt(0)},0);chance=new Chance(I*n.name().length*t.number()),a=Math.PI*chance.integer({min:13,max:85})/180,s=chance.floating({min:l+25,max:d-10});var m=r()+s*Math.cos(a)*e,y=r()+s*Math.sin(a)*u,v=p.append("g").attr("class","blip-group");t.isNew()?o(m,y,c,v):i(m,y,c,v),h.push(function(){var n;n=p.append("text").attr("x",m+15).attr("y",y+4).attr("class","blip-name").attr("text-anchor","left").text(t.name()),v.on("mouseover",function(){n.style("display","block")}).on("mouseout",function(){n.style("display","none")})}),v.append("text").attr("x",m).attr("y",y+4).attr("class","blip-text").attr("text-anchor","middle").text(t.number())})})}function f(n){function r(t,n,r,e,a){p.append("text").attr("x",r).attr("y",e).attr("class",a).attr("text-anchor",n).text(t)}r(n.I.name(),"end",t-10,10,"first"),r(n.II.name(),"start",10,10,"second"),r(n.III.name(),"start",10,t-10,"third"),r(n.IV.name(),"end",t-10,t-10,"fourth")}var d,l,p,h;return h=[],l=new tr.util.Fib,d={},d.svg=function(){return p},d.init=function(t){return p=d3.select(t||"body").append("svg"),d},d.plot=function(){var r,a;r=n.cycles().reverse(),a=n.quadrants(),p.attr("width",t).attr("height",t),u(r),e(),c(r),n.hasQuadrants()&&(f(a),s(r,a.I,1,-1,"first"),s(r,a.II,-1,-1,"second"),s(r,a.III,-1,1,"third"),s(r,a.IV,1,1,"fourth")),h.forEach(function(t){t()})},d},tr.graphing.RefTable=function(t){function n(){var n={};t.cycles().map(function(t){return{order:t.order(),name:t.name()}}).sort(function(t,n){return t.order===n.order?0:t.order<n.order?-1:1}).forEach(function(t){n[t.name]=[]});var r=[],e=t.quadrants();return Object.keys(e).forEach(function(t){r=r.concat(e[t].blips())}),r.forEach(function(t){n[t.cycle().name()].push(t)}),n}var r,e={};return e.init=function(t){return r=document.querySelector(t||"body"),e},e.render=function(){var t=n(),e='<table class="radar-ref-table">';Object.keys(t).forEach(function(n){e+='<tr class="radar-ref-status-group"><td colspan="3">'+n+"</td></tr>",t[n].forEach(function(t){e+="<tr><td>"+t.number()+"</td><td>"+t.name()+"</td><td>"+t.description()+"</td></tr>"})}),e+="</table>",r.innerHTML=e},e},tr.models.Blip=function(t,n,r,e){var a,u;return a={},u=-1,a.name=function(){return t},a.description=function(){return e||""},a.isNew=function(){return r},a.cycle=function(){return n},a.number=function(){return u},a.setNumber=function(t){u=t},a},tr.models.Cycle=function(t,n){var r={};return r.name=function(){return t},r.order=function(){return n},r},tr.models.Quadrant=function(t){var n,r;return n={},r=[],n.name=function(){return t},n.add=function(t){Array.isArray(t)?r=r.concat(t):r.push(t)},n.blips=function(){return r.slice(0)},n},tr.models.Radar=function(){function t(t){t.forEach(function(t){t.setNumber(++u)})}function n(){var t=[];for(var n in a)a.hasOwnProperty(n)&&null!=a[n]&&t.push(a[n]);return t}function r(){return n().reduce(function(t,n){return t.concat(n.blips())},[])}var e,a,u;return u=0,a={I:null,II:null,III:null,IV:null},e={},e.setFirstQuadrant=function(n){a.I=n,t(a.I.blips())},e.setSecondQuadrant=function(n){a.II=n,t(a.II.blips())},e.setThirdQuadrant=function(n){a.III=n,t(a.III.blips())},e.setFourthQuadrant=function(n){a.IV=n,t(a.IV.blips())},e.hasQuadrants=function(){return!!(a.I||a.II||a.III||a.IV)},e.cycles=function(){var t,n;n=[],t={},r().forEach(function(n){t[n.cycle().name()]=n.cycle()});for(var e in t)t.hasOwnProperty(e)&&n.push(t[e]);return n.slice(0).sort(function(t,n){return t.order()-n.order()})},e.quadrants=function(){return a},e},tr.util.Fib=function(){var t={};return t.sequence=function(t){for(var n=[0,1],r=2;t>r;r++)n[r]=n[r-2]+n[r-1];return n},t.sum=function(n){return 0===n?0:1===n?1:t.sequence(n+1).reduce(function(t,n){return t+n},0)},t};
 //# sourceMappingURL=./tech-radar.min.js.map
\ No newline at end of file
index 9971abb..3e2084e 100644 (file)
@@ -1 +1 @@
-{"version":3,"file":"./dist/tech-radar.min.js","sources":["./src/namespaces.js","./src/graphing/radar.js","./src/graphing/ref-table.js","./src/models/blip.js","./src/models/cycle.js","./src/models/quadrant.js","./src/models/radar.js","./src/util/fib.js"],"names":["tr","models","graphing","util","Radar","size","radar","center","Math","round","plotLines","svg","append","attr","getRadius","cycles","i","total","fib","sequence","length","sum","plotCircles","forEach","cycle","plotTexts","increment","text","name","triangle","x","y","cssClass","tsize","top","left","right","bottom","points","circle","plotBlips","quadrant","adjustX","adjustY","blips","maxRadius","minRadius","cycleBlips","filter","blip","angleInRad","radius","split","reduce","p","c","charCodeAt","chance","Chance","number","PI","integer","min","max","floating","cos","sin","isNew","plotQuadrantNames","quadrants","plotName","anchor","I","II","III","IV","self","Fib","init","selector","d3","select","plot","reverse","hasQuadrants","RefTable","blipsByCycle","map","order","sort","a","b","Object","keys","concat","push","injectionElement","document","querySelector","render","html","description","innerHTML","Blip","setNumber","newNumber","Cycle","Quadrant","add","newBlips","Array","isArray","slice","setNumbers","blipNumber","allQuadrants","all","hasOwnProperty","allBlips","setFirstQuadrant","setSecondQuadrant","setThirdQuadrant","setFourthQuadrant","cycleHash","cycleArray","result","previous","current"],"mappings":"AAAA,GAAIA,IAAKA,MACTA,IAAGC,UACHD,GAAGE,YACHF,GAAGG,QCHHH,GAAGE,SAASE,MAAQ,SAAUC,EAAMC,GAUlC,QAASC,KACP,MAAOC,MAAKC,MAAMJ,EAAK,GAGzB,QAASK,KACPC,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wE,EAAW5C,EAAUM,GAAG/B,UAqB1BgC,EAAKQ,aAAe,WAClB,SAASf,EAAUG,GAAOH,EAAUI,IAAQJ,EAAUK,KAASL,EAAUM,KAG3EC,EAAK7D,OAAS,WACZ,GAAI4G,GAAWC,CAEfA,MACAD,KAEAL,IAAW/F,QAAQ,SAAU0B,GAC3B0E,EAAU1E,EAAKzB,QAAQI,QAAUqB,EAAKzB,SAGxC,KAAK,GAAI8B,KAAKqE,GACRA,EAAUN,eAAe/D,IAC3BsE,EAAW7B,KAAK4B,EAAUrE,GAI9B,OAAOsE,GAAWZ,MAAM,GAAGvB,KAAK,SAAUC,EAAGC,GAAK,MAAOD,GAAEF,QAAUG,EAAEH,WAGzEZ,EAAKP,UAAY,WACf,MAAOA,IAGFO,GC9ET5E,GAAGG,KAAK0E,IAAM,WACZ,GAAID,KAqBJ,OAnBAA,GAAKzD,SAAW,SAAUC,GAGxB,IAAK,GAFDyG,IAAU,EAAG,GAER7G,EAAI,EAAOI,EAAJJ,EAAYA,IAC1B6G,EAAO7G,GAAK6G,EAAO7G,EAAE,GAAK6G,EAAO7G,EAAE,EAGrC,OAAO6G,IAGTjD,EAAKvD,IAAM,SAAUD,GACnB,MAAe,KAAXA,EAAuB,EACZ,IAAXA,EAAuB,EAEpBwD,EAAKzD,SAASC,EAAS,GAAGiC,OAAO,SAAUyE,EAAUC,GAC1D,MAAOD,GAAWC,GACjB,IAGEnD"}
\ No newline at end of file
+{"version":3,"file":"./dist/tech-radar.min.js","sources":["./src/namespaces.js","./src/graphing/radar.js","./src/graphing/ref-table.js","./src/models/blip.js","./src/models/cycle.js","./src/models/quadrant.js","./src/models/radar.js","./src/util/fib.js"],"names":["tr","models","graphing","util","Radar","size","radar","center","Math","round","plotLines","svg","append","attr","getRadius","cycles","i","total","fib","sequence","length","sum","plotCircles","forEach","cycle","plotTexts","increment","text","name","triangle","x","y","cssClass","group","tsize","top","left","right","bottom","points","circle","plotBlips","quadrant","adjustX","adjustY","blips","maxRadius","minRadius","cycleBlips","filter","blip","angleInRad","radius","split","reduce","p","c","charCodeAt","chance","Chance","number","PI","integer","min","max","floating","cos","sin","isNew","texts","push","on","style","plotQuadrantNames","quadrants","plotName","anchor","I","II","III","IV","self","Fib","init","selector","d3","select","plot","reverse","hasQuadrants","fn","RefTable","blipsByCycle","map","order","sort","a","b","Object","keys","concat","injectionElement","document","querySelector","render","html","description","innerHTML","Blip","setNumber","newNumber","Cycle","Quadrant","add","newBlips","Array","isArray","slice","setNumbers","blipNumber","allQuadrants","all","hasOwnProperty","allBlips","setFirstQuadrant","setSecondQuadrant","setThirdQuadrant","setFourthQuadrant","cycleHash","cycleArray","result","previous","current"],"mappings":"AAAA,GAAIA,IAAKA,MACTA,IAAGC,UACHD,GAAGE,YACHF,GAAGG,QCHHH,GAAGE,SAASE,MAAQ,SAAUC,EAAMC,GAWlC,QAASC,KACP,MAAOC,MAAKC,MAAMJ,EAAK,GAGzB,QAASK,KACPC,EAAIC,OAAO,QACRC,KAAK,KAAMN,KACXM,KAAK,KAAM,GACXA,KAAK,KAAMN,KACXM,KAAK,KAAMR,GACXQ,KAAK,eAAgB,IAExBF,EAAIC,OAAO,QACRC,KAAK,KAAM,GACXA,KAAK,KAAMN,KACXM,KAAK,KAAMR,GACXQ,KAAK,KAAMN,KACXM,KAAK,eAAgB,IAG1B,QAASC,GAAUC,EAAQC,GACzB,GACIC,IADWC,EAAIC,SAASJ,EAAOK,QACvBF,EAAIG,IAAIN,EAAOK,SACvBC,EAAMH,EAAIG,IAAIL,EAElB,OAAOT,KAAYA,IAAWc,EAAMJ,EAGtC,QAASK,GAAYP,GAGnBA,EAAOQ,QAAQ,SAAUC,EAAOR,GAC9BL,EAAIC,OAAO,UACRC,KAAK,KAAMN,KACXM,KAAK,KAAMN,KACXM,KAAK,IAAKC,EAAUC,EAAQC,MAInC,QAASS,GAAUV,GACjB,GAAIW,EAEJA,GAAYlB,KAAKC,MAAMF,IAAWQ,EAAOK,QAEzCL,EAAOQ,QAAQ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G,QAAQ,SAAU2B,GAC3B8E,EAAU9E,EAAK1B,QAAQI,QAAUsB,EAAK1B,SAGxC,KAAK,GAAI+B,KAAKyE,GACRA,EAAUN,eAAenE,IAC3B0E,EAAW3D,KAAK0D,EAAUzE,GAI9B,OAAO0E,GAAWZ,MAAM,GAAGtB,KAAK,SAAUC,EAAGC,GAAK,MAAOD,GAAEF,QAAUG,EAAEH,WAGzEb,EAAKP,UAAY,WACf,MAAOA,IAGFO,GC9ETjF,GAAGG,KAAK+E,IAAM,WACZ,GAAID,KAqBJ,OAnBAA,GAAK9D,SAAW,SAAUC,GAGxB,IAAK,GAFD8G,IAAU,EAAG,GAERlH,EAAI,EAAOI,EAAJJ,EAAYA,IAC1BkH,EAAOlH,GAAKkH,EAAOlH,EAAE,GAAKkH,EAAOlH,EAAE,EAGrC,OAAOkH,IAGTjD,EAAK5D,IAAM,SAAUD,GACnB,MAAe,KAAXA,EAAuB,EACZ,IAAXA,EAAuB,EAEpB6D,EAAK9D,SAASC,EAAS,GAAGkC,OAAO,SAAU6E,EAAUC,GAC1D,MAAOD,GAAWC,GACjB,IAGEnD"}
\ No newline at end of file
index 46c43ae..3bfd700 100644 (file)
@@ -1,6 +1,7 @@
 tr.graphing.Radar = function (size, radar, toolTipDescription) {
-  var self, fib, svg;
+  var self, fib, svg, texts;
 
+  texts = [];
   fib = new tr.util.Fib();
 
   self = {};
@@ -68,7 +69,7 @@ tr.graphing.Radar = function (size, radar, toolTipDescription) {
     });
   };
 
-  function triangle(x, y, cssClass) {
+  function triangle(x, y, cssClass, group) {
     var tsize, top, left, right, bottom, points;
 
     tsize = 13
@@ -79,14 +80,14 @@ tr.graphing.Radar = function (size, radar, toolTipDescription) {
 
     points = x + 1 + ',' + top + ' ' + left + ',' + bottom + ' ' + right + ',' + bottom;
 
-    return svg.append('polygon')
+    return (group || svg).append('polygon')
       .attr('points', points)
       .attr('class', cssClass)
       .attr('stroke-width', 1.5);
   }
 
-  function circle(x, y, cssClass) {
-    svg.append('circle')
+  function circle(x, y, cssClass, group) {
+    return (group || svg).append('circle')
       .attr('cx', x)
       .attr('cy', y)
       .attr('class', cssClass)
@@ -120,21 +121,38 @@ tr.graphing.Radar = function (size, radar, toolTipDescription) {
         var x = center() + radius * Math.cos(angleInRad) * adjustX;
         var y = center() + radius * Math.sin(angleInRad) * adjustY;
 
+        var group = svg.append('g').attr('class', 'blip-group');
+
         if (blip.isNew()) {
-          triangle(x, y, cssClass);
+          triangle(x, y, cssClass, group);
         } else {
-          circle(x, y, cssClass);
+          circle(x, y, cssClass, group);
         }
 
-        svg.append('text')
+        texts.push(function () {
+          var name;
+
+          name = svg.append('text')
+            .attr('x', x + 15)
+            .attr('y', y + 4)
+            .attr('class', 'blip-name')
+            .attr('text-anchor', 'left')
+            .text(blip.name())
+
+          group
+            .on('mouseover', function () { name.style('display', 'block'); })
+            .on('mouseout', function () { name.style('display', 'none'); });
+        });
+
+        group.append('text')
           .attr('x', x)
           .attr('y', y + 4)
           .attr('class', 'blip-text')
           .attr('text-anchor', 'middle')
           .text(blip.number())
           .append("svg:title")
-          .text(blip.name() + ((toolTipDescription && blip.description()) 
-              ? ': ' + blip.description().replace(/(<([^>]+)>)/ig, '') 
+          .text(blip.name() + ((toolTipDescription && blip.description())
+              ? ': ' + blip.description().replace(/(<([^>]+)>)/ig, '')
               : '' ))
       });
     });
@@ -180,6 +198,10 @@ tr.graphing.Radar = function (size, radar, toolTipDescription) {
       plotBlips(cycles, quadrants.III, -1, 1, 'third');
       plotBlips(cycles, quadrants.IV, 1, 1, 'fourth');
     }
+
+    texts.forEach(function (fn) {
+      fn();
+    });
   };
 
   return self;
index a6fbd7d..eb6f48c 100644 (file)
@@ -7,11 +7,6 @@ body {
 svg {
   padding: 20px;
 
-  .first { fill: $green; }
-  .second { fill: $blue; }
-  .third { fill: $orange; }
-  .fourth { fill: $violet; }
-
   circle {
     &:nth-child(1) { stroke: none; fill: $grey-light; }
     &:nth-child(2) { stroke: none; fill: $grey; }
@@ -19,8 +14,15 @@ svg {
     &:nth-child(4) { stroke: none; fill: $grey-darkest; }
   }
 
+  .blip-group {
+    cursor: pointer;
+  }
+
   circle, polygon {
-    stroke: $white;
+    &.first { fill: $green; stroke: $white; }
+    &.second { fill: $blue; stroke: $white; }
+    &.third { fill: $orange; stroke: $white; }
+    &.fourth { fill: $violet; stroke: $white; }
   }
 
   line {
@@ -28,6 +30,11 @@ svg {
   }
 
   text {
+    &.first { fill: $green; }
+    &.second { fill: $blue; }
+    &.third { fill: $orange; }
+    &.fourth { fill: $violet; }
+
     &.first, &.second, &.third, &.fourth {
       font-size: 16px;
       font-weight: bold;
@@ -39,6 +46,13 @@ svg {
       fill: $white;
     }
 
+    &.blip-name {
+      font-size: 12px;
+      font-weight: bold;
+      fill: $black;
+      display: none;
+    }
+
     &.line-text {
       font-weight: bold;
       text-transform: uppercase;