GitXplorerGitXplorer
b

b4

public
4 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
f107c8de1d65d9a4b54b5f09c9b601d4ce6e8684

updating b4

bbollwyvl committed 12 years ago
Unverified
1b329fb31b4ac30904ace0c019f85647912b5c3d

fixing extra initialization for title inputs

bbollwyvl committed 12 years ago
Unverified
a3c293c203e78ba81c1fe1b107abe1c35fcaffab

adding support for variables

bbollwyvl committed 12 years ago
Unverified
0ba2cb509a2e637eb3cabda6390e98bbdeb9e7a1

added space for plugins

bbollwyvl committed 12 years ago
Unverified
f30634955f6cdac333c3eb0a92ed8f24668deeb8

linting

bbollwyvl committed 12 years ago
Unverified
33897512640feabbab9072d5a235f3fa76a706b9

linting

bbollwyvl committed 12 years ago

README

The README file for this repository.

b4: beatiful blockly block builder

A d3-style API for building new Blockly blocks.

usage

I'm still a little fuzzy on how to really use Blockly in the general case (embedded as an embedded thing). I have started working on blockd3, a d3-in-Blockly library, with an editor forked from the Blockly code editor. So I guess you can check that out, and see what I did, and maybe it will help you.

motivation

Blockly is great, but kind of ponderous to extend, putting the "Java" back into "JavaScript." Let us have an alternative form. How about a more
pythonic/d3/underscore-like API?

var D3_WIKI = "https://github.com/mbostock/d3/wiki/";

// set up a base configuration
var d3_mold = b4.block()
    .generator("JavaScript")
    .helpUrlTemplate(D3_WIKI)
    .namespace("")
    .colour("steelBlue"),
            
    // make a subconfiguration
    select_mold = d3_mold.clone()
        .namespace("d3_select")
        .category("d3 selection")
        .output(D3_TYPES.SELECTION)
        .helpUrlTemplate(D3_WIKI +"Selections#wiki-<%= block.id() %>");
            
select_mold.clone("")
    .tooltip("The first element that matches the selector")
    .appendTitle("select the first element that matches")
    .appendTitle(D3_TYPES.SELECTION.field)
    .code("d3.select('<%= $.title('SELECTOR') %>')")
    .done();

roadmap

  • support full Blocky API
  • test suite
    • will probably need to use PhantomJS to get this automated, which scares me