• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wavedrom / wavedrom / 6739999361

03 Nov 2023 01:00AM UTC coverage: 64.638%. Remained the same
6739999361

push

github

drom
eslint fixes. same line else-if chains

214 of 408 branches covered (0.0%)

Branch coverage included in aggregate %.

3 of 4 new or added lines in 2 files covered. (75.0%)

2 existing lines in 1 file now uncovered.

455 of 627 relevant lines covered (72.57%)

86.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

36.54
/lib/render-over-under.js
1
'use strict';
2

3
const tt = require('onml/tt.js');
5✔
4

5
const colors = {
5✔
6
    1: '#000000',
7
    2: '#e90000',
8
    3: '#3edd00',
9
    4: '#0074cd',
10
    5: '#ff15db',
11
    6: '#af9800',
12
    7: '#00864f',
13
    8: '#a076ff'
14
};
15

16
function renderOverUnder (el, key, lane) {
17
    const xs = lane.xs;
310✔
18
    const ys = lane.ys;
310✔
19
    const period = (el.period || 1) * 2 * xs;
310✔
20
    const xoffset = -(el.phase || 0) * 2 * xs;
310✔
21
    const gap1 = 12;
310✔
22
    const serif = 7;
310✔
23
    let color;
24
    const y = (key === 'under') ? ys : 0;
310✔
25
    let start;
26

27
    function line (x) {
28
        return (start === undefined) ? [] : [['line', {
×
29
            style: 'stroke:' + color,
30
            x1: period * start + gap1,
31
            x2: period * x
32
        }]];
33
    }
34

35
    if (el[key]) {
310!
36
        let res = ['g', tt(
×
37
            xoffset,
38
            y,
39
            {style: 'stroke-width:3'}
40
        )];
41
        const arr = el[key].split('');
×
42
        arr.map(function (dot, i) {
×
43
            if ((dot !== '.') && (start !== undefined)) {
×
44
                res = res.concat(line(i));
×
45
                if (key === 'over') {
×
46
                    res.push(['path', {
×
47
                        style: 'stroke:none;fill:' + color,
48
                        d: 'm' + (period * i - serif) + ' 0 l' + serif + ' ' + serif + ' v-' + serif + ' z'
49
                    }]);
50
                }
51
            }
52
            if (dot === '0') {
×
53
                start = undefined;
×
NEW
54
            } else if (dot !== '.') {
×
55
                start = i;
×
56
                color = colors[dot] || colors[1];
×
57
            }
58
        });
59
        if (start !== undefined) {
×
60
            res = res.concat(line(arr.length));
×
61
        }
62
        return [res];
×
63
    }
64
    return [];
310✔
65
}
66

67
module.exports = renderOverUnder;
5✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc