Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jaredly/treed

Powerful Tree Editor
https://github.com/jaredly/treed

Last synced: 4 days ago
JSON representation

Powerful Tree Editor

Awesome Lists containing this project

README

        

# Treed
A Powerful Tree Editing Component

[![Join the chat at https://gitter.im/jaredly/treed](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jaredly/treed?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Treed wants to be for tree editing what ace is for text editing. Extensible, customizable, powerful, and just plain easy to use. Perhaps that's a little ambitious, but that's the idea.

[Play with a demo](http://jaredly.github.io/treed/)

[![screenshot](docs/screenshot.png)](http://jaredly.github.io/treed/)

## Features

### Keyboard navigation
I'm a vim user, so there are a lot of vim navigation commands that work out of the box, as well as more normal commands for everyone else.



Action
Bindings



Navigationarrow keys, hjkl
Indent/Dedenttab, shift tab
Collapse/Expandalt + left/right
alt + h/l
z (toggle)
Undo/Redoctrl + z, ctrl + shift + z, u, R
Move Nodectrl + alt + arrow / hjkl
Edit modereturn, f2, a, A, i, I
Normal Modeescape
Toggle Donectrl + return
New Nodeo, O (before)
return (in insert mode)
Cut/Copy/Pastectrl + x / delete, ctrl + c, ctrl + v

There are several more as well.

### Modularity
Treed is constructed using the MVC pattern such that it is simple to, for example, create an entirely different view for the tree.

You can also create your own "Node" class if you wanted to do more than just have a single text input. You could add buttons, more fields, whatever you want.

### Undo/Redo
It works. Unlimited undo.

## Drag and Drop
I'm still tinkering with the interaction on this. Should I let you drop as children of nodes that have no children?

## Still under development
I made this version in a weekend, so there are still some things to do :)

- multi-line select (cut/copy/paste multiple, not necessarily contiguous)
- api docs
- testing (js + browser)

## Future Awesomeness

I want to implement a view layer similar to each of the following services:

- workflowy
- trello
- a whiteboard
- ginko
- mindmap

And hook them all to the same model, allowing you to switch between contexts. And then hook it all up to a database (firebase or hood.ie or pouchdb or leveldb?).
I think it will be exactly what I've always wanted; we'll see.

# Build instructions

You will need:

- [nodejs](http://nodejs.org/)
- [webpack](http://webpack.github.io) `npm install -g webpack`

```
npm install
cd demo
webpack --watch
```

Then open `demo/plugins/index.html` for example in your favorite browser, and
enjoy!