gesture


License

License

GroupId

GroupId

com.github.benhutchison
ArtifactId

ArtifactId

gesture_sjs0.6_2.11
Last Version

Last Version

0.3
Release Date

Release Date

Type

Type

jar
Description

Description

gesture
gesture
Project URL

Project URL

https://github.com/benhutchison/gesture
Project Organization

Project Organization

com.github.benhutchison

Download gesture_sjs0.6_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.benhutchison/gesture_sjs0.6_2.11/ -->
<dependency>
    <groupId>com.github.benhutchison</groupId>
    <artifactId>gesture_sjs0.6_2.11</artifactId>
    <version>0.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.benhutchison/gesture_sjs0.6_2.11/
implementation 'com.github.benhutchison:gesture_sjs0.6_2.11:0.3'
// https://jarcasting.com/artifacts/com.github.benhutchison/gesture_sjs0.6_2.11/
implementation ("com.github.benhutchison:gesture_sjs0.6_2.11:0.3")
'com.github.benhutchison:gesture_sjs0.6_2.11:jar:0.3'
<dependency org="com.github.benhutchison" name="gesture_sjs0.6_2.11" rev="0.3">
  <artifact name="gesture_sjs0.6_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.benhutchison', module='gesture_sjs0.6_2.11', version='0.3')
)
libraryDependencies += "com.github.benhutchison" % "gesture_sjs0.6_2.11" % "0.3"
[com.github.benhutchison/gesture_sjs0.6_2.11 "0.3"]

Dependencies

compile (3)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.8
org.scala-js : scalajs-library_2.11 jar 0.6.13
org.typelevel : cats_sjs0.6_2.11 jar 0.8.1

test (1)

Group / Artifact Type Version
org.scala-js : scalajs-test-interface_2.11 jar 0.6.13

Project Modules

There are no modules declared in this project.

gesture

Purely functional recognition of Drag and Click gestures over a W3C Pointer Event -compatible API, for Scala/Scala.js

Built on top of the State monad provided by the Cats library.

gesture core

Contains the library code:

  • GestureProcessor converts a series of PointerEvents into a series of GestureEvents, while updating a Finite State Machine represented by PointerState.

  • Optionally, GestureAndRegionProcessor[R] can extend the functionality to tracking the region R where the gesture began and completed, if any. The region itself is provided by the user of the library an can be any type, so long a there is a search function (Double, Double) => Option[R] to find the region R at a coordinate, if any.

  • Coordinates are modeled as (Double, Double)

Published for both Scala.jvm and Scala.js.

SBT: "com.github.benhutchison" %%% "gesture" % "0.3"

Changelog

Version When Changes
0.1 Jan 16 Initial release
0.2 Oct 16 Upgrade libs, cats to 0.7.2, scalajs-dom to 0.9
0.3 Nov 16 Scala 2.12, cats to 0.8.1

gesture demo

Shows a working demo of the recognition system, implemented over an HTML canvas. Colored rectangles can be created and dragged around the screen.

To try it out, clone the project, run sbt demo/fullOptJS, and then load file demo/demo-opt.html in a browser.

The demo uses the reliable Points polyfill developed by Rich Harris to provide Pointer Events across browsers/devices.

Versions

Version
0.3
0.2
0.1