Git Product home page Git Product logo

nim-dashing's Introduction

badge badge License

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-dashing's People

Contributors

federicoceratto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nim-dashing's Issues

User input

Hi,

Amazing tool, thanks!

What is the proper way to also incorporate a user input widget/dash that waits for the input and updates a dash?

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.