From a4c79648a9f4fb0f2b8a16d34852c6e2c802f88a Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Sun, 10 Jan 2016 09:57:45 -0800 Subject: [PATCH] Minor cosmetic changes --- panoramix/static/panoramix.js | 6 ++++++ panoramix/static/widgets/viz_bignumber.js | 4 ++-- panoramix/static/widgets/viz_directed_force.js | 4 ++-- panoramix/static/widgets/viz_sankey.js | 4 ++-- panoramix/static/widgets/viz_sunburst.js | 4 ++-- panoramix/static/widgets/viz_wordcloud.js | 2 +- panoramix/templates/panoramix/explore.html | 4 +--- 7 files changed, 16 insertions(+), 12 deletions(-) diff --git a/panoramix/static/panoramix.js b/panoramix/static/panoramix.js index 141145d6316bf..d0aa9db6ecac6 100644 --- a/panoramix/static/panoramix.js +++ b/panoramix/static/panoramix.js @@ -60,6 +60,12 @@ var px = (function() { container: container, container_id: container_id, selector: selector, + width: function(){ + return token.width(); + }, + height: function(){ + return token.height(); + }, render: function() { token.find("img.loading").show(); container.hide(); diff --git a/panoramix/static/widgets/viz_bignumber.js b/panoramix/static/widgets/viz_bignumber.js index 2a69d43a97254..f7db55a294422 100644 --- a/panoramix/static/widgets/viz_bignumber.js +++ b/panoramix/static/widgets/viz_bignumber.js @@ -16,8 +16,8 @@ px.registerViz('big_number', function(slice) { var f = d3.format('.3s'); var fp = d3.format('+.1%'); - var width = slice.container.width(); - var height = slice.container.height() - 30; + var width = slice.width(); + var height = slice.height() - 30; var svg = div.append('svg'); svg.attr("width", width); svg.attr("height", height); diff --git a/panoramix/static/widgets/viz_directed_force.js b/panoramix/static/widgets/viz_directed_force.js index 5d95d61c5597f..94f3f8cf468a9 100644 --- a/panoramix/static/widgets/viz_directed_force.js +++ b/panoramix/static/widgets/viz_directed_force.js @@ -3,8 +3,6 @@ Modified from http://bl.ocks.org/d3noob/5141278 */ function viz_directed_force(slice) { - var width = slice.container.width(); - var height = slice.container.height() - 25; var link_length = slice.data.form_data['link_length']; var div = d3.select(slice.selector); if (link_length === undefined){ @@ -15,6 +13,8 @@ function viz_directed_force(slice) { charge = -500; } var render = function() { + var width = slice.width(); + var height = slice.height() - 25; d3.json(slice.jsonEndpoint(), function(error, json) { if (error != null){ diff --git a/panoramix/static/widgets/viz_sankey.js b/panoramix/static/widgets/viz_sankey.js index 83b4355e4dbdd..2d028db19eb3e 100644 --- a/panoramix/static/widgets/viz_sankey.js +++ b/panoramix/static/widgets/viz_sankey.js @@ -2,8 +2,8 @@ function viz_sankey(slice) { var div = d3.select(slice.selector); var render = function() { - var width = slice.container.width(); - var height = slice.container.height() - 25; + var width = slice.width(); + var height = slice.height() - 25; var margin = {top: 5, right: 5, bottom: 5, left: 5}; width = width - margin.left - margin.right; height = height - margin.top - margin.bottom; diff --git a/panoramix/static/widgets/viz_sunburst.js b/panoramix/static/widgets/viz_sunburst.js index 7cd7feb7654b6..3b8bccc687e6c 100644 --- a/panoramix/static/widgets/viz_sunburst.js +++ b/panoramix/static/widgets/viz_sunburst.js @@ -4,8 +4,8 @@ Modified from http://bl.ocks.org/kerryrodden/7090426 function viz_sunburst(slice) { var container = d3.select(slice.selector); - var width = slice.container.width(); - var height = slice.container.height() - 25; + var width = slice.width(); + var height = slice.height() - 25; var render = function() { // Breadcrumb dimensions: width, height, spacing, width of tip/tail. var b = { diff --git a/panoramix/static/widgets/viz_wordcloud.js b/panoramix/static/widgets/viz_wordcloud.js index 615ad7b8ee229..c4c92d217aafb 100644 --- a/panoramix/static/widgets/viz_wordcloud.js +++ b/panoramix/static/widgets/viz_wordcloud.js @@ -22,7 +22,7 @@ px.registerViz('word_cloud', function(slice) { else { var f_rotation = function() { return (~~(Math.random() * 6) - 3) * 30; }; } - var size = [slice.container.width(), slice.container.height() - 25]; + var size = [slice.width(), slice.height()]; scale = d3.scale.linear() .range(range) diff --git a/panoramix/templates/panoramix/explore.html b/panoramix/templates/panoramix/explore.html index 55b72ecfb2532..c409fd6589596 100644 --- a/panoramix/templates/panoramix/explore.html +++ b/panoramix/templates/panoramix/explore.html @@ -17,7 +17,7 @@ {% endmacro %} -
+ -
{% for fieldset in form.fieldsets %}
@@ -153,7 +152,6 @@
-