<commit_before>Molecule.tree = {}

d2js.Renderers.treeNode = function (element, v, columnName, row, _1, node) {
	if (!row) return;
	var path = row.path;
	var depth = node.depth
	var s = '';
	for (var i = 0; i < depth; i++) s += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
	var checkHtml = typeof node.checked != 'undefined' ? '<input type="checkbox">&nbsp;&nbsp;' : '';
	if (node.children.length == 0) {
		$(element).html(s + checkHtml + v);
	} else {
		if (node.expanded) {
			$(element).html(s + '<a class=""><i class="angle down icon"></i></a>&nbsp;&nbsp;' + checkHtml + v);
			$(element).find('a').on('click', function (event) {
				node.expanded = false;
				d2js.render(element.closest('table')[0]);
				event.stopPropagation();
			})
		} else {
			$(element).html(s + '<a class=""><i class="angle right icon"></i></a>' + checkHtml + v);
			$(element).find('a').on('click', function () {
				node.expanded = true;
				d2js.render(element.closest('table')[0]);
				event.stopPropagation();
			})
		}
	}
	if (typeof node.checked != 'undefined')
		$(element).find('input[type=checkbox]').prop('checked', node.checked);

	$(element).find('input[type=checkbox]').on('change', function () {
		var checked = this.checked;
		var update = false;
		(function down(node) {
			node.checked = checked;
			if (node.children.length) {
				update = true;
				node.children.forEach(down);
			}
		})(node);
		(function up(pnode) {
			if (pnode == null) return;
			if (checked && pnode.children.every(function (c) { return c.checked == true })) {
				update = true;
				pnode.checked = true;
				up(pnode.parent)
			} else if (!checked && pnode.children.some(function (c) { return c.checked === false })) {
				pnode.checked = false;
				update = true;
				up(pnode.parent)
			}
		})(node.parent);

		var t = $(element).closest('table');
		if (update) {
			d2js.render(element.closest('table')[0]);
		}
		t.trigger('checkchange');
	})
};


Molecule.tree.TreeNode = function(){
	var table = this.$el.closest('[table]').attr('table');
	var col = this.$el.attr('col');
	var text = this.$el.attr('text');
	this.$el.attr('data-n', col);
	this.$el.html(text);
}

Molecule.tree.Tree = function(ui){
	var semantic = (ui == 'semantic')
	var bootstrap = (ui == 'bootstrap');

	if(bootstrap) var selectedTrClass = 'info';
	if(semantic) var selectedTrClass = 'active';
	
	
	var table = this.$el.closest('[table]').attr('table');
	this.$el.attr('d2js.root', table).attr('data', 'this');
	var paging = this.$el.closest('[paging]').attr('paging');
	if (paging == 'false') {<commit_msg>树没有区分 bootstrap 图标导致未显示出图标<commit_after>Molecule.tree = {}

d2js.Renderers.treeNode = function (element, v, columnName, row, _1, node) {
	if (!row) return;
	var path = row.path;
	var depth = node.depth
	if($(element).closest('table').is('.ui.table')){
		var expandIcon = '<i class="angle down icon"></i>';
		var collapseIcon = '<i class="angle right icon"></i>';
	} else {
		var expandIcon = '<span class="glyphicon glyphicon-menu-down"></span>';
		var collapseIcon = '<span class="glyphicon glyphicon-menu-right"></span>';
	}
	var s = '';
	for (var i = 0; i < depth; i++) s += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
	var checkHtml = typeof node.checked != 'undefined' ? '<input type="checkbox">&nbsp;&nbsp;' : '';
	if (node.children.length == 0) {
		$(element).html(s + checkHtml + v);
	} else {
		if (node.expanded) {
			$(element).html(s + '<a class="">' + expandIcon + '</a>&nbsp;&nbsp;' + checkHtml + v);
			$(element).find('a').on('click', function (event) {
				node.expanded = false;
				d2js.render(element.closest('table')[0]);
				event.stopPropagation();
			})
		} else {
			$(element).html(s + '<a class="">' + collapseIcon + '</a>' + checkHtml + v);
			$(element).find('a').on('click', function () {
				node.expanded = true;
				d2js.render(element.closest('table')[0]);
				event.stopPropagation();
			})
		}
	}
	if (typeof node.checked != 'undefined')
		$(element).find('input[type=checkbox]').prop('checked', node.checked);

	$(element).find('input[type=checkbox]').on('change', function () {
		var checked = this.checked;
		var update = false;
		(function down(node) {
			node.checked = checked;
			if (node.children.length) {
				update = true;
				node.children.forEach(down);
			}
		})(node);
		(function up(pnode) {
			if (pnode == null) return;
			if (checked && pnode.children.every(function (c) { return c.checked == true })) {
				update = true;
				pnode.checked = true;
				up(pnode.parent)
			} else if (!checked && pnode.children.some(function (c) { return c.checked === false })) {
				pnode.checked = false;
				update = true;
				up(pnode.parent)
			}
		})(node.parent);

		var t = $(element).closest('table');
		if (update) {
			d2js.render(element.closest('table')[0]);
		}
		t.trigger('checkchange');
	})
};


Molecule.tree.TreeNode = function(){
	var table = this.$el.closest('[table]').attr('table');
	var col = this.$el.attr('col');
	var text = this.$el.attr('text');
	this.$el.attr('data-n', col);
	this.$el.html(text);
}

Molecule.tree.Tree = function(ui){
	var semantic = (ui == 'semantic')
	var bootstrap = (ui == 'bootstrap');

	if(bootstrap) var selectedTrClass = 'info';
	if(semantic) var selectedTrClass = 'active';
	
	var table = this.$el.closest('[table]').attr('table');
	this.$el.attr('d2js.root', table).attr('data', 'this');
	var paging = this.$el.closest('[paging]').attr('paging');
	if (paging == 'false') {
{'fraction_non_alphanumeric': 0.22095754290876243, 'fraction_numerical': 0.003974706413730804, 'mean_word_length': 4.102304147465437, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6690794', 'n_tokens_mistral': 2169, 'n_tokens_neox': 1968, 'n_words': 388}