Changeset 5978
- Timestamp:
- 02/15/15 18:08:48 (9 years ago)
- Location:
- SMC/trunk/SMC/src/web/scripts/js
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
SMC/trunk/SMC/src/web/scripts/js/smc-graph.js
r5306 r5978 14 14 15 15 var input_prefix = "input-"; 16 var select_rect_min_size = 5;17 var first_level_margin = 20;18 var base_font_size = 10;19 var min_circle = 4;20 var max_circle = 80;21 22 var show_count = 1;16 var select_rect_min_size = config.select_rect_min_size; 17 var first_level_margin = config.first_level_margin ; 18 var base_font_size = config.base_font_size ; 19 var min_circle = config.min_circle; 20 var max_circle = config.max_circle; 21 22 var show_count = config.show_count; 23 23 24 24 25 var detail_url = "http://localhost:8580/exist/apps/smc-browser/get.xql"; 25 //var detail_url = "http://localhost:8580/exist/apps/smc-browser/get.xql"; obsoleted by config 26 26 var comp_reg_url = "http://catalog.clarin.eu/ds/ComponentRegistry/?item="; 27 27 var wiki_url = "http://en.wikipedia.org/wiki/"; … … 42 42 //var source_file = "/smc/smc-graph.d3"; 43 43 /*var source_file = "/smc/cmd-dep-graph.d3.js";*/ 44 var data_prefix = "data/"; 45 var detail_file = "/smc/data/smc_stats_detail.html"; 46 var userdocs_file = "/smc/docs/userdocs.html"; 47 48 49 var opts = {"graph": {"value":"smc-graph-basic.js", 50 "values":[{value: "smc-graph-basic.js", label:"SMC graph basic"}, 51 {value: "smc-graph-all.js", label:"SMC graph all"}, 52 {value: "smc-graph-profiles-datcats.js", label:"only profiles + datcats"}, 53 {value: "smc-graph-groups-profiles-datcats-rr.js", label:"profiles+datcats+groups+rr"}, 54 {value: "smc-graph-profiles-similarity.js", label:"just profiles"}, 55 {value: "dbpedia_philosophers_influence_years_graph.json", label:"Philosophers"}, 56 {value: "SC_Persons_120201_cAll_graph.json", label:"Schnitzler Cooccurrences"}, 57 /*, 58 {value: "smc-graph-mdrepo-stats.js", label:"instance data"}*/ 59 60 ], "widget":"selectone" }, 61 "depth-before": {"value":2, "min":0, "max":10, "widget":"slider"}, 62 "depth-after":{"value":2, "min":0, "max":10, "widget":"slider"}, 63 "link-distance": {"value":120, "min":10, "max":300, "widget":"slider" }, 64 "charge":{"value":250, "min":10, "max":1000, "widget":"slider" }, 65 "friction":{"value":75, "min":1, "max":100, "widget":"slider" }, 66 "gravity":{"value":10, "min":1, "max":100, "widget":"slider" }, 67 "node-size": {"value":"4", "values":["1","4","8","16","count"], "widget":"selectone" }, 68 "weight":{"value":100, "min":1, "max":100, "widget":"slider" }, 69 "labels": {"value":"show", "values":["show","hide"], "widget":"selectone" }, 70 "curve": {"value":"straight-arrow", "values":["straight-line","arc-line","straight-arrow","arc-arrow"], "widget":"selectone" }, 71 "layout": {"value":"horizontal-tree", "values":["vertical-tree", "horizontal-tree", "weak-tree","force","dot", "freeze"], "widget":"selectone" }, 72 "selected": {"widget":"hidden" }, 73 "link": {"widget":"link", "label":""}, 74 "download": {"widget":"link", "label":""}, 75 "add_profile": {"widget":"link", "label":"Add profile", "widget":""} 76 }; 44 //var data_prefix = "data/"; 45 //var detail_file = "/smc/data/smc_stats_detail.html"; obsoleted by config 46 //var userdocs_file = "/smc/docs/userdocs.html"; obsoleted by config 47 77 48 78 49 … … 97 68 98 69 // load data 99 d3.json( data_prefix + graph_source,70 d3.json(config.url.data_prefix + graph_source, 100 71 function(json) { 101 72 // return if data missing … … 408 379 .enter().append("svg:marker") 409 380 .attr("id", String) 381 .attr("markerUnits", "userSpaceOnUse") 410 382 .attr("viewBox", "0 -5 10 10") 411 .attr("refX", 1 5)412 .attr("refY", -1.5)413 .attr("markerWidth", 6)414 .attr("markerHeight", 6)383 .attr("refX", 10) 384 /*.attr("refY", -1.5)*/ 385 .attr("markerWidth", 10) 386 .attr("markerHeight", 10) 415 387 .attr("orient", "auto") 416 388 .append("svg:path") … … 425 397 .classed("uses", 1) 426 398 .classed("highlight", function(d) { d.highlight } ) 427 .attr("marker-end", function(d) { return "url(#uses)"; }) 428 .style("stroke-width", function(d) { return Math.sqrt(d.value); }); 399 .attr("marker-end", function(d) { return "url(#uses)"; }); 400 401 if (opt("link-width")=="value") { 402 path.style("stroke-width", function(d) { return Math.sqrt(d.value); }); 429 403 /* .style("stroke-width", function(d) { return d.value });*/ 404 } 430 405 431 406 path.append("title").text(function(d){ return d.value }); … … 645 620 646 621 if (mode=='static') { 647 $(detail_info_holder_selector).load( detail_file,function(data) {622 $(detail_info_holder_selector).load(config.url.detail,function(data) { 648 623 $(detail_container_selector).find("h3").after( 649 624 '<div id="detail-summary-overall" class="cmds-ui-block init-show" ><div class="header">Overview</div><div class="content">' … … 687 662 return d.html(); 688 663 } else { 689 var url = detail_url + "?type=" + type + "&key=" + id;664 var url = config.url.detail + "?type=" + type + "&key=" + id; 690 665 console.log("get-detail:" + url ); 691 666 $(target).toggleClass("loading"); … … 1012 987 1013 988 /* don't filter at all */ 1014 if (weight_threshold == 1 ) {989 if (weight_threshold == 1 | opt("weight")=="") { 1015 990 var n_in = data.nodes_in[n.key] ? data.nodes_in[n.key] : [] ; 1016 991 var n_out = data.nodes_out[n.key] ? data.nodes_out[n.key] : [] ; -
SMC/trunk/SMC/src/web/scripts/js/ui.js
r5301 r5978 57 57 58 58 // loading userdocs as welcome info 59 $(graph_container).load( userdocs_file+ " div.document");59 $(graph_container).load(config.url.userdocs + " div.document"); 60 60 61 61 loadDetailInfo (); -
SMC/trunk/SMC/src/web/scripts/js/ui_settings.js
r2487 r5978 1 1 2 2 /** 3 * @fileOverview this is copy of mdservice/mdservice_ui_settings.js 4 It includes all variables and possibilities of app settings concerning following areas: 5 * data loading - actions - possible to set details of data loading (uri) 3 * @fileOverview this holds settings for UI. 4 (copied from mdservice/mdservice_ui_settings.js and reduced/adjusted) 5 6 It includes settings for: 6 7 * pane structure 7 8 * - layout_settings[pane_name], layoutBaseSettings - sets the properties of particular panes (ui-layout plugin settings ) 8 9 * - layout_initialisation - structure of particular pane placement 9 * app functionality - blocks_settings - the properties of particular ui blocks (type of detail-window display, commands-TODO) 10 11 * 10 12 * @author 11 13 * @version … … 25 27 var outerLayout, middleLayout, innerLayout; 26 28 var block_positions = ["center","north","south","east","west"]; 27 28 29 // LOAD DATA SEETTINGS30 var actions = {31 base: {32 base_uri: "/MDService2/"33 },34 collections: {35 base_uri: "/MDService2/collections/",36 current:'olac'},37 elements: {38 base_uri: "/MDService2/element/",39 current:''},40 terms: {41 base_uri: "/MDService2/terms/",42 current:'all',43 maxdepth: 8},44 terms_autocomplete: {45 base_uri: "/MDService2/terms/",46 current:''},47 components: {48 base_uri: "/MDService2/comp/",49 current:''},50 /* current:'cmdi-corpus-aac2'}, */51 compprofiles: {52 base_uri: "/MDService2/compprofile/",53 current:''},54 /* current:'cmdi-corpus-aac2'}, */55 56 search: {57 base_uri: "/MDService2/search/"58 },59 60 isocat: {61 base_uri: "/MDService2/datcats/",62 current:563 },64 sru: {65 base_uri: "/MDService2/sru/"66 },67 pazpar: {68 base_uri: "/MDService2/pazpar2/"69 },70 smc: {71 base_uri: "/MDService2/smc/"72 },73 fcs: {74 base_uri: "/MDService2/fcs"75 }76 77 };78 79 29 80 30
Note: See TracChangeset
for help on using the changeset viewer.