Move column-level attributes to key-level

This commit is contained in:
Bán Dénes 2021-12-18 18:37:26 +01:00
parent 86c00eb62d
commit 73045e4754
19 changed files with 1290 additions and 306 deletions

View file

@ -3,25 +3,25 @@ matrix_col_row:
'y': 0
r: 0
meta:
stagger: 0
spread: 0
splay: 0
origin:
- 0
- 0
shift:
- 0
- 0
rotate: 0
width: 18
height: 18
padding: 19
width: 1
height: 1
skip: false
asym: both
name: matrix_col_row
colrow: col_row
col:
stagger: 0
spread: 0
rotate: 0
origin:
- 0
- 0
rows: {}
key: {}
name: col
row: row
colrow: col_row

View file

@ -2,4 +2,10 @@ U: 19.05
u: 19
cx: 18
cy: 17
$default_stagger: 0
$default_spread: 19
$default_splay: 0
$default_height: 18
$default_width: 18
$default_padding: 19
a: 47

View file

@ -3,25 +3,25 @@ matrix_col_row:
'y': 0
r: 0
meta:
stagger: 0
spread: 0
splay: 0
origin:
- 0
- 0
shift:
- 0
- 0
rotate: 0
width: 18
height: 18
padding: 19
width: 1
height: 1
skip: false
asym: both
name: matrix_col_row
colrow: col_row
col:
stagger: 0
spread: 0
rotate: 0
origin:
- 0
- 0
rows: {}
key: {}
name: col
row: row
colrow: col_row

View file

@ -2,3 +2,9 @@ U: 19.05
u: 19
cx: 18
cy: 17
$default_stagger: 0
$default_spread: 19
$default_splay: 0
$default_height: 18
$default_width: 18
$default_padding: 19

View file

@ -3,10 +3,10 @@ points:
matrix:
columns:
left:
right:
right.key:
stagger: 5
spread: 25
rotate: 5
splay: 5
origin: [-9, -9]
rows:
bottom:

View file

@ -0,0 +1,242 @@
0
SECTION
2
HEADER
9
$INSUNITS
70
4
0
ENDSEC
0
SECTION
2
TABLES
0
TABLE
2
LTYPE
0
LTYPE
72
65
70
64
2
CONTINUOUS
3
______
73
0
40
0
0
ENDTAB
0
TABLE
2
LAYER
0
ENDTAB
0
ENDSEC
0
SECTION
2
ENTITIES
0
LINE
8
0
10
-9
20
9
11
9
21
9
0
LINE
8
0
10
9
20
9
11
9
21
-9
0
LINE
8
0
10
9
20
-9
11
-9
21
-9
0
LINE
8
0
10
-9
20
-9
11
-9
21
9
0
LINE
8
0
10
-9
20
28
11
9
21
28
0
LINE
8
0
10
9
20
28
11
9
21
10
0
LINE
8
0
10
9
20
10
11
-9
21
10
0
LINE
8
0
10
-9
20
10
11
-9
21
28
0
LINE
8
0
10
14.4311966
20
13.9315046
11
32.3627012
21
15.500308
0
LINE
8
0
10
32.3627012
20
15.500308
11
33.9315046
21
-2.4311966
0
LINE
8
0
10
33.9315046
20
-2.4311966
11
16
21
-4
0
LINE
8
0
10
16
20
-4
11
14.4311966
21
13.9315046
0
LINE
8
0
10
12.7752375
20
32.8592038
11
30.7067421
21
34.4280072
0
LINE
8
0
10
30.7067421
20
34.4280072
11
32.2755455
21
16.4965026
0
LINE
8
0
10
32.2755455
20
16.4965026
11
14.3440409
21
14.9276992
0
LINE
8
0
10
14.3440409
20
14.9276992
11
12.7752375
21
32.8592038
0
ENDSEC
0
EOF

View file

