Giter Club home page Giter Club logo

ember-konva's Introduction

ember-konva

ember-konva Logo

Ember component bindings for the Konva canvas library

Compatibility

  • Ember.js v2.18 or above
  • Ember CLI v2.13 or above
  • Node.js v8 or above

Installation

ember install ember-konva

npm install konva
# OR
yarn add konva

Usage

Examples

{{!-- app/components/konva-example.hbs --}}

<Konva::Stage
  @width={{1440}}
  @height={{800}}
  as |stage|
>
  <stage.Layer as |layer|>
    <layer.Path
      @x={{50}}
      @y={{50}}
      @data="..."
      @fill="#9B2918"
      @scale={{object x=0.4 y=0.4}}
    />

    <layer.Text
      @text="+"
      @fontSize={{36}}
      @x={{168}}
      @y={{60}}
      @fill="#020202"
    />

    <layer.Image
      @x={{200}}
      @y={{40}}
      @height={{180}}
      @width={{180}}
      @scale={{object x=0.4 y=0.4}}
      @image={{this.image}}
    />

    <layer.Text
      @text="="
      @fontSize={{36}}
      @x={{280}}
      @y={{60}}
      @fill="#020202"
    />

    <layer.Path
      @x={{315}}
      @y={{48}}
      @data="..."
      @stroke="#9B2918"
      @strokeWidth={{8}}
      @lineCap="round"
      @lineJoin="round"
      @scale={{object x=0.25 y=0.25}}
    />
  </stage.Layer>
</Konva::Stage>

This addon provides an object helper. This helper should be used instead of the ember built-in hash helper when passing component properties.
Konva relies on some object prototype methods which are stripped with the hash helper (ember apidoc)

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

ember-konva's People

Contributors

ember-tomster avatar kagemusha avatar mjanjic01 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kagemusha

ember-konva's Issues

Create component with several konva elements

Is it possible to create a component which encapsulates several konva elements that can be added to a Stage or Layer in an hbs template? Been trying to figure this out without luck.

v0.4.3 does not specify peer-dependencies

Thanks for this addon ๐Ÿ‘

The current release (0.4.3) of this addon published to npm does not specify konva as a peer-dependency which will break all applications that use this addon - I tried with a brand new app created via ember-cli 4.1.0.

The fix is already included on the master branch on github. Would be great if this version could be published as 0.4.4.

Thanks again for the work on this addon, very cool project ๐Ÿป

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.