<commit_before>(function (window, $, d3, undefined) {
	var graph = window.setNamespace('app.graph'),
		app   = window.setNamespace('app');

	/**
	 * NodeEditor trait
	 *
	 * Adds functionality to create new nodes
	 */
	graph.NodeCD = function () {

		// enforce use of new on constructor
		if ((this instanceof graph.NodeCD) === false) {
			return new graph.NodeCD(arguments);
		}

		$(this).on('trait', this.attachNodeCD);
	};

	/**
	 * Initializes variables and attaches events used for creating edges
	 */
	graph.NodeCD.prototype.attachNodeCD = function () {

		// start out hidden
		$('#node-form').addClass('hidden');

		var createNode = window.curry(this.handleNodeCreate, this),
			deleteNode = window.curry(this.handleNodeDelete, this),
			updateNode = window.curry(this.handleNodeUpdate, this),
			loadNode = window.curry(this.handleNodeSelected, this),
			unloadNode = window.curry(this.handleNodeUnselected, this),
			addProperty = window.curry(this.handlePropertyAdded, this),
			deleteProperty = window.curry(this.handlePropertyDeleted, this);

		$(this).on('drag-down', deleteNode);
		this.holdActions[graph.Drag.DOWN] = "Delete";
		$('#new-node-form').on('submit', createNode);
		$('#node-form').on('submit', deleteNode);
		$('#node-form').on('focusout', updateNode);
		$(this).on('node-clicked', loadNode);
		$(this).on('node-deleted', unloadNode);
		$('#new-property').on('click', addProperty);
		$('#node-fields').on('click', '.delete-property', deleteProperty);
	};

	graph.NodeCD.prototype.handleNodeUnselected = function (event, data) {

		if (!this.selectedNode || this.selectedNode.data.index == data.index) {
			$('#node-form').addClass('hidden');
		}
	};

	graph.NodeCD.prototype.handleNodeCreate = function (event) {

		event.preventDefault();<commit_msg>node delete button works<commit_after>(function (window, $, d3, undefined) {
	var graph = window.setNamespace('app.graph'),
		app   = window.setNamespace('app');

	/**
	 * NodeEditor trait
	 *
	 * Adds functionality to create new nodes
	 */
	graph.NodeCD = function () {

		// enforce use of new on constructor
		if ((this instanceof graph.NodeCD) === false) {
			return new graph.NodeCD(arguments);
		}

		$(this).on('trait', this.attachNodeCD);
	};

	/**
	 * Initializes variables and attaches events used for creating edges
	 */
	graph.NodeCD.prototype.attachNodeCD = function () {

		// start out hidden
		$('#node-form').addClass('hidden');

		var createNode = window.curry(this.handleNodeCreate, this),
			deleteNode = window.curry(this.handleNodeDelete, this),
			deleteNodeButton = window.curry(this.handleNodeDeleteButton, this),
			updateNode = window.curry(this.handleNodeUpdate, this),
			loadNode = window.curry(this.handleNodeSelected, this),
			unloadNode = window.curry(this.handleNodeUnselected, this),
			addProperty = window.curry(this.handlePropertyAdded, this),
			deleteProperty = window.curry(this.handlePropertyDeleted, this);

		$(this).on('drag-down', deleteNode);
		this.holdActions[graph.Drag.DOWN] = "Delete";
		$('#new-node-form').on('submit', createNode);
		$('#node-form').on('submit', deleteNodeButton);
		$('#node-form').on('focusout', updateNode);
		$(this).on('node-clicked', loadNode);
		$(this).on('node-deleted', unloadNode);
		$('#new-property').on('click', addProperty);
		$('#node-fields').on('click', '.delete-property', deleteProperty);
	};

	graph.NodeCD.prototype.handleNodeUnselected = function (event, data) {

		if (!this.selectedNode || this.selectedNode.data.index == data.index) {
			$('#node-form').addClass('hidden');
		}

		this.selectedNode = null;
	};

	graph.NodeCD.prototype.handleNodeCreate = function (event) {

		event.preventDefault();
{'fraction_non_alphanumeric': 0.1728730633324273, 'fraction_numerical': 0.0005436259853220984, 'mean_word_length': 4.661538461538462, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3666629', 'n_tokens_mistral': 1222, 'n_tokens_neox': 1133, 'n_words': 215}