@ -4,31 +4,31 @@
"y": 0,
"r": 0,
"meta": {
"stagger": 0,
"spread": 0,
"splay": 0,
"origin": [
0,
0
],
"shift": [
0,
0
],
"rotate": 0,
"width": 18,
"height": 18,
"padding": 19,
"width": 1,
"height": 1,
"skip": false,
"asym": "both",
"name": "matrix_left_bottom",
"colrow": "left_bottom",
"col": {
"stagger": 0,
"spread": 0,
"rotate": 0,
"origin": [
0,
0
],
"rows": {},
"key": {},
"name": "left"
},
"row": "bottom"
"row": "bottom",
"colrow": "left_bottom"
}
},
"matrix_left_top": {
@ -36,31 +36,31 @@
"y": 19,
"r": 0,
"meta": {
"stagger": 0,
"spread": 0,
"splay": 0,
"origin": [
0,
0
],
"shift": [
0,
0
],
"rotate": 0,
"width": 18,
"height": 18,
"padding": 19,
"width": 1,
"height": 1,
"skip": false,
"asym": "both",
"name": "matrix_left_top",
"colrow": "left_top",
"col": {
"stagger": 0,
"spread": 0,
"rotate": 0,
"origin": [
0,
0
],
"rows": {},
"key": {},
"name": "left"
},
"row": "top"
"row": "top",
"colrow": "left_top"
}
},
"matrix_right_bottom": {
@ -68,31 +68,39 @@
"y": 5.750154,
"r": 5,
"meta": {
"stagger": 5,
"spread": 25,
"splay": 5,
"origin": [
-9,
-9
],
"shift": [
0,
0
],
"rotate": 0,
"width": 18,
"height": 18,
"padding": 19,
"width": 1,
"height": 1,
"skip": false,
"asym": "both",
"name": "matrix_right_bottom",
"colrow": "right_bottom",
"col": {
"stagger": 5,
"spread": 25,
"rotate": 5,
"origin": [
-9,
-9
],
"key": {
"stagger": 5,
"spread": 25,
"splay": 5,
"origin": [
-9,
-9
]
},
"rows": {},
"key": {},
"name": "right"
},
"row": "bottom"
"row": "bottom",
"colrow": "right_bottom"
}
},
"matrix_right_top": {
@ -100,31 +108,39 @@
"y": 24.6778532,
"r": 5,
"meta": {
"stagger": 5,
"spread": 25,
"splay": 5,
"origin": [
-9,
-9
],
"shift": [
0,
0
],
"rotate": 0,
"width": 18,
"height": 18,
"padding": 19,
"width": 1,
"height": 1,
"skip": false,
"asym": "both",
"name": "matrix_right_top",
"colrow": "right_top",
"col": {
"stagger": 5,
"spread": 25,
"rotate": 5,
"origin": [
-9,
-9
],
"key": {
"stagger": 5,
"spread": 25,
"splay": 5,
"origin": [
-9,
-9
]
},
"rows": {},
"key": {},
"name": "right"
},
"row": "top"
"row": "top",
"colrow": "right_top"
}
}
}

View file

@ -0,0 +1,242 @@
0
SECTION
2
HEADER
9
$INSUNITS
70
4
0
ENDSEC
0
SECTION
2
TABLES
0
TABLE
2
LTYPE
0
LTYPE
72
65
70
64
2
CONTINUOUS
3
______
73
0
40
0
0
ENDTAB
0
TABLE
2
LAYER
0
ENDTAB
0
ENDSEC
0
SECTION
2
ENTITIES
0
LINE
8
0
10
-9
20
9
11
9
21
9
0
LINE
8
0
10
9
20
9
11
9
21
-9
0
LINE
8
0
10
9
20
-9
11
-9
21
-9
0
LINE
8
0
10
-9
20
-9
11
-9
21
9
0
LINE
8
0
10
-9
20
28
11
9
21
28
0
LINE
8
0
10
9
20
28
11
9
21
10
0
LINE
8
0
10
9
20
10
11
-9
21
10
0
LINE
8
0
10
-9
20
10
11
-9
21
28
0
LINE
8
0
10
10
20
9
11
28
21
9
0
LINE
8
0
10
28
20
9
11
28
21
-9
0
LINE
8
0
10
28
20
-9
11
10
21
-9
0
LINE
8
0
10
10
20
-9
11
10
21
9
0
LINE
8
0
10
10
20
28
11
28
21
28
0
LINE
8
0
10
28
20
28
11
28
21
10
0
LINE
8
0
10
28
20
10
11
10
21
10
0
LINE
8
0
10
10
20
10
11
10
21
28
0
ENDSEC
0
EOF

View file

