Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…complexity into beta
  • Loading branch information
makmanalp committed May 23, 2014
2 parents c992df7 + f5e54a8 commit 27b6eab
Show file tree
Hide file tree
Showing 7 changed files with 260 additions and 5,197 deletions.
7 changes: 3 additions & 4 deletions html/explore/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1287,24 +1287,22 @@ <h4 style="border-bottom: solid 1px #999; font-family:'PT Sans Narrow',Helvetica

<script src="{{ STATIC_URL }}js/libs/vizwiz/src/utils.slider.js"></script>

{% if app_name != "scatterplot" %}

<script src="{{ STATIC_URL }}js/libs/d3plus/src/viz/viz.js"></script>

{% if app_name == "tree_map" %}<script src="{{ STATIC_URL }}js/libs/d3plus/src/viz/tree_map.js"></script>{% endif %}
{% if app_name == "stacked" %}<script src="{{ STATIC_URL }}js/libs/d3plus/src/viz/stacked.js"></script>{% endif %}
{% if app_name == "pie_scatter" %}<script src="{{ STATIC_URL }}js/libs/d3plus/src/viz/pie_scatter.js"></script>{% endif %}
{% if app_name == "pie_scatter" or app_name == "scatterplot" %}<script src="{{ STATIC_URL }}js/libs/d3plus/src/viz/pie_scatter.js"></script>{% endif %}
{% if app_name == "product_space" %}<script src="{{ STATIC_URL }}js/libs/d3plus/src/viz/network.js"></script>{% endif %}
{% if app_name == "map" %}<!-- <script src="media/js/libs/d3plus/src/viz/geo_map.js"></script>-->{% endif %}
{% if app_name == "rings" %}<script src="{{ STATIC_URL }}js/libs/d3plus/src/viz/rings.js"></script>{% endif %}

{% elif app_name == "scatterplot" %}
{% elif app_name == "scatterplot_new" %}

<script src="{{ STATIC_URL }}js/libs/d3plus/d3plus.v1.2.4.js"></script>

{% endif %}

{% endif %}

{% if app_name == "map" %}

Expand Down Expand Up @@ -1424,6 +1422,7 @@ <h4 style="border-bottom: solid 1px #999; font-family:'PT Sans Narrow',Helvetica
queryParameters['details_treemap'] = queryParameters['details_treemap'] || 2;
queryParameters['cat_id'] = queryParameters['cat_id'] || "";
queryParameters['cont_id'] = queryParameters['cont_id'] || "";
queryParameters['show_related'] = Boolean(queryParameters['show_related']) || false;
//queryParameters['trade_flow'] = queryParameters['trade_flow'] || "net";
queryParameters['highlight'] = queryParameters['highlight'] || "";

Expand Down
1 change: 1 addition & 0 deletions media/js/data/search_sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"value": "explore/tree_map/export/FRA/all/show/", "label": "What did France export?"}, {"value": "explore/tree_map/import/FRA/all/show/", "label": "What did France import?"}, {"value": "explore/tree_map/import/FRA/show/all/", "label": "Where did France import from?"}, {"value": "explore/tree_map/export/FRA/show/all/", "label": "Where did France export to?"}, {"value": "explore/tree_map/import/GLP/FRA/show/", "label": "What did Guadeloupe import from France?"}, {"value": "explore/tree_map/import/AIA/FRA/show/", "label": "What did Anguilla import from France?"}, {"value": "explore/tree_map/export/MEX/FRA/show/", "label": "What did Mexico export to France?"}, {"value": "explore/tree_map/import/PAN/FRA/show/", "label": "What did Panama import from France?"}]
22 changes: 17 additions & 5 deletions media/js/explore/key.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function Key() {
cats = pretty_cats(attrs);
sitcs = pretty_sitcs(attrs);

if (prod_class == "sitc4" && (app_type=="casy"||app_type=="ccsy")){
if (prod_class == "sitc4" && (app_type=="casy"||app_type=="ccsy")) {
d3.select(this)
.attr("id", "sitc1")
.selectAll("a").data(d3.values(sitcs))
Expand All @@ -26,8 +26,6 @@ function Key() {
.append("a")
.call(key_icon)
}
// put tooltip on mouseover
// $('#key a').toopt({"gravity":'s',"fade":true});

})
}
Expand Down Expand Up @@ -194,8 +192,6 @@ function Key() {

})

// Update tooltips
// $(".tooltipbs").tooltip({delay: { show: 500, hide: 100 }});
}


Expand Down Expand Up @@ -249,6 +245,22 @@ function Key() {
classification = value;
return key;
};

key.disable = function(list) {

// Only works for rings

// Re-enable all

for(var p in cats) {
d3.selectAll(".cat_"+p).style("opacity", "1").style("pointer-events", "auto");
};

list.forEach(function(d) {
d3.selectAll(".cat_"+d).style("opacity", ".05").style("pointer-events", "none"); // "auto"
});

}

/////////////////////////////////////////////////////////////////////
// BE SURE TO ALWAYS RETURN THE APP TO ALLOW FOR METHOD CHAINING
Expand Down
Loading

0 comments on commit 27b6eab

Please sign in to comment.