Giter Site home page Giter Site logo

comic.js's Introduction

comic.js

Javascript library that acts as plugin for Raphael.js, D3.js, SVG.js and provides functions for cartoon style SVG drawing. Currently it supports only SVG (no canvas), but if someone needs canvas support I might implement it (let me know).

screenshot

Examples

Raphael.js D3.js SVG.js

Usage

Simply include comic.min.js after including one of the support libraries (Raphael.js, D3.js, SVG.js). Then it can be used as follows, assuming that you have a container div with id paper:

// Raphael.js
paper = Raphael("paper", width, height);
stuff = paper.set();

or

// D3.js
paper = d3.select("#paper").append('svg');
stuff = paper.append("g");

or

// SVG.js
paper = SVG('paper').size(width, height);
stuff = paper.group();

and then

stuff.cLine(x1, y1, x2, y2)         // LINE from starting point to end point
    .cTrian(x1, y1, x2, y2, x3, y3) // TRIANGLE over three corner points
    .cRect(x1, y1, width, height)   // RECTANGLE at upper left point with width & height
    .cCircle(x1, y1, r)             // CIRCLE at center point with radius
    .cEllipse(x1, y1, r1, r2)       // ELLIPSE at center point with two radiuses
    ;
stuff.attr({
    "stroke":"#E0AE9F",
    "stroke-width": 2
});

All further things should work the default way of your chosen library. I have done little experiments though and errors are probable - please let me know if you encounter any.

Credits

Inspired by and based on Jonas Wagner's work which is based on this paper

comic.js's People

Contributors

balint42 avatar jwagner avatar

Stargazers

Michael Anthony avatar Jan Roudaut avatar roadlabs avatar

Watchers

roadlabs avatar James Cloos avatar  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.