Coder Social home page Coder Social logo

termdash's People

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

termdash's Issues

Remove all occurrences of utf8.RuneCountInString

While utf8.RuneCountInString counts the number of runes, it cannot be used to determine the number of cells the text takes. Full-width runes take multiple cells.

This mostly affects the text alignment code and the gauge widget.

There is a potential race between Options() and Draw() calls

This affects widgets that calculate their minimum size based on what data they currently have.

The following causes a race:

  1. infra calls Options()
  2. user changes values in the widget
  3. infra calls Draw(), potentially not respecting the min size.

Generalize mouse state machine

Design and implement a library that would ease detection of mouse button presses.

A press is when both the press and the release is within a defined area.

Look at the existing implementation in the focus tracking code of the container package.

Widget: Text input

Implement a widget that will allow the user to provide text input. Either single or multi-line.

Text and ESC seq

Is it possible to use with Text widget esc seq for foreground color?
Example ESC[39;49m

Widget: Table

Implement a text table widget.

Similar to: https://github.com/yaronn/blessed-contrib/blob/master/docs/images/table.gif

Targeted features:

  • Support both ASCII and Unicode text.
  • API to specify columns and rows.
  • API to specify sizes of columns (auto based on content, fixed or percentage).
  • API to merge multiple columns and rows (colspan and rowspan).
  • Support content alignment within cells.
  • Support Text trimming, character or word wrapping within cells.
  • Support scrolling of longer tables.
  • Support keyboard and mouse input to interact with the table (row by row or cell by cell).
  • Visible or invisible cell and table borders.
  • Support sorting by individual columns (ascending and descending).

Design and implement a keyboard trigger library

This library would receive a stream of keyboard presses and trigger a callback on the configured key or key combination.

This would ease the development of widgets or code that uses keyboard input and wants to support multi-key shortcuts.

Invalid synchronisation in termdash_test

The tests (specifically the after function) is currently synchronised by waiting for the event queue to empty. This isn't a good synchronisation, since the event processing code in termdash still races with the test code that evaluates the result.

Example traceback:
The command "go test ./..." exited with 0.
12.77s$ go test -race ./...
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x5f1cc8]
goroutine 38 [running]:
testing.tRunner.func1(0xc4200c05a0)
/home/travis/.gimme/versions/go1.10.3.linux.amd64/src/testing/testing.go:742 +0x567
panic(0x62cf60, 0x7881a0)
/home/travis/.gimme/versions/go1.10.3.linux.amd64/src/runtime/panic.go:502 +0x24a
github.com/mum4k/termdash.TestRun.func5(0xc42009c750, 0xc42006f100)
/home/travis/gopath/src/github.com/mum4k/termdash/termdash_test.go:239 +0x68
github.com/mum4k/termdash.TestRun.func11(0xc4200c05a0)
/home/travis/gopath/src/github.com/mum4k/termdash/termdash_test.go:358 +0xa00
testing.tRunner(0xc4200c05a0, 0xc4200833e0)
/home/travis/.gimme/versions/go1.10.3.linux.amd64/src/testing/testing.go:777 +0x16e
created by testing.(*T).Run
/home/travis/.gimme/versions/go1.10.3.linux.amd64/src/testing/testing.go:824 +0x565
FAIL github.com/mum4k/termdash 1.068s

Use fakewidget.Draw in tests that use the fake widget

All tests that use the fake widget should use fakewidget.Draw or fakewidget.MustDraw when creating the expected value.

That way changes or enhancements to fakewidget will be limited to that package.

This is an example of a test that doesn't use MustDraw and instead uses primitives directly (MustBorder, MustText):

desc: "draws widget with container border and title aligned on the left",

This is an example of a test that uses the desired helper instead of draw primitives:

fakewidget.MustDraw(

Support wide unicode characters

Some unicode characters take more than one cell to be displayed.

This must be supported by the canvas.SetCell function, the draw.Text function and the text widget.

Support custom colors.

Should be configurable for:

  1. The line graphs.
  2. The axes.
  3. The values displayed next to the axes.
  4. The axes labels.

Optimize redraw of terminal

Some ideas:
The canvas can track which cells were set and only apply those to the terminal.
Widgets can indicate if they need a redraw or if the content is still the same.
Container can redraw only those widgets that changed.
Thetermdash API can support user triggered redraw instead of periodic.

Change of container focus using keyboard shortcuts

Currently the focus (which widget receives keyboard and mouse events) can only be moved by mouse clicks.

We could enhance the container so that widget focus is moved by configurable keyboard shortcuts. This would involve adding new container options and enhancing the container itself so that it processes events.

Support variable size container splits

Currently both the vertical and the horizontal splits split the container exactly in the middle.

Allow for multiple sizes. Consider using predefined sizes (like SplitHalf, SplitQuarter, ...) instead of accepting number to avoid possibility of input errors.

Unify APIs in the draw package

All functions should define their own option type instead of accepting cell options.

One of their options would be to take in a list of cell options.

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.