chunqiuyiyu/ervy

Big difference between 1ch and 2ch size plots

jcubic opened this issue · 1 comments

I have testing code like this:

// same imports as in demo/index.js
var size = +process.argv[2];
(function(ervy) {
    var chars = ['#', '+', '*', '#', '@', '%'];
    var colors = ['red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white'];
    var commands = {
        scatter: function(...args) {
            var data = args.map((x, i) => {
                var [key, value, style] = x.split(':');
                if (style) {
                    if (style.length === 1) {
                        style = ervy.fg(colors[i], style);
                    } else {
                        style = ervy.bg(style, size);
                    }
                } else {
                    style = chars[i];
                }
                return value.split(';').map(x => {
                    return {key, value: x.split(',').map(x => +x), style};
                });
            });
            data = [].concat.apply([], data);
            return ervy.scatter(data, {width: 15, legendGap: 18});
        }
    };
    console.log(commands.scatter('Foo:1,1;2,2;3,3;4,4;5,5;6,5;7,5;8,5:green','Bar:1,2;2,3;3,4;4,5;5,6;6,6;7,6;8,6:yellow','Baz:12,8;13,8;12,7;13,7:red','Quux:12,4;14,4:blue'));
})({fg,scatter,bg});

Below is output of pixel size 2 and 1. I think that they should look the same but the width of the dots,

ervy6

Thanks it works. In can see in my demo https://codepen.io/jcubic/pen/gObPBdP?editors=0010