This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jsonize = function(obj) { | |
if( typeof obj == 'object' && !(obj[k] instanceof Array) && Object.keys(obj).length > 0 ) { | |
for( var k in obj ) { | |
if( obj[k] instanceof Array ) for( var k2 in obj[k] ) obj[k][k2] = jsonize(obj[k][k2]); | |
else if( typeof obj[k] == 'object' && !(obj[k] instanceof Array) && Object.keys(obj[k]).length > 0 ) jsonize(obj[k]); | |
obj['_'+k] = obj[k]; | |
obj[k] = (function(n) { | |
return function(_) { | |
if(!arguments.length) return obj['_'+n]; | |
obj['_'+n] = _; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>SVG resize</title> | |
<style> | |
div, svg { | |
width:100%; | |
height:100%; | |
} |