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

use high resolution if available #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
10 changes: 1 addition & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
- categorise transactions (simple, payments, mixing etc )
</pre>
<div id="output" ></div>
<p>This is a fork of <a href="https://github.com/dailyblockchain/dailyblockchain.github.io">https://github.com/dailyblockchain/dailyblockchain.github.io</a> with high resolution enabled. See <a href="https://dailyblockchain.github.io/">https://dailyblockchain.github.io/</a> for the original.</p>
</a>Found this interesting :-) Please send some Satoshis here to keep me going:</h3>
<p><strong>1NGBYHnYYM1i4HZkLsoRy3oFB2DzqusCoU</strong></p>
<p><img src="blockchainvis-qr.png" alt="donate"></p>
Expand Down Expand Up @@ -413,13 +414,4 @@
});
</script>

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-46634113-1', 'dailyblockchain.github.io');
ga('send', 'pageview');
</script>
</html>
14 changes: 10 additions & 4 deletions js/vivagraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -5807,9 +5807,15 @@ Viva.Graph.View.webglGraphics = function (options) {

updateSize = function () {
if (container && graphicsRoot) {
width = graphicsRoot.width = Math.max(container.offsetWidth, 1);
height = graphicsRoot.height = Math.max(container.offsetHeight, 1);
if (gl) { gl.viewport(0, 0, width, height); }
const dpr = window.devicePixelRatio || 1;
width = graphicsRoot.width = Math.max(container.offsetWidth * dpr, 1);
height = graphicsRoot.height = Math.max(container.offsetHeight * dpr, 1);
if (gl) {
gl.viewport(0, 0, width, height);
gl.canvas.style = "width: 100%";
gl.canvas.width = width;
gl.canvas.height = height;
}
if (linkProgram) { linkProgram.updateSize(width / 2, height / 2); }
if (nodeProgram) { nodeProgram.updateSize(width / 2, height / 2); }
}
Expand Down Expand Up @@ -6020,12 +6026,12 @@ Viva.Graph.View.webglGraphics = function (options) {
container = c;

graphicsRoot = window.document.createElement("canvas");
gl = graphicsRoot.getContext("experimental-webgl", contextParameters);
updateSize();
resetScaleInternal();
container.appendChild(graphicsRoot);


gl = graphicsRoot.getContext("experimental-webgl", contextParameters);
if (!gl) {
var msg = "Could not initialize WebGL. Seems like the browser doesn't support it.";
window.alert(msg);
Expand Down