Changeset 5978


Ignore:
Timestamp:
02/15/15 18:08:48 (9 years ago)
Author:
xnrn@gmx.net
Message:

moved all configuration into config.js, cleaned up ui_settings.js

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  
    1414
    1515var 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;
     16var select_rect_min_size = config.select_rect_min_size;
     17var first_level_margin = config.first_level_margin ;
     18var base_font_size = config.base_font_size ;
     19var min_circle = config.min_circle;
     20var max_circle = config.max_circle;
     21
     22var show_count = config.show_count;
    2323 
    2424
    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
    2626var comp_reg_url = "http://catalog.clarin.eu/ds/ComponentRegistry/?item=";
    2727var wiki_url = "http://en.wikipedia.org/wiki/";
     
    4242//var source_file = "/smc/smc-graph.d3";
    4343/*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
    7748
    7849
     
    9768
    9869     // load data
    99      d3.json(data_prefix + graph_source,
     70     d3.json(config.url.data_prefix + graph_source,
    10071                function(json) {       
    10172                    // return if data missing
     
    408379          .enter().append("svg:marker")
    409380            .attr("id", String)
     381            .attr("markerUnits", "userSpaceOnUse")
    410382            .attr("viewBox", "0 -5 10 10")
    411             .attr("refX", 15)
    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)
    415387            .attr("orient", "auto")
    416388          .append("svg:path")
     
    425397            .classed("uses", 1)
    426398            .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); });
    429403/*             .style("stroke-width", function(d) { return d.value });*/
     404            }
    430405
    431406           path.append("title").text(function(d){ return d.value });
     
    645620     
    646621     if (mode=='static') {
    647      $(detail_info_holder_selector).load(detail_file,function(data) {
     622     $(detail_info_holder_selector).load(config.url.detail,function(data) {
    648623        $(detail_container_selector).find("h3").after(
    649624        '<div id="detail-summary-overall" class="cmds-ui-block init-show" ><div class="header">Overview</div><div class="content">'
     
    687662            return d.html();       
    688663        } else {
    689             var url = detail_url + "?type=" + type + "&key=" + id;
     664            var url = config.url.detail + "?type=" + type + "&key=" + id;
    690665            console.log("get-detail:" + url );
    691666                $(target).toggleClass("loading");
     
    1012987
    1013988        /* don't filter at all */
    1014         if (weight_threshold == 1) {
     989        if (weight_threshold == 1 | opt("weight")=="") {
    1015990           var n_in = data.nodes_in[n.key] ? data.nodes_in[n.key] : [] ;
    1016991           var n_out = data.nodes_out[n.key] ? data.nodes_out[n.key] : [] ;
  • SMC/trunk/SMC/src/web/scripts/js/ui.js

    r5301 r5978  
    5757       
    5858  // loading userdocs as welcome info
    59   $(graph_container).load(userdocs_file + " div.document");
     59  $(graph_container).load(config.url.userdocs + " div.document");
    6060 
    6161                loadDetailInfo ();
  • SMC/trunk/SMC/src/web/scripts/js/ui_settings.js

    r2487 r5978  
    11
    22/**
    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:
    67 * pane structure
    78 *      - layout_settings[pane_name], layoutBaseSettings - sets the properties of particular panes (ui-layout plugin settings )
    89 *      - 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 *
    1012 * @author
    1113 * @version
     
    2527var outerLayout, middleLayout, innerLayout;
    2628var block_positions = ["center","north","south","east","west"];
    27 
    28 
    29 // LOAD DATA SEETTINGS
    30 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:5
    63                                 },
    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 
    7929
    8030
Note: See TracChangeset for help on using the changeset viewer.