-
Notifications
You must be signed in to change notification settings - Fork 0
/
setSelect.js
47 lines (42 loc) · 1.23 KB
/
setSelect.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
47
import { CSV } from "https://js.sabae.cc/CSV.js";
import { JAPAN_PREF } from "https://js.sabae.cc/JAPAN_PREF.js";
export const markets = {
all: "全市場",
P: "プライム",
S: "スタンダード",
G: "グロース",
};
export const setSelectMarket = (selmarket) => {
for (const name in markets) {
const opt = document.createElement("option");
opt.value = name;
opt.textContent = markets[name];
selmarket.appendChild(opt);
}
};
export const industry17 = await CSV.fetchJSON("./data/industry17.csv");
// type,name
export const setSelectIndustry = (selindustry) => {
const opt = document.createElement("option");
opt.value = "all";
opt.textContent = "全産業";
selindustry.appendChild(opt);
for (const i of industry17) {
const opt = document.createElement("option");
opt.value = i.type;
opt.textContent = i.name;
selindustry.appendChild(opt);
}
};
export const prefs = JAPAN_PREF;
export const setSelectPref = (selpref) => {
const opt = document.createElement("option");
opt.value = "all";
opt.textContent = "日本";
selpref.appendChild(opt);
for (const name of prefs) {
const opt = document.createElement("option");
opt.textContent = name;
selpref.appendChild(opt);
}
};