View on GitHub

logical-matrix

Display 0-1 matrix on browsers interactively based on ProcessingJS and jQuery

Download this project as a .zip file Download this project as a tar.gz file

logical-matrix

logical-matrix is a JavaScript library to display 0-1 (binary) matrix on browsers interactively based on ProcessingJS and jQuery.

Getting Started

  1. Import

    <script type="text/javascript" src="/path/to/jQuery"></script>
    <script type="text/javascript" src="/path/to/ProcessingJS"></script>
    <script type="text/javascript" src="/path/to/logical-matrix.js"></script>
    
  2. Initial with a div container

    html file snapshot (the canvas size is set to be equal to the div container size)

    <div id="sketch" style="height:250px;width:250px;"></div>

    js file snapshot (run after document is ready)

    var p = new LogicMatrix('sketch')
    
    var mat = [
        [0,0,0,1,1,0,0],
        [0,0,1,1,1,0,0],
        [0,0,0,1,1,0,0],
        [0,0,0,1,1,0,0],
        [0,0,0,1,1,0,0],
        [0,0,0,1,1,0,0],
        [0,0,1,1,1,1,0]
        ]
    
    p.loadMat(mat)
    p.update()
    
  3. Done

    Now it is ready to display and manipulate.

Demos

Read only mode:

Interative mode:

p.interactive = true \\ enable interactive

Matrix dump: