Giter Club home page Giter Club logo

bubbles-tree's Introduction

Tree Model for BubbleTea TUI framework

This is a package to be used in applications based on Bubble Tea TUI framework.

It can be used to output an interactive tree model.

The nodes of the tree, need to conform to a simple interface.

type Node interface {
	tea.Model
	Parent() Node
	Children() Nodes
	State() NodeState
}

Instalation

go get github.com/mariusor/bubbles-tree

Examples

To see two of the possible usages for this package check the examples folder where we have a minimal filesystem tree utility and a threaded conversation.

$ go run main.go -depth 3 ../../
 └─ ⊟ /some/path/bubbles-tree
    ├─ ⊟ examples
    │  └─ ⊟ tree
    │     ├─   go.mod
    │     ├─   go.sum
    │     ├─   go.work
    │     └─   main.go
    ├─   go.mod
    ├─   go.sum
    ├─   tree.go
    └─   tree_test.go

Conversation

 $ go run . -depth 3
╻
┃ Root node
┃ Sphinx of black quartz, judge my vow!
┃ The quick brown fox jumps over the lazy dog.
╹
┃ ╻
┃ ┃ Child node
┃ ┃ Sphinx of black quartz, judge my vow!
┃ ┃ The quick brown fox jumps over the lazy dog.
┃ ╹
┃ ┃ ╻
┃ ┃ ┃ Child node
┃ ┃ ┃ Sphinx of black quartz, judge my vow!
┃ ┃ ┃ The quick brown fox jumps over the lazy dog.
┃ ┃ ╹

bubbles-tree's People

Contributors

mariusor avatar

Stargazers

Nikolaus Schlemm avatar vi|vi|vi avatar  avatar Ujjwal Panda avatar Luka Markušić avatar Conor Sinclair avatar boB Rudis avatar Birger J. Nordølum avatar Christian Rocha avatar  avatar Andy Walker avatar Nathan JANCZEWSKI avatar Different55 avatar

Watchers

 avatar James Cloos avatar Luka Markušić avatar  avatar

Forkers

austinoneil

bubbles-tree's Issues

[Feature request] Long listing format

I was just wondering were there any plans to add the ability to display a filetree with more attributes than just the path.

I'm aiming at something like this:
image

It does digress a bit from a general "tree"-like view, since this would specifically be a filetree, but I'm just curious, don't want to hack it if there's something already in the pipeline.

Missing license

Hi, I found this repo via charmbracelet/bubbles#233 but noticed it doesn't have a license. I'd recommend MIT to be consistent with the upstream project you're hoping to integrate it with 🙂

Note that, without a license, code is generally assumed to be proprietary and the Charm team will likely not be able to read it.

Tree always opens in Full Screen

I followed the example but the tree always opens up in the full screen even when AltOption is not provided.

Is is by default or am i missing something?

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.