logical-matrix
logical-matrix is a JavaScript library to display 0-1 (binary) matrix on browsers interactively based on ProcessingJS and jQuery.
Getting Started
-
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>
-
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()
-
Done
Now it is ready to display and manipulate.
Demos
Read only mode:
Interative mode:
p.interactive = true \\ enable interactive
Matrix dump: