Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Morphdom #53

Merged
merged 1 commit into from
Apr 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/morphdom-umd.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions library-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
{ type: 'optimized', id: 'vue', url: './vue/opt.html', label: 'DBMON Vue.js' },
{ type: 'optimized', id: 'rotorjs', url: './rotorjs/with_thunks.html', label: 'DBMON RotorJS (with using VnodeImmutableThunk)' },
{ type: 'naive', id: 'd3', url: './d3/index.html', label: 'DBMON D3' },
{ type: 'naive', id: 'morphdom', url: './morphdom/index.html', label: 'DBMON Morphdom' },
];

function Library() {
Expand Down
36 changes: 36 additions & 0 deletions morphdom/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
var render = function () {

var databases = ENV.generateData().toArray();

var html = '<div><table class="table table-striped latest-data"><tbody>';
for (var index = 0; index < databases.length; index++) {
var db = databases[index];
html += '<tr><td class="dbname">' + db.dbname + '</td>';
html += '<td class="query-count">';
html += '<span class="' + db.lastSample.countClassName + '">' + db.lastSample.nbQueries + '</span></td>';

for (var indexQ = 0; indexQ < db.lastSample.topFiveQueries.length; indexQ++) {
var q = db.lastSample.topFiveQueries[indexQ];
html += '<td class="' + q.elapsedClassName + '">';
html += q.formatElapsed || '';
html += '<div class="popover left">';
html += '<div class="popover-content">';
html += q.query || '';
html += '</div>';
html += '<div class="arrow"></div>';
html += '</div>';
html += '</td>';
}
html += '</tr>';
}

html += '</tbody></table></div>';

var el = document.getElementById("app");
morphdom(el, html, {childrenOnly: true});

Monitoring.renderRate.ping();
setTimeout(render, ENV.timeout);
};

render();
18 changes: 18 additions & 0 deletions morphdom/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="DBMON NOT REACT" />
<link href="../lib/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="../styles.css" rel="stylesheet" type="text/css" />
<title>dbmon</title>
</head>
<body>
<div id="app"></div>
<script src="../ENV.js"></script>
<script src="../lib/memory-stats.js"></script>
<script src="../lib/monitor.js"></script>
<script src="../lib/morphdom-umd.min.js"></script>
<script src="./app.js"></script>
<script src="../ga.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ You can test it at http://mathieuancelin.github.io/js-repaint-perfs/
* [domvm](https://github.com/leeoniya/domvm)
* [once](https://github.com/utilise/utilise#--once)
* [Ripple](https://github.com/pemrouz/ripple)
* [Morphdom](https://github.com/patrick-steele-idem/morphdom)

## Todo

Expand Down