// A tool to display arbitrary HTML, typically used to show errors if // something went wrong, but can be used quite flexibly. // // We just show json.data.html in an inner div, and return that div.
html : function ( element, json, callback ) { var div = document.createElement( 'div' );
element.appendChild( div );
div.innerHTML = json.data.html; if ( json.width ) $( div ).width( json.width ); if ( json.height ) $( div ).height( json.height );
callback( element, div );
}
};
/* *ResizesaDOMelementtobelargeenoughtoshowitscontents * *Manyvisualizationtoolsdonotautomaticallyresizetheircontainers *whentheycreatealargeplot.Sowehavethistoolavailableforthem *touseifneeded.
*/
window.resizeToShowContents = function ( element ) { // Find the largest coordinates for the (right,bottom) points of each // element below the given one in the DOM heirarchy. var maxima = { right : 0, bottom : 0 };
$( element ).find( '*' ).each( function ( idx, elt ) { var $elt = $( elt ); var right = $elt.position().left + $elt.outerWidth(); var bottom = $elt.position().top + $elt.outerHeight();
maxima = {
right : Math.max( right, maxima.right ),
bottom : Math.max( bottom, maxima.bottom )
};
} ); // Ensure that the element we were given is large enough to reveal that // bottom-right-most point. var $element = $( element );
$element.width( maxima.right - $element.position().left );
$element.height( maxima.bottom - $element.position().top );
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-06-17)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.