Forgot: the code is formally under review here https://gerrit.wikimedia.org/r/202610/. GPL-3.0+ as the old WikiPeriod.
Il 08/04/2015 01:18, Ricordisamoa ha scritto:
I'd like to announce a new Labs tool to show a periodic table https://tools.wmflabs.org/ptable/. It is based on WikiPeriod's PHP code (in turn ported from JavaScript) and features several improvements:
- 'tiles' are wider and taller;
- most of them are now provided with a background color (the same as Wikipedia's https://en.wikipedia.org/wiki/Periodic_table#Periodic_table_legend_for_category) based on the elements' "subclass of" property https://www.wikidata.org/wiki/Property:P279 (the same that powers period/group detection);
- for labels, Wikidata's built-in language fallback is used instead of just falling back to English;
- a public JSON API https://tools.wmflabs.org/ptable/api is available for everyone!
And some more under the hood:
- rewritten in Python with Jinja2: o more object-oriented o presentation is split from actual logic o less vulnerable to XSS attacks
- a LRU (least recently used) cache with a maximum TTL (per-item time-to-live) value of 6 hours is used to avoid hitting data sources on every request;
- both the Wikidata API and Wikidata Query can be used interchangeably as sources.
I had to create some items such as Q19753344 https://www.wikidata.org/wiki/Q19753344 and Q19753345 https://www.wikidata.org/wiki/Q19753345 to properly categorize elements. My knowledge of chemistry is limited, so please report/fix every mistake you can find ;-)
Future plans include:
- oxidation state
- images
- responsive design
- alternative table structures