› Apps for Statistics
  PX.JS - PC-Axis Javascript file format, Bo Justusson

PC-Axis Dataformat:
It was created by Erik Malmborg, Statistics Sweden, in the 1970s. He used an early form of object oriented programming (OOP) from SmallTalk and put all in text-files nnn.PX

The format has been very successful. Only disadvantage is that it does not use dot-format, which to-day dominates in OOP.

Using my suggested dot-format, one can fairly easy write HTML-applications for tables, graphs, maps. The interest in javascript is strong to-day - JSON!

I have two old apps in DHTML, and a new one in HTML5 Canvas, see • BJ-Maps - for all three.
Contact: Bo Justusson, Stockholm
Has worked at Statistics Sweden, now retired.
e-mail: justusXownit.nu (change X to @).
 
PX.JS-format:
My suggestion for Javascript formulation:
Single variables the same: e.g. CONTENTS="Population";
PX Array variables: e.g. STUB="region","age";
    CODES("region")="0114","0115",....,"2584";
Javascript: VAR[0].NAME="region";
    VAR[0].CODES=["0114","0115",...,"2584"];

PX Multidim. DATA= 7444 7459 ....4683;
Javascript: DATA=[ 7444,7459,...., 479 ];

I have written a small program px2js.exe that converts
nnn.px-files to nnn.px.js-files.
- The changes are so small that I could write it generically, i.e. it handles any PX-keywords.
 
Usage:
PX.JS-files can be put into HTML-pages using:
  <script src="nnn.px.js"> </script>
- Then all values can be used with its variable names in javascript in the HTML-page.
- For DATA one needs to calculate ipos for values, e.g. myval=DATA[ipos];
- Note: In the px.js-file the VAR object array is created with some standard code.

Examples with PX.JS-data in webpages:
• BJ-Maps, justus2.se/stat/maps - with
- Maps for Sweden, Norway, Denmark, Finland,
- Animated population pyramids, by municipality
- Chart for men/women by occupation,municipality
 
 
  PX-file Population by region, age, time   PX.JS-file - obtained from px2js.exe - (Server-output can be programmed!)

Webbplats: www.justus2.se     Program: © Bo Justusson, Stockholm.