Skip to content

[Feature idea] Map in the terminal #222

@varna9000

Description

@varna9000

I've been experimenting a bit with showing a static node map in the terminal. It seems it's possible entirely with python and with the help of libsixel. I'm using iTerm on MacOS which supports sixel protocol, and which is quite old btw. Not sure what others are using and if their terminals support sixel.

So I used static map generator - py-staticmaps to generate the image below by manually adding node names and their coordinates.

The idea is to collect a dynamic in-memory array of all node names and their coordinates and if the user presses, say ^m, the image will be generated on the fly and will be shown "full-screen". I guess it could be made to zoom in and out, as the generation is quite quick, but it will require further research.

The map generator uses various providers APIs to get the map tiles, so in case you want to use it offline, you need to figure out how to pre-download the tiles and generate the map. I haven't got that deep tbh and if it can be done without modifying py-staticmaps at all.

I experimented also with converting the image into ASCII, but the map is unrecognisable 😁 Any thoughts on the idea?

EDIT: This is a list of the sixel supported terminals. Not sure how up-to-date it is, but it's a starting point.

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions