Home | History | Annotate | Download | only in template

Lines Matching refs:datum

196  * passed the datum element representing each node. No traversal guarantees
206 D3SymbolTreeMap.prototype._visit = function(datum, visitor) {
207 visitor.call(this, datum);
208 if (datum.children) for (var i = 0; i < datum.children.length; i++) {
209 this._visit(datum.children[i], visitor);
257 D3SymbolTreeMap.prototype._zoomDatum = function(datum) {
258 if (this._currentRoot === datum) return; // already here
259 this._hideHighlight(datum);
260 this._hideInfoBox(datum);
261 this._currentRoot = datum;
264 console.log('zooming into datum ' + this._currentRoot.n);
282 * set to this treemap instance and passed the 'datum' object as an argument.
286 D3SymbolTreeMap.prototype._clone = function(datum, filter) {
297 var copy = {'n': datum.n, 'k': datum.k};
299 if (datum.children !== undefined) {
300 for (var i = 0; i < datum.children.length; i++) {
301 var copiedChild = this._clone(datum.children[i], filter);
316 } else if (filter !== undefined && filter.call(this, datum) !== true) {
318 } else if (datum.children === undefined) {
328 if (datum.id !== undefined) copy.id = datum.id;
329 if (datum.lastPathElement !== undefined) {
330 copy.lastPathElement = datum.lastPathElement;
332 if (datum.t !== undefined) copy.t = datum.t;
333 if (datum.value !== undefined && datum.children === undefined) {
334 copy.value = datum.value;
374 D3SymbolTreeMap.prototype._highlightElement = function(datum, selection) {
375 this._showHighlight(datum, selection);
378 D3SymbolTreeMap.prototype._unhighlightElement = function(datum, selection) {
379 this._hideHighlight(datum, selection);
385 var inodes = this._currentNodes.filter(function(datum){
386 return (datum.depth <= thisTreeMap._currentMaxDepth) &&
387 datum.children !== undefined;
390 .data(inodes, function(datum) { return datum.id; })
392 .append('div').attr('class', 'inode').attr('id', function(datum){
393 return 'node-' + datum.id;});
400 .style('z-index', function(datum) { return datum.id * 2; })
402 .style('left', function(datum) { return datum.x; })
403 .style('top', function(datum){ return datum.y; })
404 .style('width', function(datum){ return datum.dx; })
405 .style('height', function(datum){ return datum.dy; })
408 .style('background-image', function(datum) {
410 thisTreeMap, datum);
412 .style('background-color', function(datum) {
413 if (datum.t === undefined) return 'rgb(220,220,220)';
414 return D3SymbolTreeMap.getColorForType(datum.t).toString();
416 .on('mouseover', function(datum){
418 thisTreeMap, datum, d3.select(this));
419 thisTreeMap._showInfoBox.call(thisTreeMap, datum);
421 .on('mouseout', function(datum){
423 thisTreeMap, datum, d3.select(this));
424 thisTreeMap._hideInfoBox.call(thisTreeMap, datum);
429 .on('dblclick', function(datum){
430 if (datum !== thisTreeMap._currentRoot) {
432 thisTreeMap._zoomDatum(datum);
433 } else if (datum.parent) {
440 thisTreeMap._zoomDatum(datum.parent);
447 .style('z-index', function(datum) { return (datum.id * 2) + 1; })
449 .style('left', function(datum){ return datum.x; })
450 .style('top', function(datum){ return datum.y; })
451 .style('width', function(datum) { return datum.dx; })
452 .style('height', function(datum) { return thisTreeMap.boxPadding.t; })
461 .style('visibility', function(datum) {
462 return (datum.dx < 15 || datum.dy < 15) ? 'hidden' : 'visible';
464 .text(function(datum) {
465 var sizeish = ' [' + D3SymbolTreeMap._byteify(datum.value) + ']'
467 if (datum.k === 'b') { // bucket
468 if (datum
469 text = thisTreeMap.pathFor(datum) + ': '
470 + D3SymbolTreeMap._getSymbolDescription(datum.t)
472 text = D3SymbolTreeMap._getSymbolDescription(datum.t);
474 } else if (datum === thisTreeMap._currentRoot) {
476 text = thisTreeMap.pathFor(datum);
480 text = datum.n;
515 .style('background-image', function(datum) {
517 thisTreeMap, datum);
519 .style('left', function(datum) { return datum.x; })
520 .style('top', function(datum){ return datum.y; })
521 .style('width', function(datum){ return datum.dx; })
522 .style('height', function(datum){ return datum.dy; });
526 .style('visibility', function(datum) {
527 return (datum.dx < 15 || datum.dy < 15) ? 'hidden' : 'visible';
529 .style('left', function(datum){ return datum.x; })
530 .style('top', function(datum){ return datum.y; })
531 .style('width', function(datum) { return datum.dx; })
532 .style('height', function(datum) { return thisTreeMap.boxPadding.t; })
533 .text(function(datum) {
534 var sizeish = ' [' + D3SymbolTreeMap._byteify(datum.value) + ']'
536 if (datum.k === 'b') {
537 if (datum === thisTreeMap._currentRoot) {
538 text = thisTreeMap.pathFor(datum) + ': ' +
539 D3SymbolTreeMap._getSymbolDescription(datum.t)
541 text = D3SymbolTreeMap._getSymbolDescription(datum.t);
543 } else if (datum === thisTreeMap._currentRoot) {
545 text = thisTreeMap.pathFor(datum);
549 text = datum.n;
554 .data(inodes, function(datum) { return 'inode-' + datum.id; })
570 var leaves = this._currentNodes.filter(function(datum){
571 return (datum.depth <= thisTreeMap._currentMaxDepth) &&
572 datum.children === undefined; });
574 .data(leaves, function(datum) { return datum.id; })
576 .append('div').attr('class', 'leaf').attr('id', function(datum){
577 return 'node-' + datum.id;
584 .style('z-index', function(datum) { return datum.id * 2; })
586 .style('left', function(datum){ return datum.x; })
587 .style('top', function(datum){ return datum.y; })
588 .style('width', function(datum){ return datum.dx; })
589 .style('height', function(datum){ return datum.dy; })
591 .style('background-color', function(datum) {
592 if (datum.t === undefined) return 'rgb(220,220,220)';
593 return D3SymbolTreeMap.getColorForType(datum.t)
597 .on('mouseover', function(datum){
599 thisTreeMap, datum, d3.select(this));
600 thisTreeMap._showInfoBox.call(thisTreeMap, datum);
602 .on('mouseout', function(datum){
604 thisTreeMap, datum, d3.select(this));
605 thisTreeMap._hideInfoBox.call(thisTreeMap, datum);
613 .style('z-index', function(datum) { return (datum.id * 2) + 1; })
615 .style('left', function(datum){ return datum.x; })
616 .style('top', function(datum){ return datum.y; })
617 .style('width', function(datum) { return datum.dx; })
618 .style('height', function(datum) { return datum.dy; })
627 .style('visibility', function(datum) {
628 return (datum.dx < 15 || datum.dy < 15) ? 'hidden' : 'visible';
630 .text(function(datum) { return datum.n; });
648 .style('left', function(datum){ return datum.x; })
649 .style('top', function(datum){ return datum.y; })
650 .style('width', function(datum){ return datum.dx; })
651 .style('height', function(datum){ return datum.dy; });
655 .style('visibility', function(datum) {
656 return (datum.dx < 15 || datum.dy < 15) ? 'hidden' : 'visible';
658 .style('left', function(datum){ return datum.x; })
659 .style('top', function(datum){ return datum.y; })
660 .style('width', function(datum) { return datum.dx; })
661 .style('height', function(datum) { return datum.dy; });
663 .data(leaves, function(datum) { return 'leaf-' + datum.id; })
677 D3SymbolTreeMap.prototype._makeSymbolBucketBackgroundImage = function(datum) {
678 if (!(datum.t === undefined && datum.depth == this._currentMaxDepth)) {
685 var stats = datum.symbol_stats[symbol_type];
690 var percent = 100 * (stats.size / datum.value);
699 return 'linear-gradient(' + (datum.dx > datum.dy ? 'to right' :
703 D3SymbolTreeMap.prototype.pathFor = function(datum) {
704 if (datum.__path) return datum.__path;
706 node = datum;
713 datum.__path = '/' + parts.join('/');
714 return datum.__path;
717 D3SymbolTreeMap.prototype._createHighlight = function(datum, selection) {
722 datum.highlight = this._mapContainer.append('div')
723 .attr('id', 'h-' + datum.id)
740 D3SymbolTreeMap.prototype._showHighlight = function(datum, selection) {
741 if (datum === this._currentRoot) return;
742 if (datum.highlight === undefined) {
743 this._createHighlight(datum, selection);
745 datum.highlight.transition().duration(200).style('opacity', 1.0);
748 D3SymbolTreeMap.prototype._hideHighlight = function(datum, selection) {
749 if (datum.highlight === undefined) return;
750 datum.highlight.transition().duration(750)
753 if (datum.highlight) datum.highlight.remove();
754 delete datum.highlight;
774 D3SymbolTreeMap.prototype._showInfoBox = function(datum) {
777 var sizeish = D3SymbolTreeMap._pretty(datum.value) + ' bytes (' +
778 D3SymbolTreeMap._byteify(datum.value) + ')';
779 if (datum.k === 'p' || datum.k === 'b') { // path or bucket
780 if (datum.symbol_stats) { // can be empty if filters are applied
783 var stats = datum.symbol_stats[symbol_type];
787 } else if (datum.k === 's') { // symbol
791 if (datum.k === 'p' && !datum.lastPathElement) {
792 this.infobox.append('div').text('Directory: ' + this.pathFor(datum))
795 if (datum.k === 'p') { // path
796 this.infobox.append('div').text('File: ' + this.pathFor(datum))
798 } else if (datum.k === 'b') { // bucket
800 D3SymbolTreeMap._getSymbolDescription(datum.t));
803 this.infobox.append('div').text('Location: ' + this.pathFor(datum))
804 } else if (datum.k === 's') { // symbol
805 this.infobox.append('div').text('Symbol: ' + datum.n);
807 D3SymbolTreeMap._getSymbolDescription(datum.t));
809 this.infobox.append('div').text('Location: ' + this.pathFor(datum))
812 if (datum.k === 'p') {
815 if (datum.symbol_stats) { // can be empty if filters are applied
826 var stats = datum.symbol_stats[symbol_type];
842 D3SymbolTreeMap.prototype._hideInfoBox = function(datum) {
883 this.visitFromDisplayedRoot(function(datum) {
884 if (datum.children) return; // ignore non-leaves
886 result = [datum];
887 smallest = datum.value;
891 result.push(datum);
894 if (datum.value > smallest) { // array is already full
895 result.push(datum);
918 this.visitFromDisplayedRoot(function(datum) {
919 if (!datum.lastPathElement) return; // ignore non-files
921 result = [datum];
922 smallest = datum.value;
926 result.push(datum);
929 if (datum.value > smallest) { // array is already full
930 result.push(datum);