@ -4,31 +4,31 @@
"y": 0,
"r": 0,
"meta": {
"stagger": 0,
"spread": 0,
"splay": 0,
"origin": [
0,
0
],
"shift": [
0,
0
],
"rotate": 0,
"width": 18,
"height": 18,
"padding": 19,
"width": 1,
"height": 1,
"skip": false,
"asym": "both",
"name": "matrix_left_bottom",
"colrow": "left_bottom",
"col": {
"stagger": 0,
"spread": 0,
"rotate": 0,
"origin": [
0,
0
],
"rows": {},
"key": {},
"name": "left"
},
"row": "bottom"
"row": "bottom",
"colrow": "left_bottom"
}
},
"matrix_left_top": {
@ -36,31 +36,31 @@
"y": 19,
"r": 0,
"meta": {
"stagger": 0,
"spread": 0,
"splay": 0,
"origin": [
0,
0
],
"shift": [
0,
0
],
"rotate": 0,
"width": 18,
"height": 18,
"padding": 19,
"width": 1,
"height": 1,
"skip": false,
"asym": "both",
"name": "matrix_left_top",
"colrow": "left_top",
"col": {
"stagger": 0,
"spread": 0,
"rotate": 0,
"origin": [
0,
0
],
"rows": {},
"key": {},
"name": "left"
},
"row": "top"
"row": "top",
"colrow": "left_top"
}
},
"matrix_right_bottom": {
@ -68,31 +68,31 @@
"y": 0,
"r": 0,
"meta": {
"stagger": 0,
"spread": 19,
"splay": 0,
"origin": [
0,
0
],
"shift": [
0,
0
],
"rotate": 0,
"width": 18,
"height": 18,
"padding": 19,
"width": 1,
"height": 1,
"skip": false,
"asym": "both",
"name": "matrix_right_bottom",
"colrow": "right_bottom",
"col": {
"stagger": 0,
"spread": 19,
"rotate": 0,
"origin": [
0,
0
],
"rows": {},
"key": {},
"name": "right"
},
"row": "bottom"
"row": "bottom",
"colrow": "right_bottom"
}
},
"matrix_right_top": {
@ -100,31 +100,31 @@
"y": 19,
"r": 0,
"meta": {
"stagger": 0,
"spread": 19,
"splay": 0,
"origin": [
0,
0
],
"shift": [
0,
0
],
"rotate": 0,
"width": 18,
"height": 18,
"padding": 19,
"width": 1,
"height": 1,
"skip": false,
"asym": "both",
"name": "matrix_right_top",
"colrow": "right_top",
"col": {
"stagger": 0,
"spread": 19,
"rotate": 0,
"origin": [
0,
0
],
"rows": {},
"key": {},
"name": "right"
},
"row": "top"
"row": "top",
"colrow": "right_top"
}
}
}

View file

@ -0,0 +1,98 @@
0
SECTION
2
HEADER
9
$INSUNITS
70
4
0
ENDSEC
0
SECTION
2
TABLES
0
TABLE
2
LTYPE
0
LTYPE
72
65
70
64
2
CONTINUOUS
3
______
73
0
40
0
0
ENDTAB
0
TABLE
2
LAYER
0
ENDTAB
0
ENDSEC
0
SECTION
2
ENTITIES
0
LINE
8
0
10
-9
20
9
11
9
21
9
0
LINE
8
0
10
9
20
9
11
9
21
-9
0
LINE
8
0
10
9
20
-9
11
-9
21
-9
0
LINE
8
0
10
-9
20
-9
11
-9
21
9
0
ENDSEC
0
EOF

View file

@ -4,31 +4,31 @@
"y": 0,
"r": 0,
"meta": {
"stagger": 0,
"spread": 0,
"splay": 0,
"origin": [
0,
0
],
"shift": [
0,
0
],
"rotate": 0,
"width": 18,
"height": 18,
"padding": 19,
"width": 1,
"height": 1,
"skip": false,
"asym": "both",
"name": "matrix_default_default",
"colrow": "default_default",
"col": {
"stagger": 0,
"spread": 0,
"rotate": 0,
"origin": [
0,
0
],
"rows": {},
"key": {},
"name": "default"
},
"row": "default"
"row": "default",
"colrow": "default_default"
}
}
}

View file

@ -1,16 +1,15 @@
points:
zones:
matrix:
columns:
left:
middle:
rows:
top:
right:
stagger: u
row_overrides:
home:
top:
points.zones.matrix:
columns:
left:
middle:
rows:
bottom:
home:
top:
right:
key.stagger: u
rows:
bottom: $unset
home:
top:
rows:
bottom:
home:

View file

