Reducing the size (as in area) of the graph generated by graphviz

In my experience using graphviz to render graphs of that size (~ 700 nodes), minimal trial-and-error adjustment to this combination of attribute settings–some structural, some purely aesthetic–for all three objects (graph, nodes, and edges) should do what you want: reduce the minimum separation between nodes, via ‘nodesep’; e.g., nodes[nodesep=0.75]; this will make your graph being …

Read more

Specifying width and height as percentages without skewing photo proportions in HTML

Note: it is invalid to provide percentages directly as <img> width or height attribute unless you’re using HTML 4.01 (see current spec, obsolete spec and this answer for more details). That being said, browsers will often tolerate such behaviour to support backwards-compatibility. Those percentage widths in your 2nd example are actually applying to the container …

Read more

Get file size, image width and height before upload

Multiple images upload with info data preview Using HTML5 and the File API Example using URL API The images sources will be a URL representing the Blob object <img src=”https://stackoverflow.com/questions/12570834/blob:null/026cceb9-edr4-4281-babb-b56cbf759a3d”> const EL_browse = document.getElementById(‘browse’); const EL_preview = document.getElementById(‘preview’); const readImage = file => { if ( !(/^image\/(png|jpe?g|gif)$/).test(file.type) ) return EL_preview.insertAdjacentHTML(‘beforeend’, `Unsupported format ${file.type}: ${file.name}<br>`); const …

Read more

Check image width and height before upload with Javascript

The file is just a file, you need to create an image like so: var _URL = window.URL || window.webkitURL; $(“#file”).change(function (e) { var file, img; if ((file = this.files[0])) { img = new Image(); var objectUrl = _URL.createObjectURL(file); img.onload = function () { alert(this.width + ” ” + this.height); _URL.revokeObjectURL(objectUrl); }; img.src = objectUrl; …

Read more