<commit_before>/* Copyright (c) 2013 The Tagspaces Authors. All rights reserved.
 * Use of this source code is governed by a AGPL3 license that 
 * can be found in the LICENSE file. */

define(function(require, exports, module) {
"use strict";
	
	console.log("Loading perspectiveGraph");

	var extensionTitle = "Graph"
	var extensionID = "perspectiveGraph";  // ID should be equal to the directory name where the ext. is located   
	var extensionType =  "perspective";
	var extensionIcon = "icon-sitemap";
	var extensionVersion = "1.0";
	var extensionManifestVersion = 1;
	var extensionLicense = "AGPL";

	var TSCORE = require("tscore");
	
	var viewContainer = undefined;
	var viewToolbar = undefined;
	var viewFooter = undefined;
	
	var viewMode = "files" // tags
	
	var extensionDirectory = TSCORE.Config.getExtensionPath()+"/"+extensionID;
	
	var graphMode = "treeMap" // tree
	
	var width = undefined;
	var height = undefined;
	var svg = undefined;
	
	var treeData = undefined;
	
	exports.init = function init() {
		console.log("Initializing View "+extensionID);
		
	    viewContainer = $("#"+extensionID+"Container");
	    viewToolbar = $("#"+extensionID+"Toolbar");
		viewFooter = $("#"+extensionID+"Footer");
		
		viewContainer.empty();
		viewToolbar.empty();
		viewFooter.empty();	  
	
	    initUI();  
	}
	
	exports.load = function load() {
		console.log("Loading View "+extensionID);

        require([
            extensionDirectory+'/d3/d3.js',
            ], function() {
                viewContainer.append('<link rel="stylesheet" type="text/css" href="'+extensionDirectory+"/"+'styles.css">');
        }); 
	
		$( "#"+extensionID+"ReIndexButton" ).removeClass("disabled");
		TSCORE.hideLoadingAnimation();
	}
	
	var reDraw = function() {
		d3.select("svg").remove();
	
		width = viewContainer.width();
		height = viewContainer.height();
	
		svg = d3.select("#"+extensionID+"Container")
			.append("svg")
		    .attr("width", width)
		    .attr("height", height)			    			
	    
	    switch (graphMode) {
	      case "treeMap":
			drawTreeMap();<commit_msg>d3.js library exchanged with a newer version<commit_after>/* Copyright (c) 2013 The Tagspaces Authors. All rights reserved.
 * Use of this source code is governed by a AGPL3 license that 
 * can be found in the LICENSE file. */

define(function(require, exports, module) {
"use strict";
	
	console.log("Loading perspectiveGraph");

	var extensionTitle = "Graph"
	var extensionID = "perspectiveGraph";  // ID should be equal to the directory name where the ext. is located   
	var extensionType =  "perspective";
	var extensionIcon = "icon-sitemap";
	var extensionVersion = "1.0";
	var extensionManifestVersion = 1;
	var extensionLicense = "AGPL";

	var TSCORE = require("tscore");
	
	var viewContainer = undefined;
	var viewToolbar = undefined;
	var viewFooter = undefined;
	
	var viewMode = "files" // tags
	
	var extensionDirectory = TSCORE.Config.getExtensionPath()+"/"+extensionID;
	
	var graphMode = "treeMap" // tree
	
	var width = undefined;
	var height = undefined;
	var svg = undefined;
	
	var treeData = undefined;
	
	exports.init = function init() {
		console.log("Initializing View "+extensionID);
		
	    viewContainer = $("#"+extensionID+"Container");
	    viewToolbar = $("#"+extensionID+"Toolbar");
		viewFooter = $("#"+extensionID+"Footer");
		
		viewContainer.empty();
		viewToolbar.empty();
		viewFooter.empty();	  
	
	    initUI();  
	}
	
	exports.load = function load() {
		console.log("Loading View "+extensionID);

        require([
            extensionDirectory+'/d3/d3.v3.js',
            ], function() {
                viewContainer.append('<link rel="stylesheet" type="text/css" href="'+extensionDirectory+"/"+'styles.css">');
        }); 
	
		$( "#"+extensionID+"ReIndexButton" ).removeClass("disabled");
		TSCORE.hideLoadingAnimation();
	}
	
	var reDraw = function() {
		d3.select("svg").remove();
	
		width = viewContainer.width();
		height = viewContainer.height();
	
		svg = d3.select("#"+extensionID+"Container")
			.append("svg")
		    .attr("width", width)
		    .attr("height", height)			    			
	    
	    switch (graphMode) {
	      case "treeMap":
			drawTreeMap();
{'fraction_non_alphanumeric': 0.14456677836285303, 'fraction_numerical': 0.006223073240785065, 'mean_word_length': 3.5080906148867315, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, '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': '5613790', 'n_tokens_mistral': 1344, 'n_tokens_neox': 1212, 'n_words': 319}