Skip to content

Commit

Permalink
Added values and display functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Fechner authored and Florian Fechner committed Jun 17, 2017
1 parent 68aedfa commit 09b52be
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@
<td>[[element.atomic-number]]</td>
</tr>
<tr>
<td>atomic weight:</td>
<td>[[displayAtomicWeightIndex(element.atomic-weight)]]:</td>
<td>[[element.atomic-weight]]</td>
<td>melting point:</td>
<td>[[element.melting-point]] K</td>
<td>[[displayKelvin(element.melting-point)]]</td>
</tr>
<tr>
<td>electronegativity:</td>
<td>[[element.electronegativity]]</td>
<td>boiling point:</td>
<td>[[element.boiling-point]] K</td>
<td>[[displayKelvin(element.boiling-point)]]</td>
</tr>
</table>
</div>
Expand Down
20 changes: 20 additions & 0 deletions periodic-table/chemical-element-page/chemical-element-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@ class ChemicalElementPage extends Polymer.Element
{
super.connectedCallback();
}

displayKelvin(kelvin)
{
if(typeof kelvin == "number")
{
return kelvin + " K";
}

return "-";
}

displayAtomicWeightIndex(atomicWeigth)
{
if(atomicWeigth % 1 === 0)
{
return "mass number";
}

return "atomic weigth";
}
}

customElements.define(ChemicalElementPage.is, ChemicalElementPage);
36 changes: 18 additions & 18 deletions periodic-table/shared/chemical-elements.json
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@
{ "s": 2, "p": 4, "d": 0, "f": 0 }
],
"electronegativity": 2.0,
"atomic-weight": "-",
"atomic-weight": 209,
"melting-point": 527,
"boiling-point": 1235
},
Expand All @@ -1215,7 +1215,7 @@
{ "s": 2, "p": 5, "d": 0, "f": 0 }
],
"electronegativity": 2.2,
"atomic-weight": "-",
"atomic-weight": 210,
"melting-point": 575,
"boiling-point": 610
},
Expand All @@ -1234,7 +1234,7 @@
{ "s": 2, "p": 6, "d": 0, "f": 0 }
],
"electronegativity": 2.2,
"atomic-weight": "-",
"atomic-weight": 222,
"melting-point": 202,
"boiling-point": 211.5
},
Expand All @@ -1255,7 +1255,7 @@
{ "s": 1, "p": 0, "d": 0, "f": 0 }
],
"electronegativity": "> 0.79",
"atomic-weight": "-",
"atomic-weight": 223,
"melting-point": "300 (?)",
"boiling-point": "950 (?)"
},
Expand All @@ -1275,7 +1275,7 @@
{ "s": 2, "p": 0, "d": 0, "f": 0 }
],
"electronegativity": 0.9,
"atomic-weight": "-",
"atomic-weight": 226,
"melting-point": 973,
"boiling-point": 2010
},
Expand Down Expand Up @@ -1552,7 +1552,7 @@
{ "s": 2, "p": 0, "d": 0, "f": 0 }
],
"electronegativity": "1.13 (?)",
"atomic-weight": "-",
"atomic-weight": 145,
"melting-point": 1315,
"boiling-point": 3273
},
Expand Down Expand Up @@ -1764,7 +1764,7 @@
{ "s": 2, "p": 0, "d": 0, "f": 0 }
],
"electronegativity": 1.1,
"atomic-weight": "-",
"atomic-weight": 227,
"melting-point": 1500,
"boiling-point": 3500
},
Expand Down Expand Up @@ -1844,7 +1844,7 @@
{ "s": 2, "p": 0, "d": 0, "f": 0 }
],
"electronegativity": 1.36,
"atomic-weight": "-",
"atomic-weight": 237,
"melting-point": 912,
"boiling-point": 4447
},
Expand All @@ -1864,7 +1864,7 @@
{ "s": 2, "p": 0, "d": 0, "f": 0 }
],
"electronegativity": 1.28,
"atomic-weight": "-",
"atomic-weight": 244,
"melting-point": 912.5,
"boiling-point": 3505
},
Expand All @@ -1884,7 +1884,7 @@
{ "s": 2, "p": 0, "d": 0, "f": 0 }
],
"electronegativity": 1.3,
"atomic-weight": "-",
"atomic-weight": 243,
"melting-point": 1449,
"boiling-point": 2880
},
Expand All @@ -1904,7 +1904,7 @@
{ "s": 2, "p": 0, "d": 0, "f": 0 }
],
"electronegativity": "1.3",
"atomic-weight": "-",
"atomic-weight": 247,
"melting-point": "1613",
"boiling-point": "3383"
},
Expand All @@ -1924,7 +1924,7 @@
{ "s": 2, "p": 0, "d": 0, "f": 0 }
],
"electronegativity": 1.3,
"atomic-weight": "-",
"atomic-weight": 247,
"melting-point": 1259,
"boiling-point": 2900
},
Expand All @@ -1944,7 +1944,7 @@
{ "s": 2, "p": 0, "d": 0, "f": 0 }
],
"electronegativity": 1.3,
"atomic-weight": "-",
"atomic-weight": 251,
"melting-point": 1173,
"boiling-point": 1743
},
Expand All @@ -1964,7 +1964,7 @@
{ "s": 2, "p": 0, "d": 0, "f": 0 }
],
"electronegativity": 1.3,
"atomic-weight": "-",
"atomic-weight": 252,
"melting-point": 1133,
"boiling-point": 1269
},
Expand All @@ -1984,7 +1984,7 @@
{ "s": 2, "p": 0, "d": 0, "f": 0 }
],
"electronegativity": 1.3,
"atomic-weight": "-",
"atomic-weight": 257,
"melting-point": 1800,
"boiling-point": "-"
},
Expand All @@ -2004,7 +2004,7 @@
{ "s": 2, "p": 0, "d": 0, "f": 0 }
],
"electronegativity": 1.3,
"atomic-weight": "-",
"atomic-weight": 258,
"melting-point": 1100,
"boiling-point": "-"
},
Expand All @@ -2024,7 +2024,7 @@
{ "s": 2, "p": 0, "d": 0, "f": 0 }
],
"electronegativity": 1.3,
"atomic-weight": "-",
"atomic-weight": 259,
"melting-point": 1100,
"boiling-point": "-"
},
Expand All @@ -2044,7 +2044,7 @@
{ "s": 2, "p": 1, "d": 0, "f": 0 }
],
"electronegativity": 1.3,
"atomic-weight": "-",
"atomic-weight": 266,
"melting-point": 1900,
"boiling-point": "-"
}
Expand Down

0 comments on commit 09b52be

Please sign in to comment.