From 7f908717579826556a0af66371131a753656fd16 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Thu, 14 Jul 2022 19:29:57 -0700 Subject: [PATCH 1/5] time channel --- src/plot.js | 45 ++++++++++++++-- test/jsdom.js | 4 ++ test/output/drivingAnimation.svg | 89 ++++++++++++++++++++++++++++++++ test/plots/driving-animation.js | 13 +++++ test/plots/index.js | 1 + 5 files changed, 149 insertions(+), 3 deletions(-) create mode 100644 test/output/drivingAnimation.svg create mode 100644 test/plots/driving-animation.js diff --git a/src/plot.js b/src/plot.js index 99b4777fed..c469ac68a9 100644 --- a/src/plot.js +++ b/src/plot.js @@ -1,4 +1,4 @@ -import {cross, difference, groups, InternMap, select} from "d3"; +import {bisectLeft, cross, difference, groups, InternMap, select} from "d3"; import {Axes, autoAxisTicks, autoScaleLabels} from "./axes.js"; import {Channel, Channels, channelDomain, valueObject} from "./channel.js"; import {Context, create} from "./context.js"; @@ -124,6 +124,9 @@ export function plot(options = {}) { autoScaleLabels(channelsByScale, scaleDescriptors, axes, dimensions, options); + // Aggregate and sort time channels. + const times = aggregateTimes(stateByMark); + // Compute value objects, applying scales as needed. for (const state of stateByMark.values()) { state.values = valueObject(state.channels, scales); @@ -213,11 +216,31 @@ export function plot(options = {}) { } }); } else { + const timeMarks = []; for (const [mark, {channels, values, facets}] of stateByMark) { const facet = facets ? mark.filter(facets[0], channels, values) : null; - const node = mark.render(facet, scales, values, dimensions, context); + const index = channels.time ? [] : facet; + const node = mark.render(index, scales, values, dimensions, context); + if (channels.time) timeMarks.push({mark, node}); if (node != null) svg.appendChild(node); } + if (timeMarks.length) { + let timeIndex = -1; + requestAnimationFrame(function tick() { + if (++timeIndex >= times.length) return; + const time = times[timeIndex]; + for (const timeMark of timeMarks) { + const {mark, node} = timeMark; + const {channels, values, facets} = stateByMark.get(mark); + const facet = facets ? mark.filter(facets[0], channels, values) : null; + const index = facet.filter(i => channels.time.value[i] <= time); + const timeNode = mark.render(index, scales, values, dimensions, context); + node.replaceWith(timeNode); + timeMark.node = timeNode; + } + requestAnimationFrame(tick); + }); + } } // Wrap the plot in a figure with a caption, if desired. @@ -257,7 +280,7 @@ export function plot(options = {}) { export class Mark { constructor(data, channels = {}, options = {}, defaults) { - const {facet = "auto", sort, dx, dy, clip, channels: extraChannels} = options; + const {facet = "auto", sort, time, dx, dy, clip, channels: extraChannels} = options; this.data = data; this.sort = isDomainSort(sort) ? sort : null; this.initializer = initializer(options).initializer; @@ -266,6 +289,7 @@ export class Mark { channels = maybeNamed(channels); if (extraChannels !== undefined) channels = {...maybeNamed(extraChannels), ...channels}; if (defaults !== undefined) channels = {...styles(this, options, defaults), ...channels}; + if (time != null) channels = {time: {value: time}, ...channels}; this.channels = Object.fromEntries(Object.entries(channels).filter(([name, {value, optional}]) => { if (value != null) return true; if (optional) return false; @@ -367,6 +391,21 @@ function addScaleChannels(channelsByScale, stateByMark, filter = yes) { return channelsByScale; } +function aggregateTimes(stateByMark) { + const times = []; + for (const {channels: {time}} of stateByMark.values()) { + if (time) { + for (let t of time.value) { + if (t == null || isNaN(t = +t)) continue; + const i = bisectLeft(times, t); + if (times[i] === t) continue; + times.splice(i, 0, t); + } + } + } + return times; +} + // Derives a copy of the specified axis with the label disabled. function nolabel(axis) { return axis === undefined || axis.label === undefined diff --git a/test/jsdom.js b/test/jsdom.js index 94e9193c25..1cf937f178 100644 --- a/test/jsdom.js +++ b/test/jsdom.js @@ -24,6 +24,8 @@ function withJsdom(run) { global.Node = jsdom.window.Node; global.NodeList = jsdom.window.NodeList; global.HTMLCollection = jsdom.window.HTMLCollection; + global.requestAnimationFrame = () => 0; + global.cancelAnimationFrame = () => {}; global.fetch = async (href) => new Response(path.resolve("./test", href)); try { return await run(); @@ -35,6 +37,8 @@ function withJsdom(run) { delete global.Node; delete global.NodeList; delete global.HTMLCollection; + delete global.requestAnimationFrame; + delete global.cancelAnimationFrame; delete global.fetch; } }; diff --git a/test/output/drivingAnimation.svg b/test/output/drivingAnimation.svg new file mode 100644 index 0000000000..9bb7fac98a --- /dev/null +++ b/test/output/drivingAnimation.svg @@ -0,0 +1,89 @@ + + + + + + 1.4 + + + + 1.6 + + + + 1.8 + + + + 2.0 + + + + 2.2 + + + + 2.4 + + + + 2.6 + + + + 2.8 + + + + 3.0 + + + + 3.2 + ↑ gas + + + + + 4,000 + + + + 5,000 + + + + 6,000 + + + + 7,000 + + + + 8,000 + + + + 9,000 + + + + 10,000 + miles → + + + \ No newline at end of file diff --git a/test/plots/driving-animation.js b/test/plots/driving-animation.js new file mode 100644 index 0000000000..79933d9b4c --- /dev/null +++ b/test/plots/driving-animation.js @@ -0,0 +1,13 @@ +import * as Plot from "@observablehq/plot"; +import * as d3 from "d3"; + +export default async function() { + const driving = await d3.csv("data/driving.csv", d3.autoType); + return Plot.plot({ + inset: 10, + grid: true, + marks: [ + Plot.line(driving, {x: "miles", y: "gas", time: "year"}) + ] + }); +} diff --git a/test/plots/index.js b/test/plots/index.js index b3f4d78380..8a507f7b56 100644 --- a/test/plots/index.js +++ b/test/plots/index.js @@ -58,6 +58,7 @@ export {default as dotSort} from "./dot-sort.js"; export {default as downloads} from "./downloads.js"; export {default as downloadsOrdinal} from "./downloads-ordinal.js"; export {default as driving} from "./driving.js"; +export {default as drivingAnimation} from "./driving-animation.js"; export {default as empty} from "./empty.js"; export {default as emptyLegend} from "./empty-legend.js"; export {default as emptyX} from "./empty-x.js"; From 257408bcced0d21900ef6ec3617ea669e349de66 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Fri, 15 Jul 2022 13:03:55 -0700 Subject: [PATCH 2/5] gapminder, timeFilter --- src/plot.js | 8 +- src/time.js | 30 + test/data/gapminder.tsv | 1705 +++++++++++++++++++++++++++++++ test/output/gapminder.svg | 174 ++++ test/plots/driving-animation.js | 2 +- test/plots/gapminder.js | 17 + test/plots/index.js | 1 + 7 files changed, 1933 insertions(+), 4 deletions(-) create mode 100644 src/time.js create mode 100644 test/data/gapminder.tsv create mode 100644 test/output/gapminder.svg create mode 100644 test/plots/gapminder.js diff --git a/src/plot.js b/src/plot.js index c469ac68a9..1433ad3d63 100644 --- a/src/plot.js +++ b/src/plot.js @@ -9,6 +9,7 @@ import {arrayify, isDomainSort, isScaleOptions, keyword, map, maybeNamed, range, import {Scales, ScaleFunctions, autoScaleRange, exposeScales} from "./scales.js"; import {position, registry as scaleRegistry} from "./scales/index.js"; import {applyInlineStyles, maybeClassName, maybeClip, styles} from "./style.js"; +import {maybeTimeFilter} from "./time.js"; import {basic, initializer} from "./transforms/basic.js"; import {maybeInterval} from "./transforms/interval.js"; import {consumeWarnings} from "./warnings.js"; @@ -233,12 +234,12 @@ export function plot(options = {}) { const {mark, node} = timeMark; const {channels, values, facets} = stateByMark.get(mark); const facet = facets ? mark.filter(facets[0], channels, values) : null; - const index = facet.filter(i => channels.time.value[i] <= time); + const index = mark.timeFilter(facet, values.time, time); const timeNode = mark.render(index, scales, values, dimensions, context); node.replaceWith(timeNode); timeMark.node = timeNode; } - requestAnimationFrame(tick); + setTimeout(tick, 1500 / times.length); // TODO }); } } @@ -280,12 +281,13 @@ export function plot(options = {}) { export class Mark { constructor(data, channels = {}, options = {}, defaults) { - const {facet = "auto", sort, time, dx, dy, clip, channels: extraChannels} = options; + const {facet = "auto", sort, time, timeFilter, dx, dy, clip, channels: extraChannels} = options; this.data = data; this.sort = isDomainSort(sort) ? sort : null; this.initializer = initializer(options).initializer; this.transform = this.initializer ? options.transform : basic(options).transform; this.facet = facet == null || facet === false ? null : keyword(facet === true ? "include" : facet, "facet", ["auto", "include", "exclude"]); + this.timeFilter = maybeTimeFilter(timeFilter); channels = maybeNamed(channels); if (extraChannels !== undefined) channels = {...maybeNamed(extraChannels), ...channels}; if (defaults !== undefined) channels = {...styles(this, options, defaults), ...channels}; diff --git a/src/time.js b/src/time.js new file mode 100644 index 0000000000..216d36f13b --- /dev/null +++ b/src/time.js @@ -0,0 +1,30 @@ +export function maybeTimeFilter(filter = "eq") { + switch (`${filter}`.toLowerCase()) { + case "lt": return timeLt; + case "lte": return timeLte; + case "gt": return timeGt; + case "gte": return timeGte; + case "eq": return timeEq; + } + throw new Error(`invalid time filter: ${filter}`); +} + +function timeLt(I, T, time) { + return I.filter(i => T[i] < time); +} + +function timeLte(I, T, time) { + return I.filter(i => T[i] <= time); +} + +function timeGt(I, T, time) { + return I.filter(i => T[i] > time); +} + +function timeGte(I, T, time) { + return I.filter(i => T[i] >= time); +} + +function timeEq(I, T, time) { + return I.filter(i => T[i] === time); +} diff --git a/test/data/gapminder.tsv b/test/data/gapminder.tsv new file mode 100644 index 0000000000..83c5ce6ded --- /dev/null +++ b/test/data/gapminder.tsv @@ -0,0 +1,1705 @@ +country continent year lifeExp pop gdpPercap +Afghanistan Asia 1952 28.801 8425333 779.4453145 +Afghanistan Asia 1957 30.332 9240934 820.8530296 +Afghanistan Asia 1962 31.997 10267083 853.10071 +Afghanistan Asia 1967 34.02 11537966 836.1971382 +Afghanistan Asia 1972 36.088 13079460 739.9811058 +Afghanistan Asia 1977 38.438 14880372 786.11336 +Afghanistan Asia 1982 39.854 12881816 978.0114388 +Afghanistan Asia 1987 40.822 13867957 852.3959448 +Afghanistan Asia 1992 41.674 16317921 649.3413952 +Afghanistan Asia 1997 41.763 22227415 635.341351 +Afghanistan Asia 2002 42.129 25268405 726.7340548 +Afghanistan Asia 2007 43.828 31889923 974.5803384 +Albania Europe 1952 55.23 1282697 1601.056136 +Albania Europe 1957 59.28 1476505 1942.284244 +Albania Europe 1962 64.82 1728137 2312.888958 +Albania Europe 1967 66.22 1984060 2760.196931 +Albania Europe 1972 67.69 2263554 3313.422188 +Albania Europe 1977 68.93 2509048 3533.00391 +Albania Europe 1982 70.42 2780097 3630.880722 +Albania Europe 1987 72 3075321 3738.932735 +Albania Europe 1992 71.581 3326498 2497.437901 +Albania Europe 1997 72.95 3428038 3193.054604 +Albania Europe 2002 75.651 3508512 4604.211737 +Albania Europe 2007 76.423 3600523 5937.029526 +Algeria Africa 1952 43.077 9279525 2449.008185 +Algeria Africa 1957 45.685 10270856 3013.976023 +Algeria Africa 1962 48.303 11000948 2550.81688 +Algeria Africa 1967 51.407 12760499 3246.991771 +Algeria Africa 1972 54.518 14760787 4182.663766 +Algeria Africa 1977 58.014 17152804 4910.416756 +Algeria Africa 1982 61.368 20033753 5745.160213 +Algeria Africa 1987 65.799 23254956 5681.358539 +Algeria Africa 1992 67.744 26298373 5023.216647 +Algeria Africa 1997 69.152 29072015 4797.295051 +Algeria Africa 2002 70.994 31287142 5288.040382 +Algeria Africa 2007 72.301 33333216 6223.367465 +Angola Africa 1952 30.015 4232095 3520.610273 +Angola Africa 1957 31.999 4561361 3827.940465 +Angola Africa 1962 34 4826015 4269.276742 +Angola Africa 1967 35.985 5247469 5522.776375 +Angola Africa 1972 37.928 5894858 5473.288005 +Angola Africa 1977 39.483 6162675 3008.647355 +Angola Africa 1982 39.942 7016384 2756.953672 +Angola Africa 1987 39.906 7874230 2430.208311 +Angola Africa 1992 40.647 8735988 2627.845685 +Angola Africa 1997 40.963 9875024 2277.140884 +Angola Africa 2002 41.003 10866106 2773.287312 +Angola Africa 2007 42.731 12420476 4797.231267 +Argentina Americas 1952 62.485 17876956 5911.315053 +Argentina Americas 1957 64.399 19610538 6856.856212 +Argentina Americas 1962 65.142 21283783 7133.166023 +Argentina Americas 1967 65.634 22934225 8052.953021 +Argentina Americas 1972 67.065 24779799 9443.038526 +Argentina Americas 1977 68.481 26983828 10079.02674 +Argentina Americas 1982 69.942 29341374 8997.897412 +Argentina Americas 1987 70.774 31620918 9139.671389 +Argentina Americas 1992 71.868 33958947 9308.41871 +Argentina Americas 1997 73.275 36203463 10967.28195 +Argentina Americas 2002 74.34 38331121 8797.640716 +Argentina Americas 2007 75.32 40301927 12779.37964 +Australia Oceania 1952 69.12 8691212 10039.59564 +Australia Oceania 1957 70.33 9712569 10949.64959 +Australia Oceania 1962 70.93 10794968 12217.22686 +Australia Oceania 1967 71.1 11872264 14526.12465 +Australia Oceania 1972 71.93 13177000 16788.62948 +Australia Oceania 1977 73.49 14074100 18334.19751 +Australia Oceania 1982 74.74 15184200 19477.00928 +Australia Oceania 1987 76.32 16257249 21888.88903 +Australia Oceania 1992 77.56 17481977 23424.76683 +Australia Oceania 1997 78.83 18565243 26997.93657 +Australia Oceania 2002 80.37 19546792 30687.75473 +Australia Oceania 2007 81.235 20434176 34435.36744 +Austria Europe 1952 66.8 6927772 6137.076492 +Austria Europe 1957 67.48 6965860 8842.59803 +Austria Europe 1962 69.54 7129864 10750.72111 +Austria Europe 1967 70.14 7376998 12834.6024 +Austria Europe 1972 70.63 7544201 16661.6256 +Austria Europe 1977 72.17 7568430 19749.4223 +Austria Europe 1982 73.18 7574613 21597.08362 +Austria Europe 1987 74.94 7578903 23687.82607 +Austria Europe 1992 76.04 7914969 27042.01868 +Austria Europe 1997 77.51 8069876 29095.92066 +Austria Europe 2002 78.98 8148312 32417.60769 +Austria Europe 2007 79.829 8199783 36126.4927 +Bahrain Asia 1952 50.939 120447 9867.084765 +Bahrain Asia 1957 53.832 138655 11635.79945 +Bahrain Asia 1962 56.923 171863 12753.27514 +Bahrain Asia 1967 59.923 202182 14804.6727 +Bahrain Asia 1972 63.3 230800 18268.65839 +Bahrain Asia 1977 65.593 297410 19340.10196 +Bahrain Asia 1982 69.052 377967 19211.14731 +Bahrain Asia 1987 70.75 454612 18524.02406 +Bahrain Asia 1992 72.601 529491 19035.57917 +Bahrain Asia 1997 73.925 598561 20292.01679 +Bahrain Asia 2002 74.795 656397 23403.55927 +Bahrain Asia 2007 75.635 708573 29796.04834 +Bangladesh Asia 1952 37.484 46886859 684.2441716 +Bangladesh Asia 1957 39.348 51365468 661.6374577 +Bangladesh Asia 1962 41.216 56839289 686.3415538 +Bangladesh Asia 1967 43.453 62821884 721.1860862 +Bangladesh Asia 1972 45.252 70759295 630.2336265 +Bangladesh Asia 1977 46.923 80428306 659.8772322 +Bangladesh Asia 1982 50.009 93074406 676.9818656 +Bangladesh Asia 1987 52.819 103764241 751.9794035 +Bangladesh Asia 1992 56.018 113704579 837.8101643 +Bangladesh Asia 1997 59.412 123315288 972.7700352 +Bangladesh Asia 2002 62.013 135656790 1136.39043 +Bangladesh Asia 2007 64.062 150448339 1391.253792 +Belgium Europe 1952 68 8730405 8343.105127 +Belgium Europe 1957 69.24 8989111 9714.960623 +Belgium Europe 1962 70.25 9218400 10991.20676 +Belgium Europe 1967 70.94 9556500 13149.04119 +Belgium Europe 1972 71.44 9709100 16672.14356 +Belgium Europe 1977 72.8 9821800 19117.97448 +Belgium Europe 1982 73.93 9856303 20979.84589 +Belgium Europe 1987 75.35 9870200 22525.56308 +Belgium Europe 1992 76.46 10045622 25575.57069 +Belgium Europe 1997 77.53 10199787 27561.19663 +Belgium Europe 2002 78.32 10311970 30485.88375 +Belgium Europe 2007 79.441 10392226 33692.60508 +Benin Africa 1952 38.223 1738315 1062.7522 +Benin Africa 1957 40.358 1925173 959.6010805 +Benin Africa 1962 42.618 2151895 949.4990641 +Benin Africa 1967 44.885 2427334 1035.831411 +Benin Africa 1972 47.014 2761407 1085.796879 +Benin Africa 1977 49.19 3168267 1029.161251 +Benin Africa 1982 50.904 3641603 1277.897616 +Benin Africa 1987 52.337 4243788 1225.85601 +Benin Africa 1992 53.919 4981671 1191.207681 +Benin Africa 1997 54.777 6066080 1232.975292 +Benin Africa 2002 54.406 7026113 1372.877931 +Benin Africa 2007 56.728 8078314 1441.284873 +Bolivia Americas 1952 40.414 2883315 2677.326347 +Bolivia Americas 1957 41.89 3211738 2127.686326 +Bolivia Americas 1962 43.428 3593918 2180.972546 +Bolivia Americas 1967 45.032 4040665 2586.886053 +Bolivia Americas 1972 46.714 4565872 2980.331339 +Bolivia Americas 1977 50.023 5079716 3548.097832 +Bolivia Americas 1982 53.859 5642224 3156.510452 +Bolivia Americas 1987 57.251 6156369 2753.69149 +Bolivia Americas 1992 59.957 6893451 2961.699694 +Bolivia Americas 1997 62.05 7693188 3326.143191 +Bolivia Americas 2002 63.883 8445134 3413.26269 +Bolivia Americas 2007 65.554 9119152 3822.137084 +Bosnia and Herzegovina Europe 1952 53.82 2791000 973.5331948 +Bosnia and Herzegovina Europe 1957 58.45 3076000 1353.989176 +Bosnia and Herzegovina Europe 1962 61.93 3349000 1709.683679 +Bosnia and Herzegovina Europe 1967 64.79 3585000 2172.352423 +Bosnia and Herzegovina Europe 1972 67.45 3819000 2860.16975 +Bosnia and Herzegovina Europe 1977 69.86 4086000 3528.481305 +Bosnia and Herzegovina Europe 1982 70.69 4172693 4126.613157 +Bosnia and Herzegovina Europe 1987 71.14 4338977 4314.114757 +Bosnia and Herzegovina Europe 1992 72.178 4256013 2546.781445 +Bosnia and Herzegovina Europe 1997 73.244 3607000 4766.355904 +Bosnia and Herzegovina Europe 2002 74.09 4165416 6018.975239 +Bosnia and Herzegovina Europe 2007 74.852 4552198 7446.298803 +Botswana Africa 1952 47.622 442308 851.2411407 +Botswana Africa 1957 49.618 474639 918.2325349 +Botswana Africa 1962 51.52 512764 983.6539764 +Botswana Africa 1967 53.298 553541 1214.709294 +Botswana Africa 1972 56.024 619351 2263.611114 +Botswana Africa 1977 59.319 781472 3214.857818 +Botswana Africa 1982 61.484 970347 4551.14215 +Botswana Africa 1987 63.622 1151184 6205.88385 +Botswana Africa 1992 62.745 1342614 7954.111645 +Botswana Africa 1997 52.556 1536536 8647.142313 +Botswana Africa 2002 46.634 1630347 11003.60508 +Botswana Africa 2007 50.728 1639131 12569.85177 +Brazil Americas 1952 50.917 56602560 2108.944355 +Brazil Americas 1957 53.285 65551171 2487.365989 +Brazil Americas 1962 55.665 76039390 3336.585802 +Brazil Americas 1967 57.632 88049823 3429.864357 +Brazil Americas 1972 59.504 100840058 4985.711467 +Brazil Americas 1977 61.489 114313951 6660.118654 +Brazil Americas 1982 63.336 128962939 7030.835878 +Brazil Americas 1987 65.205 142938076 7807.095818 +Brazil Americas 1992 67.057 155975974 6950.283021 +Brazil Americas 1997 69.388 168546719 7957.980824 +Brazil Americas 2002 71.006 179914212 8131.212843 +Brazil Americas 2007 72.39 190010647 9065.800825 +Bulgaria Europe 1952 59.6 7274900 2444.286648 +Bulgaria Europe 1957 66.61 7651254 3008.670727 +Bulgaria Europe 1962 69.51 8012946 4254.337839 +Bulgaria Europe 1967 70.42 8310226 5577.0028 +Bulgaria Europe 1972 70.9 8576200 6597.494398 +Bulgaria Europe 1977 70.81 8797022 7612.240438 +Bulgaria Europe 1982 71.08 8892098 8224.191647 +Bulgaria Europe 1987 71.34 8971958 8239.854824 +Bulgaria Europe 1992 71.19 8658506 6302.623438 +Bulgaria Europe 1997 70.32 8066057 5970.38876 +Bulgaria Europe 2002 72.14 7661799 7696.777725 +Bulgaria Europe 2007 73.005 7322858 10680.79282 +Burkina Faso Africa 1952 31.975 4469979 543.2552413 +Burkina Faso Africa 1957 34.906 4713416 617.1834648 +Burkina Faso Africa 1962 37.814 4919632 722.5120206 +Burkina Faso Africa 1967 40.697 5127935 794.8265597 +Burkina Faso Africa 1972 43.591 5433886 854.7359763 +Burkina Faso Africa 1977 46.137 5889574 743.3870368 +Burkina Faso Africa 1982 48.122 6634596 807.1985855 +Burkina Faso Africa 1987 49.557 7586551 912.0631417 +Burkina Faso Africa 1992 50.26 8878303 931.7527731 +Burkina Faso Africa 1997 50.324 10352843 946.2949618 +Burkina Faso Africa 2002 50.65 12251209 1037.645221 +Burkina Faso Africa 2007 52.295 14326203 1217.032994 +Burundi Africa 1952 39.031 2445618 339.2964587 +Burundi Africa 1957 40.533 2667518 379.5646281 +Burundi Africa 1962 42.045 2961915 355.2032273 +Burundi Africa 1967 43.548 3330989 412.9775136 +Burundi Africa 1972 44.057 3529983 464.0995039 +Burundi Africa 1977 45.91 3834415 556.1032651 +Burundi Africa 1982 47.471 4580410 559.603231 +Burundi Africa 1987 48.211 5126023 621.8188189 +Burundi Africa 1992 44.736 5809236 631.6998778 +Burundi Africa 1997 45.326 6121610 463.1151478 +Burundi Africa 2002 47.36 7021078 446.4035126 +Burundi Africa 2007 49.58 8390505 430.0706916 +Cambodia Asia 1952 39.417 4693836 368.4692856 +Cambodia Asia 1957 41.366 5322536 434.0383364 +Cambodia Asia 1962 43.415 6083619 496.9136476 +Cambodia Asia 1967 45.415 6960067 523.4323142 +Cambodia Asia 1972 40.317 7450606 421.6240257 +Cambodia Asia 1977 31.22 6978607 524.9721832 +Cambodia Asia 1982 50.957 7272485 624.4754784 +Cambodia Asia 1987 53.914 8371791 683.8955732 +Cambodia Asia 1992 55.803 10150094 682.3031755 +Cambodia Asia 1997 56.534 11782962 734.28517 +Cambodia Asia 2002 56.752 12926707 896.2260153 +Cambodia Asia 2007 59.723 14131858 1713.778686 +Cameroon Africa 1952 38.523 5009067 1172.667655 +Cameroon Africa 1957 40.428 5359923 1313.048099 +Cameroon Africa 1962 42.643 5793633 1399.607441 +Cameroon Africa 1967 44.799 6335506 1508.453148 +Cameroon Africa 1972 47.049 7021028 1684.146528 +Cameroon Africa 1977 49.355 7959865 1783.432873 +Cameroon Africa 1982 52.961 9250831 2367.983282 +Cameroon Africa 1987 54.985 10780667 2602.664206 +Cameroon Africa 1992 54.314 12467171 1793.163278 +Cameroon Africa 1997 52.199 14195809 1694.337469 +Cameroon Africa 2002 49.856 15929988 1934.011449 +Cameroon Africa 2007 50.43 17696293 2042.09524 +Canada Americas 1952 68.75 14785584 11367.16112 +Canada Americas 1957 69.96 17010154 12489.95006 +Canada Americas 1962 71.3 18985849 13462.48555 +Canada Americas 1967 72.13 20819767 16076.58803 +Canada Americas 1972 72.88 22284500 18970.57086 +Canada Americas 1977 74.21 23796400 22090.88306 +Canada Americas 1982 75.76 25201900 22898.79214 +Canada Americas 1987 76.86 26549700 26626.51503 +Canada Americas 1992 77.95 28523502 26342.88426 +Canada Americas 1997 78.61 30305843 28954.92589 +Canada Americas 2002 79.77 31902268 33328.96507 +Canada Americas 2007 80.653 33390141 36319.23501 +Central African Republic Africa 1952 35.463 1291695 1071.310713 +Central African Republic Africa 1957 37.464 1392284 1190.844328 +Central African Republic Africa 1962 39.475 1523478 1193.068753 +Central African Republic Africa 1967 41.478 1733638 1136.056615 +Central African Republic Africa 1972 43.457 1927260 1070.013275 +Central African Republic Africa 1977 46.775 2167533 1109.374338 +Central African Republic Africa 1982 48.295 2476971 956.7529907 +Central African Republic Africa 1987 50.485 2840009 844.8763504 +Central African Republic Africa 1992 49.396 3265124 747.9055252 +Central African Republic Africa 1997 46.066 3696513 740.5063317 +Central African Republic Africa 2002 43.308 4048013 738.6906068 +Central African Republic Africa 2007 44.741 4369038 706.016537 +Chad Africa 1952 38.092 2682462 1178.665927 +Chad Africa 1957 39.881 2894855 1308.495577 +Chad Africa 1962 41.716 3150417 1389.817618 +Chad Africa 1967 43.601 3495967 1196.810565 +Chad Africa 1972 45.569 3899068 1104.103987 +Chad Africa 1977 47.383 4388260 1133.98495 +Chad Africa 1982 49.517 4875118 797.9081006 +Chad Africa 1987 51.051 5498955 952.386129 +Chad Africa 1992 51.724 6429417 1058.0643 +Chad Africa 1997 51.573 7562011 1004.961353 +Chad Africa 2002 50.525 8835739 1156.18186 +Chad Africa 2007 50.651 10238807 1704.063724 +Chile Americas 1952 54.745 6377619 3939.978789 +Chile Americas 1957 56.074 7048426 4315.622723 +Chile Americas 1962 57.924 7961258 4519.094331 +Chile Americas 1967 60.523 8858908 5106.654313 +Chile Americas 1972 63.441 9717524 5494.024437 +Chile Americas 1977 67.052 10599793 4756.763836 +Chile Americas 1982 70.565 11487112 5095.665738 +Chile Americas 1987 72.492 12463354 5547.063754 +Chile Americas 1992 74.126 13572994 7596.125964 +Chile Americas 1997 75.816 14599929 10118.05318 +Chile Americas 2002 77.86 15497046 10778.78385 +Chile Americas 2007 78.553 16284741 13171.63885 +China Asia 1952 44 556263527 400.448611 +China Asia 1957 50.54896 637408000 575.9870009 +China Asia 1962 44.50136 665770000 487.6740183 +China Asia 1967 58.38112 754550000 612.7056934 +China Asia 1972 63.11888 862030000 676.9000921 +China Asia 1977 63.96736 943455000 741.2374699 +China Asia 1982 65.525 1000281000 962.4213805 +China Asia 1987 67.274 1084035000 1378.904018 +China Asia 1992 68.69 1164970000 1655.784158 +China Asia 1997 70.426 1230075000 2289.234136 +China Asia 2002 72.028 1280400000 3119.280896 +China Asia 2007 72.961 1318683096 4959.114854 +Colombia Americas 1952 50.643 12350771 2144.115096 +Colombia Americas 1957 55.118 14485993 2323.805581 +Colombia Americas 1962 57.863 17009885 2492.351109 +Colombia Americas 1967 59.963 19764027 2678.729839 +Colombia Americas 1972 61.623 22542890 3264.660041 +Colombia Americas 1977 63.837 25094412 3815.80787 +Colombia Americas 1982 66.653 27764644 4397.575659 +Colombia Americas 1987 67.768 30964245 4903.2191 +Colombia Americas 1992 68.421 34202721 5444.648617 +Colombia Americas 1997 70.313 37657830 6117.361746 +Colombia Americas 2002 71.682 41008227 5755.259962 +Colombia Americas 2007 72.889 44227550 7006.580419 +Comoros Africa 1952 40.715 153936 1102.990936 +Comoros Africa 1957 42.46 170928 1211.148548 +Comoros Africa 1962 44.467 191689 1406.648278 +Comoros Africa 1967 46.472 217378 1876.029643 +Comoros Africa 1972 48.944 250027 1937.577675 +Comoros Africa 1977 50.939 304739 1172.603047 +Comoros Africa 1982 52.933 348643 1267.100083 +Comoros Africa 1987 54.926 395114 1315.980812 +Comoros Africa 1992 57.939 454429 1246.90737 +Comoros Africa 1997 60.66 527982 1173.618235 +Comoros Africa 2002 62.974 614382 1075.811558 +Comoros Africa 2007 65.152 710960 986.1478792 +Congo, Dem. Rep. Africa 1952 39.143 14100005 780.5423257 +Congo, Dem. Rep. Africa 1957 40.652 15577932 905.8602303 +Congo, Dem. Rep. Africa 1962 42.122 17486434 896.3146335 +Congo, Dem. Rep. Africa 1967 44.056 19941073 861.5932424 +Congo, Dem. Rep. Africa 1972 45.989 23007669 904.8960685 +Congo, Dem. Rep. Africa 1977 47.804 26480870 795.757282 +Congo, Dem. Rep. Africa 1982 47.784 30646495 673.7478181 +Congo, Dem. Rep. Africa 1987 47.412 35481645 672.774812 +Congo, Dem. Rep. Africa 1992 45.548 41672143 457.7191807 +Congo, Dem. Rep. Africa 1997 42.587 47798986 312.188423 +Congo, Dem. Rep. Africa 2002 44.966 55379852 241.1658765 +Congo, Dem. Rep. Africa 2007 46.462 64606759 277.5518587 +Congo, Rep. Africa 1952 42.111 854885 2125.621418 +Congo, Rep. Africa 1957 45.053 940458 2315.056572 +Congo, Rep. Africa 1962 48.435 1047924 2464.783157 +Congo, Rep. Africa 1967 52.04 1179760 2677.939642 +Congo, Rep. Africa 1972 54.907 1340458 3213.152683 +Congo, Rep. Africa 1977 55.625 1536769 3259.178978 +Congo, Rep. Africa 1982 56.695 1774735 4879.507522 +Congo, Rep. Africa 1987 57.47 2064095 4201.194937 +Congo, Rep. Africa 1992 56.433 2409073 4016.239529 +Congo, Rep. Africa 1997 52.962 2800947 3484.164376 +Congo, Rep. Africa 2002 52.97 3328795 3484.06197 +Congo, Rep. Africa 2007 55.322 3800610 3632.557798 +Costa Rica Americas 1952 57.206 926317 2627.009471 +Costa Rica Americas 1957 60.026 1112300 2990.010802 +Costa Rica Americas 1962 62.842 1345187 3460.937025 +Costa Rica Americas 1967 65.424 1588717 4161.727834 +Costa Rica Americas 1972 67.849 1834796 5118.146939 +Costa Rica Americas 1977 70.75 2108457 5926.876967 +Costa Rica Americas 1982 73.45 2424367 5262.734751 +Costa Rica Americas 1987 74.752 2799811 5629.915318 +Costa Rica Americas 1992 75.713 3173216 6160.416317 +Costa Rica Americas 1997 77.26 3518107 6677.045314 +Costa Rica Americas 2002 78.123 3834934 7723.447195 +Costa Rica Americas 2007 78.782 4133884 9645.06142 +Cote d'Ivoire Africa 1952 40.477 2977019 1388.594732 +Cote d'Ivoire Africa 1957 42.469 3300000 1500.895925 +Cote d'Ivoire Africa 1962 44.93 3832408 1728.869428 +Cote d'Ivoire Africa 1967 47.35 4744870 2052.050473 +Cote d'Ivoire Africa 1972 49.801 6071696 2378.201111 +Cote d'Ivoire Africa 1977 52.374 7459574 2517.736547 +Cote d'Ivoire Africa 1982 53.983 9025951 2602.710169 +Cote d'Ivoire Africa 1987 54.655 10761098 2156.956069 +Cote d'Ivoire Africa 1992 52.044 12772596 1648.073791 +Cote d'Ivoire Africa 1997 47.991 14625967 1786.265407 +Cote d'Ivoire Africa 2002 46.832 16252726 1648.800823 +Cote d'Ivoire Africa 2007 48.328 18013409 1544.750112 +Croatia Europe 1952 61.21 3882229 3119.23652 +Croatia Europe 1957 64.77 3991242 4338.231617 +Croatia Europe 1962 67.13 4076557 5477.890018 +Croatia Europe 1967 68.5 4174366 6960.297861 +Croatia Europe 1972 69.61 4225310 9164.090127 +Croatia Europe 1977 70.64 4318673 11305.38517 +Croatia Europe 1982 70.46 4413368 13221.82184 +Croatia Europe 1987 71.52 4484310 13822.58394 +Croatia Europe 1992 72.527 4494013 8447.794873 +Croatia Europe 1997 73.68 4444595 9875.604515 +Croatia Europe 2002 74.876 4481020 11628.38895 +Croatia Europe 2007 75.748 4493312 14619.22272 +Cuba Americas 1952 59.421 6007797 5586.53878 +Cuba Americas 1957 62.325 6640752 6092.174359 +Cuba Americas 1962 65.246 7254373 5180.75591 +Cuba Americas 1967 68.29 8139332 5690.268015 +Cuba Americas 1972 70.723 8831348 5305.445256 +Cuba Americas 1977 72.649 9537988 6380.494966 +Cuba Americas 1982 73.717 9789224 7316.918107 +Cuba Americas 1987 74.174 10239839 7532.924763 +Cuba Americas 1992 74.414 10723260 5592.843963 +Cuba Americas 1997 76.151 10983007 5431.990415 +Cuba Americas 2002 77.158 11226999 6340.646683 +Cuba Americas 2007 78.273 11416987 8948.102923 +Czech Republic Europe 1952 66.87 9125183 6876.14025 +Czech Republic Europe 1957 69.03 9513758 8256.343918 +Czech Republic Europe 1962 69.9 9620282 10136.86713 +Czech Republic Europe 1967 70.38 9835109 11399.44489 +Czech Republic Europe 1972 70.29 9862158 13108.4536 +Czech Republic Europe 1977 70.71 10161915 14800.16062 +Czech Republic Europe 1982 70.96 10303704 15377.22855 +Czech Republic Europe 1987 71.58 10311597 16310.4434 +Czech Republic Europe 1992 72.4 10315702 14297.02122 +Czech Republic Europe 1997 74.01 10300707 16048.51424 +Czech Republic Europe 2002 75.51 10256295 17596.21022 +Czech Republic Europe 2007 76.486 10228744 22833.30851 +Denmark Europe 1952 70.78 4334000 9692.385245 +Denmark Europe 1957 71.81 4487831 11099.65935 +Denmark Europe 1962 72.35 4646899 13583.31351 +Denmark Europe 1967 72.96 4838800 15937.21123 +Denmark Europe 1972 73.47 4991596 18866.20721 +Denmark Europe 1977 74.69 5088419 20422.9015 +Denmark Europe 1982 74.63 5117810 21688.04048 +Denmark Europe 1987 74.8 5127024 25116.17581 +Denmark Europe 1992 75.33 5171393 26406.73985 +Denmark Europe 1997 76.11 5283663 29804.34567 +Denmark Europe 2002 77.18 5374693 32166.50006 +Denmark Europe 2007 78.332 5468120 35278.41874 +Djibouti Africa 1952 34.812 63149 2669.529475 +Djibouti Africa 1957 37.328 71851 2864.969076 +Djibouti Africa 1962 39.693 89898 3020.989263 +Djibouti Africa 1967 42.074 127617 3020.050513 +Djibouti Africa 1972 44.366 178848 3694.212352 +Djibouti Africa 1977 46.519 228694 3081.761022 +Djibouti Africa 1982 48.812 305991 2879.468067 +Djibouti Africa 1987 50.04 311025 2880.102568 +Djibouti Africa 1992 51.604 384156 2377.156192 +Djibouti Africa 1997 53.157 417908 1895.016984 +Djibouti Africa 2002 53.373 447416 1908.260867 +Djibouti Africa 2007 54.791 496374 2082.481567 +Dominican Republic Americas 1952 45.928 2491346 1397.717137 +Dominican Republic Americas 1957 49.828 2923186 1544.402995 +Dominican Republic Americas 1962 53.459 3453434 1662.137359 +Dominican Republic Americas 1967 56.751 4049146 1653.723003 +Dominican Republic Americas 1972 59.631 4671329 2189.874499 +Dominican Republic Americas 1977 61.788 5302800 2681.9889 +Dominican Republic Americas 1982 63.727 5968349 2861.092386 +Dominican Republic Americas 1987 66.046 6655297 2899.842175 +Dominican Republic Americas 1992 68.457 7351181 3044.214214 +Dominican Republic Americas 1997 69.957 7992357 3614.101285 +Dominican Republic Americas 2002 70.847 8650322 4563.808154 +Dominican Republic Americas 2007 72.235 9319622 6025.374752 +Ecuador Americas 1952 48.357 3548753 3522.110717 +Ecuador Americas 1957 51.356 4058385 3780.546651 +Ecuador Americas 1962 54.64 4681707 4086.114078 +Ecuador Americas 1967 56.678 5432424 4579.074215 +Ecuador Americas 1972 58.796 6298651 5280.99471 +Ecuador Americas 1977 61.31 7278866 6679.62326 +Ecuador Americas 1982 64.342 8365850 7213.791267 +Ecuador Americas 1987 67.231 9545158 6481.776993 +Ecuador Americas 1992 69.613 10748394 7103.702595 +Ecuador Americas 1997 72.312 11911819 7429.455877 +Ecuador Americas 2002 74.173 12921234 5773.044512 +Ecuador Americas 2007 74.994 13755680 6873.262326 +Egypt Africa 1952 41.893 22223309 1418.822445 +Egypt Africa 1957 44.444 25009741 1458.915272 +Egypt Africa 1962 46.992 28173309 1693.335853 +Egypt Africa 1967 49.293 31681188 1814.880728 +Egypt Africa 1972 51.137 34807417 2024.008147 +Egypt Africa 1977 53.319 38783863 2785.493582 +Egypt Africa 1982 56.006 45681811 3503.729636 +Egypt Africa 1987 59.797 52799062 3885.46071 +Egypt Africa 1992 63.674 59402198 3794.755195 +Egypt Africa 1997 67.217 66134291 4173.181797 +Egypt Africa 2002 69.806 73312559 4754.604414 +Egypt Africa 2007 71.338 80264543 5581.180998 +El Salvador Americas 1952 45.262 2042865 3048.3029 +El Salvador Americas 1957 48.57 2355805 3421.523218 +El Salvador Americas 1962 52.307 2747687 3776.803627 +El Salvador Americas 1967 55.855 3232927 4358.595393 +El Salvador Americas 1972 58.207 3790903 4520.246008 +El Salvador Americas 1977 56.696 4282586 5138.922374 +El Salvador Americas 1982 56.604 4474873 4098.344175 +El Salvador Americas 1987 63.154 4842194 4140.442097 +El Salvador Americas 1992 66.798 5274649 4444.2317 +El Salvador Americas 1997 69.535 5783439 5154.825496 +El Salvador Americas 2002 70.734 6353681 5351.568666 +El Salvador Americas 2007 71.878 6939688 5728.353514 +Equatorial Guinea Africa 1952 34.482 216964 375.6431231 +Equatorial Guinea Africa 1957 35.983 232922 426.0964081 +Equatorial Guinea Africa 1962 37.485 249220 582.8419714 +Equatorial Guinea Africa 1967 38.987 259864 915.5960025 +Equatorial Guinea Africa 1972 40.516 277603 672.4122571 +Equatorial Guinea Africa 1977 42.024 192675 958.5668124 +Equatorial Guinea Africa 1982 43.662 285483 927.8253427 +Equatorial Guinea Africa 1987 45.664 341244 966.8968149 +Equatorial Guinea Africa 1992 47.545 387838 1132.055034 +Equatorial Guinea Africa 1997 48.245 439971 2814.480755 +Equatorial Guinea Africa 2002 49.348 495627 7703.4959 +Equatorial Guinea Africa 2007 51.579 551201 12154.08975 +Eritrea Africa 1952 35.928 1438760 328.9405571 +Eritrea Africa 1957 38.047 1542611 344.1618859 +Eritrea Africa 1962 40.158 1666618 380.9958433 +Eritrea Africa 1967 42.189 1820319 468.7949699 +Eritrea Africa 1972 44.142 2260187 514.3242082 +Eritrea Africa 1977 44.535 2512642 505.7538077 +Eritrea Africa 1982 43.89 2637297 524.8758493 +Eritrea Africa 1987 46.453 2915959 521.1341333 +Eritrea Africa 1992 49.991 3668440 582.8585102 +Eritrea Africa 1997 53.378 4058319 913.47079 +Eritrea Africa 2002 55.24 4414865 765.3500015 +Eritrea Africa 2007 58.04 4906585 641.3695236 +Ethiopia Africa 1952 34.078 20860941 362.1462796 +Ethiopia Africa 1957 36.667 22815614 378.9041632 +Ethiopia Africa 1962 40.059 25145372 419.4564161 +Ethiopia Africa 1967 42.115 27860297 516.1186438 +Ethiopia Africa 1972 43.515 30770372 566.2439442 +Ethiopia Africa 1977 44.51 34617799 556.8083834 +Ethiopia Africa 1982 44.916 38111756 577.8607471 +Ethiopia Africa 1987 46.684 42999530 573.7413142 +Ethiopia Africa 1992 48.091 52088559 421.3534653 +Ethiopia Africa 1997 49.402 59861301 515.8894013 +Ethiopia Africa 2002 50.725 67946797 530.0535319 +Ethiopia Africa 2007 52.947 76511887 690.8055759 +Finland Europe 1952 66.55 4090500 6424.519071 +Finland Europe 1957 67.49 4324000 7545.415386 +Finland Europe 1962 68.75 4491443 9371.842561 +Finland Europe 1967 69.83 4605744 10921.63626 +Finland Europe 1972 70.87 4639657 14358.8759 +Finland Europe 1977 72.52 4738902 15605.42283 +Finland Europe 1982 74.55 4826933 18533.15761 +Finland Europe 1987 74.83 4931729 21141.01223 +Finland Europe 1992 75.7 5041039 20647.16499 +Finland Europe 1997 77.13 5134406 23723.9502 +Finland Europe 2002 78.37 5193039 28204.59057 +Finland Europe 2007 79.313 5238460 33207.0844 +France Europe 1952 67.41 42459667 7029.809327 +France Europe 1957 68.93 44310863 8662.834898 +France Europe 1962 70.51 47124000 10560.48553 +France Europe 1967 71.55 49569000 12999.91766 +France Europe 1972 72.38 51732000 16107.19171 +France Europe 1977 73.83 53165019 18292.63514 +France Europe 1982 74.89 54433565 20293.89746 +France Europe 1987 76.34 55630100 22066.44214 +France Europe 1992 77.46 57374179 24703.79615 +France Europe 1997 78.64 58623428 25889.78487 +France Europe 2002 79.59 59925035 28926.03234 +France Europe 2007 80.657 61083916 30470.0167 +Gabon Africa 1952 37.003 420702 4293.476475 +Gabon Africa 1957 38.999 434904 4976.198099 +Gabon Africa 1962 40.489 455661 6631.459222 +Gabon Africa 1967 44.598 489004 8358.761987 +Gabon Africa 1972 48.69 537977 11401.94841 +Gabon Africa 1977 52.79 706367 21745.57328 +Gabon Africa 1982 56.564 753874 15113.36194 +Gabon Africa 1987 60.19 880397 11864.40844 +Gabon Africa 1992 61.366 985739 13522.15752 +Gabon Africa 1997 60.461 1126189 14722.84188 +Gabon Africa 2002 56.761 1299304 12521.71392 +Gabon Africa 2007 56.735 1454867 13206.48452 +Gambia Africa 1952 30 284320 485.2306591 +Gambia Africa 1957 32.065 323150 520.9267111 +Gambia Africa 1962 33.896 374020 599.650276 +Gambia Africa 1967 35.857 439593 734.7829124 +Gambia Africa 1972 38.308 517101 756.0868363 +Gambia Africa 1977 41.842 608274 884.7552507 +Gambia Africa 1982 45.58 715523 835.8096108 +Gambia Africa 1987 49.265 848406 611.6588611 +Gambia Africa 1992 52.644 1025384 665.6244126 +Gambia Africa 1997 55.861 1235767 653.7301704 +Gambia Africa 2002 58.041 1457766 660.5855997 +Gambia Africa 2007 59.448 1688359 752.7497265 +Germany Europe 1952 67.5 69145952 7144.114393 +Germany Europe 1957 69.1 71019069 10187.82665 +Germany Europe 1962 70.3 73739117 12902.46291 +Germany Europe 1967 70.8 76368453 14745.62561 +Germany Europe 1972 71 78717088 18016.18027 +Germany Europe 1977 72.5 78160773 20512.92123 +Germany Europe 1982 73.8 78335266 22031.53274 +Germany Europe 1987 74.847 77718298 24639.18566 +Germany Europe 1992 76.07 80597764 26505.30317 +Germany Europe 1997 77.34 82011073 27788.88416 +Germany Europe 2002 78.67 82350671 30035.80198 +Germany Europe 2007 79.406 82400996 32170.37442 +Ghana Africa 1952 43.149 5581001 911.2989371 +Ghana Africa 1957 44.779 6391288 1043.561537 +Ghana Africa 1962 46.452 7355248 1190.041118 +Ghana Africa 1967 48.072 8490213 1125.69716 +Ghana Africa 1972 49.875 9354120 1178.223708 +Ghana Africa 1977 51.756 10538093 993.2239571 +Ghana Africa 1982 53.744 11400338 876.032569 +Ghana Africa 1987 55.729 14168101 847.0061135 +Ghana Africa 1992 57.501 16278738 925.060154 +Ghana Africa 1997 58.556 18418288 1005.245812 +Ghana Africa 2002 58.453 20550751 1111.984578 +Ghana Africa 2007 60.022 22873338 1327.60891 +Greece Europe 1952 65.86 7733250 3530.690067 +Greece Europe 1957 67.86 8096218 4916.299889 +Greece Europe 1962 69.51 8448233 6017.190733 +Greece Europe 1967 71 8716441 8513.097016 +Greece Europe 1972 72.34 8888628 12724.82957 +Greece Europe 1977 73.68 9308479 14195.52428 +Greece Europe 1982 75.24 9786480 15268.42089 +Greece Europe 1987 76.67 9974490 16120.52839 +Greece Europe 1992 77.03 10325429 17541.49634 +Greece Europe 1997 77.869 10502372 18747.69814 +Greece Europe 2002 78.256 10603863 22514.2548 +Greece Europe 2007 79.483 10706290 27538.41188 +Guatemala Americas 1952 42.023 3146381 2428.237769 +Guatemala Americas 1957 44.142 3640876 2617.155967 +Guatemala Americas 1962 46.954 4208858 2750.364446 +Guatemala Americas 1967 50.016 4690773 3242.531147 +Guatemala Americas 1972 53.738 5149581 4031.408271 +Guatemala Americas 1977 56.029 5703430 4879.992748 +Guatemala Americas 1982 58.137 6395630 4820.49479 +Guatemala Americas 1987 60.782 7326406 4246.485974 +Guatemala Americas 1992 63.373 8486949 4439.45084 +Guatemala Americas 1997 66.322 9803875 4684.313807 +Guatemala Americas 2002 68.978 11178650 4858.347495 +Guatemala Americas 2007 70.259 12572928 5186.050003 +Guinea Africa 1952 33.609 2664249 510.1964923 +Guinea Africa 1957 34.558 2876726 576.2670245 +Guinea Africa 1962 35.753 3140003 686.3736739 +Guinea Africa 1967 37.197 3451418 708.7595409 +Guinea Africa 1972 38.842 3811387 741.6662307 +Guinea Africa 1977 40.762 4227026 874.6858643 +Guinea Africa 1982 42.891 4710497 857.2503577 +Guinea Africa 1987 45.552 5650262 805.5724718 +Guinea Africa 1992 48.576 6990574 794.3484384 +Guinea Africa 1997 51.455 8048834 869.4497668 +Guinea Africa 2002 53.676 8807818 945.5835837 +Guinea Africa 2007 56.007 9947814 942.6542111 +Guinea-Bissau Africa 1952 32.5 580653 299.850319 +Guinea-Bissau Africa 1957 33.489 601095 431.7904566 +Guinea-Bissau Africa 1962 34.488 627820 522.0343725 +Guinea-Bissau Africa 1967 35.492 601287 715.5806402 +Guinea-Bissau Africa 1972 36.486 625361 820.2245876 +Guinea-Bissau Africa 1977 37.465 745228 764.7259628 +Guinea-Bissau Africa 1982 39.327 825987 838.1239671 +Guinea-Bissau Africa 1987 41.245 927524 736.4153921 +Guinea-Bissau Africa 1992 43.266 1050938 745.5398706 +Guinea-Bissau Africa 1997 44.873 1193708 796.6644681 +Guinea-Bissau Africa 2002 45.504 1332459 575.7047176 +Guinea-Bissau Africa 2007 46.388 1472041 579.231743 +Haiti Americas 1952 37.579 3201488 1840.366939 +Haiti Americas 1957 40.696 3507701 1726.887882 +Haiti Americas 1962 43.59 3880130 1796.589032 +Haiti Americas 1967 46.243 4318137 1452.057666 +Haiti Americas 1972 48.042 4698301 1654.456946 +Haiti Americas 1977 49.923 4908554 1874.298931 +Haiti Americas 1982 51.461 5198399 2011.159549 +Haiti Americas 1987 53.636 5756203 1823.015995 +Haiti Americas 1992 55.089 6326682 1456.309517 +Haiti Americas 1997 56.671 6913545 1341.726931 +Haiti Americas 2002 58.137 7607651 1270.364932 +Haiti Americas 2007 60.916 8502814 1201.637154 +Honduras Americas 1952 41.912 1517453 2194.926204 +Honduras Americas 1957 44.665 1770390 2220.487682 +Honduras Americas 1962 48.041 2090162 2291.156835 +Honduras Americas 1967 50.924 2500689 2538.269358 +Honduras Americas 1972 53.884 2965146 2529.842345 +Honduras Americas 1977 57.402 3055235 3203.208066 +Honduras Americas 1982 60.909 3669448 3121.760794 +Honduras Americas 1987 64.492 4372203 3023.096699 +Honduras Americas 1992 66.399 5077347 3081.694603 +Honduras Americas 1997 67.659 5867957 3160.454906 +Honduras Americas 2002 68.565 6677328 3099.72866 +Honduras Americas 2007 70.198 7483763 3548.330846 +Hong Kong, China Asia 1952 60.96 2125900 3054.421209 +Hong Kong, China Asia 1957 64.75 2736300 3629.076457 +Hong Kong, China Asia 1962 67.65 3305200 4692.648272 +Hong Kong, China Asia 1967 70 3722800 6197.962814 +Hong Kong, China Asia 1972 72 4115700 8315.928145 +Hong Kong, China Asia 1977 73.6 4583700 11186.14125 +Hong Kong, China Asia 1982 75.45 5264500 14560.53051 +Hong Kong, China Asia 1987 76.2 5584510 20038.47269 +Hong Kong, China Asia 1992 77.601 5829696 24757.60301 +Hong Kong, China Asia 1997 80 6495918 28377.63219 +Hong Kong, China Asia 2002 81.495 6762476 30209.01516 +Hong Kong, China Asia 2007 82.208 6980412 39724.97867 +Hungary Europe 1952 64.03 9504000 5263.673816 +Hungary Europe 1957 66.41 9839000 6040.180011 +Hungary Europe 1962 67.96 10063000 7550.359877 +Hungary Europe 1967 69.5 10223422 9326.64467 +Hungary Europe 1972 69.76 10394091 10168.65611 +Hungary Europe 1977 69.95 10637171 11674.83737 +Hungary Europe 1982 69.39 10705535 12545.99066 +Hungary Europe 1987 69.58 10612740 12986.47998 +Hungary Europe 1992 69.17 10348684 10535.62855 +Hungary Europe 1997 71.04 10244684 11712.7768 +Hungary Europe 2002 72.59 10083313 14843.93556 +Hungary Europe 2007 73.338 9956108 18008.94444 +Iceland Europe 1952 72.49 147962 7267.688428 +Iceland Europe 1957 73.47 165110 9244.001412 +Iceland Europe 1962 73.68 182053 10350.15906 +Iceland Europe 1967 73.73 198676 13319.89568 +Iceland Europe 1972 74.46 209275 15798.06362 +Iceland Europe 1977 76.11 221823 19654.96247 +Iceland Europe 1982 76.99 233997 23269.6075 +Iceland Europe 1987 77.23 244676 26923.20628 +Iceland Europe 1992 78.77 259012 25144.39201 +Iceland Europe 1997 78.95 271192 28061.09966 +Iceland Europe 2002 80.5 288030 31163.20196 +Iceland Europe 2007 81.757 301931 36180.78919 +India Asia 1952 37.373 372000000 546.5657493 +India Asia 1957 40.249 409000000 590.061996 +India Asia 1962 43.605 454000000 658.3471509 +India Asia 1967 47.193 506000000 700.7706107 +India Asia 1972 50.651 567000000 724.032527 +India Asia 1977 54.208 634000000 813.337323 +India Asia 1982 56.596 708000000 855.7235377 +India Asia 1987 58.553 788000000 976.5126756 +India Asia 1992 60.223 872000000 1164.406809 +India Asia 1997 61.765 959000000 1458.817442 +India Asia 2002 62.879 1034172547 1746.769454 +India Asia 2007 64.698 1110396331 2452.210407 +Indonesia Asia 1952 37.468 82052000 749.6816546 +Indonesia Asia 1957 39.918 90124000 858.9002707 +Indonesia Asia 1962 42.518 99028000 849.2897701 +Indonesia Asia 1967 45.964 109343000 762.4317721 +Indonesia Asia 1972 49.203 121282000 1111.107907 +Indonesia Asia 1977 52.702 136725000 1382.702056 +Indonesia Asia 1982 56.159 153343000 1516.872988 +Indonesia Asia 1987 60.137 169276000 1748.356961 +Indonesia Asia 1992 62.681 184816000 2383.140898 +Indonesia Asia 1997 66.041 199278000 3119.335603 +Indonesia Asia 2002 68.588 211060000 2873.91287 +Indonesia Asia 2007 70.65 223547000 3540.651564 +Iran Asia 1952 44.869 17272000 3035.326002 +Iran Asia 1957 47.181 19792000 3290.257643 +Iran Asia 1962 49.325 22874000 4187.329802 +Iran Asia 1967 52.469 26538000 5906.731805 +Iran Asia 1972 55.234 30614000 9613.818607 +Iran Asia 1977 57.702 35480679 11888.59508 +Iran Asia 1982 59.62 43072751 7608.334602 +Iran Asia 1987 63.04 51889696 6642.881371 +Iran Asia 1992 65.742 60397973 7235.653188 +Iran Asia 1997 68.042 63327987 8263.590301 +Iran Asia 2002 69.451 66907826 9240.761975 +Iran Asia 2007 70.964 69453570 11605.71449 +Iraq Asia 1952 45.32 5441766 4129.766056 +Iraq Asia 1957 48.437 6248643 6229.333562 +Iraq Asia 1962 51.457 7240260 8341.737815 +Iraq Asia 1967 54.459 8519282 8931.459811 +Iraq Asia 1972 56.95 10061506 9576.037596 +Iraq Asia 1977 60.413 11882916 14688.23507 +Iraq Asia 1982 62.038 14173318 14517.90711 +Iraq Asia 1987 65.044 16543189 11643.57268 +Iraq Asia 1992 59.461 17861905 3745.640687 +Iraq Asia 1997 58.811 20775703 3076.239795 +Iraq Asia 2002 57.046 24001816 4390.717312 +Iraq Asia 2007 59.545 27499638 4471.061906 +Ireland Europe 1952 66.91 2952156 5210.280328 +Ireland Europe 1957 68.9 2878220 5599.077872 +Ireland Europe 1962 70.29 2830000 6631.597314 +Ireland Europe 1967 71.08 2900100 7655.568963 +Ireland Europe 1972 71.28 3024400 9530.772896 +Ireland Europe 1977 72.03 3271900 11150.98113 +Ireland Europe 1982 73.1 3480000 12618.32141 +Ireland Europe 1987 74.36 3539900 13872.86652 +Ireland Europe 1992 75.467 3557761 17558.81555 +Ireland Europe 1997 76.122 3667233 24521.94713 +Ireland Europe 2002 77.783 3879155 34077.04939 +Ireland Europe 2007 78.885 4109086 40675.99635 +Israel Asia 1952 65.39 1620914 4086.522128 +Israel Asia 1957 67.84 1944401 5385.278451 +Israel Asia 1962 69.39 2310904 7105.630706 +Israel Asia 1967 70.75 2693585 8393.741404 +Israel Asia 1972 71.63 3095893 12786.93223 +Israel Asia 1977 73.06 3495918 13306.61921 +Israel Asia 1982 74.45 3858421 15367.0292 +Israel Asia 1987 75.6 4203148 17122.47986 +Israel Asia 1992 76.93 4936550 18051.52254 +Israel Asia 1997 78.269 5531387 20896.60924 +Israel Asia 2002 79.696 6029529 21905.59514 +Israel Asia 2007 80.745 6426679 25523.2771 +Italy Europe 1952 65.94 47666000 4931.404155 +Italy Europe 1957 67.81 49182000 6248.656232 +Italy Europe 1962 69.24 50843200 8243.58234 +Italy Europe 1967 71.06 52667100 10022.40131 +Italy Europe 1972 72.19 54365564 12269.27378 +Italy Europe 1977 73.48 56059245 14255.98475 +Italy Europe 1982 74.98 56535636 16537.4835 +Italy Europe 1987 76.42 56729703 19207.23482 +Italy Europe 1992 77.44 56840847 22013.64486 +Italy Europe 1997 78.82 57479469 24675.02446 +Italy Europe 2002 80.24 57926999 27968.09817 +Italy Europe 2007 80.546 58147733 28569.7197 +Jamaica Americas 1952 58.53 1426095 2898.530881 +Jamaica Americas 1957 62.61 1535090 4756.525781 +Jamaica Americas 1962 65.61 1665128 5246.107524 +Jamaica Americas 1967 67.51 1861096 6124.703451 +Jamaica Americas 1972 69 1997616 7433.889293 +Jamaica Americas 1977 70.11 2156814 6650.195573 +Jamaica Americas 1982 71.21 2298309 6068.05135 +Jamaica Americas 1987 71.77 2326606 6351.237495 +Jamaica Americas 1992 71.766 2378618 7404.923685 +Jamaica Americas 1997 72.262 2531311 7121.924704 +Jamaica Americas 2002 72.047 2664659 6994.774861 +Jamaica Americas 2007 72.567 2780132 7320.880262 +Japan Asia 1952 63.03 86459025 3216.956347 +Japan Asia 1957 65.5 91563009 4317.694365 +Japan Asia 1962 68.73 95831757 6576.649461 +Japan Asia 1967 71.43 100825279 9847.788607 +Japan Asia 1972 73.42 107188273 14778.78636 +Japan Asia 1977 75.38 113872473 16610.37701 +Japan Asia 1982 77.11 118454974 19384.10571 +Japan Asia 1987 78.67 122091325 22375.94189 +Japan Asia 1992 79.36 124329269 26824.89511 +Japan Asia 1997 80.69 125956499 28816.58499 +Japan Asia 2002 82 127065841 28604.5919 +Japan Asia 2007 82.603 127467972 31656.06806 +Jordan Asia 1952 43.158 607914 1546.907807 +Jordan Asia 1957 45.669 746559 1886.080591 +Jordan Asia 1962 48.126 933559 2348.009158 +Jordan Asia 1967 51.629 1255058 2741.796252 +Jordan Asia 1972 56.528 1613551 2110.856309 +Jordan Asia 1977 61.134 1937652 2852.351568 +Jordan Asia 1982 63.739 2347031 4161.415959 +Jordan Asia 1987 65.869 2820042 4448.679912 +Jordan Asia 1992 68.015 3867409 3431.593647 +Jordan Asia 1997 69.772 4526235 3645.379572 +Jordan Asia 2002 71.263 5307470 3844.917194 +Jordan Asia 2007 72.535 6053193 4519.461171 +Kenya Africa 1952 42.27 6464046 853.540919 +Kenya Africa 1957 44.686 7454779 944.4383152 +Kenya Africa 1962 47.949 8678557 896.9663732 +Kenya Africa 1967 50.654 10191512 1056.736457 +Kenya Africa 1972 53.559 12044785 1222.359968 +Kenya Africa 1977 56.155 14500404 1267.613204 +Kenya Africa 1982 58.766 17661452 1348.225791 +Kenya Africa 1987 59.339 21198082 1361.936856 +Kenya Africa 1992 59.285 25020539 1341.921721 +Kenya Africa 1997 54.407 28263827 1360.485021 +Kenya Africa 2002 50.992 31386842 1287.514732 +Kenya Africa 2007 54.11 35610177 1463.249282 +Korea, Dem. Rep. Asia 1952 50.056 8865488 1088.277758 +Korea, Dem. Rep. Asia 1957 54.081 9411381 1571.134655 +Korea, Dem. Rep. Asia 1962 56.656 10917494 1621.693598 +Korea, Dem. Rep. Asia 1967 59.942 12617009 2143.540609 +Korea, Dem. Rep. Asia 1972 63.983 14781241 3701.621503 +Korea, Dem. Rep. Asia 1977 67.159 16325320 4106.301249 +Korea, Dem. Rep. Asia 1982 69.1 17647518 4106.525293 +Korea, Dem. Rep. Asia 1987 70.647 19067554 4106.492315 +Korea, Dem. Rep. Asia 1992 69.978 20711375 3726.063507 +Korea, Dem. Rep. Asia 1997 67.727 21585105 1690.756814 +Korea, Dem. Rep. Asia 2002 66.662 22215365 1646.758151 +Korea, Dem. Rep. Asia 2007 67.297 23301725 1593.06548 +Korea, Rep. Asia 1952 47.453 20947571 1030.592226 +Korea, Rep. Asia 1957 52.681 22611552 1487.593537 +Korea, Rep. Asia 1962 55.292 26420307 1536.344387 +Korea, Rep. Asia 1967 57.716 30131000 2029.228142 +Korea, Rep. Asia 1972 62.612 33505000 3030.87665 +Korea, Rep. Asia 1977 64.766 36436000 4657.22102 +Korea, Rep. Asia 1982 67.123 39326000 5622.942464 +Korea, Rep. Asia 1987 69.81 41622000 8533.088805 +Korea, Rep. Asia 1992 72.244 43805450 12104.27872 +Korea, Rep. Asia 1997 74.647 46173816 15993.52796 +Korea, Rep. Asia 2002 77.045 47969150 19233.98818 +Korea, Rep. Asia 2007 78.623 49044790 23348.13973 +Kuwait Asia 1952 55.565 160000 108382.3529 +Kuwait Asia 1957 58.033 212846 113523.1329 +Kuwait Asia 1962 60.47 358266 95458.11176 +Kuwait Asia 1967 64.624 575003 80894.88326 +Kuwait Asia 1972 67.712 841934 109347.867 +Kuwait Asia 1977 69.343 1140357 59265.47714 +Kuwait Asia 1982 71.309 1497494 31354.03573 +Kuwait Asia 1987 74.174 1891487 28118.42998 +Kuwait Asia 1992 75.19 1418095 34932.91959 +Kuwait Asia 1997 76.156 1765345 40300.61996 +Kuwait Asia 2002 76.904 2111561 35110.10566 +Kuwait Asia 2007 77.588 2505559 47306.98978 +Lebanon Asia 1952 55.928 1439529 4834.804067 +Lebanon Asia 1957 59.489 1647412 6089.786934 +Lebanon Asia 1962 62.094 1886848 5714.560611 +Lebanon Asia 1967 63.87 2186894 6006.983042 +Lebanon Asia 1972 65.421 2680018 7486.384341 +Lebanon Asia 1977 66.099 3115787 8659.696836 +Lebanon Asia 1982 66.983 3086876 7640.519521 +Lebanon Asia 1987 67.926 3089353 5377.091329 +Lebanon Asia 1992 69.292 3219994 6890.806854 +Lebanon Asia 1997 70.265 3430388 8754.96385 +Lebanon Asia 2002 71.028 3677780 9313.93883 +Lebanon Asia 2007 71.993 3921278 10461.05868 +Lesotho Africa 1952 42.138 748747 298.8462121 +Lesotho Africa 1957 45.047 813338 335.9971151 +Lesotho Africa 1962 47.747 893143 411.8006266 +Lesotho Africa 1967 48.492 996380 498.6390265 +Lesotho Africa 1972 49.767 1116779 496.5815922 +Lesotho Africa 1977 52.208 1251524 745.3695408 +Lesotho Africa 1982 55.078 1411807 797.2631074 +Lesotho Africa 1987 57.18 1599200 773.9932141 +Lesotho Africa 1992 59.685 1803195 977.4862725 +Lesotho Africa 1997 55.558 1982823 1186.147994 +Lesotho Africa 2002 44.593 2046772 1275.184575 +Lesotho Africa 2007 42.592 2012649 1569.331442 +Liberia Africa 1952 38.48 863308 575.5729961 +Liberia Africa 1957 39.486 975950 620.9699901 +Liberia Africa 1962 40.502 1112796 634.1951625 +Liberia Africa 1967 41.536 1279406 713.6036483 +Liberia Africa 1972 42.614 1482628 803.0054535 +Liberia Africa 1977 43.764 1703617 640.3224383 +Liberia Africa 1982 44.852 1956875 572.1995694 +Liberia Africa 1987 46.027 2269414 506.1138573 +Liberia Africa 1992 40.802 1912974 636.6229191 +Liberia Africa 1997 42.221 2200725 609.1739508 +Liberia Africa 2002 43.753 2814651 531.4823679 +Liberia Africa 2007 45.678 3193942 414.5073415 +Libya Africa 1952 42.723 1019729 2387.54806 +Libya Africa 1957 45.289 1201578 3448.284395 +Libya Africa 1962 47.808 1441863 6757.030816 +Libya Africa 1967 50.227 1759224 18772.75169 +Libya Africa 1972 52.773 2183877 21011.49721 +Libya Africa 1977 57.442 2721783 21951.21176 +Libya Africa 1982 62.155 3344074 17364.27538 +Libya Africa 1987 66.234 3799845 11770.5898 +Libya Africa 1992 68.755 4364501 9640.138501 +Libya Africa 1997 71.555 4759670 9467.446056 +Libya Africa 2002 72.737 5368585 9534.677467 +Libya Africa 2007 73.952 6036914 12057.49928 +Madagascar Africa 1952 36.681 4762912 1443.011715 +Madagascar Africa 1957 38.865 5181679 1589.20275 +Madagascar Africa 1962 40.848 5703324 1643.38711 +Madagascar Africa 1967 42.881 6334556 1634.047282 +Madagascar Africa 1972 44.851 7082430 1748.562982 +Madagascar Africa 1977 46.881 8007166 1544.228586 +Madagascar Africa 1982 48.969 9171477 1302.878658 +Madagascar Africa 1987 49.35 10568642 1155.441948 +Madagascar Africa 1992 52.214 12210395 1040.67619 +Madagascar Africa 1997 54.978 14165114 986.2958956 +Madagascar Africa 2002 57.286 16473477 894.6370822 +Madagascar Africa 2007 59.443 19167654 1044.770126 +Malawi Africa 1952 36.256 2917802 369.1650802 +Malawi Africa 1957 37.207 3221238 416.3698064 +Malawi Africa 1962 38.41 3628608 427.9010856 +Malawi Africa 1967 39.487 4147252 495.5147806 +Malawi Africa 1972 41.766 4730997 584.6219709 +Malawi Africa 1977 43.767 5637246 663.2236766 +Malawi Africa 1982 45.642 6502825 632.8039209 +Malawi Africa 1987 47.457 7824747 635.5173634 +Malawi Africa 1992 49.42 10014249 563.2000145 +Malawi Africa 1997 47.495 10419991 692.2758103 +Malawi Africa 2002 45.009 11824495 665.4231186 +Malawi Africa 2007 48.303 13327079 759.3499101 +Malaysia Asia 1952 48.463 6748378 1831.132894 +Malaysia Asia 1957 52.102 7739235 1810.066992 +Malaysia Asia 1962 55.737 8906385 2036.884944 +Malaysia Asia 1967 59.371 10154878 2277.742396 +Malaysia Asia 1972 63.01 11441462 2849.09478 +Malaysia Asia 1977 65.256 12845381 3827.921571 +Malaysia Asia 1982 68 14441916 4920.355951 +Malaysia Asia 1987 69.5 16331785 5249.802653 +Malaysia Asia 1992 70.693 18319502 7277.912802 +Malaysia Asia 1997 71.938 20476091 10132.90964 +Malaysia Asia 2002 73.044 22662365 10206.97794 +Malaysia Asia 2007 74.241 24821286 12451.6558 +Mali Africa 1952 33.685 3838168 452.3369807 +Mali Africa 1957 35.307 4241884 490.3821867 +Mali Africa 1962 36.936 4690372 496.1743428 +Mali Africa 1967 38.487 5212416 545.0098873 +Mali Africa 1972 39.977 5828158 581.3688761 +Mali Africa 1977 41.714 6491649 686.3952693 +Mali Africa 1982 43.916 6998256 618.0140641 +Mali Africa 1987 46.364 7634008 684.1715576 +Mali Africa 1992 48.388 8416215 739.014375 +Mali Africa 1997 49.903 9384984 790.2579846 +Mali Africa 2002 51.818 10580176 951.4097518 +Mali Africa 2007 54.467 12031795 1042.581557 +Mauritania Africa 1952 40.543 1022556 743.1159097 +Mauritania Africa 1957 42.338 1076852 846.1202613 +Mauritania Africa 1962 44.248 1146757 1055.896036 +Mauritania Africa 1967 46.289 1230542 1421.145193 +Mauritania Africa 1972 48.437 1332786 1586.851781 +Mauritania Africa 1977 50.852 1456688 1497.492223 +Mauritania Africa 1982 53.599 1622136 1481.150189 +Mauritania Africa 1987 56.145 1841240 1421.603576 +Mauritania Africa 1992 58.333 2119465 1361.369784 +Mauritania Africa 1997 60.43 2444741 1483.136136 +Mauritania Africa 2002 62.247 2828858 1579.019543 +Mauritania Africa 2007 64.164 3270065 1803.151496 +Mauritius Africa 1952 50.986 516556 1967.955707 +Mauritius Africa 1957 58.089 609816 2034.037981 +Mauritius Africa 1962 60.246 701016 2529.067487 +Mauritius Africa 1967 61.557 789309 2475.387562 +Mauritius Africa 1972 62.944 851334 2575.484158 +Mauritius Africa 1977 64.93 913025 3710.982963 +Mauritius Africa 1982 66.711 992040 3688.037739 +Mauritius Africa 1987 68.74 1042663 4783.586903 +Mauritius Africa 1992 69.745 1096202 6058.253846 +Mauritius Africa 1997 70.736 1149818 7425.705295 +Mauritius Africa 2002 71.954 1200206 9021.815894 +Mauritius Africa 2007 72.801 1250882 10956.99112 +Mexico Americas 1952 50.789 30144317 3478.125529 +Mexico Americas 1957 55.19 35015548 4131.546641 +Mexico Americas 1962 58.299 41121485 4581.609385 +Mexico Americas 1967 60.11 47995559 5754.733883 +Mexico Americas 1972 62.361 55984294 6809.40669 +Mexico Americas 1977 65.032 63759976 7674.929108 +Mexico Americas 1982 67.405 71640904 9611.147541 +Mexico Americas 1987 69.498 80122492 8688.156003 +Mexico Americas 1992 71.455 88111030 9472.384295 +Mexico Americas 1997 73.67 95895146 9767.29753 +Mexico Americas 2002 74.902 102479927 10742.44053 +Mexico Americas 2007 76.195 108700891 11977.57496 +Mongolia Asia 1952 42.244 800663 786.5668575 +Mongolia Asia 1957 45.248 882134 912.6626085 +Mongolia Asia 1962 48.251 1010280 1056.353958 +Mongolia Asia 1967 51.253 1149500 1226.04113 +Mongolia Asia 1972 53.754 1320500 1421.741975 +Mongolia Asia 1977 55.491 1528000 1647.511665 +Mongolia Asia 1982 57.489 1756032 2000.603139 +Mongolia Asia 1987 60.222 2015133 2338.008304 +Mongolia Asia 1992 61.271 2312802 1785.402016 +Mongolia Asia 1997 63.625 2494803 1902.2521 +Mongolia Asia 2002 65.033 2674234 2140.739323 +Mongolia Asia 2007 66.803 2874127 3095.772271 +Montenegro Europe 1952 59.164 413834 2647.585601 +Montenegro Europe 1957 61.448 442829 3682.259903 +Montenegro Europe 1962 63.728 474528 4649.593785 +Montenegro Europe 1967 67.178 501035 5907.850937 +Montenegro Europe 1972 70.636 527678 7778.414017 +Montenegro Europe 1977 73.066 560073 9595.929905 +Montenegro Europe 1982 74.101 562548 11222.58762 +Montenegro Europe 1987 74.865 569473 11732.51017 +Montenegro Europe 1992 75.435 621621 7003.339037 +Montenegro Europe 1997 75.445 692651 6465.613349 +Montenegro Europe 2002 73.981 720230 6557.194282 +Montenegro Europe 2007 74.543 684736 9253.896111 +Morocco Africa 1952 42.873 9939217 1688.20357 +Morocco Africa 1957 45.423 11406350 1642.002314 +Morocco Africa 1962 47.924 13056604 1566.353493 +Morocco Africa 1967 50.335 14770296 1711.04477 +Morocco Africa 1972 52.862 16660670 1930.194975 +Morocco Africa 1977 55.73 18396941 2370.619976 +Morocco Africa 1982 59.65 20198730 2702.620356 +Morocco Africa 1987 62.677 22987397 2755.046991 +Morocco Africa 1992 65.393 25798239 2948.047252 +Morocco Africa 1997 67.66 28529501 2982.101858 +Morocco Africa 2002 69.615 31167783 3258.495584 +Morocco Africa 2007 71.164 33757175 3820.17523 +Mozambique Africa 1952 31.286 6446316 468.5260381 +Mozambique Africa 1957 33.779 7038035 495.5868333 +Mozambique Africa 1962 36.161 7788944 556.6863539 +Mozambique Africa 1967 38.113 8680909 566.6691539 +Mozambique Africa 1972 40.328 9809596 724.9178037 +Mozambique Africa 1977 42.495 11127868 502.3197334 +Mozambique Africa 1982 42.795 12587223 462.2114149 +Mozambique Africa 1987 42.861 12891952 389.8761846 +Mozambique Africa 1992 44.284 13160731 410.8968239 +Mozambique Africa 1997 46.344 16603334 472.3460771 +Mozambique Africa 2002 44.026 18473780 633.6179466 +Mozambique Africa 2007 42.082 19951656 823.6856205 +Myanmar Asia 1952 36.319 20092996 331 +Myanmar Asia 1957 41.905 21731844 350 +Myanmar Asia 1962 45.108 23634436 388 +Myanmar Asia 1967 49.379 25870271 349 +Myanmar Asia 1972 53.07 28466390 357 +Myanmar Asia 1977 56.059 31528087 371 +Myanmar Asia 1982 58.056 34680442 424 +Myanmar Asia 1987 58.339 38028578 385 +Myanmar Asia 1992 59.32 40546538 347 +Myanmar Asia 1997 60.328 43247867 415 +Myanmar Asia 2002 59.908 45598081 611 +Myanmar Asia 2007 62.069 47761980 944 +Namibia Africa 1952 41.725 485831 2423.780443 +Namibia Africa 1957 45.226 548080 2621.448058 +Namibia Africa 1962 48.386 621392 3173.215595 +Namibia Africa 1967 51.159 706640 3793.694753 +Namibia Africa 1972 53.867 821782 3746.080948 +Namibia Africa 1977 56.437 977026 3876.485958 +Namibia Africa 1982 58.968 1099010 4191.100511 +Namibia Africa 1987 60.835 1278184 3693.731337 +Namibia Africa 1992 61.999 1554253 3804.537999 +Namibia Africa 1997 58.909 1774766 3899.52426 +Namibia Africa 2002 51.479 1972153 4072.324751 +Namibia Africa 2007 52.906 2055080 4811.060429 +Nepal Asia 1952 36.157 9182536 545.8657229 +Nepal Asia 1957 37.686 9682338 597.9363558 +Nepal Asia 1962 39.393 10332057 652.3968593 +Nepal Asia 1967 41.472 11261690 676.4422254 +Nepal Asia 1972 43.971 12412593 674.7881296 +Nepal Asia 1977 46.748 13933198 694.1124398 +Nepal Asia 1982 49.594 15796314 718.3730947 +Nepal Asia 1987 52.537 17917180 775.6324501 +Nepal Asia 1992 55.727 20326209 897.7403604 +Nepal Asia 1997 59.426 23001113 1010.892138 +Nepal Asia 2002 61.34 25873917 1057.206311 +Nepal Asia 2007 63.785 28901790 1091.359778 +Netherlands Europe 1952 72.13 10381988 8941.571858 +Netherlands Europe 1957 72.99 11026383 11276.19344 +Netherlands Europe 1962 73.23 11805689 12790.84956 +Netherlands Europe 1967 73.82 12596822 15363.25136 +Netherlands Europe 1972 73.75 13329874 18794.74567 +Netherlands Europe 1977 75.24 13852989 21209.0592 +Netherlands Europe 1982 76.05 14310401 21399.46046 +Netherlands Europe 1987 76.83 14665278 23651.32361 +Netherlands Europe 1992 77.42 15174244 26790.94961 +Netherlands Europe 1997 78.03 15604464 30246.13063 +Netherlands Europe 2002 78.53 16122830 33724.75778 +Netherlands Europe 2007 79.762 16570613 36797.93332 +New Zealand Oceania 1952 69.39 1994794 10556.57566 +New Zealand Oceania 1957 70.26 2229407 12247.39532 +New Zealand Oceania 1962 71.24 2488550 13175.678 +New Zealand Oceania 1967 71.52 2728150 14463.91893 +New Zealand Oceania 1972 71.89 2929100 16046.03728 +New Zealand Oceania 1977 72.22 3164900 16233.7177 +New Zealand Oceania 1982 73.84 3210650 17632.4104 +New Zealand Oceania 1987 74.32 3317166 19007.19129 +New Zealand Oceania 1992 76.33 3437674 18363.32494 +New Zealand Oceania 1997 77.55 3676187 21050.41377 +New Zealand Oceania 2002 79.11 3908037 23189.80135 +New Zealand Oceania 2007 80.204 4115771 25185.00911 +Nicaragua Americas 1952 42.314 1165790 3112.363948 +Nicaragua Americas 1957 45.432 1358828 3457.415947 +Nicaragua Americas 1962 48.632 1590597 3634.364406 +Nicaragua Americas 1967 51.884 1865490 4643.393534 +Nicaragua Americas 1972 55.151 2182908 4688.593267 +Nicaragua Americas 1977 57.47 2554598 5486.371089 +Nicaragua Americas 1982 59.298 2979423 3470.338156 +Nicaragua Americas 1987 62.008 3344353 2955.984375 +Nicaragua Americas 1992 65.843 4017939 2170.151724 +Nicaragua Americas 1997 68.426 4609572 2253.023004 +Nicaragua Americas 2002 70.836 5146848 2474.548819 +Nicaragua Americas 2007 72.899 5675356 2749.320965 +Niger Africa 1952 37.444 3379468 761.879376 +Niger Africa 1957 38.598 3692184 835.5234025 +Niger Africa 1962 39.487 4076008 997.7661127 +Niger Africa 1967 40.118 4534062 1054.384891 +Niger Africa 1972 40.546 5060262 954.2092363 +Niger Africa 1977 41.291 5682086 808.8970728 +Niger Africa 1982 42.598 6437188 909.7221354 +Niger Africa 1987 44.555 7332638 668.3000228 +Niger Africa 1992 47.391 8392818 581.182725 +Niger Africa 1997 51.313 9666252 580.3052092 +Niger Africa 2002 54.496 11140655 601.0745012 +Niger Africa 2007 56.867 12894865 619.6768924 +Nigeria Africa 1952 36.324 33119096 1077.281856 +Nigeria Africa 1957 37.802 37173340 1100.592563 +Nigeria Africa 1962 39.36 41871351 1150.927478 +Nigeria Africa 1967 41.04 47287752 1014.514104 +Nigeria Africa 1972 42.821 53740085 1698.388838 +Nigeria Africa 1977 44.514 62209173 1981.951806 +Nigeria Africa 1982 45.826 73039376 1576.97375 +Nigeria Africa 1987 46.886 81551520 1385.029563 +Nigeria Africa 1992 47.472 93364244 1619.848217 +Nigeria Africa 1997 47.464 106207839 1624.941275 +Nigeria Africa 2002 46.608 119901274 1615.286395 +Nigeria Africa 2007 46.859 135031164 2013.977305 +Norway Europe 1952 72.67 3327728 10095.42172 +Norway Europe 1957 73.44 3491938 11653.97304 +Norway Europe 1962 73.47 3638919 13450.40151 +Norway Europe 1967 74.08 3786019 16361.87647 +Norway Europe 1972 74.34 3933004 18965.05551 +Norway Europe 1977 75.37 4043205 23311.34939 +Norway Europe 1982 75.97 4114787 26298.63531 +Norway Europe 1987 75.89 4186147 31540.9748 +Norway Europe 1992 77.32 4286357 33965.66115 +Norway Europe 1997 78.32 4405672 41283.16433 +Norway Europe 2002 79.05 4535591 44683.97525 +Norway Europe 2007 80.196 4627926 49357.19017 +Oman Asia 1952 37.578 507833 1828.230307 +Oman Asia 1957 40.08 561977 2242.746551 +Oman Asia 1962 43.165 628164 2924.638113 +Oman Asia 1967 46.988 714775 4720.942687 +Oman Asia 1972 52.143 829050 10618.03855 +Oman Asia 1977 57.367 1004533 11848.34392 +Oman Asia 1982 62.728 1301048 12954.79101 +Oman Asia 1987 67.734 1593882 18115.22313 +Oman Asia 1992 71.197 1915208 18616.70691 +Oman Asia 1997 72.499 2283635 19702.05581 +Oman Asia 2002 74.193 2713462 19774.83687 +Oman Asia 2007 75.64 3204897 22316.19287 +Pakistan Asia 1952 43.436 41346560 684.5971438 +Pakistan Asia 1957 45.557 46679944 747.0835292 +Pakistan Asia 1962 47.67 53100671 803.3427418 +Pakistan Asia 1967 49.8 60641899 942.4082588 +Pakistan Asia 1972 51.929 69325921 1049.938981 +Pakistan Asia 1977 54.043 78152686 1175.921193 +Pakistan Asia 1982 56.158 91462088 1443.429832 +Pakistan Asia 1987 58.245 105186881 1704.686583 +Pakistan Asia 1992 60.838 120065004 1971.829464 +Pakistan Asia 1997 61.818 135564834 2049.350521 +Pakistan Asia 2002 63.61 153403524 2092.712441 +Pakistan Asia 2007 65.483 169270617 2605.94758 +Panama Americas 1952 55.191 940080 2480.380334 +Panama Americas 1957 59.201 1063506 2961.800905 +Panama Americas 1962 61.817 1215725 3536.540301 +Panama Americas 1967 64.071 1405486 4421.009084 +Panama Americas 1972 66.216 1616384 5364.249663 +Panama Americas 1977 68.681 1839782 5351.912144 +Panama Americas 1982 70.472 2036305 7009.601598 +Panama Americas 1987 71.523 2253639 7034.779161 +Panama Americas 1992 72.462 2484997 6618.74305 +Panama Americas 1997 73.738 2734531 7113.692252 +Panama Americas 2002 74.712 2990875 7356.031934 +Panama Americas 2007 75.537 3242173 9809.185636 +Paraguay Americas 1952 62.649 1555876 1952.308701 +Paraguay Americas 1957 63.196 1770902 2046.154706 +Paraguay Americas 1962 64.361 2009813 2148.027146 +Paraguay Americas 1967 64.951 2287985 2299.376311 +Paraguay Americas 1972 65.815 2614104 2523.337977 +Paraguay Americas 1977 66.353 2984494 3248.373311 +Paraguay Americas 1982 66.874 3366439 4258.503604 +Paraguay Americas 1987 67.378 3886512 3998.875695 +Paraguay Americas 1992 68.225 4483945 4196.411078 +Paraguay Americas 1997 69.4 5154123 4247.400261 +Paraguay Americas 2002 70.755 5884491 3783.674243 +Paraguay Americas 2007 71.752 6667147 4172.838464 +Peru Americas 1952 43.902 8025700 3758.523437 +Peru Americas 1957 46.263 9146100 4245.256698 +Peru Americas 1962 49.096 10516500 4957.037982 +Peru Americas 1967 51.445 12132200 5788.09333 +Peru Americas 1972 55.448 13954700 5937.827283 +Peru Americas 1977 58.447 15990099 6281.290855 +Peru Americas 1982 61.406 18125129 6434.501797 +Peru Americas 1987 64.134 20195924 6360.943444 +Peru Americas 1992 66.458 22430449 4446.380924 +Peru Americas 1997 68.386 24748122 5838.347657 +Peru Americas 2002 69.906 26769436 5909.020073 +Peru Americas 2007 71.421 28674757 7408.905561 +Philippines Asia 1952 47.752 22438691 1272.880995 +Philippines Asia 1957 51.334 26072194 1547.944844 +Philippines Asia 1962 54.757 30325264 1649.552153 +Philippines Asia 1967 56.393 35356600 1814.12743 +Philippines Asia 1972 58.065 40850141 1989.37407 +Philippines Asia 1977 60.06 46850962 2373.204287 +Philippines Asia 1982 62.082 53456774 2603.273765 +Philippines Asia 1987 64.151 60017788 2189.634995 +Philippines Asia 1992 66.458 67185766 2279.324017 +Philippines Asia 1997 68.564 75012988 2536.534925 +Philippines Asia 2002 70.303 82995088 2650.921068 +Philippines Asia 2007 71.688 91077287 3190.481016 +Poland Europe 1952 61.31 25730551 4029.329699 +Poland Europe 1957 65.77 28235346 4734.253019 +Poland Europe 1962 67.64 30329617 5338.752143 +Poland Europe 1967 69.61 31785378 6557.152776 +Poland Europe 1972 70.85 33039545 8006.506993 +Poland Europe 1977 70.67 34621254 9508.141454 +Poland Europe 1982 71.32 36227381 8451.531004 +Poland Europe 1987 70.98 37740710 9082.351172 +Poland Europe 1992 70.99 38370697 7738.881247 +Poland Europe 1997 72.75 38654957 10159.58368 +Poland Europe 2002 74.67 38625976 12002.23908 +Poland Europe 2007 75.563 38518241 15389.92468 +Portugal Europe 1952 59.82 8526050 3068.319867 +Portugal Europe 1957 61.51 8817650 3774.571743 +Portugal Europe 1962 64.39 9019800 4727.954889 +Portugal Europe 1967 66.6 9103000 6361.517993 +Portugal Europe 1972 69.26 8970450 9022.247417 +Portugal Europe 1977 70.41 9662600 10172.48572 +Portugal Europe 1982 72.77 9859650 11753.84291 +Portugal Europe 1987 74.06 9915289 13039.30876 +Portugal Europe 1992 74.86 9927680 16207.26663 +Portugal Europe 1997 75.97 10156415 17641.03156 +Portugal Europe 2002 77.29 10433867 19970.90787 +Portugal Europe 2007 78.098 10642836 20509.64777 +Puerto Rico Americas 1952 64.28 2227000 3081.959785 +Puerto Rico Americas 1957 68.54 2260000 3907.156189 +Puerto Rico Americas 1962 69.62 2448046 5108.34463 +Puerto Rico Americas 1967 71.1 2648961 6929.277714 +Puerto Rico Americas 1972 72.16 2847132 9123.041742 +Puerto Rico Americas 1977 73.44 3080828 9770.524921 +Puerto Rico Americas 1982 73.75 3279001 10330.98915 +Puerto Rico Americas 1987 74.63 3444468 12281.34191 +Puerto Rico Americas 1992 73.911 3585176 14641.58711 +Puerto Rico Americas 1997 74.917 3759430 16999.4333 +Puerto Rico Americas 2002 77.778 3859606 18855.60618 +Puerto Rico Americas 2007 78.746 3942491 19328.70901 +Reunion Africa 1952 52.724 257700 2718.885295 +Reunion Africa 1957 55.09 308700 2769.451844 +Reunion Africa 1962 57.666 358900 3173.72334 +Reunion Africa 1967 60.542 414024 4021.175739 +Reunion Africa 1972 64.274 461633 5047.658563 +Reunion Africa 1977 67.064 492095 4319.804067 +Reunion Africa 1982 69.885 517810 5267.219353 +Reunion Africa 1987 71.913 562035 5303.377488 +Reunion Africa 1992 73.615 622191 6101.255823 +Reunion Africa 1997 74.772 684810 6071.941411 +Reunion Africa 2002 75.744 743981 6316.1652 +Reunion Africa 2007 76.442 798094 7670.122558 +Romania Europe 1952 61.05 16630000 3144.613186 +Romania Europe 1957 64.1 17829327 3943.370225 +Romania Europe 1962 66.8 18680721 4734.997586 +Romania Europe 1967 66.8 19284814 6470.866545 +Romania Europe 1972 69.21 20662648 8011.414402 +Romania Europe 1977 69.46 21658597 9356.39724 +Romania Europe 1982 69.66 22356726 9605.314053 +Romania Europe 1987 69.53 22686371 9696.273295 +Romania Europe 1992 69.36 22797027 6598.409903 +Romania Europe 1997 69.72 22562458 7346.547557 +Romania Europe 2002 71.322 22404337 7885.360081 +Romania Europe 2007 72.476 22276056 10808.47561 +Rwanda Africa 1952 40 2534927 493.3238752 +Rwanda Africa 1957 41.5 2822082 540.2893983 +Rwanda Africa 1962 43 3051242 597.4730727 +Rwanda Africa 1967 44.1 3451079 510.9637142 +Rwanda Africa 1972 44.6 3992121 590.5806638 +Rwanda Africa 1977 45 4657072 670.0806011 +Rwanda Africa 1982 46.218 5507565 881.5706467 +Rwanda Africa 1987 44.02 6349365 847.991217 +Rwanda Africa 1992 23.599 7290203 737.0685949 +Rwanda Africa 1997 36.087 7212583 589.9445051 +Rwanda Africa 2002 43.413 7852401 785.6537648 +Rwanda Africa 2007 46.242 8860588 863.0884639 +Sao Tome and Principe Africa 1952 46.471 60011 879.5835855 +Sao Tome and Principe Africa 1957 48.945 61325 860.7369026 +Sao Tome and Principe Africa 1962 51.893 65345 1071.551119 +Sao Tome and Principe Africa 1967 54.425 70787 1384.840593 +Sao Tome and Principe Africa 1972 56.48 76595 1532.985254 +Sao Tome and Principe Africa 1977 58.55 86796 1737.561657 +Sao Tome and Principe Africa 1982 60.351 98593 1890.218117 +Sao Tome and Principe Africa 1987 61.728 110812 1516.525457 +Sao Tome and Principe Africa 1992 62.742 125911 1428.777814 +Sao Tome and Principe Africa 1997 63.306 145608 1339.076036 +Sao Tome and Principe Africa 2002 64.337 170372 1353.09239 +Sao Tome and Principe Africa 2007 65.528 199579 1598.435089 +Saudi Arabia Asia 1952 39.875 4005677 6459.554823 +Saudi Arabia Asia 1957 42.868 4419650 8157.591248 +Saudi Arabia Asia 1962 45.914 4943029 11626.41975 +Saudi Arabia Asia 1967 49.901 5618198 16903.04886 +Saudi Arabia Asia 1972 53.886 6472756 24837.42865 +Saudi Arabia Asia 1977 58.69 8128505 34167.7626 +Saudi Arabia Asia 1982 63.012 11254672 33693.17525 +Saudi Arabia Asia 1987 66.295 14619745 21198.26136 +Saudi Arabia Asia 1992 68.768 16945857 24841.61777 +Saudi Arabia Asia 1997 70.533 21229759 20586.69019 +Saudi Arabia Asia 2002 71.626 24501530 19014.54118 +Saudi Arabia Asia 2007 72.777 27601038 21654.83194 +Senegal Africa 1952 37.278 2755589 1450.356983 +Senegal Africa 1957 39.329 3054547 1567.653006 +Senegal Africa 1962 41.454 3430243 1654.988723 +Senegal Africa 1967 43.563 3965841 1612.404632 +Senegal Africa 1972 45.815 4588696 1597.712056 +Senegal Africa 1977 48.879 5260855 1561.769116 +Senegal Africa 1982 52.379 6147783 1518.479984 +Senegal Africa 1987 55.769 7171347 1441.72072 +Senegal Africa 1992 58.196 8307920 1367.899369 +Senegal Africa 1997 60.187 9535314 1392.368347 +Senegal Africa 2002 61.6 10870037 1519.635262 +Senegal Africa 2007 63.062 12267493 1712.472136 +Serbia Europe 1952 57.996 6860147 3581.459448 +Serbia Europe 1957 61.685 7271135 4981.090891 +Serbia Europe 1962 64.531 7616060 6289.629157 +Serbia Europe 1967 66.914 7971222 7991.707066 +Serbia Europe 1972 68.7 8313288 10522.06749 +Serbia Europe 1977 70.3 8686367 12980.66956 +Serbia Europe 1982 70.162 9032824 15181.0927 +Serbia Europe 1987 71.218 9230783 15870.87851 +Serbia Europe 1992 71.659 9826397 9325.068238 +Serbia Europe 1997 72.232 10336594 7914.320304 +Serbia Europe 2002 73.213 10111559 7236.075251 +Serbia Europe 2007 74.002 10150265 9786.534714 +Sierra Leone Africa 1952 30.331 2143249 879.7877358 +Sierra Leone Africa 1957 31.57 2295678 1004.484437 +Sierra Leone Africa 1962 32.767 2467895 1116.639877 +Sierra Leone Africa 1967 34.113 2662190 1206.043465 +Sierra Leone Africa 1972 35.4 2879013 1353.759762 +Sierra Leone Africa 1977 36.788 3140897 1348.285159 +Sierra Leone Africa 1982 38.445 3464522 1465.010784 +Sierra Leone Africa 1987 40.006 3868905 1294.447788 +Sierra Leone Africa 1992 38.333 4260884 1068.696278 +Sierra Leone Africa 1997 39.897 4578212 574.6481576 +Sierra Leone Africa 2002 41.012 5359092 699.489713 +Sierra Leone Africa 2007 42.568 6144562 862.5407561 +Singapore Asia 1952 60.396 1127000 2315.138227 +Singapore Asia 1957 63.179 1445929 2843.104409 +Singapore Asia 1962 65.798 1750200 3674.735572 +Singapore Asia 1967 67.946 1977600 4977.41854 +Singapore Asia 1972 69.521 2152400 8597.756202 +Singapore Asia 1977 70.795 2325300 11210.08948 +Singapore Asia 1982 71.76 2651869 15169.16112 +Singapore Asia 1987 73.56 2794552 18861.53081 +Singapore Asia 1992 75.788 3235865 24769.8912 +Singapore Asia 1997 77.158 3802309 33519.4766 +Singapore Asia 2002 78.77 4197776 36023.1054 +Singapore Asia 2007 79.972 4553009 47143.17964 +Slovak Republic Europe 1952 64.36 3558137 5074.659104 +Slovak Republic Europe 1957 67.45 3844277 6093.26298 +Slovak Republic Europe 1962 70.33 4237384 7481.107598 +Slovak Republic Europe 1967 70.98 4442238 8412.902397 +Slovak Republic Europe 1972 70.35 4593433 9674.167626 +Slovak Republic Europe 1977 70.45 4827803 10922.66404 +Slovak Republic Europe 1982 70.8 5048043 11348.54585 +Slovak Republic Europe 1987 71.08 5199318 12037.26758 +Slovak Republic Europe 1992 71.38 5302888 9498.467723 +Slovak Republic Europe 1997 72.71 5383010 12126.23065 +Slovak Republic Europe 2002 73.8 5410052 13638.77837 +Slovak Republic Europe 2007 74.663 5447502 18678.31435 +Slovenia Europe 1952 65.57 1489518 4215.041741 +Slovenia Europe 1957 67.85 1533070 5862.276629 +Slovenia Europe 1962 69.15 1582962 7402.303395 +Slovenia Europe 1967 69.18 1646912 9405.489397 +Slovenia Europe 1972 69.82 1694510 12383.4862 +Slovenia Europe 1977 70.97 1746919 15277.03017 +Slovenia Europe 1982 71.063 1861252 17866.72175 +Slovenia Europe 1987 72.25 1945870 18678.53492 +Slovenia Europe 1992 73.64 1999210 14214.71681 +Slovenia Europe 1997 75.13 2011612 17161.10735 +Slovenia Europe 2002 76.66 2011497 20660.01936 +Slovenia Europe 2007 77.926 2009245 25768.25759 +Somalia Africa 1952 32.978 2526994 1135.749842 +Somalia Africa 1957 34.977 2780415 1258.147413 +Somalia Africa 1962 36.981 3080153 1369.488336 +Somalia Africa 1967 38.977 3428839 1284.73318 +Somalia Africa 1972 40.973 3840161 1254.576127 +Somalia Africa 1977 41.974 4353666 1450.992513 +Somalia Africa 1982 42.955 5828892 1176.807031 +Somalia Africa 1987 44.501 6921858 1093.244963 +Somalia Africa 1992 39.658 6099799 926.9602964 +Somalia Africa 1997 43.795 6633514 930.5964284 +Somalia Africa 2002 45.936 7753310 882.0818218 +Somalia Africa 2007 48.159 9118773 926.1410683 +South Africa Africa 1952 45.009 14264935 4725.295531 +South Africa Africa 1957 47.985 16151549 5487.104219 +South Africa Africa 1962 49.951 18356657 5768.729717 +South Africa Africa 1967 51.927 20997321 7114.477971 +South Africa Africa 1972 53.696 23935810 7765.962636 +South Africa Africa 1977 55.527 27129932 8028.651439 +South Africa Africa 1982 58.161 31140029 8568.266228 +South Africa Africa 1987 60.834 35933379 7825.823398 +South Africa Africa 1992 61.888 39964159 7225.069258 +South Africa Africa 1997 60.236 42835005 7479.188244 +South Africa Africa 2002 53.365 44433622 7710.946444 +South Africa Africa 2007 49.339 43997828 9269.657808 +Spain Europe 1952 64.94 28549870 3834.034742 +Spain Europe 1957 66.66 29841614 4564.80241 +Spain Europe 1962 69.69 31158061 5693.843879 +Spain Europe 1967 71.44 32850275 7993.512294 +Spain Europe 1972 73.06 34513161 10638.75131 +Spain Europe 1977 74.39 36439000 13236.92117 +Spain Europe 1982 76.3 37983310 13926.16997 +Spain Europe 1987 76.9 38880702 15764.98313 +Spain Europe 1992 77.57 39549438 18603.06452 +Spain Europe 1997 78.77 39855442 20445.29896 +Spain Europe 2002 79.78 40152517 24835.47166 +Spain Europe 2007 80.941 40448191 28821.0637 +Sri Lanka Asia 1952 57.593 7982342 1083.53203 +Sri Lanka Asia 1957 61.456 9128546 1072.546602 +Sri Lanka Asia 1962 62.192 10421936 1074.47196 +Sri Lanka Asia 1967 64.266 11737396 1135.514326 +Sri Lanka Asia 1972 65.042 13016733 1213.39553 +Sri Lanka Asia 1977 65.949 14116836 1348.775651 +Sri Lanka Asia 1982 68.757 15410151 1648.079789 +Sri Lanka Asia 1987 69.011 16495304 1876.766827 +Sri Lanka Asia 1992 70.379 17587060 2153.739222 +Sri Lanka Asia 1997 70.457 18698655 2664.477257 +Sri Lanka Asia 2002 70.815 19576783 3015.378833 +Sri Lanka Asia 2007 72.396 20378239 3970.095407 +Sudan Africa 1952 38.635 8504667 1615.991129 +Sudan Africa 1957 39.624 9753392 1770.337074 +Sudan Africa 1962 40.87 11183227 1959.593767 +Sudan Africa 1967 42.858 12716129 1687.997641 +Sudan Africa 1972 45.083 14597019 1659.652775 +Sudan Africa 1977 47.8 17104986 2202.988423 +Sudan Africa 1982 50.338 20367053 1895.544073 +Sudan Africa 1987 51.744 24725960 1507.819159 +Sudan Africa 1992 53.556 28227588 1492.197043 +Sudan Africa 1997 55.373 32160729 1632.210764 +Sudan Africa 2002 56.369 37090298 1993.398314 +Sudan Africa 2007 58.556 42292929 2602.394995 +Swaziland Africa 1952 41.407 290243 1148.376626 +Swaziland Africa 1957 43.424 326741 1244.708364 +Swaziland Africa 1962 44.992 370006 1856.182125 +Swaziland Africa 1967 46.633 420690 2613.101665 +Swaziland Africa 1972 49.552 480105 3364.836625 +Swaziland Africa 1977 52.537 551425 3781.410618 +Swaziland Africa 1982 55.561 649901 3895.384018 +Swaziland Africa 1987 57.678 779348 3984.839812 +Swaziland Africa 1992 58.474 962344 3553.0224 +Swaziland Africa 1997 54.289 1054486 3876.76846 +Swaziland Africa 2002 43.869 1130269 4128.116943 +Swaziland Africa 2007 39.613 1133066 4513.480643 +Sweden Europe 1952 71.86 7124673 8527.844662 +Sweden Europe 1957 72.49 7363802 9911.878226 +Sweden Europe 1962 73.37 7561588 12329.44192 +Sweden Europe 1967 74.16 7867931 15258.29697 +Sweden Europe 1972 74.72 8122293 17832.02464 +Sweden Europe 1977 75.44 8251648 18855.72521 +Sweden Europe 1982 76.42 8325260 20667.38125 +Sweden Europe 1987 77.19 8421403 23586.92927 +Sweden Europe 1992 78.16 8718867 23880.01683 +Sweden Europe 1997 79.39 8897619 25266.59499 +Sweden Europe 2002 80.04 8954175 29341.63093 +Sweden Europe 2007 80.884 9031088 33859.74835 +Switzerland Europe 1952 69.62 4815000 14734.23275 +Switzerland Europe 1957 70.56 5126000 17909.48973 +Switzerland Europe 1962 71.32 5666000 20431.0927 +Switzerland Europe 1967 72.77 6063000 22966.14432 +Switzerland Europe 1972 73.78 6401400 27195.11304 +Switzerland Europe 1977 75.39 6316424 26982.29052 +Switzerland Europe 1982 76.21 6468126 28397.71512 +Switzerland Europe 1987 77.41 6649942 30281.70459 +Switzerland Europe 1992 78.03 6995447 31871.5303 +Switzerland Europe 1997 79.37 7193761 32135.32301 +Switzerland Europe 2002 80.62 7361757 34480.95771 +Switzerland Europe 2007 81.701 7554661 37506.41907 +Syria Asia 1952 45.883 3661549 1643.485354 +Syria Asia 1957 48.284 4149908 2117.234893 +Syria Asia 1962 50.305 4834621 2193.037133 +Syria Asia 1967 53.655 5680812 1881.923632 +Syria Asia 1972 57.296 6701172 2571.423014 +Syria Asia 1977 61.195 7932503 3195.484582 +Syria Asia 1982 64.59 9410494 3761.837715 +Syria Asia 1987 66.974 11242847 3116.774285 +Syria Asia 1992 69.249 13219062 3340.542768 +Syria Asia 1997 71.527 15081016 4014.238972 +Syria Asia 2002 73.053 17155814 4090.925331 +Syria Asia 2007 74.143 19314747 4184.548089 +Taiwan Asia 1952 58.5 8550362 1206.947913 +Taiwan Asia 1957 62.4 10164215 1507.86129 +Taiwan Asia 1962 65.2 11918938 1822.879028 +Taiwan Asia 1967 67.5 13648692 2643.858681 +Taiwan Asia 1972 69.39 15226039 4062.523897 +Taiwan Asia 1977 70.59 16785196 5596.519826 +Taiwan Asia 1982 72.16 18501390 7426.354774 +Taiwan Asia 1987 73.4 19757799 11054.56175 +Taiwan Asia 1992 74.26 20686918 15215.6579 +Taiwan Asia 1997 75.25 21628605 20206.82098 +Taiwan Asia 2002 76.99 22454239 23235.42329 +Taiwan Asia 2007 78.4 23174294 28718.27684 +Tanzania Africa 1952 41.215 8322925 716.6500721 +Tanzania Africa 1957 42.974 9452826 698.5356073 +Tanzania Africa 1962 44.246 10863958 722.0038073 +Tanzania Africa 1967 45.757 12607312 848.2186575 +Tanzania Africa 1972 47.62 14706593 915.9850592 +Tanzania Africa 1977 49.919 17129565 962.4922932 +Tanzania Africa 1982 50.608 19844382 874.2426069 +Tanzania Africa 1987 51.535 23040630 831.8220794 +Tanzania Africa 1992 50.44 26605473 825.682454 +Tanzania Africa 1997 48.466 30686889 789.1862231 +Tanzania Africa 2002 49.651 34593779 899.0742111 +Tanzania Africa 2007 52.517 38139640 1107.482182 +Thailand Asia 1952 50.848 21289402 757.7974177 +Thailand Asia 1957 53.63 25041917 793.5774148 +Thailand Asia 1962 56.061 29263397 1002.199172 +Thailand Asia 1967 58.285 34024249 1295.46066 +Thailand Asia 1972 60.405 39276153 1524.358936 +Thailand Asia 1977 62.494 44148285 1961.224635 +Thailand Asia 1982 64.597 48827160 2393.219781 +Thailand Asia 1987 66.084 52910342 2982.653773 +Thailand Asia 1992 67.298 56667095 4616.896545 +Thailand Asia 1997 67.521 60216677 5852.625497 +Thailand Asia 2002 68.564 62806748 5913.187529 +Thailand Asia 2007 70.616 65068149 7458.396327 +Togo Africa 1952 38.596 1219113 859.8086567 +Togo Africa 1957 41.208 1357445 925.9083202 +Togo Africa 1962 43.922 1528098 1067.53481 +Togo Africa 1967 46.769 1735550 1477.59676 +Togo Africa 1972 49.759 2056351 1649.660188 +Togo Africa 1977 52.887 2308582 1532.776998 +Togo Africa 1982 55.471 2644765 1344.577953 +Togo Africa 1987 56.941 3154264 1202.201361 +Togo Africa 1992 58.061 3747553 1034.298904 +Togo Africa 1997 58.39 4320890 982.2869243 +Togo Africa 2002 57.561 4977378 886.2205765 +Togo Africa 2007 58.42 5701579 882.9699438 +Trinidad and Tobago Americas 1952 59.1 662850 3023.271928 +Trinidad and Tobago Americas 1957 61.8 764900 4100.3934 +Trinidad and Tobago Americas 1962 64.9 887498 4997.523971 +Trinidad and Tobago Americas 1967 65.4 960155 5621.368472 +Trinidad and Tobago Americas 1972 65.9 975199 6619.551419 +Trinidad and Tobago Americas 1977 68.3 1039009 7899.554209 +Trinidad and Tobago Americas 1982 68.832 1116479 9119.528607 +Trinidad and Tobago Americas 1987 69.582 1191336 7388.597823 +Trinidad and Tobago Americas 1992 69.862 1183669 7370.990932 +Trinidad and Tobago Americas 1997 69.465 1138101 8792.573126 +Trinidad and Tobago Americas 2002 68.976 1101832 11460.60023 +Trinidad and Tobago Americas 2007 69.819 1056608 18008.50924 +Tunisia Africa 1952 44.6 3647735 1468.475631 +Tunisia Africa 1957 47.1 3950849 1395.232468 +Tunisia Africa 1962 49.579 4286552 1660.30321 +Tunisia Africa 1967 52.053 4786986 1932.360167 +Tunisia Africa 1972 55.602 5303507 2753.285994 +Tunisia Africa 1977 59.837 6005061 3120.876811 +Tunisia Africa 1982 64.048 6734098 3560.233174 +Tunisia Africa 1987 66.894 7724976 3810.419296 +Tunisia Africa 1992 70.001 8523077 4332.720164 +Tunisia Africa 1997 71.973 9231669 4876.798614 +Tunisia Africa 2002 73.042 9770575 5722.895655 +Tunisia Africa 2007 73.923 10276158 7092.923025 +Turkey Europe 1952 43.585 22235677 1969.10098 +Turkey Europe 1957 48.079 25670939 2218.754257 +Turkey Europe 1962 52.098 29788695 2322.869908 +Turkey Europe 1967 54.336 33411317 2826.356387 +Turkey Europe 1972 57.005 37492953 3450.69638 +Turkey Europe 1977 59.507 42404033 4269.122326 +Turkey Europe 1982 61.036 47328791 4241.356344 +Turkey Europe 1987 63.108 52881328 5089.043686 +Turkey Europe 1992 66.146 58179144 5678.348271 +Turkey Europe 1997 68.835 63047647 6601.429915 +Turkey Europe 2002 70.845 67308928 6508.085718 +Turkey Europe 2007 71.777 71158647 8458.276384 +Uganda Africa 1952 39.978 5824797 734.753484 +Uganda Africa 1957 42.571 6675501 774.3710692 +Uganda Africa 1962 45.344 7688797 767.2717398 +Uganda Africa 1967 48.051 8900294 908.9185217 +Uganda Africa 1972 51.016 10190285 950.735869 +Uganda Africa 1977 50.35 11457758 843.7331372 +Uganda Africa 1982 49.849 12939400 682.2662268 +Uganda Africa 1987 51.509 15283050 617.7244065 +Uganda Africa 1992 48.825 18252190 644.1707969 +Uganda Africa 1997 44.578 21210254 816.559081 +Uganda Africa 2002 47.813 24739869 927.7210018 +Uganda Africa 2007 51.542 29170398 1056.380121 +United Kingdom Europe 1952 69.18 50430000 9979.508487 +United Kingdom Europe 1957 70.42 51430000 11283.17795 +United Kingdom Europe 1962 70.76 53292000 12477.17707 +United Kingdom Europe 1967 71.36 54959000 14142.85089 +United Kingdom Europe 1972 72.01 56079000 15895.11641 +United Kingdom Europe 1977 72.76 56179000 17428.74846 +United Kingdom Europe 1982 74.04 56339704 18232.42452 +United Kingdom Europe 1987 75.007 56981620 21664.78767 +United Kingdom Europe 1992 76.42 57866349 22705.09254 +United Kingdom Europe 1997 77.218 58808266 26074.53136 +United Kingdom Europe 2002 78.471 59912431 29478.99919 +United Kingdom Europe 2007 79.425 60776238 33203.26128 +United States Americas 1952 68.44 157553000 13990.48208 +United States Americas 1957 69.49 171984000 14847.12712 +United States Americas 1962 70.21 186538000 16173.14586 +United States Americas 1967 70.76 198712000 19530.36557 +United States Americas 1972 71.34 209896000 21806.03594 +United States Americas 1977 73.38 220239000 24072.63213 +United States Americas 1982 74.65 232187835 25009.55914 +United States Americas 1987 75.02 242803533 29884.35041 +United States Americas 1992 76.09 256894189 32003.93224 +United States Americas 1997 76.81 272911760 35767.43303 +United States Americas 2002 77.31 287675526 39097.09955 +United States Americas 2007 78.242 301139947 42951.65309 +Uruguay Americas 1952 66.071 2252965 5716.766744 +Uruguay Americas 1957 67.044 2424959 6150.772969 +Uruguay Americas 1962 68.253 2598466 5603.357717 +Uruguay Americas 1967 68.468 2748579 5444.61962 +Uruguay Americas 1972 68.673 2829526 5703.408898 +Uruguay Americas 1977 69.481 2873520 6504.339663 +Uruguay Americas 1982 70.805 2953997 6920.223051 +Uruguay Americas 1987 71.918 3045153 7452.398969 +Uruguay Americas 1992 72.752 3149262 8137.004775 +Uruguay Americas 1997 74.223 3262838 9230.240708 +Uruguay Americas 2002 75.307 3363085 7727.002004 +Uruguay Americas 2007 76.384 3447496 10611.46299 +Venezuela Americas 1952 55.088 5439568 7689.799761 +Venezuela Americas 1957 57.907 6702668 9802.466526 +Venezuela Americas 1962 60.77 8143375 8422.974165 +Venezuela Americas 1967 63.479 9709552 9541.474188 +Venezuela Americas 1972 65.712 11515649 10505.25966 +Venezuela Americas 1977 67.456 13503563 13143.95095 +Venezuela Americas 1982 68.557 15620766 11152.41011 +Venezuela Americas 1987 70.19 17910182 9883.584648 +Venezuela Americas 1992 71.15 20265563 10733.92631 +Venezuela Americas 1997 72.146 22374398 10165.49518 +Venezuela Americas 2002 72.766 24287670 8605.047831 +Venezuela Americas 2007 73.747 26084662 11415.80569 +Vietnam Asia 1952 40.412 26246839 605.0664917 +Vietnam Asia 1957 42.887 28998543 676.2854478 +Vietnam Asia 1962 45.363 33796140 772.0491602 +Vietnam Asia 1967 47.838 39463910 637.1232887 +Vietnam Asia 1972 50.254 44655014 699.5016441 +Vietnam Asia 1977 55.764 50533506 713.5371196 +Vietnam Asia 1982 58.816 56142181 707.2357863 +Vietnam Asia 1987 62.82 62826491 820.7994449 +Vietnam Asia 1992 67.662 69940728 989.0231487 +Vietnam Asia 1997 70.672 76048996 1385.896769 +Vietnam Asia 2002 73.017 80908147 1764.456677 +Vietnam Asia 2007 74.249 85262356 2441.576404 +West Bank and Gaza Asia 1952 43.16 1030585 1515.592329 +West Bank and Gaza Asia 1957 45.671 1070439 1827.067742 +West Bank and Gaza Asia 1962 48.127 1133134 2198.956312 +West Bank and Gaza Asia 1967 51.631 1142636 2649.715007 +West Bank and Gaza Asia 1972 56.532 1089572 3133.409277 +West Bank and Gaza Asia 1977 60.765 1261091 3682.831494 +West Bank and Gaza Asia 1982 64.406 1425876 4336.032082 +West Bank and Gaza Asia 1987 67.046 1691210 5107.197384 +West Bank and Gaza Asia 1992 69.718 2104779 6017.654756 +West Bank and Gaza Asia 1997 71.096 2826046 7110.667619 +West Bank and Gaza Asia 2002 72.37 3389578 4515.487575 +West Bank and Gaza Asia 2007 73.422 4018332 3025.349798 +Yemen, Rep. Asia 1952 32.548 4963829 781.7175761 +Yemen, Rep. Asia 1957 33.97 5498090 804.8304547 +Yemen, Rep. Asia 1962 35.18 6120081 825.6232006 +Yemen, Rep. Asia 1967 36.984 6740785 862.4421463 +Yemen, Rep. Asia 1972 39.848 7407075 1265.047031 +Yemen, Rep. Asia 1977 44.175 8403990 1829.765177 +Yemen, Rep. Asia 1982 49.113 9657618 1977.55701 +Yemen, Rep. Asia 1987 52.922 11219340 1971.741538 +Yemen, Rep. Asia 1992 55.599 13367997 1879.496673 +Yemen, Rep. Asia 1997 58.02 15826497 2117.484526 +Yemen, Rep. Asia 2002 60.308 18701257 2234.820827 +Yemen, Rep. Asia 2007 62.698 22211743 2280.769906 +Zambia Africa 1952 42.038 2672000 1147.388831 +Zambia Africa 1957 44.077 3016000 1311.956766 +Zambia Africa 1962 46.023 3421000 1452.725766 +Zambia Africa 1967 47.768 3900000 1777.077318 +Zambia Africa 1972 50.107 4506497 1773.498265 +Zambia Africa 1977 51.386 5216550 1588.688299 +Zambia Africa 1982 51.821 6100407 1408.678565 +Zambia Africa 1987 50.821 7272406 1213.315116 +Zambia Africa 1992 46.1 8381163 1210.884633 +Zambia Africa 1997 40.238 9417789 1071.353818 +Zambia Africa 2002 39.193 10595811 1071.613938 +Zambia Africa 2007 42.384 11746035 1271.211593 +Zimbabwe Africa 1952 48.451 3080907 406.8841148 +Zimbabwe Africa 1957 50.469 3646340 518.7642681 +Zimbabwe Africa 1962 52.358 4277736 527.2721818 +Zimbabwe Africa 1967 53.995 4995432 569.7950712 +Zimbabwe Africa 1972 55.635 5861135 799.3621758 +Zimbabwe Africa 1977 57.674 6642107 685.5876821 +Zimbabwe Africa 1982 60.363 7636524 788.8550411 +Zimbabwe Africa 1987 62.351 9216418 706.1573059 +Zimbabwe Africa 1992 60.377 10704340 693.4207856 +Zimbabwe Africa 1997 46.809 11404948 792.4499603 +Zimbabwe Africa 2002 39.989 11926563 672.0386227 +Zimbabwe Africa 2007 43.487 12311143 469.7092981 diff --git a/test/output/gapminder.svg b/test/output/gapminder.svg new file mode 100644 index 0000000000..a2fbfbd674 --- /dev/null +++ b/test/output/gapminder.svg @@ -0,0 +1,174 @@ + + + + + + 25 + + + + 30 + + + + 35 + + + + 40 + + + + 45 + + + + 50 + + + + 55 + + + + 60 + + + + 65 + + + + 70 + + + + 75 + + + + 80 + ↑ lifeExp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1k + + + + 2k + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10k + + + + 20k + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100k + gdpPercap → + + + + \ No newline at end of file diff --git a/test/plots/driving-animation.js b/test/plots/driving-animation.js index 79933d9b4c..4f47d65036 100644 --- a/test/plots/driving-animation.js +++ b/test/plots/driving-animation.js @@ -7,7 +7,7 @@ export default async function() { inset: 10, grid: true, marks: [ - Plot.line(driving, {x: "miles", y: "gas", time: "year"}) + Plot.line(driving, {x: "miles", y: "gas", time: "year", timeFilter: "lte"}) ] }); } diff --git a/test/plots/gapminder.js b/test/plots/gapminder.js new file mode 100644 index 0000000000..7123dcfa9b --- /dev/null +++ b/test/plots/gapminder.js @@ -0,0 +1,17 @@ +import * as Plot from "@observablehq/plot"; +import * as d3 from "d3"; + +export default async function() { + const gapminder = await d3.tsv("data/gapminder.tsv", d3.autoType); + return Plot.plot({ + inset: 10, + grid: true, + x: { + type: "log" + }, + marks: [ + Plot.line(gapminder, {x: "gdpPercap", y: "lifeExp", r: "pop", z: "country", stroke: "continent", strokeWidth: 0.5, time: "year", timeFilter: "lte"}), + Plot.dot(gapminder, {x: "gdpPercap", y: "lifeExp", r: "pop", stroke: "continent", time: "year"}) + ] + }); +} diff --git a/test/plots/index.js b/test/plots/index.js index 8a507f7b56..c2bf783bc6 100644 --- a/test/plots/index.js +++ b/test/plots/index.js @@ -75,6 +75,7 @@ export {default as footballCoverage} from "./football-coverage.js"; export {default as frameCorners} from "./frame-corners.js"; export {default as fruitSales} from "./fruit-sales.js"; export {default as fruitSalesDate} from "./fruit-sales-date.js"; +export {default as gapminder} from "./gapminder.js"; export {default as gistempAnomaly} from "./gistemp-anomaly.js"; export {default as gistempAnomalyMoving} from "./gistemp-anomaly-moving.js"; export {default as gistempAnomalyTransform} from "./gistemp-anomaly-transform.js"; From 5c5a8b486043edd4e66250542e1e7d739fec16a8 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Tue, 26 Jul 2022 11:48:09 -0700 Subject: [PATCH 3/5] timeFilter function --- src/time.js | 7 +++++++ test/plots/gapminder.js | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/time.js b/src/time.js index 216d36f13b..ae2ae87ce9 100644 --- a/src/time.js +++ b/src/time.js @@ -1,4 +1,5 @@ export function maybeTimeFilter(filter = "eq") { + if (typeof filter === "function") return timeFunction(filter); switch (`${filter}`.toLowerCase()) { case "lt": return timeLt; case "lte": return timeLte; @@ -9,6 +10,12 @@ export function maybeTimeFilter(filter = "eq") { throw new Error(`invalid time filter: ${filter}`); } +function timeFunction(f) { + return (I, T, time) => { + return I.filter(i => f(T[i], time)); + }; +} + function timeLt(I, T, time) { return I.filter(i => T[i] < time); } diff --git a/test/plots/gapminder.js b/test/plots/gapminder.js index 7123dcfa9b..c0b504b9ce 100644 --- a/test/plots/gapminder.js +++ b/test/plots/gapminder.js @@ -10,7 +10,7 @@ export default async function() { type: "log" }, marks: [ - Plot.line(gapminder, {x: "gdpPercap", y: "lifeExp", r: "pop", z: "country", stroke: "continent", strokeWidth: 0.5, time: "year", timeFilter: "lte"}), + Plot.line(gapminder, {x: "gdpPercap", y: "lifeExp", z: "country", stroke: "continent", strokeWidth: 0.5, time: "year", timeFilter: "lte"}), Plot.dot(gapminder, {x: "gdpPercap", y: "lifeExp", r: "pop", stroke: "continent", time: "year"}) ] }); From 701bd01f33a22685dd0e6cc95cb5b7fcc03416c7 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Tue, 26 Jul 2022 17:36:16 -0700 Subject: [PATCH 4/5] time interpolation --- src/plot.js | 92 +++++++++++++++++++++++++++++++++-------- test/plots/gapminder.js | 4 +- 2 files changed, 76 insertions(+), 20 deletions(-) diff --git a/src/plot.js b/src/plot.js index 1433ad3d63..22cc6b4b7c 100644 --- a/src/plot.js +++ b/src/plot.js @@ -1,13 +1,14 @@ -import {bisectLeft, cross, difference, groups, InternMap, select} from "d3"; +import {bisectLeft, cross, difference, groups, InternMap, interpolate, interpolateNumber, select} from "d3"; import {Axes, autoAxisTicks, autoScaleLabels} from "./axes.js"; import {Channel, Channels, channelDomain, valueObject} from "./channel.js"; import {Context, create} from "./context.js"; import {defined} from "./defined.js"; import {Dimensions} from "./dimensions.js"; import {Legends, exposeLegends} from "./legends.js"; -import {arrayify, isDomainSort, isScaleOptions, keyword, map, maybeNamed, range, second, where, yes} from "./options.js"; -import {Scales, ScaleFunctions, autoScaleRange, exposeScales} from "./scales.js"; +import {arrayify, isDomainSort, isScaleOptions, keyword, map, maybeNamed, range, second, take, where, yes} from "./options.js"; +import {Scales, ScaleFunctions, autoScaleRange, exposeScales, coerceNumbers} from "./scales.js"; import {position, registry as scaleRegistry} from "./scales/index.js"; +import {inferDomain} from "./scales/quantitative.js"; import {applyInlineStyles, maybeClassName, maybeClip, styles} from "./style.js"; import {maybeTimeFilter} from "./time.js"; import {basic, initializer} from "./transforms/basic.js"; @@ -126,7 +127,9 @@ export function plot(options = {}) { autoScaleLabels(channelsByScale, scaleDescriptors, axes, dimensions, options); // Aggregate and sort time channels. - const times = aggregateTimes(stateByMark); + const timeChannels = findTimeChannels(stateByMark); + const timeDomain = inferDomain(timeChannels); + const times = aggregateTimes(timeChannels); // Compute value objects, applying scales as needed. for (const state of stateByMark.values()) { @@ -226,20 +229,60 @@ export function plot(options = {}) { if (node != null) svg.appendChild(node); } if (timeMarks.length) { - let timeIndex = -1; + // TODO There needs to be an option to avoid interpolation and just play + // the distinct times, as given, in ascending order, as keyframes. And + // there needs to be an option to control the delay, duration, iterations, + // and other timing parameters of the animation. + const interpolateTime = interpolateNumber(...timeDomain); + const delay = 0; // TODO configurable; delay initial rendering + const duration = 5000; // TODO configurable + const startTime = performance.now() + delay; requestAnimationFrame(function tick() { - if (++timeIndex >= times.length) return; - const time = times[timeIndex]; + const t = Math.max(0, Math.min(1, (performance.now() - startTime) / duration)); + const currentTime = interpolateTime(t); + const i0 = bisectLeft(times, currentTime); + const time0 = times[i0 - 1]; + const time1 = times[i0]; + const timet = (currentTime - time0) / (time1 - time0); for (const timeMark of timeMarks) { const {mark, node} = timeMark; const {channels, values, facets} = stateByMark.get(mark); const facet = facets ? mark.filter(facets[0], channels, values) : null; - const index = mark.timeFilter(facet, values.time, time); - const timeNode = mark.render(index, scales, values, dimensions, context); + const {time: T} = values; + let timeNode; + if (isFinite(timet)) { + const I0 = facet.filter(i => T[i] === time0); + const I1 = facet.filter(i => T[i] === time1); + const interp = {}; + // TODO This is interpolating the already-scaled values, but we + // probably want to interpolate in data space instead and then + // re-apply the scales. I’m not sure what to do for ordinal data, + // but interpolating in data space will ensure that the resulting + // instantaneous visualization is meaningful and valid. TODO If the + // data is sparse (not all series have values for all times), or if + // the data is inconsistently ordered, then we will need a separate + // key channel to align the start and end values for interpolation; + // this code currently assumes that the data is complete and the + // order is consistent. TODO The sort transform (which happens by + // default with the dot mark) breaks consistent ordering! TODO If + // the time filter is not “eq” (strict equals) here, then we’ll need + // to combine the interpolated data with the filtered data. + for (const k in values) { + if (k === "time") continue; // avoid unnecessary interpolation + const V0 = take(values[k], I0); + const V1 = take(values[k], I1); + interp[k] = interpolate(V0, V1)(timet); + } + const index = range(I0); + timeNode = mark.render(index, scales, interp, dimensions, context); + } else { + const index = facet.filter(i => T[i] === time0); + timeNode = mark.render(index, scales, values, dimensions, context); + } node.replaceWith(timeNode); timeMark.node = timeNode; } - setTimeout(tick, 1500 / times.length); // TODO + if (t < 1) requestAnimationFrame(tick); }); } } @@ -393,16 +436,29 @@ function addScaleChannels(channelsByScale, stateByMark, filter = yes) { return channelsByScale; } -function aggregateTimes(stateByMark) { - const times = []; +// TODO There should be a way to set at explicit domain of the time scale, and +// probably also a way to control whether times are expressed (and coerced) to +// numbers or dates. And maybe non-linear (log or sqrt) time, too, or should +// that be controlled with easing? +function findTimeChannels(stateByMark) { + const channels = []; for (const {channels: {time}} of stateByMark.values()) { if (time) { - for (let t of time.value) { - if (t == null || isNaN(t = +t)) continue; - const i = bisectLeft(times, t); - if (times[i] === t) continue; - times.splice(i, 0, t); - } + coerceNumbers(time.value); // Note: mutates! + channels.push(time); + } + } + return channels; +} + +function aggregateTimes(channels) { + const times = []; + for (const {value} of channels) { + for (let t of value) { + if (t == null || isNaN(t = +t)) continue; + const i = bisectLeft(times, t); + if (times[i] === t) continue; + times.splice(i, 0, t); } } return times; diff --git a/test/plots/gapminder.js b/test/plots/gapminder.js index c0b504b9ce..d33660f2f4 100644 --- a/test/plots/gapminder.js +++ b/test/plots/gapminder.js @@ -10,8 +10,8 @@ export default async function() { type: "log" }, marks: [ - Plot.line(gapminder, {x: "gdpPercap", y: "lifeExp", z: "country", stroke: "continent", strokeWidth: 0.5, time: "year", timeFilter: "lte"}), - Plot.dot(gapminder, {x: "gdpPercap", y: "lifeExp", r: "pop", stroke: "continent", time: "year"}) + Plot.line(gapminder, {x: "gdpPercap", y: "lifeExp", z: "country", sort: null, stroke: "continent", strokeWidth: 0.5, time: "year", timeFilter: "lte"}), + Plot.dot(gapminder, {x: "gdpPercap", y: "lifeExp", r: "pop", sort: null, stroke: "continent", time: "year"}) ] }); } From fc2206a717856fe7356ad8a10bae120e5da3d07f Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Thu, 28 Jul 2022 10:25:20 -0700 Subject: [PATCH 5/5] interpolate with filter --- src/plot.js | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/src/plot.js b/src/plot.js index 22cc6b4b7c..6d68feaa90 100644 --- a/src/plot.js +++ b/src/plot.js @@ -225,7 +225,7 @@ export function plot(options = {}) { const facet = facets ? mark.filter(facets[0], channels, values) : null; const index = channels.time ? [] : facet; const node = mark.render(index, scales, values, dimensions, context); - if (channels.time) timeMarks.push({mark, node}); + if (channels.time) timeMarks.push({mark, node, interp: Object.fromEntries(Object.entries(values).map(([key, value]) => [key, Array.from(value)]))}); if (node != null) svg.appendChild(node); } if (timeMarks.length) { @@ -245,15 +245,17 @@ export function plot(options = {}) { const time1 = times[i0]; const timet = (currentTime - time0) / (time1 - time0); for (const timeMark of timeMarks) { - const {mark, node} = timeMark; + const {mark, node, interp} = timeMark; const {channels, values, facets} = stateByMark.get(mark); const facet = facets ? mark.filter(facets[0], channels, values) : null; const {time: T} = values; let timeNode; if (isFinite(timet)) { - const I0 = facet.filter(i => T[i] === time0); - const I1 = facet.filter(i => T[i] === time1); - const interp = {}; + const I0 = facet.filter(i => T[i] === time0); // preceding keyframe + const I1 = facet.filter(i => T[i] === time1); // following keyframe + const n = I0.length; // TODO enter, exit, key + const Ii = I0.map((_, i) => i + facet.length); // TODO optimize + // TODO This is interpolating the already-scaled values, but we // probably want to interpolate in data space instead and then // re-apply the scales. I’m not sure what to do for ordinal data, @@ -268,15 +270,26 @@ export function plot(options = {}) { // the time filter is not “eq” (strict equals) here, then we’ll need // to combine the interpolated data with the filtered data. for (const k in values) { - if (k === "time") continue; // avoid unnecessary interpolation - const V0 = take(values[k], I0); - const V1 = take(values[k], I1); - interp[k] = interpolate(V0, V1)(timet); + if (k === "time") { + for (let i = 0; i < n; ++i) { + interp[k][Ii[i]] = currentTime; + } + } else { + for (let i = 0; i < n; ++i) { + interp[k][Ii[i]] = interpolate(values[k][I0[i]], values[k][I1[i]])(timet); + } + } } - const index = range(I0); + + // TODO We need to switch to using temporal facets so that the + // facets are guaranteed to be in chronological order. (Within a + // facet, there’s no guarantee that the index is sorted + // chronologically.) + const ifacet = [...facet.filter(i => T[i] <= time0), ...Ii, ...facet.filter(i => T[i] > time0)]; + const index = mark.timeFilter(ifacet, interp.time, currentTime); timeNode = mark.render(index, scales, interp, dimensions, context); } else { - const index = facet.filter(i => T[i] === time0); + const index = mark.timeFilter(facet, T, currentTime); timeNode = mark.render(index, scales, values, dimensions, context); } node.replaceWith(timeNode);