Built-in Data Collections in Mathematica

ElementData examples

Jamie Williams (jamiew@wolfram.com)

Wolfram Research, Inc.

ElementData has over 40 properties of the elements, and is growing

Here is a list of the elements

ElementData[]

Available properties

ElementData[All,"Properties"]

ElementData["Carbon","AtomicMass"]//FullForm

ElementData["Carbon","AtomicMass","Units"]

ElementData["Carbon","AtomicMass","Description"]

ElementData["Carbon","AtomicMass","Interval"]

Datapaclets + Dynamic Visualization

Here's an obvious thing you can do: build an interactive periodic table

Table formatting

(periodicTableGrid={{1," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ",2},
{3,4," "," "," "," "," "," "," "," "," "," ",5,6,7,8,9,10},{11,12," "," "," "," "," "," "," "," "," "," ",13,14,15,16,17,18},{19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36},{37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54},{55,56,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86},{87,88,103,104,105,106,107,108,109,110,111,112,113,114,115,116," "," "},{" "," ",57,58,59,60,61,62,63,64,65,66,67,68,69,70," "," "},{" "," ",89,90,91,92,93,94,95,96,97,98,99,100,101,102," "," "}})//TableForm

Periodic Table Functions

elementColors[n_,prop_]:=
Module[{valuelist,maxval,minval,propval,setlist,valpos,setlength},
	propval=ElementData[n,prop];
	valuelist=ElementData[#,prop]&/@ElementData[];
	Which[
		MatchQ[propval,Missing[a___]],
			Return[Hue[.5,0]],
		StringQ[propval],
			setlist=Intersection[valuelist];
			setlength=Length[setlist];
			valpos=Position[setlist,propval][[1,1]];
			Return[Hue[(valpos-1)/(setlength-1)*.7]];
			,
		!StringQ[propval],
			valuelist=Cases[valuelist,x_?(NumberQ[#]&)];
			maxval=Max[valuelist];
			minval=Min[valuelist];
			Return[Hue[(propval-minval)/maxval*.7]]
	]
];

chosenElement=1;
chosenProperty="AtomicNumber";

ElementButton[n_,prop_]:=If[n≠" ",Button[(ElementData[n,"Abbreviation"]//ToString)//Style[#,20,Bold,FontFamily->"Arial"]&,chosenElement=n,ImageSize->{50,35},Alignment->{0,0},Background->elementColors[n,prop]]," "]//Tooltip[#,{ElementData[n,"AtomicNumber"],ElementData[n,"Name"]~~": ",ElementData[n,prop]}//TableForm//Style[#,20,Bold,FontFamily->"Arial"]&]&;

menu=PopupMenu[chosenProperty//Dynamic,ElementData[All,"Properties"],ImageSize->{260,35}]//Style[#,20,Bold,FontFamily->"Arial"]&;

periodicTable={menu,"",Map[ElementButton[#,chosenProperty]&,periodicTableGrid,{2},Heads->False]//TableForm//Dynamic//Panel[#,FrameMargins->10]&}//TableForm;

Playing with the table

periodicTable

chosenElement//Dynamic

ElementData[chosenElement,chosenProperty,"Units"]//Dynamic

propMin=Min[ElementData[#,chosenProperty]&/@ElementData[]//Cases[#,Except[Missing["NotAvailable"]]]&]//Dynamic;
propMax=Max[ElementData[#,chosenProperty]&/@ElementData[]//Cases[#,Except[Missing["NotAvailable"]]]&]//Dynamic;
Manipulate[f[Tooltip[ElementData[#,chosenProperty]&/@ElementData[]],PlotMarkers->{Automatic,.015},PlotRange->{{0,100},{propMin,propMax}},AxesLabel->{"Atomic Number"//Style[#,14,FontFamily->"Arial"]&,chosenProperty//Style[#,14,FontFamily->"Arial"]&}]//Dynamic,{{f,ListPlot,"plot style"},{ListPlot,ListLogPlot}}]

If this sort of thing interests you, we'd love to get your input

What kind of data would you find useful in your field?

How would you use the data?

Contact us: kathrync@wolfram.com,  fredm@wolfram.com,  jamiew@wolfram.com