nim-dashing

Terminal dashboards for Nim
授权协议 LGPL-3.0 License
开发语言 C/C++
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 康泽宇
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Dashing is a library to quickly create terminal-based dashboards in Nim.

Example

Dashing provides high-level components: vertical and horizontal charts, gauges, log panes, text windows and screen splitting. It’s built on top of the terminal module.

Similar libraries for other languages: dashing termui blessed blessed-contrib

Installation

Use packages from your Linux distribution, or:

nimble install dashing

Usage

import terminal
from os import sleep

import dashing

proc demo() =
  erase_screen()
  var ui = Tile(kind:HSplit, title:"foo", border_color:"f00", items: @[
    Tile(kind:VSplit, items: @[
      Tile(kind:HGauge, val:50, title:"only title", border_color:"f88"),
      Tile(kind:HGauge, label:"only label", val:20, border_color:"f88"),
      Tile(kind:HGauge, label:"only label", val:30, border_color:"f88"),
      Tile(kind:HGauge, label:"only label", val:50, border_color:"f88"),
      Tile(kind:HGauge, label:"only label", val:80, border_color:"f88"),
      Tile(kind:HGauge, val:20),
      Tile(kind:HGauge, label:"label, no border", val:55),
      Tile(kind:HSplit, items: @[
        Tile(kind:VGauge, val:0),
        Tile(kind:VGauge, val:5),
        Tile(kind:VGauge, val:30),
        Tile(kind:VGauge, val:50),
        Tile(kind:VGauge, val:80),
        Tile(kind:VGauge, val:95),
      ]),
    ]),
    Tile(kind:VSplit, items: @[
      Tile(kind:HSplit, border_color:"0ff"),
      Tile(kind:HChart, border_color:"0f0", low_color:"2d2", high_color:"bfb"),
      Tile(kind:Log, title:"logs", border_color:"000"),
    ]),
    Tile(kind:HSplit, items: @[
      # Tile(kind:VGauge, val:95, low_color:"2d2", high_color:"22d"),
      # Tile(kind:VGauge, val:95, low_color:"2d2", high_color:"22d"),
      # Tile(kind:VGauge, val:95, low_color:"2d2", high_color:"22d"),
      # Tile(kind:VGauge, val:95, low_color:"0c0", high_color:"c00"),
      Tile(kind:Text, text:"Hello World,\nthis is dashing.", border_color:"000"),
      Tile(kind:Log, title:"logs", border_color:"000"),
      Tile(kind:VChart, border_color:"", color:""),
      Tile(kind:HChart, border_color:"0f0", low_color:"2d2", high_color:"bfb"),
      Tile(kind:HBrailleChart, border_color:"", color:""),
      Tile(kind:HBrailleFilledChart, border_color:"", color:"")
    ])
  ])

  ui.items[0].items[0].val = 0.5
  sleep 1000
  set_cursor_at(0, terminal_height() - 1)
 相关资料
  • Nim

    Nimrod(已改名为 Nim)是一种静态类型的编译系统编程语言。它结合了 Python、Ada和Modula等成熟语言的成功理念。 高效的 Nim生成不依赖于虚拟机的本机无依赖可执行文件,这些可执行文件很小并且允许重新分配。 Nim编译器和生成的可执行文件支持所有主要平台,例如Windows,Linux,BSD和macOS。 在C ++和Rust的启发下,Nim的内存管理是确定性的,并且可以使用

  • nim-asciitables simple terminal ascii tables for nim DEPRECATION project is deprecated in favor for nim-terminaltables How to use asciitables has a very simple api setHeaders to set column names addRo

  • nim-terminaltables terminal tables for nim API API docs available hereterminaltables has a very small API newUnicodeTable uses unicodeStyle newAsciiTable uses asciiStyle Table style is configurable us

  • Gatabase Works with ARC, ORC, --panics:on, --experimental:strictFuncs. Use Gatabase is designed as 1 simplified Strong Static Typed Connection-Pooling Compile-Time SQL DSL Sugar. Nim mimics SQL. ~1000

  • allographer An asynchronous query builder library inspired by Laravel/PHP and Orator/Python for Nim Easy to access Rdb Query Builder import asyncdispatchimport allographer/connectionimport allographer

  • libssh2.nim Nim wrapper for libssh2 For document please refer to libssh2 website Requirements In order to use this wrapper, libssh2 must installed on your system: Mac OSX:$ port install libssh2 Ubuntu

相关阅读

相关文章

相关问答

相关文档