tributary

rapid prototyping with d3.js

  • 所有者: enjalot/tributary
  • 平台:
  • 许可证: Other
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Tributary

![Gitter](https://badges.gitter.im/Join Chat.svg)

Tributary allows you to share live-editable code snippets. These snippets will
most likely use d3.js and allow a user to play with code in a very responsive
way.

Tributary is innovation on principle, taking the excellent work of Gabriel
Florit which was in turn inspired by Bret Victor's genius and making it sharable.

Tributary is a labor of love by Ian '@enjalot' Johnson and EJ '@mrejfox' Fox.

Usage:

Start typing into the code editor and watch your code come to life!
If you want to save your work you can click the fork button and it will save into a gist.
The url in your browser will update to something like:
http://tributary.io/inlet/2958568

where the number: 2958568 is the gist id
(you can see it here: https://gist.github.com/2958568 )

Development:

On the backend tributary only depends on node and mongodb:
To deploy locally run

git clone https://github.com/enjalot/tributary
cd ./tributary
npm install
node server.js

If you want to have github authentication working you will need to setup a
github app ( https://github.com/settings/applications ) and fill out the settings.js (see example-settings.js)
The github app should have the following settings:
full URL: http://localhost:8888
callback URL: http://localhost:8888/github-authenticated

Right now you will also need to setup an imgur app and set the authentication details in settings.js as well

Frontend JS src file compilation with make to static requires node.js, uglify-js and browserify

npm install

You need to compile the frontend code and templates using make:

make

You can check the Makefile to see how it's done with uglify and handlebars.
there is also a watch.sh bash script which will recompile the frontend code
when any files change.

To run the server you need to modify your /etc/hosts file and add

127.0.0.1 sandbox.localhost

this is because tributary uses a separate subdomain to execute unsafe code in an iframe.

Some 3rd party libraries are minified and catted together for convenience. The
result is found in /static/3rdparty.js
To see what those are and how they are bundled look at this repository:
http://github.com/enjalot/3rdparty

Reserved properties of the tributary object:
tributary.initialize
tributary.init
tributary.run
tributary.g
tributary.ctx
tributary.t
tributary.dt
tributary.loop
tributary.loop_type
tributary.autoinit
tributary.pause
tributary.bv
tributary.nclones
tributary.clone_opacity
tributary.duration
tributary.ease
tributary.reverse
tributary.render

Usage as a node module

Contexts

I'm using latest CodeMirror from git (updating every-so often)
I have customized the JSHINT options in addons/lint/javascript-lint.js to be:

{
  asi: true,
  laxcomma: true,
  laxbreak: true,
  loopfunc: true,
  smarttabs: true,
  sub: true
}

TODO:

Editor UI:

  • re-enable vim and emacs mode (add ui for those selections somewhere)
  • re-enable local storage backups per editor (need it so you can load code back but not execute it)

File UI:

  • open file from disk (file dialog)

  • edit filename

  • delete files

  • Embedding example (simpler UI, assemble from fewer pieces)

  • Make BV button work for any of the renders (not just svg)

Contexts

  • enable number scrubbing for text mode (csv and tsv files)

主要指标

概览
名称与所有者enjalot/tributary
主编程语言JavaScript
编程语言Makefile (语言数: 8)
平台
许可证Other
所有者活动
创建于2012-03-17 02:42:38
推送于2017-05-03 17:22:42
最后一次提交2017-05-03 10:22:41
发布数0
用户参与
星数597
关注者数38
派生数70
提交数776
已启用问题?
问题数104
打开的问题数36
拉请求数26
打开的拉请求数0
关闭的拉请求数4
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?