All Projects → tomasAlabes → backbone.raphael

tomasAlabes / backbone.raphael

Licence: MIT license
An easy way to add svg/vml views into your Backbone app

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to backbone.raphael

Shareabouts
Shareabouts is a mapping application for crowdsourced info gathering.
Stars: ✭ 269 (+389.09%)
Mutual labels:  backbonejs
Backbone.vdomview
VirtualDOM-aware Backbone View
Stars: ✭ 23 (-58.18%)
Mutual labels:  backbonejs
Backbone Poller
Backbone poller is a simple utility that allows polling on any backbone model or collection
Stars: ✭ 140 (+154.55%)
Mutual labels:  backbonejs
Pim Community Standard
[Community Standard Edition] The open source Product Information Management (PIM) - please raise issues in https://github.com/akeneo/pim-community-dev/issues
Stars: ✭ 329 (+498.18%)
Mutual labels:  backbonejs
Tyto
manage and organise things
Stars: ✭ 662 (+1103.64%)
Mutual labels:  backbonejs
Backbone.js Russian
Русская версия сайта Backbone.js
Stars: ✭ 62 (+12.73%)
Mutual labels:  backbonejs
indigo
Indigo Platform for publishing beautiful legislation.
Stars: ✭ 44 (-20%)
Mutual labels:  backbonejs
Dimeshift
💰💰💰 the easiest way to track your expenses. Free. Open-source. Node.js
Stars: ✭ 173 (+214.55%)
Mutual labels:  backbonejs
Backbone Debugger
Chrome Developer Tools extension for debugging Backbone.js applications
Stars: ✭ 702 (+1176.36%)
Mutual labels:  backbonejs
Backboneanalyze
backbone源码解读
Stars: ✭ 129 (+134.55%)
Mutual labels:  backbonejs
Query Engine
Even though this is an amazing piece of technology, and can be used independently, it requires a conversion to TypeScript and proper documetnation and tutorials, which we do not have time for.
Stars: ✭ 332 (+503.64%)
Mutual labels:  backbonejs
Community Skeleton
UVDesk Opensource Community Helpdesk Project built for all to make a full Ticketing Support System along with many more other features.
Stars: ✭ 540 (+881.82%)
Mutual labels:  backbonejs
Marionette.toolkit
A collection of opinionated Backbone.Marionette extensions for large scale application architecture.
Stars: ✭ 71 (+29.09%)
Mutual labels:  backbonejs
Client Js
Backbone-based JavaScript client for WP API
Stars: ✭ 270 (+390.91%)
Mutual labels:  backbonejs
Web
Angular6 music player to search and play YouTube, SoundCloud and Mixcloud tracks
Stars: ✭ 156 (+183.64%)
Mutual labels:  backbonejs
Jass
SoulSeek client with web interface and recommender system
Stars: ✭ 23 (-58.18%)
Mutual labels:  backbonejs
Backbone Faux Server
A framework for mocking up server-side persistence / processing for Backbone.js
Stars: ✭ 55 (+0%)
Mutual labels:  backbonejs
raphael-boilerplate
Raphael JS vector graphics library boilerplate
Stars: ✭ 52 (-5.45%)
Mutual labels:  raphaeljs
Evolutility Ui Jquery
Model-driven Web UI for CRUD using REST or localStorage.
Stars: ✭ 164 (+198.18%)
Mutual labels:  backbonejs
Mydailylearn
🚀 Important commands, Code Snippets, Basics on different topics learning daily 🎉!
Stars: ✭ 87 (+58.18%)
Mutual labels:  backbonejs

Backbone.raphael

An easy way to add svg/vml views into your Backbone app

This extension enables you to add views to your backbone apps tweaking how Backbone and RaphaelJS handle event bindings.

Quickstart guide

  • Add backbone.raphael.js after Backbone and all it dependencies
<script type="text/javascript" src="raphael.js"></script>

<script type="text/javascript" src="jquery-2.0.1.js"></script>
<script type="text/javascript" src="underscore.js"></script>
<script type="text/javascript" src="backbone.js"></script>


<script type="text/javascript" src="backbone.raphael.js"></script>


<script type="text/javascript" src="yourApp.js"></script>
  • Use it in your app
var paper = Raphael("container", 300, 640);

// Usual backbone model
var CircleModel = Backbone.Model.extend();

var CircleView = Backbone.RaphaelView.extend({

    initialize: function(){
        var model = this.model;
        this.listenTo(model, "change", this.render);

        // Create raphael element from the model
        var circle = paper.circle(model.get("x"), model.get("y"), model.get("radio")).attr({fill: model.get("color")});

        // Set the element of the view
        this.setElement(circle);
    },

    events: {
        // Any raphael event
        "click": "sayType"
    },

    sayType: function(evt){
        console.log(evt.type);
    },

    render: function(){
        var circle = this.el;
        var model = this.model;

        //When the model changes, so the element
        circle.attr({
            cx: model.get("x"),
            cy: model.get("y"),
            r: model.get("radio"),
            fill: model.get("color")
        });
    }

});

var model = new CircleModel({
    x: 100,
    y: 150,
    radio: 50,
    color: "blue"
});

var view = new CircleView({
    model: model
});

For a more complex example see the sample app in this repo.

Thats it!

Copyright and license

Licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].