-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsheet.js
99 lines (96 loc) · 2.33 KB
/
sheet.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
const bracket_data = [
[1, 0, 1, , , , 0],
[2, 2000, 1, , 180000, "=MIN(MAX(F1-MIN(F1*$A$16,$B$16), INDEX($B$1:$B$14, MIN(MAX(1,G1),14))) + MAX((MIN(E2/$C$16,1)*65000-MAX(F1-MIN(F1*$A$16,$B$16), INDEX($B$1:$B$14, MIN(MAX(1,G1),14))))*INDEX($C$1:$C$14,MIN(MAX(1,G1),14)), 0), INDEX($B$1:$B$14,MIN(G1+4,14)))", "=MAX(IF(F2 >= 5000, MIN(INT(F2/5000) + 2, 14), IF(F2 >=2000, 2, 1)), G1)"],
[3, 5000, 1, , 690000],
[4, 10000, .8, , 750000],
[5, 15000, .8, , 750000],
[6, 20000, .8, , 750000],
[7, 25000, .7, , 750000],
[8, 30000, .7, , 750000],
[9, 35000, .6],
[10, 40000, .5],
[11, 45000, .5],
[12, 50000, .4],
[13, 55000, .4],
[14, 60000, .34],
[],
[.2, 2500, 750000],
];
for (let i = 2; i < 13; i++) {
bracket_data[i][5] = bracket_data[1][5].replaceAll('F1', 'F' + i).replaceAll('E2', 'E' + (i + 1)).replaceAll('G1', 'G' + i)
bracket_data[i][6] = bracket_data[1][6].replaceAll('F2', 'F' + (i + 1)).replaceAll('G1', 'G' + i)
}
const hfInstance = HyperFormula.buildEmpty({
licenseKey: 'gpl-v3',
});
const bracket_container = document.getElementById('ranker');
const hot1 = new Handsontable(bracket_container, {
data: bracket_data,
formulas: {
engine: hfInstance,
},
colHeaders: ['Rank', 'Req CP', 'Keep Coef', ' ','Honor', 'CP', 'Standing'],
height: 'auto',
licenseKey: 'non-commercial-and-evaluation',
fillHandle: {
autoInsertRow: true
},
customBorders: [
{
range: {
from: {
row: 1,
col: 4
},
to: {
row: 12,
col: 4
}
},
top: {
width: 2,
color: 'magenta'
},
left: {
width: 2,
color: 'orange'
},
bottom: {
width: 2,
color: 'red'
},
right: {
width: 2,
color: '#5292F7'
}
},
{
range: {
from: {
row: 0,
col: 6
},
to: {
row: 0,
col: 6
}
},
top: {
width: 2,
color: 'magenta'
},
left: {
width: 2,
color: 'orange'
},
bottom: {
width: 2,
color: 'red'
},
right: {
width: 2,
color: '#5292F7'
}
}
]
});