Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big difference between 1ch and 2ch size plots #15

Closed
jcubic opened this issue Jan 3, 2020 · 1 comment
Closed

Big difference between 1ch and 2ch size plots #15

jcubic opened this issue Jan 3, 2020 · 1 comment

Comments

@jcubic
Copy link
Contributor

jcubic commented Jan 3, 2020

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

chunqiuyiyu pushed a commit that referenced this issue Jan 7, 2020
@jcubic
Copy link
Contributor Author

jcubic commented Jan 7, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants