├── .project ├── LICENSE ├── README.md ├── celegans.gexf ├── config.js ├── gexf2json.py ├── img ├── fleches-horiz.png ├── gephi.png ├── loupe-edges.png ├── plusmoins.png └── search.gif ├── index.html ├── js ├── gexfjs.js ├── jquery-2.0.2.min.js ├── jquery-ui-1.10.3.custom.min.js └── jquery.mousewheel.min.js ├── miserables.gexf └── styles ├── gexfjs.css └── jquery-ui-1.10.3.custom.min.css /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | gexf-js 4 | 5 | 6 | 7 | 8 | 9 | com.aptana.ide.core.unifiedBuilder 10 | 11 | 12 | 13 | 14 | 15 | com.aptana.projects.webnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2011 by Raphaël Velt 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JavaScript GEXF Viewer for Gephi # 2 | 3 | #### Released under MIT License ### 4 | 5 | ### Known Issues 6 | 7 | **The issue below is the source of 90% of support emails I receive, please read carefully** 8 | 9 | Gexf-JS won't work if launched from your local drive (with a file:/// URI scheme) because AJAX is disabled by default on local URIs. 10 | This is a known security limitation, part of the Cross-Origin Resource Sharing security model, and there are 2 known workarounds: 11 | 12 | 1. Change the security settings of your browser - check https://www.thepolyglotdeveloper.com/2014/08/bypass-cors-errors-testing-apis-locally/ for details. 13 | 2. Use a server (upload it or use a local server). If you have Python on your computer, the simplest is to launch a SimpleHTTPServer with the Command Line: 14 | 15 | $ cd /path/to/gexf-js 16 | $ python -m SimpleHTTPServer 17 | 18 | Firefox used to support AJAX from local files, but it is now disabled as of version 68 - unless you set **security.fileuri.strict_origin_policy** to **false** 19 | 20 | ### Newest features 21 | 22 | Hybrid directed/undirected graphs are now supported, and arrows can be shown. 23 | 24 | Gexf-JS now speaks 9 languages: Dutch, English, French, Finnish, German, Greek, Italian, Spanish, and Turkish! 25 | 26 | ### Contributors 27 | 28 | #### Raphaël Velt (main developer, French and English versions) 29 | 30 | * http://raphaelve.lt/ 31 | * Twitter: [@raphv](http://twitter.com/raphv) 32 | 33 | #### Vicenzo Cosenza (Italian translation) 34 | 35 | * http://www.vincos.it/ 36 | * Twitter: [@vincos](http://twitter.com/vincos) 37 | 38 | #### Eduardo Ramos Ibáñez (Spanish translation) 39 | 40 | * https://github.com/eduramiba 41 | * Twitter: [@eduramiba](http://twitter.com/eduramiba) 42 | 43 | #### Jaakko Salonen (Finnish translation and hyperlink replacement) 44 | 45 | * https://github.com/jsalonen 46 | * Twitter: [@jsalonen](http://twitter.com/jsalonen) 47 | 48 | #### Zeynep Akata (Turkish translation) 49 | 50 | #### Σωτήρης Φραγκίσκος (Greek translation) 51 | 52 | #### Martin Eckert (German translation) 53 | 54 | #### Tobias Bora (Arrows and hybrid graphs) 55 | 56 | * https://github.com/tobiasBora 57 | 58 | #### Jan de Mooij (Dutch translation and touch-screen compatibility) 59 | 60 | * https://github.com/Ilsontfous 61 | 62 | #### Bruna Delzari (Portuguese translation) 63 | 64 | #### Adil Aliyev (Azerbaijani translation) 65 | * https://github.com/adilek 66 | * Twitter: [@adilaliyev](http://twitter.com/adilaliyev) 67 | 68 | ### How to use ? 69 | 70 | 1. Export your graph from Gephi as a GEXF file 71 | 2. Put it in the gexf-js directory 72 | 3. Modify config.js to point to your GEXF File and tune the interface. 73 | 74 | You can view more Gexf files by pointing your browser to index.html#Filename.gexf 75 | 76 | ### Compatibility 77 | 78 | Gexf-JS uses the canvas element, which might cause compatibility issues with older browsers. 79 | 80 | It has been tested with the latest Chrome, Firefox and Internet Explorer versions. 81 | 82 | It doesn't work with Internet Explorer 8 or older. 83 | 84 | ### Contribute as a translator 85 | 86 | Gexf JS Viewer is now available in English, French and Italian 87 | 88 | If you want to translate the interface in your language (and share this translation with the community), please translate the following sentences, send them to me and I'll upload them to github. 89 | 90 | Strings to translate: 91 | 92 | 1. Search nodes 93 | 2. Attributes 94 | 3. Nodes 95 | 4. Inbound Links from 96 | 5. Outbound Links to 97 | 6. Undirected links with 98 | 7. Activate lens mode 99 | 8. Deactivate lens mode 100 | 9. Show edges 101 | 1. Hide edges 102 | 1. Zoom In 103 | 1. Zoom Out 104 | 1. Your browser cannot properly display this page. We recommend you use the latest Firefox or Chrome version 105 | -------------------------------------------------------------------------------- /config.js: -------------------------------------------------------------------------------- 1 | /*** USE THIS FILE TO SET OPTIONS ***/ 2 | 3 | GexfJS.setParams({ 4 | graphFile : "miserables.gexf", 5 | /* 6 | The GEXF file to show ! -- can be overriden by adding 7 | a hash to the document location, e.g. index.html#celegans.gexf 8 | GEXF files can now be replaced by pre-processed JSON files (use gexf2json.py) 9 | for faster load time 10 | */ 11 | showEdges : true, 12 | /* 13 | Default state of the "show edges" button. Set to null to disable button. 14 | */ 15 | useLens : false, 16 | /* 17 | Default state of the "use lens" button. Set to null to disable button. 18 | */ 19 | zoomLevel : 0, 20 | /* 21 | Default zoom level. At zoom = 0, the graph should fill a 800x700px zone 22 | */ 23 | curvedEdges : true, 24 | /* 25 | False for curved edges, true for straight edges 26 | this setting can't be changed from the User Interface 27 | */ 28 | edgeWidthFactor : 1, 29 | /* 30 | Change this parameter for wider or narrower edges 31 | this setting can't be changed from the User Interface 32 | */ 33 | minEdgeWidth : 1, 34 | maxEdgeWidth : 50, 35 | textDisplayThreshold: 9, 36 | fontSizeFactor : 1, 37 | nodeSizeFactor : 1, 38 | /* 39 | Change this parameter for smaller or larger nodes 40 | this setting can't be changed from the User Interface 41 | */ 42 | replaceUrls : true, 43 | /* 44 | Enable the replacement of Urls by Hyperlinks 45 | this setting can't be changed from the User Interface 46 | */ 47 | showEdgeWeight : true, 48 | /* 49 | Show the weight of edges in the list 50 | this setting can't be changed from the User Interface 51 | */ 52 | showEdgeLabel : true, 53 | sortNodeAttributes: true, 54 | /* 55 | Alphabetically sort node attributes 56 | */ 57 | showId : true, 58 | /* 59 | Show the id of the node in the list 60 | this setting can't be changed from the User Interface 61 | */ 62 | showEdgeArrow : true, 63 | /* 64 | Show the edge arrows when the edge is directed 65 | this setting can't be changed from the User Interface 66 | */ 67 | language: false, 68 | /* 69 | Set to an ISO language code to switch the interface to that language. 70 | Available languages are: 71 | - German [de] 72 | - English [en] 73 | - French [fr] 74 | - Spanish [es] 75 | - Italian [it] 76 | - Finnish [fi] 77 | - Turkish [tr] 78 | - Greek [el] 79 | - Dutch [nl] 80 | If set to false, the language will be that of the user's browser. 81 | */ 82 | }); 83 | -------------------------------------------------------------------------------- /gexf2json.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import json 3 | from json import encoder 4 | from lxml import etree 5 | 6 | encoder.FLOAT_REPR = lambda f: format(f, '.6g') 7 | 8 | BASE_W = 800 9 | BASE_H = 700 10 | PADDING = 30 11 | MIN_EDGE_WIDTH = 1 12 | MAX_EDGE_WIDTH = 50 13 | DEFAULT_COLOR = {'r': 127, 'g': 127, 'b': 127} 14 | 15 | parser = argparse.ArgumentParser() 16 | parser.add_argument('input', type=argparse.FileType('r'), help='Input GEXF File') 17 | parser.add_argument('output', nargs='?', type=argparse.FileType('w'), help='Output JSON File') 18 | args = parser.parse_args() 19 | tree = etree.parse(args.input) 20 | 21 | base_nsmap = tree.getroot().nsmap 22 | nsmap = { 23 | 'g': base_nsmap[None], 24 | 'viz': base_nsmap['viz'], 25 | } 26 | 27 | attribute_list = set() 28 | 29 | # Normalizing positions and attribute list 30 | node_x = [] 31 | node_y = [] 32 | for node in tree.xpath('//g:node', namespaces=nsmap): 33 | pos = node.xpath('viz:position', namespaces=nsmap)[0] 34 | node_x.append(float(pos.get('x'))) 35 | node_y.append(float(pos.get('y'))) 36 | attributes = node.xpath('g:attvalues/g:attvalue', namespaces=nsmap) 37 | attribute_list.update([(attribute.get('for') or attribute.get('id')) for attribute in attributes]) 38 | x_min = min(node_x) 39 | x_max = max(node_x) 40 | y_min = min(node_y) 41 | y_max = max(node_y) 42 | scale = min((BASE_W-PADDING)/(x_max-x_min),(BASE_H-PADDING)/(y_max-y_min)) 43 | offset_x = (BASE_W-scale*(x_min+x_max))/2 44 | offset_y = (BASE_H-scale*(y_min+y_max))/2 45 | 46 | attribute_list = list(attribute_list) 47 | attribute_lookup = dict((v,k) for k,v in enumerate(attribute_list)) 48 | nodes = [] 49 | nodes_rgb = [] 50 | node_index = {} 51 | 52 | graph_is_directed = ((tree.xpath('//g:graph/@defaultedgetype',namespaces=nsmap) or [''])[0] == 'directed') 53 | 54 | print('Processing nodes') 55 | k = 0 56 | 57 | for node in tree.xpath('//g:node', namespaces=nsmap): 58 | id = node.get('id') 59 | label = node.get('label') or id 60 | pos = node.xpath('viz:position', namespaces=nsmap)[0] 61 | x = float(pos.get('x')) 62 | y = float(pos.get('y')) 63 | size = float(node.xpath('viz:size', namespaces=nsmap)[0].get('value')) 64 | color = (node.xpath('viz:color', namespaces=nsmap) or [DEFAULT_COLOR])[0] 65 | r = int(color.get('r')) 66 | g = int(color.get('g')) 67 | b = int(color.get('b')) 68 | attributes = node.xpath('g:attvalues/g:attvalue', namespaces=nsmap) 69 | attributes = [[ 70 | attribute_lookup[attribute.get('for') or attribute.get('id')], 71 | attribute.get('value'), 72 | ] for attribute in attributes] 73 | attributes.sort(key=lambda a: a[0]) 74 | node_data = { 75 | 'id': id, 76 | 'l': label, 77 | 'x': offset_x + scale * x, 78 | 'y': offset_y - scale * y, 79 | 'r': scale * size, 80 | 'B': "rgba(%d,%d,%d,.7)"%(r,g,b), 81 | 'G': "rgba(%d,%d,%d,.5)"%(tuple(84+.33*k for k in (r,g,b))), 82 | 'a': attributes, 83 | } 84 | nodes.append(node_data) 85 | nodes_rgb.append((r,g,b)) 86 | node_index[id] = k 87 | k += 1 88 | if not (k % 1000): 89 | print("%7d nodes processed"%k, end='\r') 90 | 91 | print("Total: %d nodes processed"%k) 92 | 93 | edges = [] 94 | 95 | def get_attribute(edge, attlabel, default): 96 | attribute = edge.xpath('g:attvalues/g:attvalue[@for="%s"]'%attlabel,namespaces=nsmap) 97 | return (attribute or [{'value':edge.get(attlabel)}])[0].get('value') or default 98 | 99 | print('Processing edges') 100 | 101 | k = 0 102 | for edge in tree.xpath('//g:edge', namespaces=nsmap): 103 | edgesource = edge.get('source') 104 | edgetarget = edge.get('target') 105 | sourceindex = node_index[edgesource] 106 | targetindex = node_index[edgetarget] 107 | weight = float(get_attribute(edge, 'weight', 1)) 108 | edge_is_directed = graph_is_directed 109 | directed_attr = edge.get('type') 110 | if directed_attr == 'directed': 111 | edge_is_directed = True 112 | if directed_attr == 'undirected': 113 | edge_is_directed = False 114 | owncolor = edge.xpath('viz:color', namespaces=nsmap) 115 | if owncolor: 116 | color = tuple(int(owncolor[0].get(k)) for k in ["r", "g", "b"]) 117 | else: 118 | sourcecolor = nodes_rgb[sourceindex] 119 | targetcolor = nodes_rgb[targetindex] 120 | color = sourcecolor if edge_is_directed else tuple((sourcecolor[k] + targetcolor[k])/2 for k in range(3)) 121 | edges.append({ 122 | 's': sourceindex, 123 | 't': targetindex, 124 | 'C': "rgba(%d,%d,%d,.7)"%color, 125 | 'w': weight, 126 | 'W': max(MIN_EDGE_WIDTH, min(MAX_EDGE_WIDTH, weight)) * scale, 127 | 'l': get_attribute(edge, 'label', ''), 128 | 'd': int(edge_is_directed), 129 | }) 130 | k += 1 131 | if not (k % 1000): 132 | print("%7d edges processed"%k, end='\r') 133 | 134 | print("Total: %d edges processed"%k) 135 | 136 | res = { 137 | 'nodeList': nodes, 138 | 'edgeList': edges, 139 | 'directed': int(graph_is_directed), 140 | 'attributes': attribute_list, 141 | } 142 | 143 | if args.output is None: 144 | filename = ".".join(args.input.name.split(".")[:-1] + ['json']) 145 | output = open(filename,'w') 146 | else: 147 | output = args.output 148 | 149 | print("Saving to %s"%output.name) 150 | 151 | json.dump(res, output) 152 | 153 | output.close() 154 | args.input.close() 155 | -------------------------------------------------------------------------------- /img/fleches-horiz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raphv/gexf-js/ebfd2a7213d3b678c8f5e93a71955673e2ffa111/img/fleches-horiz.png -------------------------------------------------------------------------------- /img/gephi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raphv/gexf-js/ebfd2a7213d3b678c8f5e93a71955673e2ffa111/img/gephi.png -------------------------------------------------------------------------------- /img/loupe-edges.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raphv/gexf-js/ebfd2a7213d3b678c8f5e93a71955673e2ffa111/img/loupe-edges.png -------------------------------------------------------------------------------- /img/plusmoins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raphv/gexf-js/ebfd2a7213d3b678c8f5e93a71955673e2ffa111/img/plusmoins.png -------------------------------------------------------------------------------- /img/search.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raphv/gexf-js/ebfd2a7213d3b678c8f5e93a71955673e2ffa111/img/search.gif -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Gephi: JavaScript GEXF Viewer 5 | 6 | 7 | 8 | 9 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 40 |
41 |
42 | 43 |
44 |
45 |
46 | 47 |
48 |
49 |
50 |
51 |
52 |

Gephi: JavaScript GEXF Viewer

53 |
54 |
55 | 56 | 57 |
58 |
59 | 61 | 62 | -------------------------------------------------------------------------------- /js/gexfjs.js: -------------------------------------------------------------------------------- 1 | /* Lead developer: Raphaël Velt 2 | * Other developers: Jakko Salonen, Tobias Bora, Jan de Mooij 3 | * 4 | * Licensed under the MIT License 5 | * Translations by: 6 | * Vicenzo Cosenza (Italian) 7 | * Eduardo Ramos Ibáñez (Spanish) 8 | * Jaakko Salonen (Finnish) 9 | * Zeynep Akata (Turkish) 10 | * Σωτήρης Φραγκίσκος (Greek) 11 | * Martin Eckert (German) 12 | * Jan de Mooij (Dutch) 13 | * Bruna Delazeri (Brazilian Portuguese) 14 | * Adil Aliyev (Azerbaijani) 15 | * */ 16 | 17 | (function() { 18 | 19 | var GexfJS = { 20 | lensRadius: 200, 21 | lensGamma: 0.5, 22 | graphZone: { 23 | width: 0, 24 | height: 0 25 | }, 26 | oldGraphZone: {}, 27 | params: { 28 | centreX: 400, 29 | centreY: 350, 30 | activeNode: -1, 31 | currentNode: -1, 32 | isMoving: false 33 | }, 34 | oldParams: {}, 35 | minZoom: -3, 36 | maxZoom: 10, 37 | overviewWidth: 200, 38 | overviewHeight: 175, 39 | baseWidth: 800, 40 | baseHeight: 700, 41 | overviewScale: .25, 42 | totalScroll: 0, 43 | autoCompletePosition: 0, 44 | i18n: { 45 | "az": { 46 | "search": "Təpələri axtar", 47 | "nodeAttr": "Attributlar", 48 | "nodes": "Təpə nöqtələri", 49 | "inLinks": "Daxil olan əlaqələr:", 50 | "outLinks": "Çıxan əlaqələr:", 51 | "undirLinks": "İstiqamətsiz əlaqələr:", 52 | "lensOn": "Linza rejiminə keç", 53 | "lensOff": "Linza rejimindən çıx", 54 | "edgeOn": "Tilləri göstər", 55 | "edgeOff": "Tilləri gizlət", 56 | "zoomIn": "Yaxınlaşdır", 57 | "zoomOut": "Uzaqlaşdır", 58 | "modularity_class": "Modullaşma sinfi", 59 | "degree": "Dərəcə" 60 | }, 61 | "de": { 62 | "search": "Suche Knoten", 63 | "nodeAttr": "Attribute", 64 | "nodes": "Knoten", 65 | "inLinks": "Ankommende Verknüpfung von", 66 | "outLinks": "Ausgehende Verknüpfung zu", 67 | "undirLinks": "Ungerichtete Verknüpfung mit", 68 | "lensOn": "Vergrößerungsmodus an", 69 | "lensOff": "Vergrößerungsmodus aus", 70 | "edgeOn": "Kanten anzeigen", 71 | "edgeOff": "Kanten verstecken", 72 | "zoomIn": "Vergrößern", 73 | "zoomOut": "Verkleinern", 74 | }, 75 | "el": { 76 | "search": "Αναζήτηση Κόμβων", 77 | "nodeAttr": "Χαρακτηριστικά", 78 | "nodes": "Κόμβοι", 79 | "inLinks": "Εισερχόμενοι δεσμοί από", 80 | "outLinks": "Εξερχόμενοι δεσμοί προς", 81 | "undirLinks": "Ακατεύθυντοι δεσμοί με", 82 | "lensOn": "Ενεργοποίηση φακού", 83 | "lensOff": "Απενεργοποίηση φακού", 84 | "edgeOn": "Εμφάνιση ακμών", 85 | "edgeOff": "Απόκρυψη ακμών", 86 | "zoomIn": "Μεγέθυνση", 87 | "zoomOut": "Σμίκρυνση", 88 | }, 89 | "en": { 90 | "search": "Search nodes", 91 | "nodeAttr": "Attributes", 92 | "nodes": "Nodes", 93 | "inLinks": "Inbound Links from:", 94 | "outLinks": "Outbound Links to:", 95 | "undirLinks": "Undirected links with:", 96 | "lensOn": "Activate lens mode", 97 | "lensOff": "Deactivate lens mode", 98 | "edgeOn": "Show edges", 99 | "edgeOff": "Hide edges", 100 | "zoomIn": "Zoom In", 101 | "zoomOut": "Zoom Out", 102 | }, 103 | "es": { 104 | "search": "Buscar un nodo", 105 | "nodeAttr": "Atributos", 106 | "nodes": "Nodos", 107 | "inLinks": "Aristas entrantes desde :", 108 | "outLinks": "Aristas salientes hacia :", 109 | "undirLinks": "Aristas no dirigidas con :", 110 | "lensOn": "Activar el modo lupa", 111 | "lensOff": "Desactivar el modo lupa", 112 | "edgeOn": "Mostrar aristas", 113 | "edgeOff": "Ocultar aristas", 114 | "zoomIn": "Acercar", 115 | "zoomOut": "Alejar", 116 | "modularity_class": "Clase de modularidad", 117 | "degree": "Grado", 118 | "indegree": "Grado de entrada", 119 | "outdegree": "Grado de salida", 120 | "weighted degree": "Grado ponderado", 121 | "weighted indegree": "Grado de entrada ponderado", 122 | "weighted outdegree": "Grado de salida ponderado", 123 | "closnesscentrality": "Cercanía", 124 | "betweenesscentrality": "Intermediación", 125 | "authority": "Puntuación de autoridad (HITS)", 126 | "hub": "Puntuación de hub (HITS)", 127 | "pageranks": "Puntuación de PageRank" 128 | }, 129 | "fi": { 130 | "search": "Etsi solmuja", 131 | "nodeAttr": "Attribuutit", 132 | "nodes": "Solmut", 133 | "inLinks": "Lähtevät yhteydet :", 134 | "outLinks": "Tulevat yhteydet :", 135 | "undirLinks": "Yhteydet :", 136 | "lensOn": "Ota linssitila käyttöön", 137 | "lensOff": "Poista linssitila käytöstä", 138 | "edgeOn": "Näytä kaikki yhteydet", 139 | "edgeOff": "Näytä vain valitun solmun yhteydet", 140 | "zoomIn": "Suurenna", 141 | "zoomOut": "Pienennä", 142 | }, 143 | "fr": { 144 | "search": "Rechercher un nœud", 145 | "nodeAttr": "Attributs", 146 | "nodes": "Nœuds", 147 | "inLinks": "Liens entrants depuis :", 148 | "outLinks": "Liens sortants vers :", 149 | "undirLinks": "Liens non-dirigés avec :", 150 | "lensOn": "Activer le mode loupe", 151 | "lensOff": "Désactiver le mode loupe", 152 | "edgeOn": "Afficher les sommets", 153 | "edgeOff": "Cacher les sommets", 154 | "zoomIn": "S'approcher", 155 | "zoomOut": "S'éloigner", 156 | "modularity_class": "Classe de modularité", 157 | "degree": "Degré", 158 | "indegree": "Demi-degré intérieur", 159 | "outdegree": "Demi-degré extérieur", 160 | "weighted degree": "Degré pondéré", 161 | "weighted indegree": "Demi-degré intérieur pondéré", 162 | "weighted outdegree": "Demi-degré extérieur pondéré", 163 | "closnesscentrality": "Centralité de proximité", 164 | "betweenesscentrality": "Centralité d’intermédiarité", 165 | "authority": "Score d’autorité (HITS)", 166 | "hub": "Score de hub (HITS)", 167 | "pageranks": "Score de PageRank" 168 | }, 169 | "it": { 170 | "search": "Cerca i nodi", 171 | "nodeAttr": "Attributi", 172 | "nodes": "Nodi", 173 | "inLinks": "Link in entrata da :", 174 | "outLinks": "Link in uscita verso :", 175 | "undirLinks": "Link non direzionati con :", 176 | "lensOn": "Attiva la lente d’ingrandimento", 177 | "lensOff": "Disattiva la lente d’ingrandimento", 178 | "edgeOn": "Mostra gli spigoli", 179 | "edgeOff": "Nascondi gli spigoli", 180 | "zoomIn": "Zoom in avanti", 181 | "zoomOut": "Zoom indietro", 182 | }, 183 | "tr": { 184 | "search": "Düğüm ara", 185 | "nodeAttr": "Özellikler", 186 | "nodes": "Düğümler", 187 | "inLinks": "Gelen bağlantılar", 188 | "outLinks": "Giden bağlantılar", 189 | "undirLinks": "Yönsüz bağlantılar", 190 | "lensOn": "Merceği etkinleştir", 191 | "lensOff": "Merceği etkisizleştir", 192 | "edgeOn": "Kenar çizgilerini göster", 193 | "edgeOff": "Kenar çizgilerini gizle", 194 | "zoomIn": "Yaklaştır", 195 | "zoomOut": "Uzaklaştır", 196 | }, 197 | "nl": { 198 | "search": "Knooppunten doorzoeken", 199 | "nodeAttr": "Attributen", 200 | "nodes": "Knooppunten", 201 | "inLinks": "Binnenkomende verbindingen van :", 202 | "outLinks": "Uitgaande verbindingen naar :", 203 | "undirLinks": "Ongerichtte verbindingen met:", 204 | "lensOn": "Loepmodus activeren", 205 | "lensOff": "Loepmodus deactiveren", 206 | "edgeOn": "Kanten tonen", 207 | "edgeOff": "Kanten verbergen", 208 | "zoomIn": "Inzoomen", 209 | "zoomOut": "Uitzoomen", 210 | }, 211 | "pt": { 212 | "search": "Pesquisar nós", 213 | "nodeAttr": "Atributos", 214 | "nodes": "Nós", 215 | "inLinks": "Ligações de entrada", 216 | "outLinks": "Ligações de saída", 217 | "undirLinks": "Ligações sem direção", 218 | "lensOn": "Ativar modo lente", 219 | "lensOff": "Ativar modo lente", 220 | "edgeOn": "Mostrar arestas", 221 | "edgeOff": "Esconder arestas", 222 | "zoomIn": "Aumentar zoom", 223 | "zoomOut": "Diminuir zoom", 224 | } 225 | }, 226 | lang: "en" 227 | }; 228 | 229 | var timedict = {} 230 | function measureTime(key) { 231 | if (timedict[key]) { 232 | console.log(key + " took " + (Date.now() - timedict[key])/1000 + "s"); 233 | delete timedict[key] 234 | } else { 235 | timedict[key] = Date.now() 236 | } 237 | } 238 | 239 | var movingTO = null; 240 | 241 | function onStartMoving() { 242 | window.clearTimeout(movingTO); 243 | GexfJS.params.isMoving = true; 244 | } 245 | 246 | function onEndMoving() { 247 | movingTO = window.setTimeout(function () { 248 | GexfJS.params.isMoving = false; 249 | }, 200); 250 | } 251 | 252 | function strLang(_str) { 253 | var _l = GexfJS.i18n[GexfJS.lang]; 254 | return (_l[_str] ? _l[_str] : (GexfJS.i18n["en"][_str] ? GexfJS.i18n["en"][_str] : _str.replace("_", " "))); 255 | } 256 | 257 | function replaceURLWithHyperlinks(text) { 258 | if (GexfJS.params.replaceUrls) { 259 | var _urlExp = /(\b(?:https?:\/\/)?[-A-Z0-9]+\.[-A-Z0-9.:]+(?:\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*)?)/ig, 260 | _protocolExp = /^https?:\/\//i, 261 | _res = text.split(_urlExp); 262 | return _res.map(function (_txt) { 263 | if (_txt.match(_urlExp)) { 264 | return $('').attr({ 265 | href: (_protocolExp.test(_txt) ? '' : 'http://') + _txt, 266 | target: "_blank" 267 | }).text(_txt.replace(_protocolExp, '')); 268 | } else { 269 | return $('').text(_txt); 270 | } 271 | }); 272 | } 273 | return $("").text(text); 274 | } 275 | 276 | function displayNode(_nodeIndex, _recentre) { 277 | GexfJS.params.currentNode = _nodeIndex; 278 | if (_nodeIndex != -1) { 279 | var _d = GexfJS.graph.nodeList[_nodeIndex], 280 | _html = $('
'), 281 | _ul = $('