<commit_before>E2.p = E2.plugins["graph"] = function(core, node)
{
	this.desc = 'Encapsulate a nested graph into- and out of which arbitrary data can be routed and the encapsulated logic of which can be optinally rendered to a <b>texture</b> instead of the framebuffer.';
	
	this.input_slots = [
		{ name: 'enabled', dt: core.datatypes.BOOL, desc: 'En- or disable the processing of the nested graph logic.', def: 'True' }
	];
	
	this.output_slots = [
		{ name: 'texture', dt: core.datatypes.TEXTURE, desc: 'When connected, all enclosed plugins will render to this texture instead of the framebuffer. Also, when connected two dynamic input slots will appear that allows control of the texture resolution.', def: 'Render to framebuffer' }
	];
	
	this.state = { enabled: true, input_sids: {}, output_sids: {} };
		
	this.gl = core.renderer.context;
	this.core = core;
	this.input_nodes = {};
	this.output_nodes = {};
	this.is_reset = true;
	this.parent_node = node; // For reverse lookup in the core.
	this.updated_sids = [];
	this.framebuffer = null;
	this.texture = null;
	this.renderbuffer = null;
	this.e2_is_graph = true; // Constant. To get rid of string compares from the core.
};

E2.p.prototype.reset = function()
{
	this.state.enabled = true;
	
	if(this.graph)
		this.graph.reset();
};

E2.p.prototype.get_dt_name = function(dt)
{
	if(!dt || !dt.name)
		return 'ERROR';
		
	return dt.name;
};

E2.p.prototype.dbg = function(str)
{
	// msg('Graph: ' + str);
};

E2.p.prototype.connection_changed = function(on, conn, slot)
{
	if(slot.uid !== undefined)<commit_msg>Added 'Edit' button to the Graph plugin that allows to jump to the contained graph in the edit view.<commit_after>E2.p = E2.plugins["graph"] = function(core, node)
{
	this.desc = 'Encapsulate a nested graph into- and out of which arbitrary data can be routed and the encapsulated logic of which can be optinally rendered to a <b>texture</b> instead of the framebuffer.';
	
	this.input_slots = [
		{ name: 'enabled', dt: core.datatypes.BOOL, desc: 'En- or disable the processing of the nested graph logic.', def: 'True' }
	];
	
	this.output_slots = [
		{ name: 'texture', dt: core.datatypes.TEXTURE, desc: 'When connected, all enclosed plugins will render to this texture instead of the framebuffer. Also, when connected two dynamic input slots will appear that allows control of the texture resolution.', def: 'Render to framebuffer' }
	];
	
	this.state = { enabled: true, input_sids: {}, output_sids: {} };
		
	this.gl = core.renderer.context;
	this.core = core;
	this.input_nodes = {};
	this.output_nodes = {};
	this.is_reset = true;
	this.parent_node = node; // For reverse lookup in the core.
	this.updated_sids = [];
	this.framebuffer = null;
	this.texture = null;
	this.renderbuffer = null;
	this.e2_is_graph = true; // Constant. To get rid of string compares from the core.
};

E2.p.prototype.reset = function()
{
	this.state.enabled = true;
	
	if(this.graph)
		this.graph.reset();
};

E2.p.prototype.create_ui = function()
{
	var inp = $('<input id="state" type="button" value="Edit" title="Open this graph for editing." />');
	
	inp.click(function(self) { return function(e) 
	{
		if(self.graph)
			self.graph.tree_node.activate();
	}}(this));
	
	return inp;
};

E2.p.prototype.get_dt_name = function(dt)
{
	if(!dt || !dt.name)
		return 'ERROR';
		
	return dt.name;
};

E2.p.prototype.dbg = function(str)
{
	// msg('Graph: ' + str);
};

E2.p.prototype.connection_changed = function(on, conn, slot)
{
	if(slot.uid !== undefined)
{'fraction_non_alphanumeric': 0.14004563605248146, 'fraction_numerical': 0.004278379920136908, 'mean_word_length': 3.9394366197183097, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '4590520', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1164, 'n_words': 354}