This repository has been archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
helpers.js
46 lines (45 loc) · 1.91 KB
/
helpers.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
var data = [ {name: "Beijing", value: 12},
{name: "Tianjin", value: 12},
{name: "Shanghai", value: 12},
{name: "Chongqing", value: 12},
{name: "Hebei", value: 12},
{name: "Henan", value: 12},
{name: "Yunnan", value: 12},
{name: "Liaoning", value: 12},
{name: "Heilongjiang", value: 12},
{name: "Hunan", value: 12},
{name: "Anhui", value: 12},
{name: "Shandong", value: 12},
{name: "Xinjiang", value: 12},
{name: "Jiangsu Province", value: 12},
{name: "Zhejiang", value: 12},
{name: "Jiangxi", value: 12},
{name: "Hubei", value: 12},
{name: "Guangxi", value: 12},
{name: "Gansu", value: 12},
{name: "Shanxi", value: 12},
{name: "Inner", value: 12},
{name: "Shaanxi", value: 12},
{name: "Jilin", value: 12},
{name: "Fujian", value: 12},
{name: "Guizhou", value: 12},
{name: "Guangdong", value: 12},
{name: "Qinghai", value: 12},
{name: "Tibet", value: 12},
{name: "Sichuan", value: 12},
{name: "Ningxia", value: 12},
{name: "Hainan", value: 12},
{name: "Taiwan", value: 12},
{name: "Hong Kong", value: 12},
{name: "Macau", value: 12}
];
var strings = ""
for (var i = 0 ; i < data.length; i++) {
var datum = data[i];
var randomX = Math.random() * 3;
var randomY = Math.random() * 5;
var x = 100 + randomX;
var y = 34 + randomY;
strings += "Tuple \"" + datum.name + "\" (Tuple " + x.toFixed(4) + " " + y.toFixed(4) + "),\n";
}
console.log(strings);