-
Notifications
You must be signed in to change notification settings - Fork 2
/
nuclides.min.js
13 lines (13 loc) · 69.6 KB
/
nuclides.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
"use strict";var Caption=function(){this.properties={text:"",x:0,y:0,line_height:1,tspans:[]}};Caption.prototype.text=function(t){return"undefined"==typeof t?this.properties.text:(this.properties.text=t.toString(),this)},Caption.prototype.x=function(t){return"undefined"==typeof t?this.properties.x:(this.properties.x=parseFloat(t),this)},Caption.prototype.y=function(t){return"undefined"==typeof t?this.properties.y:(this.properties.y=parseFloat(t),this)},Caption.prototype.lineHeight=function(t){return"undefined"==typeof t?this.properties.line_height:(this.properties.line_height=parseFloat(t),this)},Caption.prototype.appendTo=function(t){this.properties.tspans=this.parse(),t.selectAll("tspan").remove();for(var e in this.properties.tspans){var l=this.properties.tspans[e];null!=l["class"][1]&&(l["class"][1]="small");var s=l["class"].join(" ").trim(),n=t.append("tspan").text(l.text);if(s.length&&n.attr("class",s),null!=l.x&&n.attr("x",l.x),null!=l.y&&n.attr("y",l.y),Math.abs(l.dy)>0&&n.attr("dy",l.dy),"repo"==l.mouse)n.on("click",function(){document.getElementById("link_repo_contrib").click()});else if("link"==l.mouse){var i=matter.element_name_map[l.text],u=matter.nuclide_name_map[l.text];"undefined"!=typeof i?!function(t,e,l){e.append("title").text("What is "+t.text+"?"),e.on("mouseover",function(){display.highlightElement(l,!0)}).on("mouseout",function(){display.highlightElement(l,!1)}).on("click",function(){display.next_element=l.protons,questions.call("what_is_element")})}(l,n,i):"undefined"!=typeof u&&!function(t,e,l){e.append("title").text("What is "+t.text+"?"),e.on("mouseover",function(){display.highlightNuclide(l,!0)}).on("mouseout",function(){display.highlightNuclide(l,!1)}).on("click",function(){display.next_element=l.protons,questions.call("what_is_element")})}(l,n,u)}else"q"==l.mouse&&!function(t,e){e.append("title").text(t.title),e.on("click",function(){var e=questions.titleToID(t.title);questions.call(e)})}(l,n)}return!0},Caption.prototype.parse=function(){var t=[],e=this.properties.text.split(/(\[\w+\])/),l=null,s=null,n={sup:-1*display.scale,sub:.5*display.scale,sml:0},i=0,u=0,o=this.properties.x*display.scale,p=(this.properties.y+this.properties.line_height)*display.scale,a=this.properties.line_height*display.scale;for(t.push({text:"","class":[],mouse:null,title:null,x:o,y:p,dy:null});i<e.length;){switch(e[i]){case"[br]":var r=a;u>0&&null!=t[u-1]["class"][1]&&(r+=-1*n[t[u-1]["class"][1]]),t.push({text:"","class":[],mouse:null,title:null,x:o,y:null,dy:r}),u++;break;case"[em1]":case"[em2]":case"[em3]":case"[em4]":case"[emi]":var c=e[i].slice(1,4);null==l?(l=c,t[u].text.length?(t.push({text:"","class":[l,s],title:null,mouse:null,x:null,y:null,dy:null}),u++):t[u]["class"][0]=l):(l=null,t[u].text.length?(t.push({text:"","class":[l,s],title:null,mouse:null,x:null,y:null,dy:null}),u++):t[u]["class"][0]=null);break;case"[sub]":case"[sup]":case"[sml]":var c=e[i].slice(1,4);if(null==s){s=c;var r=n[s];t[u].text.length?(t.push({text:"","class":[l,s],title:null,mouse:null,x:null,y:null,dy:r}),u++):(t[u]["class"][1]=c,t[u].dy+=r)}else{var r=-1*n[s];s=null,t[u].text.length?(t.push({text:"","class":[l,s],title:null,mouse:null,x:null,y:null,dy:r}),u++):(t[u]["class"][1]=null,t[u].dy+=r)}break;case"[q]":null==t[u].mouse?0==t[u].text.length?(t[u].mouse="q",t[u]["class"].push("href")):(t.push({text:"","class":["href"],mouse:"q",title:null,x:null,y:null,dy:null}),u++):(t.push({text:"","class":[],mouse:null,title:null,x:null,y:null,dy:null}),u++);break;case"[link]":null==t[u].mouse?0==t[u].text.length?(t[u]["class"].push("href"),t[u].mouse="link"):(t.push({text:"","class":["href"],mouse:"link",title:null,x:null,y:null,dy:null}),u++):(t.push({text:"","class":[],mouse:null,x:null,title:null,y:null,dy:null}),u++);break;case"[repo]":null==t[u].mouse?0==t[u].text.length?(t[u]["class"].push("href"),t[u].mouse="repo"):(t.push({text:"","class":["href"],mouse:"repo",title:null,x:null,y:null,dy:null}),u++):(t.push({text:"","class":[],mouse:null,title:null,x:null,y:null,dy:null}),u++);break;default:if("q"==t[u].mouse){var h=e[i].split("|");t[u].text=h[0],t[u].title=h[1]}else t[u].text+=e[i]}i++}return""==t[t.length-1].text&&t.pop(),t};
"use strict";var display={scale:1,available_width:0,available_height:0,nuclides_per_row:0,current_element:null,next_element:null,transition_speed:0,area:{w:256,h:160},regions:{questions:{x:0,y:28,w:44,h:108,regions:{credit:{x:0,y:108,w:44,h:24}}},key:{x:192,y:0,w:64,h:160,regions:{detail:{x:0,y:0,w:44,h:28},slider:{x:44,y:0,w:20,h:160}}},stage:{x:44,y:28,w:192,h:132},curtain:{x:0,y:0,w:256,h:160},title:{x:0,y:0,w:192,h:28}},components:{thumbnail:{w:1,h:1},nuclide_hover:{w:50,h:18}},parseTransform:function(t){var e=t.attr("transform").match(/\d+\.*\d*/g);for(var a in e)e[a]=parseFloat(e[a]);return e},fadeIn:function(t,e){if("number"!=typeof e)var e=0;t.style("opacity",0).style("display",null),t.transition().delay(e*display.transition_speed).style("opacity",1)},fadeOut:function(t,e){if("number"!=typeof e)var e=0;t.transition().delay(e*display.transition_speed).style("opacity",0),function(t,e){d3.timer(function(){return t.style("display","none"),!0},e*display.transition_speed)}(t,e)},periodic_table:{getElementCoords:function(t,e){var a="function"==typeof e.element.w?e.element.w():e.element.w,l="function"==typeof e.element.m?e.element.m():e.element.m,i=display.scale*(a+l),s=display.scale*e.origin.x,n=display.scale*e.origin.y;return t.group>18?(s+=(t.group-17)*i,n+=(t.period+2)*i):0==t.group?n-=1.5*i:(s+=(t.group-1)*i,n+=(t.period-1)*i),[s,n]},getNuclideCoords:function(t,e){var a="function"==typeof e.nuclide.w?e.nuclide.w():e.nuclide.w,l="function"==typeof e.nuclide.m?e.nuclide.m():e.nuclide.m,i=display.scale*(a+l),s=display.periodic_table.getElementCoords(t.parentElement,e),n=t.neutrons-t.parentElement.min_neutrons,r=s[0]+n%display.nuclides_per_row*i,d=s[1]+Math.floor(n/display.nuclides_per_row)*i;return[r,d]}},chart_of_nuclides:{getNuclideCoords:function(t,e){var a="function"==typeof e.nuclide.w?e.nuclide.w():e.nuclide.w,l="function"==typeof e.nuclide.m?e.nuclide.m():e.nuclide.m,i=display.scale*(a+l),s=display.scale*e.origin.x+t.neutrons*i,n=display.scale*e.origin.y+(120-t.protons)*i;return[s,n]}},isotopes_grid:{getNuclideCoords:function(t,e){var a="function"==typeof e.nuclide.w?e.nuclide.w():e.nuclide.w,l="function"==typeof e.nuclide.m?e.nuclide.m():e.nuclide.m,i=display.scale*(a+l),s=[display.scale*e.origin.x,display.scale*e.origin.y],n=t.neutrons-t.parentElement.min_neutrons,r=s[0]+n%display.nuclides_per_row*i,d=s[1]+Math.floor(n/display.nuclides_per_row)*i;return[r,d]}},showDataset:function(t,e){var a={origin:{x:0,y:0},element:{w:0,m:0},nuclide:{w:0,m:0},show_labels:!1,show_hitboxes:!0,transition:{duration:0,delay:0},coordsFunction:function(){}};if("object"==typeof e)for(var l in e)a[l]=e[l];var i="";"undefined"!=typeof a.next_element&&(i="display"==a.next_element?".e"+display.next_element:".e"+a.next_element);var s=a[t].w;"function"==typeof a[t].w&&(s=a[t].w());var n=a[t].m;if("function"==typeof a[t].m&&(n=a[t].m()),d3.selectAll("g."+t+i).style("display",null),d3.selectAll("g."+t+i).transition().delay(a.transition.delay*display.transition_speed).duration(a.transition.duration*display.transition_speed).attr("transform",function(t){var e=a.coordsFunction(t,a),l=s*display.scale;return"translate("+e[0]+","+e[1]+") scale("+l+")"}).style("opacity",1),a.show_labels?display.fadeIn(d3.selectAll("text."+t+i),a.transition.duration):display.fadeOut(d3.selectAll("text."+t+i),a.transition.duration),a.show_hitboxes){var r=display.scale*(s+n);d3.selectAll("rect.hitbox."+t+i).style("display",null).attr("width",r).attr("height",r).attr("transform",function(t){var e=a.coordsFunction(t,a);return"translate("+e[0]+","+e[1]+")"})}else d3.selectAll("rect.hitbox."+t+i).style("display","none")},hideDataset:function(t){d3.selectAll("rect.hitbox."+t).style("display","none"),d3.selectAll("text."+t).style("display","none"),d3.selectAll("g."+t).style("display","none")},setTitle:function(){var t=questions.next.title;questions.next.element_specific&&(t="What is "+matter.elements[display.next_element].name+"?"),d3.select("#question_title").text(t)},setCaptions:function(){if(display.fadeIn(d3.select("#captions"),500),"number"!=typeof t)var t=0;if("number"!=typeof e)var e=0;if("number"!=typeof a)var a=0;var l=questions.next.captions;questions.next.element_specific&&(l[0].copy=matter.elements[display.next_element].caption);for(var i=0;i<questions.next.captions.length;i++){var s=questions.next.captions[i];"undefined"==typeof s.id&&(s.id="");var n=d3.select("#captions").append("text").attr("class","caption").attr("id",s.id).style("font-size",.85*s.line_height*display.scale+"px").style("opacity",0);(new Caption).text(s.copy).x(s.x).y(s.y).lineHeight(s.line_height).appendTo(n),n.transition().delay((e+a*i)*display.transition_speed).duration(t*display.transition_speed).style("opacity",1)}},setComponents:function(){if(display.fadeIn(d3.select("#components"),500),"number"!=typeof t)var t=0;if("number"!=typeof e)var e=0;if("number"!=typeof a)var a=0;var l=0;for(var i in questions.next.components){var s=questions.next.components[i],n=d3.select("#"+i);n.style("display",null),n.attr("transform","translate("+s.x*display.scale+","+s.y*display.scale+")"),n.transition().delay((e+a*l)*display.transition_speed).duration(t*display.transition_speed).style("opacity",1),l++}},setQuestions:function(){d3.select("#qlist").selectAll("tspan").remove();for(var t in questions.next.questions){var e=questions.next.questions[t];!function(t,e){for(var a=questions.titleToID(e),l=[],i=35;e.length>0;)if(e.length<=i)l.push(e),e="";else{var s=e.slice(0,i).lastIndexOf(" ");l.push(e.slice(0,s).trim()),e=e.slice(s).trim()}for(var n in l)var r=7*(t>0&&0==n?1:0)*display.scale+3.2*(n>0?1:0)*display.scale,d=d3.select("#qlist").append("tspan").attr("class","qhref").attr("x",1.5*display.scale).attr("dy",r).style("font-size",2.5*display.scale+"px").text(l[n]).on("click",function(){questions.call(a)})}(t,e)}},setScale:function(){questions.current.scale!=questions.next.scale&&(display.fadeOut(d3.select("#key_"+questions.current.scale+"_scale"),500*display.transition_speed),display.fadeIn(d3.select("#key_"+questions.next.scale+"_scale"),500*display.transition_speed),"element"==questions.next.scale?display.fadeOut(d3.select("#key_elapsed_time"),500*display.transition_speed):display.fadeIn(d3.select("#key_elapsed_time"),500*display.transition_speed))},highlightElement:function(t,e){if(null==t||0==e)return d3.select("#element_highlightbox").style("display","none"),void(null!=display.current_element&&display.setThumbnail(display.current_element));var a=display.parseTransform(d3.select("#element_"+t.protons+"_display")),l=a[0],i=a[1],s=a[2];return d3.select("#element_highlightbox").style("display","block").attr("x",l).attr("y",i).attr("width",s).attr("height",s),void display.setThumbnail(t.protons)},highlightNuclide:function(t,e){if(null==t||0==e)display.setNuclideHover(null),d3.select("#nuclide_highlightbox").style("display","none"),d3.select("#nuclide_row_highlightbox").style("display","none");else{display.setNuclideHover(t);var a=display.parseTransform(d3.select("#element_"+t.protons+"_nuclide_"+t.neutrons+"_display")),l=a[0],i=a[1],s=a[2];if(d3.select("#nuclide_highlightbox").style("display","block").attr("x",l).attr("y",i).attr("width",s).attr("height",s),display.setThumbnail(t.protons),"undefined"!=typeof questions.current.chart_of_nuclides&&questions.current.chart_of_nuclides.highlight_row){var n=s/questions.current.chart_of_nuclides.nuclide.w*questions.current.chart_of_nuclides.nuclide.m,r=l-(t.neutrons-t.parentElement.min_neutrons)*(s+n),d=t.parentElement.neutron_spread*(s+n)-n;d3.select("#nuclide_row_highlightbox").style("display","block").attr("x",r).attr("y",i).attr("width",d).attr("height",s)}}display.highlightElement(t.parentElement,e)},setNuclideHover:function(t){if(null==t)return void d3.select("#nuclide_hover").style("display","none");var e=d3.select("#element_"+t.protons+"_nuclide_"+t.neutrons+"_display");if("none"==e.style("display"))return void d3.select("#nuclide_hover").style("display","none");var a=display.components.nuclide_hover.w*display.scale,l=display.components.nuclide_hover.h*display.scale,i=display.parseTransform(e),s=l/display.scale/10,n="[em4]"+t.parentElement.name+"-"+(t.protons+t.neutrons)+"[em4][br][em3]Protons: "+t.protons+"[em3][br][em1]Neutrons: "+t.neutrons+"[em1][br][em2]Half-life: "+t.halflife.repNumerical()+"[em2]";(new Caption).text(n).x(s).y(0).lineHeight(2.2*s).appendTo(d3.select("#nuclide_hover_info"));var r=(display.regions.stage.w+display.regions.key.regions.slider.w)*display.scale,d=i[0]+1.1*i[2];d+a>r&&(d=i[0]-a-.1*i[2]);var p=i[1]-l/4;d3.select("#nuclide_hover").attr("transform","translate("+d+", "+p+")").style("display",null)},setThumbnail:function(t){var e=0,a="";"object"==typeof matter.elements[t]&&(a=t+" - "+matter.elements[t].name+" ("+matter.elements[t].symbol+")",matter.elements[t].has_image&&(e=t));var l=29*display.scale;d3.select("#thumbnail_src").attr("y",0-e*l+l/10),d3.select("#thumbnail_title").text(a)},elapsed_time_exp:null,setElapsedTimeExp:function(t){if(null!=t){if(t=parseFloat(t),isNaN(t))return;t=Math.max(t,matter.min_halflife_exp-1),t=Math.min(t,matter.max_halflife_exp-1)}this.elapsed_time_exp=t,d3.selectAll("rect.nuclide").attr("fill",function(t){return palette.nuclide(t)}),d3.selectAll("text.nuclide").attr("fill",function(t){return palette.nuclideLabel(t)}),d3.select("#key_elapsed_time_numerical").selectAll("tspan").remove();var e=Math.floor(this.elapsed_time_exp),a=Math.pow(10,this.elapsed_time_exp-Math.floor(this.elapsed_time_exp)),l=new Time(a,e),i="[em3]None[em3][sml] (change with the slider →)[sml]";if(null!=this.elapsed_time_exp&&(i="[em3]"+l.repNumerical()+"[em3]"),(new Caption).text(i).x(2.5).y(10).lineHeight(0).appendTo(d3.select("#key_elapsed_time_numerical")),d3.select("#key_elapsed_time_caption").selectAll("tspan").remove(),null!=this.elapsed_time_exp){var s=l.repPrefixed(),n=l.repAnalogy(),r="";s.length>0&&(r+="("+s+")"),n.length&&(r+=(r.length>0?"[br]":"")+n),r.length&&(new Caption).text(r).x(2.5).y(11).lineHeight(3).appendTo(d3.select("#key_elapsed_time_caption"))}}};display.regions.stage.init=function(){display.nuclides_per_row=Math.ceil(Math.sqrt(matter.max_nuclides_per_element))},display.regions.key.init=function(){display.time_slider={w:14,h:3},display.time_slider.y_margin=15*display.scale,display.time_slider.slider_height=3*display.scale,display.time_slider.slider_width=14*display.scale,display.time_slider.x_origin=display.regions.key.regions.slider.w/2*display.scale-display.time_slider.slider_width/2,display.time_slider.y_min=display.time_slider.y_margin-display.time_slider.slider_height/2,display.time_slider.y_max=display.regions.key.regions.slider.h*display.scale-(display.time_slider.y_margin+.5*display.time_slider.slider_height),display.time_slider.x=display.time_slider.x_origin,display.time_slider.y=display.time_slider.y_min,display.time_slider.slideToExponent=function(t){var t=parseFloat(t);if(!isNaN(t)){t<0&&(t-=.01),t=Math.min(Math.max(t,matter.min_halflife_exp),matter.max_halflife_exp);var e=(display.time_slider.y_max-display.time_slider.y_min)*((t+Math.abs(matter.min_halflife_exp))/(matter.max_halflife_exp-matter.min_halflife_exp))+display.time_slider.y_min;display.time_slider.slideTo(e,!1)}},display.time_slider.slideTo=function(t,e){if(e)t=Math.min(Math.max(t,display.time_slider.y_min),display.time_slider.y_max);else if(t<display.time_slider.y_min||t>display.time_slider.y_max)return;display.time_slider.highlightSlider(!0),display.time_slider.y=t,d3.select("#time_slider_handle").attr("y",display.time_slider.y),d3.select("#time_slider_shadow").attr("height",display.time_slider.y-display.time_slider.y_min);var a=null;display.time_slider.y>display.time_slider.y_min&&(a=matter.min_halflife_exp+(matter.max_halflife_exp-matter.min_halflife_exp)*(display.time_slider.y-display.time_slider.y_min)/(display.time_slider.y_max-display.time_slider.y_min)),display.setElapsedTimeExp(a)},display.time_slider.drag=function(t){if("undefined"==typeof d3.event.y)var e=d3.event.clientY;else var e=d3.event.y;var a=e-display.time_slider.slider_height/2;display.time_slider.slideTo(a,t)},display.time_slider.highlightSlider=function(t){t?d3.select("#time_slider_handle").attr("fill","url(#slider_gradient_highlight)").attr("filter","url(#highlight-glow)"):d3.select("#time_slider_handle").attr("fill","url(#slider_gradient)").attr("filter",null)}},display.regions.title.draw=function(t){var e=display.regions.title.h/10*display.scale,a=display.scale*(display.regions.title.h/64*.8);d3.select("#title").append("title").text("Nuclides.org - Interactively explore the elements, nuclides, and isotopes"),d3.select("#title").append("desc").text("The Periodic Table of Elements and the Chart of Nuclides: Two sets of data, all known matter in the universe"),d3.select("#title").append("g").attr("id","title_svg").attr("transform","scale("+a+") translate(0, "+.5*e+")").node().appendChild(t),d3.select("#title").append("text").attr("x",8*e).attr("y",5.25*e).attr("font-size",5*e+"px").attr("fill","rgb(255,255,255)").attr("filter","url(#highlight-glow)").text("Nuclides.org");var l=d3.select("#title").append("text").attr("y",7.1*e).attr("font-size",.9*e+"px").attr("fill","rgb(127,127,127)").style("font-style","italic");l.append("tspan").attr("x",9*e).attr("dy",0).text("The Periodic Table of Elements and the Chart of Nuclides"),l.append("tspan").attr("x",12*e).attr("dy",1.3*e).text("Two sets of data, all known matter in the universe")},display.regions.curtain.draw=function(){d3.select("#curtain").style("opacity",1).append("rect").attr("x",0).attr("y",0).attr("width",display.scale*display.regions.curtain.w).attr("height",display.scale*display.regions.curtain.h).attr("fill","rgb(0,0,0)"),d3.select("#curtain").append("text").attr("id","curtain_text").attr("text-anchor","middle").attr("fill","rgb(255,255,255)").attr("x",display.scale*(display.regions.curtain.w/2)).attr("y",display.scale*(display.regions.curtain.h/2)).style("font-size",6*display.scale+"px").text("loading..")},display.regions.questions.draw=function(){d3.select("#questions").append("path").attr("d",pathString([44,0,44,131])).attr("stroke","#FFFFFF").style("stroke-width","1").attr("fill","none"),d3.select("#questions").append("path").attr("d",pathString([0,6,44,6])).attr("stroke","#FFFFFF").style("stroke-width","1").attr("fill","none"),d3.select("#questions").append("path").attr("d",pathString([0,108,44,108])).attr("stroke","#FFFFFF").style("stroke-width","1").attr("fill","none"),d3.select("#questions").append("text").append("tspan").attr("class","qhref").attr("x",1.5*display.scale).attr("y",3*display.scale).style("font-size",3*display.scale+"px").style("font-weight","bold").text("What is Nuclides.org?").on("click",function(){questions.call("what_is_nuclides_org")}),d3.select("#questions").append("text").attr("id","qlist").attr("y",11.5*display.scale)},display.regions.questions.regions.credit.draw=function(){var t=1.5*display.scale,e=d3.select("#credit").append("text").attr("class","credit").attr("x",0).attr("y",0);e.append("tspan").attr("x",t).attr("y",3.5*display.scale).style("font-size",1.9*display.scale+"px").text("Data provided by Brookhaven Nat'l Laboratory"),e.append("tspan").attr("class","credit href").attr("x",t).attr("dy",2.5*display.scale).style("font-size",1.9*display.scale+"px").text("http://www.nndc.bnl.gov/").on("click",function(){document.getElementById("credit_brookhaven").click()}),e.append("tspan").attr("x",t).attr("dy",3.5*display.scale).style("font-size",1.9*display.scale+"px").text("Images provided by Images-of-Elements.com"),e.append("tspan").attr("class","credit href").attr("x",t).attr("dy",2.5*display.scale).style("font-size",1.9*display.scale+"px").text("http://images-of-elements.com/").on("click",function(){document.getElementById("credit_imagesofelements").click()}),e.append("tspan").attr("x",t).attr("dy",3.5*display.scale).style("font-size",1.9*display.scale+"px").text("Developed, maintained, and open sourced by"),e.append("tspan").attr("class","credit href").attr("x",t).attr("dy",2.5*display.scale).style("font-size",1.9*display.scale+"px").text("Christopher Clark (Frencil)").on("click",function(){document.getElementById("credit_frencil").click()}),e.append("tspan").attr("x",t).attr("dy",3.5*display.scale).style("font-size",1.7*display.scale+"px").text("© Copyright "+(new Date).getFullYear()+" Nuclides.org • "),e.append("tspan").attr("class","credit href").style("font-size",1.7*display.scale+"px").text("About Nuclides.org").on("click",function(){document.getElementById("link_repo").click()})},display.regions.key.draw=function(){var t=d3.select("#key").append("g").attr("id","key_brackets");t.append("path").attr("d",pathString([3,1,1,1,1,27,3,27])).attr("stroke","#FFFFFF").style("stroke-width","1").attr("fill","none"),t.append("path").attr("d",pathString([41,1,43,1,43,27,41,27])).attr("stroke","#FFFFFF").style("stroke-width","1").attr("fill","none"),t.append("path").attr("d",pathString([47,1,45,1,45,159,47,159])).attr("stroke","#FFFFFF").style("stroke-width","1").attr("fill","none"),t.append("path").attr("d",pathString([61,1,63,1,63,159,61,159])).attr("stroke","#FFFFFF").style("stroke-width","1").attr("fill","none"),t.append("path").attr("d",pathString([43,13,45,13])).attr("stroke","#FFFFFF").style("stroke-width","1").attr("fill","none"),t.append("path").attr("d",pathString([43,14,45,14])).attr("stroke","#FFFFFF").style("stroke-width","1").attr("fill","none")},display.regions.key.regions.detail.draw=function(){var t=d3.select("#detail").append("g").attr("id","key_elapsed_time");t.append("text").attr("fill","rgb(255,255,255)").style("font-size",3.5*display.scale+"px").attr("x",2.5*display.scale).attr("y",5.5*display.scale).text("Elapsed Time:"),t.append("text").attr("id","key_elapsed_time_numerical").attr("fill","rgb(255,255,255)").style("font-size",3*display.scale+"px").attr("x",2.5*display.scale).attr("y",10*display.scale),t.append("text").attr("id","key_elapsed_time_caption").attr("fill","rgb(255,255,255)").style("font-size",2*display.scale+"px").style("font-style","italic").attr("x",2.5*display.scale).attr("y",14*display.scale)},display.regions.key.regions.slider.draw=function(){var t=15,e=display.regions.key.regions.slider.w,a=display.regions.key.regions.slider.h,l=6,i=a-2*t,s=(e/2-l)*display.scale,n=d3.behavior.drag().on("drag",function(t){display.time_slider.drag(!0)});d3.select("#slider").call(n).on("click",function(t){display.time_slider.drag(!1)});var r=d3.select("#slider").append("g").attr("id","key_element_scale").style("opacity",0);r.append("title").text("Elements are colored by how many isotopes they have: fewer is lighter yellow, more is darker green"),r.append("rect").attr("id","element_scale").attr("x",s).attr("y",t*display.scale).attr("width",l*display.scale).attr("height",i*display.scale).attr("stroke","#FFFFFF").style("stroke-width","1").attr("fill","url(#element_gradient)");var d=r.append("text").attr("class","scale").style("font-size",3*display.scale+"px");d.append("tspan").attr("text-anchor","middle").attr("x",e/2*display.scale).attr("y",.2*t*display.scale).attr("dy",4*display.scale).text("Fewer"),d.append("tspan").attr("text-anchor","middle").attr("x",e/2*display.scale).attr("dy",3.5*display.scale).text("Isotopes"),d.append("tspan").attr("text-anchor","middle").attr("x",e/2*display.scale).attr("y",(t+i+.15*t)*display.scale).attr("dy",4*display.scale).text("More"),d.append("tspan").attr("text-anchor","middle").attr("x",e/2*display.scale).attr("dy",3.5*display.scale).text("Isotopes");for(var p=(e/2+l)*display.scale,o=r.append("text"),c=0;c<10;c++){var y=1+5*c,h=t+(y-1)/45*i;r.append("path").attr("d",pathString([e/2-l,h,e/2+l,h])).attr("stroke","#FFFFFF").style("stroke-width","1.5").attr("fill","none");var u=(h-1)*display.scale;0==c&&(u=(h+4)*display.scale);var m=0==c||9==c?y:y-1;o.append("tspan").attr("x",p).attr("y",u).attr("text-anchor","end").attr("fill","#FFFFFF").style("font-size",3.5*display.scale+"px").text(m)}var _=d3.select("#slider").append("g").attr("id","key_nuclide_scale").style("opacity",0).style("cursor","pointer");_.append("title").text("Nuclides are colored by how long their half-life is: shorter is blue, longer is orange"),_.append("rect").attr("id","nuclide_scale").attr("x",s).attr("y",t*display.scale).attr("width",l*display.scale).attr("height",i*display.scale).attr("stroke","#FFFFFF").style("stroke-width","1").attr("fill","url(#nuclide_gradient)");var f=_.append("text").attr("class","scale").style("font-size",3*display.scale+"px");f.append("tspan").attr("text-anchor","middle").attr("x",e/2*display.scale).attr("y",.2*t*display.scale).attr("dy",4*display.scale).text("Shorter"),f.append("tspan").attr("text-anchor","middle").attr("x",e/2*display.scale).attr("dy",3.5*display.scale).text("Half-Life"),f.append("tspan").attr("text-anchor","middle").attr("x",e/2*display.scale).attr("y",(t+i+.15*t)*display.scale).attr("dy",4*display.scale).text("Longer"),f.append("tspan").attr("text-anchor","middle").attr("x",e/2*display.scale).attr("dy",3.5*display.scale).text("Half-Life"),_.append("rect").attr("id","time_slider_shadow").attr("x",s).attr("y",display.time_slider.y).attr("width",l*display.scale).attr("height",0).attr("fill","rgba(0,0,0,0.75)");for(var p=(e/2+.7)*display.scale,c=0;c<14;c++){var y=-22+4*c,h=t+(22+y)/52*i;_.append("path").attr("d",pathString([e/2-l,h,e/2+l,h])).attr("stroke","#FFFFFF").style("stroke-width","1.5").attr("fill","none");var u=(h-1)*display.scale;0==c&&(u=(h+3)*display.scale);var g=_.append("text");Math.abs(y)<4?g.append("tspan").attr("x",p).attr("y",u).attr("fill","#FFFFFF").style("font-size",2*display.scale+"px").text(Math.pow(10,y)+"s"):(g.append("tspan").attr("x",p).attr("y",u).attr("fill","#FFFFFF").style("font-size",2*display.scale+"px").text("10"),g.append("tspan").attr("dy",-1*display.scale).attr("fill","#FFFFFF").style("font-size",1.3*display.scale+"px").text(y),g.append("tspan").attr("dy",display.scale).attr("fill","#FFFFFF").style("font-size",2*display.scale+"px").text("s"))}_.append("rect").data([display.time_slider]).attr("id","time_slider_handle").attr("class","handle").attr("x",display.time_slider.x).attr("y",display.time_slider.y).attr("width",display.time_slider.w*display.scale).attr("height",display.time_slider.h*display.scale).attr("rx",display.scale).attr("ry",display.scale/2).attr("stroke","rgb(255,255,255)").style("stroke-width","1").attr("fill","url(#slider_gradient)").on("mouseover",function(){display.time_slider.highlightSlider(!0)}).on("mouseout",function(){display.time_slider.highlightSlider(!1)}).append("title").text("Move this slider up and down to simulate the passage of time and see nuclides decay according to their half-lives")},display.regions.stage.draw=function(){d3.select("#stage").append("text").attr("id","question_title").attr("class","qtitle").attr("x",2*display.scale).attr("y",5.5*display.scale).style("font-size",5*display.scale+"px").text(""),d3.select("#stage").append("g").attr("id","captions"),d3.select("#stage").append("rect").attr("id","floating_element_highlightbox").attr("class","highlightbox").attr("filter","url(#highlight-glow)").attr("width",0).attr("height",0).attr("display","none"),d3.select("#stage").append("g").attr("id","dataset").attr("class","element_group"),d3.select("#dataset").selectAll("g.element").data(matter.elements).enter().append("g").attr("id",function(t){return"element_"+t.protons+"_display"}).attr("class",function(t){return"element e"+t.protons}).attr("transform","translate(0, 0) scale(1)").style("display","none").each(function(t,e){var a="element_"+t.protons+"_display";d3.select("#"+this.id).attr("transform","translate(0,0)"),d3.select("#"+a).append("rect").attr("class","element e"+t.protons).attr("id",function(t){return"element_"+t.protons+"_block"}).attr("width",1).attr("height",1).attr("fill",function(t){return palette.element(t)});var l=d3.select("#"+a).append("text").attr("class","element").attr("id","element_"+t.protons+"_label").style("display","none"),i=l.append("tspan").attr("class","element_symbol e"+t.protons).attr("x",.1).attr("y",.8).style("font-size","0.5px").text(t.symbol);l.append("tspan").attr("class","element_number e"+t.protons).attr("x",.9).attr("y",.3).style("font-size","0.25px").attr("text-anchor","end").text(t.protons),t.symbol.length>2&&i.attr("textLength","0.7px").attr("lengthAdjust","spacingAndGlyphs")}),d3.select("#dataset").selectAll("g.nuclide").data(Object.keys(matter.nuclide_name_map).map(function(t){return matter.nuclide_name_map[t]})).enter().append("g").attr("class",function(t){return"nuclide e"+t.protons+" n"+t.neutrons}).attr("id",function(t){return"element_"+t.protons+"_nuclide_"+t.neutrons+"_display"}).attr("transform","translate(0, 0) scale(1)").style("display","none").each(function(t,e){var a="element_"+t.protons+"_nuclide_"+t.neutrons+"_display";d3.select("#"+a).append("rect").attr("id",function(t){return"element_"+t.protons+"_nuclide_"+t.neutrons+"_block"}).attr("class",function(t){return"nuclide e"+t.protons+" n"+t.neutrons}).attr("width",1).attr("height",1).attr("fill",function(t){return palette.nuclide(t)});var l=d3.select("#"+a).append("text").attr("id",function(t){return"element_"+t.protons+"_nuclide_"+t.neutrons+"_label"}).attr("class",function(t){return"nuclide e"+t.protons+" n"+t.neutrons}).attr("fill",function(t){return palette.nuclideLabel(t)}).style("display","none");l.append("tspan").attr("x",.85).attr("y",.8).style("font-size","0.4px").attr("text-anchor","end").text(function(t){return t.parentElement.symbol}),l.append("tspan").attr("x",.15).attr("y",.38).style("font-size","0.27px").text(t.protons+t.neutrons)}),d3.select("#stage").append("g").attr("id","highlightboxes"),d3.select("#highlightboxes").append("rect").attr("id","element_highlightbox").attr("class","highlightbox").attr("stroke-width",.3*display.scale).attr("stroke-dasharray",.5*display.scale+","+.5*display.scale).attr("filter","url(#highlight-glow)").attr("display","none"),d3.select("#highlightboxes").append("rect").attr("id","nuclide_highlightbox").attr("class","highlightbox").attr("stroke-width",.3*display.scale).attr("stroke-dasharray",.5*display.scale+","+.5*display.scale).attr("filter","url(#highlight-glow)").attr("display","none"),d3.select("#highlightboxes").append("rect").attr("id","nuclide_row_highlightbox").attr("class","highlightbox").attr("stroke-width",.3*display.scale).attr("stroke-dasharray",.5*display.scale+","+.5*display.scale).attr("filter","url(#highlight-glow)").attr("display","none"),d3.select("#stage").append("g").attr("id","components");var t=d3.select("#components").append("g").attr("id","thumbnail").attr("class","component").attr("transform","translate(0,0)").style("display","none"),e=52*display.scale,a=29*display.scale;t.append("clipPath").attr("id","thumbnail_clip").append("rect").attr("id","thumbnail_cliprect").attr("x",0).attr("y",0).attr("width",e).attr("height",a);var l=t.append("g").attr("id","thumbnail_main").attr("clip-path","url(#thumbnail_clip)");l.append("svg:image").attr("id","thumbnail_src").attr("xlink:href","assets/images/elements/sprite_map.jpg").attr("x",0).attr("y",0).attr("width",e).attr("height",(matter.sprite_map_max+1)*a),l.append("rect").attr("id","thumbnail_titlerect").attr("class","thumbnail title").attr("x",0).attr("y",0).attr("width",e).attr("height",a/5),l.append("text").attr("id","thumbnail_title").attr("class","thumbnail title").attr("x",1.5*display.scale).attr("y",a/5-1.65*display.scale).attr("font-size",a/5*.7+"px"),l.append("rect").attr("id","thumbnail_border").attr("class","borderbox").attr("x",0).attr("y",0).attr("width",e).attr("height",a),display.setThumbnail(1);var e=display.components.nuclide_hover.w*display.scale,a=display.components.nuclide_hover.h*display.scale,i=d3.select("#components").append("g").attr("id","nuclide_hover").attr("transform","translate(0,0)").style("display","none");i.append("rect").attr("width",e).attr("height",a).attr("x",0).attr("y",0).attr("fill","rgb(0,0,0)").attr("filter","url(#highlight-glow)");i.append("text").attr("id","nuclide_hover_info").style("font-size",a/5.5+"px");d3.select("#stage").append("g").attr("id","specifics"),d3.select("#stage").append("g").attr("id","hitboxes"),d3.select("#hitboxes").selectAll(".hitbox.element").data(matter.elements).enter().append("rect").attr("class",function(t){return"hitbox element e"+t.protons}).attr("width",1).attr("height",1).attr("transform","translate(0,0)").style("display","none").on("mouseover",function(t){display.highlightElement(t,!0)}).on("mouseout",function(t){display.highlightElement(t,!1)}).on("click",function(t){0==t.protons?questions.call("what_is_a_neutron"):(display.next_element=t.protons,questions.call("what_is_element"))}).append("title").text(function(t){return"What is "+(0==t.protons?"a Neutron":t.name)+"?"}),d3.select("#hitboxes").selectAll(".hitbox.nuclide").data(Object.keys(matter.nuclide_name_map).map(function(t){return matter.nuclide_name_map[t]})).enter().append("rect").attr("class",function(t){return"hitbox nuclide e"+t.protons+" n"+t.neutrons}).attr("width",1).attr("height",1).attr("transform","translate(0,0)").style("display","none").on("mouseover",function(t){display.highlightNuclide(t,!0)}).on("mouseout",function(t){display.highlightNuclide(t,!1)}).on("click",function(t){display.next_element=t.protons,questions.call("what_is_element")})};
"use strict";function Element(t,n,s,e,i,a,r){this.protons=parseInt(t),this.period=parseInt(n),this.group=parseInt(s),this.symbol=e,this.name=i,this.caption=r,this.has_image=!1,1==parseInt(a)&&(this.has_image=!0,window.matter.sprite_map_max=Math.max(this.protons,window.matter.sprite_map_max)),this.nuclide_count=0,this.min_neutrons=null,this.max_neutrons=null,this.neutron_spread=null,this.stablest_neutrons=null,this.smallest_stable_neutrons=null,this.largest_stable_neutrons=null,this.is_highlighted=!1,this.show_img_credit=!0,this.nuclides=new Object,window.matter.element_name_map[this.name]=this.protons,this.addNuclide=function(t){t.index=Object.keys(this.nuclides).length,this.nuclides[t.neutrons]=t,this.nuclides[t.neutrons].parentElement=this,1==Object.keys(this.nuclides).length?(this.min_neutrons=t.neutrons,this.max_neutrons=t.neutrons,this.stablest_neutrons=t.neutrons):(this.min_neutrons=Math.min(this.min_neutrons,t.neutrons),this.max_neutrons=Math.max(this.max_neutrons,t.neutrons),(t.isStable||t.halflife.exponent>this.nuclides[this.stablest_neutrons].halflife.exponent)&&(this.stablest_neutrons=t.neutrons),t.isStable&&(null==this.smallest_stable_neutrons||null==this.largest_stable_neutrons?(this.smallest_stable_neutrons=t.neutrons,this.largest_stable_neutrons=t.neutrons):(t.neutrons<this.smallest_stable_neutrons&&(this.smallest_stable_neutrons=t.neutrons),t.neutrons>this.largest_stable_neutrons&&(this.largest_stable_neutrons=t.neutrons)))),this.nuclide_count++,this.neutron_spread=this.max_neutrons-this.min_neutrons+1,window.matter.max_neutrons=Math.max(window.matter.max_neutrons,t.neutrons),window.matter.max_neutron_spread=Math.max(this.max_neutrons-this.min_neutrons,window.matter.max_neutron_spread),window.matter.absolute_max_neutrons=Math.max(this.max_neutrons,window.matter.absolute_max_neutrons),window.matter.max_nuclides_per_element=Math.max(window.matter.max_nuclides_per_element,Object.keys(this.nuclides).length),window.matter.total_nuclides++;var n=window.matter.elements[t.protons].name+"-"+(t.protons+t.neutrons);window.matter.nuclide_name_map[n]=t}}
"use strict";var Nucleus=function(t,e){if("object"==typeof t)return"undefined"!=typeof e?this.id=e.toString():this.id=String.fromCharCode(65+Math.floor(26*Math.random()))+Date.now(),this.selector=null,this.nucleons_selector=null,this.ejecta_selector=null,this.original_nuclide=null,this.nuclide=null,this.particles={},this.count={proton:0,neutron:0},this.width_sum=0,this.show_labels=!1,this.force=null,this.gravity=.9,this.collide=null,t instanceof Nuclide&&this.setNuclide(t),this};Nucleus.prototype.setNuclide=function(t){return null==this.nuclide&&(this.original_nuclide=t),this.nuclide=t,function(t){for(;t.count.proton!=t.nuclide.protons;)t.count.proton<t.nuclide.protons?t.add(new Proton):t.removeByType("proton");for(;t.count.neutron!=t.nuclide.neutrons;)t.count.neutron<t.nuclide.neutrons?t.add(new Neutron):t.removeByType("neutron");t.collide=function(e){var r=d3.geom.quadtree(t.particlesArray());return function(t){var n=1.7*t.circle.r,i=t.x-n,s=t.x+n,o=t.y-n,c=t.y+n;r.visit(function(r,n,l,u,a){if(r.point&&r.point!==t){var h=t.x-r.point.x,p=t.y-r.point.y,d=Math.sqrt(h*h+p*p),f=t.circle.r+r.point.circle.r-6.28*Math.abs(t.circle.r-r.point.circle.r);d<f&&0!=d&&(d=(d-f)/d*e,t.x-=h*=d,t.y-=p*=d,r.point.x+=h,r.point.y+=p)}return n>s||u<i||l>c||a<o})}}}(this),this},Nucleus.prototype._settableAttributes={id:"string",gravity:"float",show_labels:"boolean"},Nucleus.prototype.attr=function(t,e){if("undefined"==typeof this._settableAttributes[t])return void console.log("Particle error: "+t+" is not a valid attribute");if("undefined"==typeof e)return this[t];switch(this._settableAttributes[t]){case"int":this[t]=parseInt(e);break;case"float":this[t]=parseFloat(e);break;case"boolean":this[t]=Boolean(e);case"string":this[t]=e.toString();break;default:this[t]=e}return this},Nucleus.prototype.add=function(t){return this.count[t.type]++,this.particles[t.id]=t,this.width_sum+=t.circle.r,this},Nucleus.prototype.remove=function(t){return this.count[t.type]--,d3.select("#"+t.id).remove(),this.width_sum-=t.circle.r,delete this.particles[t.id],this},Nucleus.prototype.removeByType=function(t){for(var e=null,r=0;null==e&&r<this.particlesArray().length;)this.particlesArray()[r].type==t&&(e=this.particlesArray()[r]),r++;return null!=e&&this.remove(e),e},Nucleus.prototype.reset=function(){this.force.stop(),this.nuclide!=this.original_nuclide&&this.setNuclide(this.original_nuclide),this.restart()},Nucleus.prototype.particlesArray=function(){var t=this;return Object.keys(t.particles).map(function(e){return t.particles[e]})},Nucleus.prototype.appendTo=function(t){return this.selector=t.append("g").attr("id",this.id),this.nucleons_selector=this.selector.append("g"),this.ejecta_selector=this.selector.append("g"),this.restart(),this},Nucleus.prototype.restart=function(){!function(t){var e=Math.sqrt(t.width_sum),r=Math.sqrt(t.width_sum)/2;t.force=d3.layout.force().nodes(t.particlesArray()).links([]).size([e,e]).charge(-2).chargeDistance(r).gravity(t.gravity).friction(.5),t.nucleons_selector.selectAll("g.nucleon").remove();var n=t.nucleons_selector.selectAll("g.nucleon").data(d3.shuffle(t.particlesArray())).enter().append("g").attr("class","nucleon").attr("id",function(t){return t.id}).call(t.force.drag);n.append("circle").attr("r",function(t){return t.circle.r}).attr("fill",function(t){return t.circle.fill}).attr("stroke",function(t){return t.circle.stroke}).style("stroke-width",function(t){return t.circle.stroke_width}),t.show_labels&&n.append("text").attr("fill",function(t){return t.text.fill}).attr("transform",function(t){return"translate("+[t.text.x,t.text.y]+")"}).style("font-size",function(t){return t.text.font_size+"px"}).text(function(t){return t.text.text}),t.force.on("tick",function(e){t.nucleons_selector.selectAll("g.nucleon").each(t.collide(.1)).attr("transform",function(t){return"translate("+[t.x,t.y]+")"})}),t.force.start()}(this)},Nucleus.prototype._decayModes=["a","b+","b-","p","n",["b+","b+"],["b-","b-"],["p","p"],["n","n"],["b+","a"],["b-","a"],["b+","p"],["b-","n"],["b-","n","n"],["b-","n","n","n"],["b-","n","n","n","n"],["b+","a","a"],["b+","a","a","a"],["b+","p","p"]],Nucleus.prototype.decay=function(t,e){if("undefined"==typeof e)var e=!1;var r=this.count.proton,n=this.count.neutron,i=[];"string"==typeof t&&(t=[t]);for(var s in t){var o=t[s];switch(o){case"a":r-=2,n-=2,i.push(new Nucleus(matter.elements[2].nuclides[2]).attr("show_labels",!0));break;case"b-":r+=1,n-=1,i.push(new Electron),i.push(new ElectronNeutrino);break;case"b+":r-=1,n+=1,i.push(new Positron),i.push(new ElectronAntiNeutrino);break;case"p":r-=1,i.push(new Proton);break;case"n":n-=1,i.push(new Neutron);break;default:return console.log("Invalid decay mode: "+o),!1}}if(e)return matter.nuclideExists(r,n);if(matter.nuclideExists(r,n)){this.setNuclide(matter.elements[r].nuclides[n]),this.restart();for(var c in i)i[c].appendTo(this.ejecta_selector),this.eject(i[c])}else console.log("Unable to decay: "+t+"; target nuclide outside of dataset");return this},Nucleus.prototype.eject=function(t){var e=360*Math.random(),r=Math.sqrt(this.width_sum)/2,n=Math.cos(e)*Math.sqrt(this.width_sum)*6,i=Math.sin(e)*Math.sqrt(this.width_sum)*6;d3.select("#"+t.id).attr("transform","translate("+r+","+r+")"),d3.select("#"+t.id).transition().duration(3e3).ease("cubic-out").attr("transform","translate("+n+","+i+")").style("opacity",0).remove()};
"use strict";var Nuclide=function(){this.index=null,this.protons=null,this.neutrons=null,this.halflife=null,this.isStable=null,this.parentElement=null,this.caption=""};Nuclide.prototype.name=function(){return this.parentElement.name+"-"+(this.protons+this.neutrons)},Nuclide.prototype.setProtons=function(t){return this.protons=parseInt(t),this},Nuclide.prototype.setNeutrons=function(t){return this.neutrons=parseInt(t),this},Nuclide.prototype.setCaption=function(t){return this.caption=t.toString(),this},Nuclide.prototype.setHalflife=function(t){var e=0,i=0;if("infinity"!=t){this.isStable=!1;var n=t.toString().match("(\\d(.?)+)E((-?)\\d+)");null!=n?(e=parseFloat(n[1]),i=parseInt(n[3])):(e=parseFloat(t),i=0);var l=Math.floor(Math.log(e)/Math.log(10));0!=l&&(e/=Math.pow(10,l),i+=l),i>matter.max_halflife_exp&&(matter.max_halflife_exp=i),i<matter.min_halflife_exp&&(matter.min_halflife_exp=i)}else this.isStable=!0;return this.halflife=new Time(e,i),this};
"use strict";var Orbit=function(){this.node=null,this.properties={id:"",path:1,stroke:"rgb(128,128,128)",stroke_width:.1,stroke_dasharray:"1, 2",tension:.5,interpolate:"cardinal-closed",duration:1e3,ease:"out-in",scaleFunction:null,opacityFunction:null,animateFunction:null}};Orbit.prototype.id=function(t){return"undefined"==typeof t?this.properties.id:(this.properties.id=t.toString(),this)},Orbit.prototype.path=function(t){return"undefined"==typeof t?this.properties.path:(this.properties.path=t,this)},Orbit.prototype.stroke=function(t){return"undefined"==typeof t?this.properties.stroke:(this.properties.stroke=t.toString(),this)},Orbit.prototype.stroke_width=function(t){return"undefined"==typeof t?this.properties.stroke_width:(this.properties.stroke_width=parseFloat(t),this)},Orbit.prototype.stroke_dasharray=function(t){return"undefined"==typeof t?this.properties.stroke_dasharray:(this.properties.stroke_dasharray=t.toString(),this)},Orbit.prototype.tension=function(t){return"undefined"==typeof t?this.properties.tension:(this.properties.tension=parseFloat(t),this)},Orbit.prototype.interpolate=function(t){return"undefined"==typeof t?this.properties.interpolate:(this.properties.interpolate=t.toString(),this)},Orbit.prototype.duration=function(t){return"undefined"==typeof t?this.properties.duration:(this.properties.duration=parseInt(t),this)},Orbit.prototype.ease=function(t){return"undefined"==typeof t?this.properties.ease:(this.properties.ease=t.toString(),this)},Orbit.prototype.scaleFunction=function(t){return"undefined"==typeof t?this.properties.scaleFunction:"function"==typeof t?(this.properties.scaleFunction=t,this):void 0},Orbit.prototype.opacityFunction=function(t){return"undefined"==typeof t?this.properties.opacityFunction:"function"==typeof t?(this.properties.opacityFunction=t,this):void 0},Orbit.prototype.appendTo=function(t){return this.node=t.append("path").attr("id",this.properties.id).attr("class","orbit").attr("fill","none").attr("stroke-width",this.properties.stroke_width).attr("stroke",this.properties.stroke).attr("stroke-dasharray",this.properties.stroke_dasharray).data([this.properties.path]).attr("d",d3.svg.line().tension(this.properties.tension).interpolate(this.properties.interpolate)),this},Orbit.prototype.attachParticle=function(t){var e=this;!function(t,e){t.animateFunction=function(){e.node.transition().duration(t.duration()).ease(t.ease()).attrTween("transform",t.transformAlong(t.node.node())).styleTween("opacity",t.opacityAlong(t.node.node())).each("end",t.animateFunction)}}(e,t),this.animateFunction()},Orbit.prototype.transformAlong=function(t){var e=t.getTotalLength(),i=this;return function(r,o,n){return function(r){var o=t.getPointAtLength(r*e),n="translate("+o.x+","+o.y+")";if("function"==typeof i.properties.scaleFunction){var p=i.properties.scaleFunction(r);n+=" scale("+p+")"}return n}}},Orbit.prototype.opacityAlong=function(t){var e=t.getTotalLength(),i=this;return function(r,o,n){return function(r){var o=(t.getPointAtLength(r*e),1);return"function"==typeof i.properties.opacityFunction&&(o=i.properties.opacityFunction(r)),o}}};
"use strict";var Palette=function(){this.schemes={element:[{h:60,s:100,l:94.9},{h:64,s:91.8,l:85.7},{h:78,s:72,l:79},{h:96,s:53.7,l:71.2},{h:121,s:40.6,l:62.4},{h:136,s:44.9,l:46.3},{h:140,s:58.1,l:32.7},{h:152,s:100,l:20.4},{h:156,s:100,l:13.5}],nuclide:[{h:177,s:100,l:11.8},{h:176,s:97.9,l:18.8},{h:175,s:56.6,l:34.3},{h:173,s:37.1,l:54.5},{h:171,s:44.4,l:73.9},{h:100,s:33.3,l:91.2},{h:43,s:64.4,l:76.9},{h:38,s:56.7,l:59.2},{h:34,s:66.4,l:42},{h:33,s:87.2,l:27.6},{h:33,s:88.8,l:17.5}]}};Palette.prototype.map_range=function(e,l,t,a,s){return t==l?a:a+(s-a)*(e-l)/(t-l)},Palette.prototype.hsla=function(e){return"hsla("+e.h+","+e.s+"%,"+e.l+"%,"+e.a+")"},Palette.prototype.getColor=function(e,l,t){var a=this.schemes[t],s=Math.floor(e*(a.length-1)),h=Math.ceil(e*(a.length-1));return{h:this.map_range(e,0,1,a[s].h,a[h].h),s:this.map_range(e,0,1,a[s].s,a[h].s),l:this.map_range(e,0,1,a[s].l,a[h].l),a:l}},Palette.prototype.element=function(e){var l=this.map_range(e.nuclide_count,matter.min_nuclides_per_element,matter.max_nuclides_per_element,0,1);return this.hsla(this.getColor(l,1,"element"))},Palette.prototype.nuclide=function(e){if("undefined"==typeof e)return"hsla(0,0,0,0)";var l=Math.min(e.halflife.exponent+Math.log10(e.halflife.base),matter.max_halflife_exp);e.isStable&&(l=matter.max_halflife_exp);var t=this.map_range(l,matter.min_halflife_exp,matter.max_halflife_exp,0,1),a=1;return null==display.elapsed_time_exp||e.isStable||l<=display.elapsed_time_exp&&(a=.5,display.elapsed_time_exp-l>=Math.log10(2)&&(a=.25,display.elapsed_time_exp-l>=Math.log10(3)&&(a=0))),this.hsla(this.getColor(t,a,"nuclide"))},Palette.prototype.nuclideLabel=function(e){var l="rgb(0,0,0)",t=Math.min(e.halflife.exponent+Math.log10(e.halflife.base),matter.max_halflife_exp);return e.isStable&&(t=matter.max_halflife_exp),null==display.elapsed_time_exp||e.isStable||t<=display.elapsed_time_exp&&(l="rgb(196,196,196)",display.elapsed_time_exp-t>=Math.log10(3)&&(l="rgb(230,230,230)")),l};
"use strict";var Particle=function(){return this.id=null,this.type=null,this.x=null,this.y=null,this.circle=null,this.text=null,this.index=null,this.show_labels=!0,this};Particle.prototype.getRandomId=function(){for(var t="",e=0;e<5;e++)t+=String.fromCharCode(65+Math.floor(26*Math.random()));return t+=Date.now()},Particle.prototype._settableAttributes={id:"string",x:"float",y:"float",index:"int",show_labels:"boolean"},Particle.prototype.attr=function(t,e){if("undefined"==typeof this._settableAttributes[t])return void console.log("Particle error: "+t+" is not a valid attribute");if("undefined"==typeof e)return this[t];switch(this._settableAttributes[t]){case"int":this[t]=parseInt(e);break;case"float":this[t]=parseFloat(e);break;case"boolean":this[t]=Boolean(e);case"string":this[t]=e.toString();break;default:this[t]=e}return this};var Proton=function(){return this.id=this.getRandomId(),this.x=Math.random(),this.y=Math.random(),this};Proton.prototype=new Particle,Proton.prototype.type="proton",Proton.prototype.circle={r:1,stroke_width:.1,fill:"rgb(170,255,186)",stroke:"rgb(102,153,112)"},Proton.prototype.text={text:"p+",x:-.65,y:.4,fill:"rgb(15,15,15)",font_size:1.3};var Neutron=function(){return this.id=this.getRandomId(),this.x=Math.random(),this.y=Math.random(),this};Neutron.prototype=new Particle,Neutron.prototype.type="neutron",Neutron.prototype.circle={r:.9,stroke_width:.1,fill:"rgb(255,213,170)",stroke:"rgb(153,128,102)"},Neutron.prototype.text={text:"n",x:-.4,y:.35,fill:"rgb(15,15,15)",font_size:1.3};var Electron=function(){return this.id=this.getRandomId(),this.x=Math.random(),this.y=Math.random(),this};Electron.prototype=new Particle,Electron.prototype.type="electron",Electron.prototype.circle={r:.4,stroke_width:.05,fill:"rgb(170,227,255)",stroke:"rgb(102,136,153)"},Electron.prototype.text={text:"e-",x:-.24,y:.18,fill:"rgb(15,15,15)",font_size:.6};var Positron=function(){return this.id=this.getRandomId(),this.x=Math.random(),this.y=Math.random(),this};Positron.prototype=new Particle,Positron.prototype.type="positron",Positron.prototype.circle={r:.4,stroke_width:.05,fill:"rgb(102,136,153)",stroke:"rgb(170,227,255)"},Positron.prototype.text={text:"e+",x:-.23,y:.2,fill:"rgb(240,240,240)",font_size:.5,text_decoration:"overline"};var ElectronNeutrino=function(){return this.id=this.getRandomId(),this.x=Math.random(),this.y=Math.random(),this};ElectronNeutrino.prototype=new Particle,ElectronNeutrino.prototype.type="electronneutrino",ElectronNeutrino.prototype.circle={r:.2,stroke_width:.03,fill:"rgb(243,170,255)",stroke:"rgb(145,102,153)"},ElectronNeutrino.prototype.text={text:"νₑ",x:-.14,y:.1,fill:"rgb(15,15,15)",font_size:.3};var ElectronAntiNeutrino=function(){return this.id=this.getRandomId(),this.x=Math.random(),this.y=Math.random(),this};ElectronAntiNeutrino.prototype=new Particle,ElectronAntiNeutrino.prototype.type="electronantineutrino",ElectronAntiNeutrino.prototype.circle={r:.2,stroke_width:.03,fill:"rgb(145,102,153)",stroke:"rgb(243,170,255)"},ElectronAntiNeutrino.prototype.text={text:"νₑ",x:-.12,y:.1,fill:"rgb(240,240,240)",font_size:.25,text_decoration:"overline"},Particle.prototype.appendTo=function(t){if(null==this.type)return console.log("Error - particle type not set"),!1;if(this.node=t.append("g").attr("id",this.id).attr("transform","translate("+this.x+","+this.y+")"),this.show_labels)var e=["circle","text"];else var e=["circle"];for(var r in e){var o=this[e[r]],i=this.node.append(e[r]).attr("class","particle");for(var n in o){var s=o[n],a=n.replace("_","-");switch(a){case"text":i.text(s);break;case"text-decoration":i.style(a,s);break;case"font-size":i.style(a,s+"px");break;default:i.attr(a,s)}}}return this};
"use strict";var Questions=function(){this.attempt=null,this.current=null,this.next=null,this.cache={}};Questions.prototype.titleToID=function(e){return e.toLowerCase().replace("?","").replace(/\W/g,"_")},Questions.prototype.call=function(e,t){var n=this;"undefined"==typeof t&&(t=function(){n.finalize()}),e!=this.titleToID(e)&&(console.log("Attempted to call invalid question ID: "+e),t()),d3.select("#stage").selectAll("*").interrupt(),this.next=null,function(t){n.fetch(e,function(){n.unloadCurrent(),n.current.halt_animation=!0,d3.timer(function(){var e="object"==typeof n.next.periodic_table,i="object"==typeof n.next.chart_of_nuclides,s="object"==typeof n.next.isotopes_grid;return e||display.hideDataset("element"),i||display.hideDataset("nuclide"),e&&display.showDataset("element",n.next.periodic_table),i&&display.showDataset("nuclide",n.next.chart_of_nuclides),s&&display.showDataset("nuclide",n.next.isotopes_grid),display.setTitle(),display.setCaptions(),display.setComponents(),display.setQuestions(),display.setScale(),display.fadeIn(d3.select("#specifics"),500),n.next.load(function(){t(),"function"==typeof n.current.animate&&(n.current.halt_animation=!1,n.current.animate()),"function"==typeof n.current.onload&&n.current.onload()}),!0},1e3*display.transition_speed)})}(t)},Questions.prototype.fetch=function(e,t){e!=this.titleToID(e)&&(console.log("Attempted to fetch invalid question ID: "+e),t()),"undefined"!=typeof this.cache[e]?(this.next=this.cache[e],t()):("404"!=e&&(this.attempt=e),function(e,t,n){var i="assets/js/questions/"+t+".js?t="+(new Date).getTime(),s=document.getElementsByTagName("head")[0]||document.documentElement,l=document.createElement("script");l.type="text/javascript",l.src=i,l.onload=function(){e.next=e.cache[t],n()},l.onerror=function(){e.next=e.cache[404],n()},s.appendChild(l)}(this,e,t))},Questions.prototype.unloadCurrent=function(){display.highlightElement(null),display.transition_speed>0?(display.fadeOut(d3.select("#captions"),500),display.fadeOut(d3.select("#specifics"),500),display.fadeOut(d3.select("#components"),500),d3.timer(function(){return d3.select("#floating_element_highlightbox").style("display","none"),d3.select("#captions").selectAll("*").remove(),d3.select("#specifics").selectAll("*").remove(),d3.select("#components").selectAll("g.component").style("display","none"),!0},500*display.transition_speed)):(d3.select("#captions").selectAll("*").remove(),d3.select("#specifics").selectAll("*").remove(),d3.select("#components").selectAll("g.component").style("display","none"))},Questions.prototype.finalize=function(e){this.current=this.next,this.next=null,null!=display.next_element&&(display.current_element=display.next_element,display.next_element=null),"undefined"==typeof e&&this.pushUrl()},Questions.prototype.pushUrl=function(){if(Modernizr.history){var e=this.titleToID(this.current.title),t=this.current.title,n="";this.current.element_specific&&display.current_element>0&&(e="what_is_element",t="Nuclides.org - What is "+matter.elements[display.current_element].name+"?",n="#"+matter.elements[display.current_element].name),"undefined"!=typeof this.current.is404&&(e=this.attempt,t="Nuclides.org - 404 - Page Not Found");var i={question:e,elements:display.current_element},s="?"+e+n;history.pushState(i,t,s),_paq.push(["trackPageView",t])}},Questions.prototype.parseUrl=function(){var e={id:null,element:null};if(window.location.search.length>1&&(e.id=window.location.search.slice(1),window.location.hash.length>1)){var t=window.location.hash.slice(1);"what_is_element"==e.id&&"object"==typeof matter.element_name_map[t]&&(e.element=matter.element_name_map[t].protons)}return e};
"use strict";function Time(e,o){if(this.min_exponent=-24,this.max_exponent=39,this.base=e,this.exponent=o,Math.floor(this.exponent)!=this.exponent){var t=this.exponent-Math.floor(this.exponent);this.exponent=Math.floor(this.exponent),this.base+=Math.pow(10,t),this.base>10&&(this.base-=10,this.exponent++)}}Time.prototype.exponent_group=function(){return this.exponent<0?3*Math.ceil((this.exponent-2)/3):this.exponent>0?3*Math.floor(this.exponent/3):0},Time.prototype.exponent_subgroup=function(){return this.exponent-this.exponent_group()},Time.prototype._prefixes={"-24":"yocto","-21":"zepto","-18":"atto","-15":"femto","-12":"pico","-9":"nano","-6":"micro","-3":"milli",0:"",3:"Kilo",6:"Mega",9:"Giga",12:"Tera",15:"Peta",18:"Exa",21:"Zetta",24:"Yotta",27:"Xona",30:"Weka",33:"Vunda",36:"Uda"},Time.prototype._analogies={"-24":["{1} quadrillionths of a billionth of[br]a second","{10} quadrillionths of a billionth of[br]a second","{100} quadrillionths of a billionth[br]of a second"],"-21":["{1} trillionths of a billionth of a second","{10} trillionths of a billionth of a second","{100} trillionths of a billionth of a second"],"-18":["{1} billionth of a billionth of a second","{10} billionths of a billionth of a second,[br]or {1} times the shortest time interval ever[br]directly measured by humans.","{100} billionths of a billionth of a second,[br]or {1} times the speed of the shortest[br]pulses of laser light ever created."],"-15":["{1} quadrillionths of a second","{10} quadrillionths of a second, or {1} times[br]the cycle time for UV light, a form of light[br]that's just energic enough to be invisible[br]to human eyes.","{100} quadrillionths of a second, or [br]about as fast as the fastest chemical[br]reactions in nature"],"-12":["{1} trillionths of a second","{10} trillionths of a second","{100} trillionths of a second"],"-9":["{1} billionths of a second, or {1} cycles on a[br]1GHz CPU","{10} billionths of a second, or about how[br]long it takes light to travel {10} feet","{100} billionths of a second, or about[br]as fast as the fusion reaction in[br]a hydrogen bomb"],"-6":["{1} millionths of a second, or about how[br]long it takes light to travel {1000} feet","{10} millionths of a second, or about how[br]long it takes a bolt of lightning to[br]travel {200} feet","{100} millionths of a second, or about[br]as fast as the fastest fungal spore[br]launch"],"-3":["{1} thousandths of a second, or about as[br]fast as {1} wing flaps of a housefly","{1} hundredths of a second, or about as[br]fast as {1} wing flaps of a humminbird","{1} tenths of a second, or about as fast[br]as {1} blinks of a human eye"],0:["","",""],3:["","",""],6:["","",""],9:["","","About {3,200} years, or {1} times how long[br]ago the Trojan War happened in ancient[br]Greece"],12:["About {32,000} years, or {1} times how long[br]ago the bow and arrow was invented","About {320,000} years, or {1} times how long[br]ago early pre-humans first began to[br]control fire","About {3.2} million years or {2} times as far[br]back in time as when the first stone tools[br]were made by early pre-humans"],15:["About {32} million years or {1} times how[br]long ago Antarctica, after breaking away[br]from the other continents, first developed[br]its ice cap","About {320} million years or {1} times how[br]long ago the first reptiles evolved from[br]amphibians","About {3.2} billion years or {1} times how[br]long ago life is thought to have first begun[br]on Earth, which is 4.3 billion years old"],18:["About {32} billion years or more than {2}[br]times the current age of the universe, which[br]is 13.8 billion years old","About {320} billion years or more than {20}[br]times the current age of the universe","About {3.2} trillion years or more than {200}[br]times the current age of the universe"],21:["About {32} trillion years or {1} years for[br]every cell in your body","About {320} trillion years or {1} years for[br]every dollar in the U.S. if the every single[br]person in the country had a million dollars","About {3.2} quadrillion years or {1} years[br]for every cell in an elphant's body"],24:["About {32} quadrillion years or {1} years[br]for every meter between here and the[br]closest star, Proxima Centauri[br](4.2 light years away)","About {320} quadrillion years or (roughly)[br]{1} years for every word in every email[br]ever sent since the invention of email,[br]including spam","About {3.2} quintillion years"],27:["About {32} quintillion years or {32}[br]billion billion years","About {320} quintillion years or {1} years[br]for every meter between here and the[br]center of the Milky Way Galaxy","About {3.2} sextillion years or {1} years[br]for every molecule of H[sub]2[sub]O in a drop of[br]ordinary water"],30:["About {32} sextillion years or {1} years[br]for every star in every galaxy the entire[br]observable universe","About {320} sextillion years","About {3.2} septillion years"],33:["About {32} septillion years","About {320} septillion years","About {3.2} octillion years"],36:["About {32} octillion years","About {320} octillion years","About {3.2} nonillion years"]},Time.prototype.repNumerical=function(){var e="Infinity (Stable)";if(0!=this.exponent||0!=this.base)if(this.exponent>-4&&this.exponent<4){var o=(this.base*Math.pow(10,this.exponent)).toString();o.length>6&&(o=o.slice(0,6)),e=o+" seconds"}else{var o=(Math.round(1e3*this.base)/1e3).toString();e=o+" x 10[sup]"+this.exponent+"[sup] seconds"}return e},Time.prototype.repPrefixed=function(){var e="";if((0!=this.exponent||0!=this.base)&&(this.exponent<-3||this.exponent>3)&&"undefined"!=typeof this._prefixes[this.exponent_group()]){var o=Math.round(this.base*Math.pow(10,this.exponent_subgroup())),t=1==o?"":"s";e=o.toString()+" "+this._prefixes[this.exponent_group()]+"second"+t}return e},Time.prototype.repApproximate=function(){if(this.exponent<0||0==this.exponent&&0==this.base)return this.repNumerical();var e=[[1,"seconds"],[60,"minutes"],[3600,"hours"],[86400,"days"],[604800,"weeks"],[2592e3,"months"],[31536e3,"years"]],o="seconds",t=1;for(var r in e)this.base*Math.pow(10,this.exponent)>=e[r][0]&&(o=e[r][1],t=1/e[r][0]);var i=this.base*Math.pow(10,this.exponent)*t;return this.format(i)+" "+o},Time.prototype.repAnalogy=function(){var e="";if("undefined"!=typeof this._analogies[this.exponent_group()]&&"undefined"!=typeof this._analogies[this.exponent_group()][this.exponent_subgroup()]&&(e=this._analogies[this.exponent_group()][this.exponent_subgroup()]),0==e.length)e="About "+this.repApproximate();else if(e.indexOf("{")!=-1){var o=e.match(/\{[0-9.,]+\}/g);for(var t in o){var r=parseFloat(o[t].slice(1,-1).replace(",",""));isNaN(r)||(e=e.replace(o[t],this.format(r*this.base)))}}return e},Time.prototype.format=function(e){return e<10?(Math.round(10*e)/10).toString():e>1e3?Math.floor(e/1e3).toString()+","+Math.round(e-1e3*Math.floor(e/1e3)+1e3).toString().slice(1):Math.round(e).toString()};
"use strict";function setup(){initializeApplication(function(){d3.select("#curtain_text").text("loading..."),loadElements(function(){d3.select("#curtain_text").text("loading...."),loadNuclides(function(){d3.select("#curtain_text").text("loading....."),renderApplication(function(){questions.finalize(),display.transition_speed=.8,d3.select("#curtain_text").text("welcome!"),d3.select("#curtain").transition().duration(1e3).style("opacity",0),d3.timer(function(){return d3.select("#curtain").style("display","none"),!0},1100)})})})})}function loadElements(e){d3.csv("assets/data/elements.csv?r="+cacheKey,function(e){return new Element(e.protons,e.period,e.group,e.symbol,e.name,e.has_image,e.info)},function(t,n){if(t)console.log("Error loading elements: "+t);else{matter.elements=n;for(var i in matter.element_name_map)matter.element_name_map[i]=matter.elements[matter.element_name_map[i]];e()}})}function loadNuclides(e){d3.csv("assets/data/nuclides.csv?r="+cacheKey,function(e){var t=(new Nuclide).setProtons(e.protons).setNeutrons(e.neutrons).setHalflife(e.halflife);return"undefined"!=typeof e.caption&&t.setCaption(e.caption),t},function(t,n){if(t)console.log("Error loading nuclides: "+t);else{for(var i in n)matter.elements[n[i].protons].addNuclide(n[i]);e()}})}function pathString(e){var t="";for(var n in e){var i=e[n]*display.scale;n%2||(t+=0==n?"M":"L"),t+=i+" "}return t}function initializeApplication(e){questions.current=questions.cache.setup,display.available_width=window.innerWidth||document.documentElement.clientWidth||document.getElementsByTagName("body")[0].clientWidth,display.available_height=window.innerHeight||document.documentElement.clientHeight||document.getElementsByTagName("body")[0].clientHeight,display.scale=Math.max(Math.min(display.available_width/display.area.w,display.available_height/display.area.h),1),d3.select("#galaxy_of_nuclides").style("width",display.area.w*display.scale+"px").style("height",display.area.h*display.scale+"px"),d3.selectAll("g").remove();var t=function(e,n){for(var i in e)!function(i){var a=e[i],s="translate("+a.x*display.scale+","+a.y*display.scale+")";d3.select(n).append("g").attr("id",i).attr("transform",s),void 0!==a.regions&&t(a.regions,"#"+i)}(i)};t(display.regions,"svg"),display.regions.curtain.draw(),d3.xml("assets/images/svg/logo.svg","image/svg+xml",function(t){var n=document.importNode(t.documentElement,!0);display.regions.title.draw(n),e()})}function renderApplication(e){var t=function(e,n){for(var i in e)!function(n){var i=e[n];"title"!=n&&"curtain"!=n&&("function"==typeof i.init&&i.init(),"function"==typeof i.draw&&i.draw()),void 0!==i.regions&&t(i.regions,"#"+n)}(i)};t(display.regions,"svg"),display.setElapsedTimeExp(null);var n=questions.parseUrl();null!=n.id?(null!=n.element&&(display.next_element=n.element),questions.call(n.id,e)):questions.call("what_is_nuclides_org",e)}var cacheKey="2021-11-28",matter={min_halflife_exp:0,max_halflife_exp:0,max_neutrons:0,max_neutron_spread:0,absolute_max_neutrons:0,max_nuclides_per_element:0,min_nuclides_per_element:0,total_nuclides:0,sprite_map_max:0,element_name_map:{},nuclide_name_map:{},nuclideExists:function(e,t){return"undefined"!=typeof this.elements[e]&&"undefined"!=typeof this.elements[e].nuclides[t]}},palette=new Palette,questions=new Questions;questions.cache.setup={title:"Loading...",scale:null},window.onpopstate=function(e){"object"==typeof e.state&&"string"==typeof e.state.question&&questions.call(e.state.question,function(){questions.finalize(!0)})};
"use strict";questions.cache.what_is_nuclides_org={title:"What is Nuclides.org?",scale:"nuclide",components:{thumbnail:{x:90,y:100.5},nuclide_hover:{x:0,y:-100}},periodic_table:{origin:{x:2,y:84},element:{w:4.3,m:.4},coordsFunction:display.periodic_table.getElementCoords,show_labels:!0},isotopes_grid:{origin:{x:141,y:15},nuclide:{w:function(){return 50/display.nuclides_per_row*.9},m:function(){return 50/display.nuclides_per_row*.1}},coordsFunction:display.isotopes_grid.getNuclideCoords,show_labels:!0,next_element:79},captions:[{x:2,y:8,line_height:4,copy:"[em4]Welcome to Nuclides.org[em4]—an interactive platform for questions about atoms using [emi]real atomic data[emi]."},{x:33.5,y:15.5,line_height:3,copy:"[em1]Every page on Nuclides.org answers a question about atoms.[em3][br]Questions can appear as links in text [q]like this|What is a Nuclide?[q]. The far left column will show additional[br]relevant questions on every page. Questions work just like pages on any other website so[br][em1]you can use your browser's back button to revisit questions you've already seen[em1][br]and you can bookmark/copy the URL on any page to return to that question any time."},{x:33.5,y:34,line_height:3,copy:"There are 120 different kinds of atoms and each different kind is called an element. You[br]can probably already name several of the elements, such as [link]Carbon[link] or [link]Oxygen[link]."},{x:33.5,y:43.5,line_height:3,copy:"[em2]All the elements are usually shown on a chart called The Periodic Table of Elements.[em2][br]This chart can be seen here in the lower left and it's interactive too. Any time you see the[br][q]Periodic Table|What is an Element?[q] you can click any square to see a picture of that element and learn more[br]about it. [em2]The interactive Periodic Table appears on most pages on Nuclides.org[em2]"},{x:33.5,y:60,line_height:3,copy:"Atoms are made of [q]protons|What is a Proton?[q], [q]neutrons|What is a Neutron?[q], and [q]electrons|What is an Electron?[q]. Protons and neutrons live in an atom's[br]nucleus. [em3]The number of protons determines what element an atom is[em3] (and therefore its[br]chemical properties). [em3]When two atoms of the same element have a different number of[em3][br][em3]neutrons they are called different isotopes of that element.[em3] Some elements only have a few different isotopes and some have a lot,[br]like [link]Gold[link] with 41 (shown at top right). [link]Mercury[link] has the most of any element with 46 but new nuclides are discovered over time."},{x:90,y:78.5,line_height:3,copy:"[em4]All the isotopes of all the elements are known as the nuclides.[em4] There are close to[br]3,200 known nuclides and you can see them all in one place on the [q]Chart of Nuclides|What is a Nuclide?[q]."},{x:90,y:88,line_height:3,copy:"Some atoms are [q]stable|What makes an Atom Stable?[q] and others [q]decay|How do Atoms Decay?[q] into more stable nuclides, releasing [q]radiation|What is Radiation?[q][br]in the process. Atoms decay randomly so the best we can do is measure how long it will[br]take for half of a group of the same nuclide to decay on average, or the nuclide's [q]half-life|What is Half-Life?[q]."},{x:144,y:100.5,line_height:3,copy:"[em4]Use the slider to the right to simulate[em4][br][em4]time elapsing and see how decay and[em4][br][em4]half-life work at different time scales.[em4][br]The scale is [emi]enormous[emi]—from extremely[br]tiny fractions of a second to many times[br]the age of the universe. Try loading the[br][q]Chart of Nuclides|What is a Nuclide?[q] and playing with the[br]slider to see how half-lives compare[br]across all nuclides known to science!"},{x:5,y:41,line_height:2.3,copy:"[link]Carbon-12[link] is stable nuclide."},{x:2,y:70,line_height:2.3,copy:"[link]Carbon-9[link] can decay into [link]Lithium-5[link]."},{x:16.5,y:87,line_height:2.3,copy:"[q]The Periodic Table[q] shows all 120 known[br]elements. The darker the color the more[br][q]isotopes|What are isotopes?[q] the element has."},{x:141,y:58,line_height:2.3,copy:"All 41 isotopes (nuclides) of [link]Gold[link]. The number is the[br]sum of protons and neutrons in each nuclide. Gold only[br]has one stable nuclide (shown in dark brown). Move the[br]time slider to the right to see these nuclides decay."}],questions:["What is an Element?","What is a Nuclide?","How do Atoms Decay?"],load:function(e){this.carbon12=new Nucleus(matter.elements[6].nuclides[6]).attr("id","carbon-12").attr("show_labels",!0).appendTo(d3.select("#specifics")),d3.select("#carbon-12").attr("transform","translate("+13*display.scale+","+22*display.scale+") scale("+2*display.scale+")"),this.carbon9=new Nucleus(matter.elements[6].nuclides[3]).attr("id","carbon-9").attr("show_labels",!0).appendTo(d3.select("#specifics")),d3.select("#carbon-9").attr("transform","translate("+13*display.scale+","+54*display.scale+") scale("+2*display.scale+")"),e()},animate:function(){return this.halt_animation||!function(e){d3.timer(function(){return e.carbon9.decay(["b+","a"]),d3.timer(function(){return e.carbon9.reset(),e.animate(),!0},3e3),!0},2e3)}(this),!0}};
"use strict";questions.cache[404]={is404:!0,title:"That page doesn't exist yet!",scale:"nuclide",components:{},captions:[{x:2,y:8,line_height:3.1,copy:"Sorry, that page hasn't been written yet. [em4]Nuclides.org[em4] is still a work in progress.[br]If you got here by clicking a link on Nuclides.org then it's on the list to be written soon![br] [br][em3]You can help write pages like this![em3] Nuclides.org is open source, so [repo]visit the repository[repo] to get started.[br]Contributions are [emi]always[emi] welcome!"}],questions:["What is an Element?","What is a Nuclide?","How do Atoms Decay?"],load:function(e){var t=Math.floor(114*Math.random()+5),i=0,n=0;for(var s in matter.elements[t].nuclides)Math.random()<1/++i&&(n=s);this.bignuc=new Nucleus(matter.elements[t].nuclides[n]).attr("id","bignuc").attr("show_labels",!0).appendTo(d3.select("#specifics")),d3.select("#bignuc").attr("transform","translate("+100*display.scale+","+60*display.scale+") scale("+2*display.scale+")"),e()},animate:function(){return this.halt_animation||!function(e){d3.timer(function(){if(e.bignuc.count.proton<2||e.bignuc.count.neutron<2)e.bignuc.reset();else{var t=Nucleus.prototype._decayModes[Math.floor(Math.random()*Nucleus.prototype._decayModes.length)];e.bignuc.decay(t)}return d3.timer(function(){return e.animate(),!0},3e3),!0},2e3)}(this),!0}};