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

it is not ascii chart #2

Closed
diphuaji opened this issue Sep 11, 2017 · 4 comments
Closed

it is not ascii chart #2

diphuaji opened this issue Sep 11, 2017 · 4 comments
Assignees

Comments

@diphuaji
Copy link

characters from base ASCII table range from 0 to 127 and those from extended ASCII table are within 0 to 255.
the characters used in the project fall outside of either of the two ranges.

@kroitor kroitor self-assigned this Sep 11, 2017
@kroitor
Copy link
Owner

kroitor commented Sep 11, 2017

Yep, thanks, I agree! This is not an ASCII chart to be formally strict. The box-drawing symbols were initially configurable, later I decided to remove that option, but the title remained the same.

@kroitor kroitor closed this as completed Sep 11, 2017
@evert
Copy link

evert commented Jan 25, 2019

I just ran into this as well. This is how it looks like on my vt320

img_20190125_144126

@kroitor
Copy link
Owner

kroitor commented Jan 26, 2019

@evert wow! cool term, man! )

In order to display it in true ASCII 0-127, you can change the drawing symbols, like so:

        for (let y = min2; y <= max2; ++y) { // axis + labels
            let label = format (max - (y - min2) * range / rows, y - min2)
            result[y - min2][Math.max (offset - label.length, 0)] = label
            result[y - min2][offset - 1] = (y == 0) ? '┼' : '┤'  // ←--------- change this to + and |
        }

        let y0 = Math.round (series[0] * ratio) - min2
        result[rows - y0][offset - 1] = '┼' // first value // ←--------- change this to +

        for (let x = 0; x < series.length - 1; x++) { // plot the line
            let y0 = Math.round (series[x + 0] * ratio) - min2
            let y1 = Math.round (series[x + 1] * ratio) - min2
            if (y0 == y1) {
                result[rows - y0][x + offset] = '─' // ←-------- change this to a dash -
            } else {
                result[rows - y1][x + offset] = (y0 > y1) ? '╰' : '╭' // ←- change this to \ and /
                result[rows - y0][x + offset] = (y0 > y1) ? '╮' : '╯' // ←- change this to \ and /
                let from = Math.min (y0, y1)
                let to = Math.max (y0, y1)
                for (let y = from + 1; y < to; y++) {
                    result[rows - y][x + offset] = '│' // ← change this to a small vertical bar |
                }
            }
        }

↑ that, however, requires editing the source code of the package. I'll think on restoring config options for drawing symbols as well.

@DoktorJ
Copy link

DoktorJ commented Jun 16, 2020

FWIW the option has been reimplemented at this point, so you can specify the characters you want to use (such as "+", "-", "|", "/", "" or whatever else).

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

4 participants