Code Monkey home page Code Monkey logo

shinsekai's Introduction

shinsekai

Component based visualization framework for Angular

Install

bower

bower install shinsekai
<script src="angular.js"></script>
<script src="shinsekai.js"></script>

npm

npm install shinsekai
var angular = require('angular'),
    shinsekai = require('shinsekai');

angular.module('example', [shinsekai]);

Usage

<!-- Normal SVG -->
<circle r="5" cx="50" cy="50"/>

<!-- SVG with data binding -->
<circle ss-r="ctrl.r" ss-cx="ctrl.cx" ss-cy="ctrl.cy"/>

<!-- SVG with data binding and animation -->
<circle ss-r="ctrl.r" ss-cx="ctrl.cx" ss-cy="ctrl.cy" ss-dur="0.3" ss-delay="0.2"/>

Example

https://jsfiddle.net/9mdjvh1o/

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>shinsekai.js Example</title>
</head>
<body ng-app="shinsekai-example">
<div ng-controller="MainController as ctrl">
  <div>
    <label>r</label>
    <input type="number" min="0" max="50" step="5" ng-model="ctrl.r"/>
  </div>
  <div>
    <label>x</label>
    <input type="number" min="0" max="500" step="50" ng-model="ctrl.x"/>
  </div>
  <div>
    <label>y</label>
    <input type="number" min="0" max="500" step="50" ng-model="ctrl.y"/>
  </div>
  <div>
    <label>color</label>
    <input type="color" ng-model="ctrl.color"/>
  </div>
  <div>
    <svg width="500" height="500">
      <circle ss-r="ctrl.r" ss-cx="ctrl.x" ss-cy="ctrl.y" ss-fill="ctrl.color" ss-dur="0.5"/>
    </svg>
  </div>
</div>
<script src="angular.js"></script>
<script src="shinsekai.js"></script>
<script>
angular.module('shinsekai-example', ['shinsekai'])
  .controller('MainController', function () {
    this.r = 20;
    this.x = 250;
    this.y = 250;
    this.color = '#000';
  });
</script>
</body>
</html>

Another example

Lisence

MIT

shinsekai's People

Contributors

likr avatar

Watchers

 avatar  avatar

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.