Coder Social home page Coder Social logo

tactilegraph.js's Introduction

Code Climate GitHub version MIT License

tactileGraph.js

Just a 'canvas like' tactile graphic drawing library.:octocat:


日本語:https://github.com/HirotsuguKaga/tactileGraph.js/blob/master/README_ja.md


Gh-Pages & DEMO: https://hirotsugukaga.github.io/tactileGraph.js/


REQUREMENT

ECMA-262 3rd edition or above.

INSTALL

<script src="tactileGraph.js"></script>
  or
<script src="tactileGraph.min.js"></script>

USAGE

ex.
  var tg = tactileGraph("canvas", "A4", "edl");  //initial. tactileGraph("[id]","[paper size]", "[EDL or EDI]")

  tg.drawBraille("ABCDEF", 0, 10);  //drawing
  tg.drawLine(0,20,50,20);

  hoge.href = tg.map2esa();  //output

Methods

Draw Braille

drawBraille(string str, int x, int y , int returnX);

return next letter position ([x, y]).

arr2braille(arr, x,y);

drawBrailleMath(string str, int x, int y , int returnX);

drawBrailleRight(string str, int x, int y);

drawBrailleMathRight(string str, int x, int y);

drawDecapoint(string str, int x, int y);

drawKleintype(string str, int x, int y);

Draw Graph

drawDot(int x, int y);

drawLine(int x1, int y1, int x2, int y2 );

strokeRect(int x, int y, int width, int height);

fillRect(int x, int y, width, height);

strokeCircle(int r, int x, int y);

strokeRhombus(int x, int y, int width, int height);

drawLineTilt(int x1, int y1, int length, int angle);

strokeRectTilt(int x, int y, int width, int height, int angle);

strokeRhombusTilt(int x, int y, int width, int height, int angle);

fillRectTilt(int x, int y, int width, int height, int angle);

strokeTable(int x, int y, int width, int height, int cols, int rows);

drawPattern(array, int x, int y);

Clear

clearDot(int x, int y);

clear();

Setting

setCanvas(String id);

set a canvas ID for screen preview(option).

setSize(String size);

set paper size(A4, B5, IJB6, IJB5, IJA4, IJB4, & IJA3).

setInterval(int num)

set a distance between dots in a line. (strokeCircle(), drawLine(), strokeRect, etc.)

setAdjust(boolean);

set dot interval adjustment from start position to end position.

setDot(int num);

set dot size. 0: small, 1: middle, 2: large. ####setLetterSize(LineHeight, Width, Height, Inter-character); default is (30,6,7,15).

setType(edl or edi);

setColor(Color);

set dot color on preview.

Output

loadEdl();

return string.

readEdl(String);

map2esa();

return PNG.

loadArr();

return array.

Misc

convertText(String str);

return converted string.

Code Climate GitHub version MIT License

tactileGraph.js

Just a 'canvas like' tactile graphic drawing library.:octocat:


日本語:https://github.com/HirotsuguKaga/tactileGraph.js/blob/master/README_ja.md


Gh-Pages & DEMO: https://hirotsugukaga.github.io/tactileGraph.js/


REQUREMENT

ECMA-262 3rd edition or above.

INSTALL

<script src="tactileGraph.js"></script>
  or
<script src="tactileGraph.min.js"></script>

USAGE

ex.
  var tg = tactileGraph(id, "A4");  //initial
 
  tg.drawBraille("ABCDEF", 0, 10);  //drawing
  tg.drawLine(0,20,50,20);

  hoge.href = tg.map2esa();  //output

Methods

Draw Braille

drawBraille(string str, int x, int y , int returnX);

arr2braille(arr, x,y);

drawBrailleMath(string str, int x, int y , int returnX);

drawBrailleRight(string str, int x, int y);

drawBrailleMathRight(string str, int x, int y);

drawDecapoint(string str, int x, int y);

drawKleintype(string str, int x, int y);

Draw Graph

drawDot(int x, int y);

drawLine(int x1, int y1, int x2, int y2 );

strokeRect(int x, int y, int width, int height);

fillRect(int x, int y, width, height);

strokeCircle(int r, int x, int y);

strokeRhombus(int x, int y, int width, int height);

drawLineTilt(int x1, int y1, int length, int angle);

strokeRectTilt(int x, int y, int width, int height, int angle);

strokeRhombusTilt(int x, int y, int width, int height, int angle);

fillRectTilt(int x, int y, int width, int height, int angle);

strokeTable(int x, int y, int width, int height, int cols, int rows);

drawPattern(array, int x, int y);

Clear

clearDot(int x, int y);

clear();

Setting

setCanvas(String id);

set a canvas ID for screen preview(option).

setSize(String size);

set paper size(A4 or B5).

setInterval(int num)

set a distance between dots in a line. (strokeCircle(), drawLine(), strokeRect, etc.)

setAdjust(boolean);

setDot(int num);

setColor(Color);

Output

loadEdl();

return string.

readEdl(String);

map2esa();

return PNG.

loadArr();

return array.

Misc

convertText(String str);

return converted string.

origin/gh-pages

tactilegraph.js's People

Contributors

hirotsugukaga avatar clark0226 avatar

Watchers

John Alexis Guerra Gómez 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.