Skip to content
Browse files

Merge branch 'master' into gh-pages

  • Loading branch information...
2 parents f4f973e + 6f929da commit 059016addfafa41920579898d9f50f55e49765c1 @qiao committed Apr 22, 2012
Showing with 15 additions and 9 deletions.
  1. +4 −0 visual/grid.js
  2. +1 −2 visual/index.html
  3. +4 −4 visual/main.css
  4. +6 −3 visual/panel.js
View
4 visual/grid.js
@@ -581,4 +581,8 @@ window.GridController = {
return this.operationCnt;
},
+ getPathLength: function() {
+ return this.path.length;
+ },
+
};
View
3 visual/index.html
@@ -145,8 +145,7 @@ <h3 id="jump_point_header"><a href="#">Jump Point Search</a></h3>
<button id="reset_button">Clear Walls</button>
</div>
- <div id="timer">
- </div>
+ <div id="stats"></div>
<footer>
Project Hosted on <a href="http://github.com/qiao/PathFinding.js">Github</a>
View
8 visual/main.css
@@ -98,12 +98,12 @@ button:hover {
margin: 2px 30px 0;
}
-#timer {
+#stats {
position: absolute;
- bottom: 10px;
- left: 20px;
+ bottom: 40px;
+ left: 35px;
color: #0a0;
- font-size: 70%;
+ font-size: 85%;
padding: 5px;
display: none;
background: rgba(255, 255, 255, 0.5);
View
9 visual/panel.js
@@ -142,9 +142,12 @@ window.Panel = {
},
showStat: function() {
- var text1 = GridController.getTimeSpent() + 'ms',
- text2 = GridController.getOperationCount() + 'ops';
- $('#timer').show().text([text1, text2].join(' '));
+ var texts = [
+ 'time: ' + GridController.getTimeSpent() + 'ms',
+ 'length: ' + GridController.getPathLength(),
+ 'operations: ' + GridController.getOperationCount()
+ ];
+ $('#stats').show().html(texts.join('<br>'));
},
};

0 comments on commit 059016a

Please sign in to comment.
Something went wrong with that request. Please try again.