@ -0,0 +1,386 @@
0
SECTION
2
HEADER
9
$INSUNITS
70
4
0
ENDSEC
0
SECTION
2
TABLES
0
TABLE
2
LTYPE
0
LTYPE
72
65
70
64
2
CONTINUOUS
3
______
73
0
40
0
0
ENDTAB
0
TABLE
2
LAYER
0
ENDTAB
0
ENDSEC
0
SECTION
2
ENTITIES
0
LINE
8
0
10
-9
20
9
11
9
21
9
0
LINE
8
0
10
9
20
9
11
9
21
-9
0
LINE
8
0
10
9
20
-9
11
-9
21
-9
0
LINE
8
0
10
-9
20
-9
11
-9
21
9
0
LINE
8
0
10
-9
20
28
11
9
21
28
0
LINE
8
0
10
9
20
28
11
9
21
10
0
LINE
8
0
10
9
20
10
11
-9
21
10
0
LINE
8
0
10
-9
20
10
11
-9
21
28
0
LINE
8
0
10
10
20
9
11
28
21
9
0
LINE
8
0
10
28
20
9
11
28
21
-9
0
LINE
8
0
10
28
20
-9
11
10
21
-9
0
LINE
8
0
10
10
20
-9
11
10
21
9
0
LINE
8
0
10
10
20
28
11
28
21
28
0
LINE
8
0
10
28
20
28
11
28
21
10
0
LINE
8
0
10
28
20
10
11
10
21
10
0
LINE
8
0
10
10
20
10
11
10
21
28
0
LINE
8
0
10
10
20
47
11
28
21
47
0
LINE
8
0
10
28
20
47
11
28
21
29
0
LINE
8
0
10
28
20
29
11
10
21
29
0
LINE
8
0
10
10
20
29
11
10
21
47
0
LINE
8
0
10
29
20
28
11
47
21
28
0
LINE
8
0
10
47
20
28
11
47
21
10
0
LINE
8
0
10
47
20
10
11
29
21
10
0
LINE
8
0
10
29
20
10
11
29
21
28
0
LINE
8
0
10
29
20
47
11
47
21
47
0
LINE
8
0
10
47
20
47
11
47
21
29
0
LINE
8
0
10
47
20
29
11
29
21
29
0
LINE
8
0
10
29
20
29
11
29
21
47
0
ENDSEC
0
EOF

View file

@ -4,31 +4,31 @@
"y": 0,
"r": 0,
"meta": {
"stagger": 0,
"spread": 0,
"splay": 0,
"origin": [
0,
0
],
"shift": [
0,
0
],
"rotate": 0,
"width": 18,
"height": 18,
"padding": 19,
"width": 1,
"height": 1,
"skip": false,
"asym": "both",
"name": "matrix_left_bottom",
"colrow": "left_bottom",
"col": {
"stagger": 0,
"spread": 0,
"rotate": 0,
"origin": [
0,
0
],
"rows": {},
"key": {},
"name": "left"
},
"row": "bottom"
"row": "bottom",
"colrow": "left_bottom"
}
},
"matrix_left_home": {
@ -36,31 +36,31 @@
"y": 19,
"r": 0,
"meta": {
"stagger": 0,
"spread": 0,
"splay": 0,
"origin": [
0,
0
],
"shift": [
0,
0
],
"rotate": 0,
"width": 18,
"height": 18,
"padding": 19,
"width": 1,
"height": 1,
"skip": false,
"asym": "both",
"name": "matrix_left_home",
"colrow": "left_home",
"col": {
"stagger": 0,
"spread": 0,
"rotate": 0,
"origin": [
0,
0
],
"rows": {},
"key": {},
"name": "left"
},
"row": "home"
"row": "home",
"colrow": "left_home"
}
},
"matrix_middle_bottom": {
@ -68,33 +68,33 @@
"y": 0,
"r": 0,
"meta": {
"stagger": 0,
"spread": 19,
"splay": 0,
"origin": [
0,
0
],
"shift": [
0,
0
],
"rotate": 0,
"width": 18,
"height": 18,
"padding": 19,
"width": 1,
"height": 1,
"skip": false,
"asym": "both",
"name": "matrix_middle_bottom",
"colrow": "middle_bottom",
"col": {
"rows": {
"top": {}
},
"stagger": 0,
"spread": 19,
"rotate": 0,
"origin": [
0,
0
],
"key": {},
"name": "middle"
},
"row": "bottom"
"row": "bottom",
"colrow": "middle_bottom"
}
},
"matrix_middle_home": {
@ -102,33 +102,33 @@
"y": 19,
"r": 0,
"meta": {
"stagger": 0,
"spread": 19,
"splay": 0,
"origin": [
0,
0
],
"shift": [
0,
0
],
"rotate": 0,
"width": 18,
"height": 18,
"padding": 19,
"width": 1,
"height": 1,
"skip": false,
"asym": "both",
"name": "matrix_middle_home",
"colrow": "middle_home",
"col": {
"rows": {
"top": {}
},
"stagger": 0,
"spread": 19,
"rotate": 0,
"origin": [
0,
0
],
"key": {},
"name": "middle"
},
"row": "home"
"row": "home",
"colrow": "middle_home"
}
},
"matrix_middle_top": {
@ -136,33 +136,33 @@
"y": 38,
"r": 0,
"meta": {
"stagger": 0,
"spread": 19,
"splay": 0,
"origin": [
0,
0
],
"shift": [
0,
0
],
"rotate": 0,
"width": 18,
"height": 18,
"padding": 19,
"width": 1,
"height": 1,
"skip": false,
"asym": "both",
"name": "matrix_middle_top",
"colrow": "middle_top",
"col": {
"rows": {
"top": {}
},
"stagger": 0,
"spread": 19,
"rotate": 0,
"origin": [
0,
0
],
"key": {},
"name": "middle"
},
"row": "top"
"row": "top",
"colrow": "middle_top"
}
},
"matrix_right_home": {
@ -170,38 +170,37 @@
"y": 19,
"r": 0,
"meta": {
"stagger": 19,
"spread": 19,
"splay": 0,
"origin": [
0,
0
],
"shift": [
0,
0
],
"rotate": 0,
"width": 18,
"height": 18,
"padding": 19,
"width": 1,
"height": 1,
"skip": false,
"asym": "both",
"name": "matrix_right_home",
"colrow": "right_home",
"col": {
"stagger": 19,
"row_overrides": {
"home": {},
"top": {}
"key": {
"stagger": "u"
},
"spread": 19,
"rotate": 0,
"origin": [
0,
0
],
"rows": {
"bottom": "$unset",
"home": {},
"top": {}
},
"key": {},
"name": "right"
},
"row": "home"
"row": "home",
"colrow": "right_home"
}
},
"matrix_right_top": {
@ -209,38 +208,37 @@
"y": 38,
"r": 0,
"meta": {
"stagger": 19,
"spread": 19,
"splay": 0,
"origin": [
0,
0
],
"shift": [
0,
0
],
"rotate": 0,
"width": 18,
"height": 18,
"padding": 19,
"width": 1,
"height": 1,
"skip": false,
"asym": "both",
"name": "matrix_right_top",
"colrow": "right_top",
"col": {
"stagger": 19,
"row_overrides": {
"home": {},
"top": {}
"key": {
"stagger": "u"
},
"spread": 19,
"rotate": 0,
"origin": [
0,
0
],
"rows": {
"bottom": "$unset",
"home": {},
"top": {}
},
"key": {},
"name": "right"
},
"row": "top"
"row": "top",
"colrow": "right_top"
}
}
}

View file

@ -4,5 +4,11 @@
"cx": 18,
"cy": 17,
"a": 10,
"b": 15
"b": 15,
"$default_stagger": 0,
"$default_spread": 19,
"$default_splay": 0,
"$default_height": 18,
"$default_width": 18,
"$default_padding": 19
}

View file

@ -1,11 +1,12 @@
const u = require('../../src/units')
const public = key => !key.startsWith('$')
describe('Units', function() {
it('defaults', function() {
// check that an empty config has the default units (and nothing more)
const def = u.parse({})
Object.keys(def).length.should.equal(4)
Object.keys(def).filter(public).length.should.equal(4)
def.U.should.equal(19.05)
def.u.should.equal(19)
def.cx.should.equal(18)
@ -20,7 +21,7 @@ describe('Units', function() {
b: 'a + 1'
}
})
Object.keys(res).length.should.equal(6)
Object.keys(res).filter(public).length.should.equal(6)
res.a.should.equal(9)
res.b.should.equal(10)
// also check that order matters, which it should
@ -42,7 +43,7 @@ describe('Units', function() {
a: 'U + 1'
}
})
Object.keys(res).length.should.equal(5)
Object.keys(res).filter(public).length.should.equal(5)
res.a.should.equal(20.05)
})