Code Monkey home page Code Monkey logo

Comments (4)

EddieDover avatar EddieDover commented on July 18, 2024 1

@basxto I actually like how your mind was working with this, so I ran with your technique.

A new PR is up that should do nicely. It may take a bit to get merged in, but the work is done.

from termsaver.

brunobraga avatar brunobraga commented on July 18, 2024

Care to elaborate what this functionality is about?

from termsaver.

basxto avatar basxto commented on July 18, 2024

This was especially meant for sysmon.
It would be handy for matrix, but cmatrix is already capable of that.

Background is that I’m writing a little terminal module for LED panels.
I'm very limited on pixels and that’s why I tried to get it working with only ASCII.
But I added ASCII altchars (lineart stuff) and a few characters from unicode (half blocks, lineart) by now.
I still have a few missing characters on sysmon though. (It looks the same on TTY)

Before I started translating unicode characters to altchars, sysmon looked like this:

It could be realized with just ASCII (#_## etc) or with altcodes.
Altchars work like this: \033(0m\033(B for └
A full block could be created with inverting color \033[7m \033[27m

And before I started to tread multiple (ASCII) chars as one unknown unicode character, it looked like this:

That’s how it will look in Terminals, that do not support unicode.

EDIT: I modified my unicode translator a bit and this is how sysmon could look with just +-|#

from termsaver.

basxto avatar basxto commented on July 18, 2024

I could imagine something like this:

    pie_chart = [['○', '◔', '◑', '◕', '●'],[' ', '|', '(', 'C', 'O'],[' ', '|', '(', 'C', 'O']]
    """
    Holds the unicode symbols for pie chart representation of percentage
    """
    block = [[' ', '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█', '█'], [' ', '\033(0s\033(B', '\033(0s\033(B', '\033(0s\033(B', '\033(0s\033(B', '\033[7m \033[27m', '\033[7m \033[27m', '\033[7m \033[27m', '\033[7m \033[27m', '\033[7m \033[27m'], [' ', '_', '_', 'm', 'm', 'm', '#', '#', '#', '#']]
    """
    Holds the block unicode symbolds used to draw the charts
    """
    axis_corner = ["└","\033(0m\033(B","+"]
    """
    Represents the unicode symbol for the axis corner in the xy chart
    """
    axis_h = ["─","\033(0q\033(B","-"]
    """
    Represents the unicode symbol for the horizontal axis in the xy chart
    """
    axis_v = ["│","\033(0x\033(B","|"]

from termsaver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.