GithubHelp home page GithubHelp logo

om-draggable's Introduction

om-draggable

A draggable meta-component with a few different dragging behaviors: free-drag, grid-snap-drag, and guideline-snap-drag.

Demo

Run the visualize example to get a sense of the draggable behaviors:

lein cljsbuild once
python -m SimpleHTTPServer 4005
open http://localhost:4005/examples/visualize/

Usage

(ns visualize.core
  (:require [cljs.core.async :as async :refer [>! <! alts! chan sliding-buffer put! close!]]
            [draggable.core :as dnd]
            [om.core :as om :include-macros true]
            [om.dom :as dom :include-macros true])
  (:require-macros [cljs.core.async.macros :as am :refer [go go-loop alt!]]))

(def app {:top 10
          :left 10
          :sub-com block-com
          :sub-com-data {:color %1
                         :size %2}
          :snap-threshold 25})

(om/root dnd/draggable
         app
         {:opts {:dragger-fn (fn [owner _]
                               (dnd/free-drag owner (:snap-threshold app)))}})

LICENSE

All code released under the MIT license

Copyright

BUSHIDO INC. 2014

om-draggable's People

Contributors

robert-stuttaford avatar sgrove avatar yayitswei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

om-draggable's Issues

Not seeing any snap behaviour in the example

I'm assuming from the code that the 3 different groups of circles should showcase free-drag, grid-snap and guideline-snap but in both Chromium and Firefox they all seem to behave like free-drag.

publish to clojars?

I'd like to use this code in my project, but from what I can tell that essentially means copying it and fitting it into the repo of my own code. Would be great if I could include it with all my other deps.

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.