Changeset 716592
- Timestamp:
- 05/22/2013 10:53:16 AM (13 years ago)
- Location:
- ipu-chart
- Files:
-
- 6 edited
- 1 copied
-
tags/0.6.2 (copied) (copied from ipu-chart/trunk)
-
tags/0.6.2/ipu-chart.php (modified) (2 diffs)
-
tags/0.6.2/js/ipu-chart.js (modified) (13 diffs)
-
tags/0.6.2/readme.txt (modified) (3 diffs)
-
trunk/ipu-chart.php (modified) (2 diffs)
-
trunk/js/ipu-chart.js (modified) (13 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ipu-chart/tags/0.6.2/ipu-chart.php
r714394 r716592 5 5 Description: Creates D3/SVG based charts out of your comma- or tab-separated data. Currently supports bar, pie, donut, line, scatter, bubble and world map charts. 6 6 Author: Thomas Müller Flury, ipublia 7 Version: 0.6. 17 Version: 0.6.2 8 8 Author URI: https://www.ipublia.com/author/thmufl/ 9 9 Text Domain: ipuchart … … 59 59 'title' => 'Set a title', 60 60 'description' => 'Set a description', 61 'sort' => ' none',61 'sort' => 'true', 62 62 'interpolate' => 'linear', 63 63 'animate' => 'none', -
ipu-chart/tags/0.6.2/js/ipu-chart.js
r714394 r716592 213 213 color = toArray(color); 214 214 animate = toArray(animate); 215 sort = (sort.toLowerCase() == "true"); 215 216 216 217 if(animate[0] == "slow") animate = ["5000", "linear"]; … … 432 433 var svg = figure.select("svg"); 433 434 434 var margin = {top: 2, right: 2, bottom: 2, left: 2},435 var margin = {top: 8, right: 8, bottom: 8, left: 2}, 435 436 width = parseInt(svg.attr("width")) - margin.left - margin.right, 436 437 height = parseInt(svg.attr("height")) - margin.top - margin.bottom; 437 438 438 439 var g = svg.select("g.main"); 439 440 440 441 var pack = d3.layout.pack() 441 442 .size([width, height]) 442 443 .padding(1.5) 443 444 .value(function(d) { return d[value[0]]; }) 444 .sort( null);445 .sort(function(a, b) { return sort ? d3.descending(a.value, b.value) : a.value }); 445 446 446 447 var data = { name: "root", children: data }; … … 451 452 .attr("class", function(d) { return d.children ? "node" : "leaf node"; }) 452 453 .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; }) 454 .style("opacity", function(d) { return d.r != 0 ? defaultOpacity : 0; }) 453 455 .attr("d", function(d) { return d.__category = category; }) 454 456 .attr("d", function(d) { return d.__value = value; }); … … 502 504 .duration(3000) 503 505 .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; }) 506 .style("opacity", function(d) { return d[value[i]] != 0 ? defaultOpacity : 0; }) 504 507 .select("circle") 505 .attr("r", function(d) { return d.r; }); 508 .attr("r", function(d) { return d.r; }); 506 509 } 507 510 … … 525 528 var svg = figure.select("svg"); 526 529 527 var margin = {top: 20, right: 20, bottom: 40, left: 80},530 var margin = {top: 20, right: 20, bottom: 40, left: d3.max(data, function(d) { return 8 * d[value[1]].toString().length; })}, 528 531 width = parseInt(svg.attr("width")) - margin.left - margin.right, 529 532 height = parseInt(svg.attr("height")) - margin.top - margin.bottom; … … 538 541 .scale(x) 539 542 .orient("bottom") 540 .tickSize(height); 543 .tickSize(height) 544 .ticks(8); 541 545 542 546 var yAxis = d3.svg.axis() … … 623 627 624 628 var svg = figure.select("svg"); 625 626 var margin = {top: 20, right: 20, bottom: 40, left: 80},629 630 var margin = {top: 20, right: 10, bottom: 40, left: d3.max(data, function(d) { return 8*d[value].toString().length; })}, 627 631 width = parseInt(svg.attr("width")) - margin.left - margin.right, 628 632 height = parseInt(svg.attr("height")) - margin.top - margin.bottom; … … 637 641 .scale(x) 638 642 .orient("bottom") 639 .tickSize(height); 643 .tickSize(height) 644 .ticks(8); 640 645 641 646 var yAxis = d3.svg.axis() … … 652 657 y.domain(d3.extent(data, function(d) { return d[value]; })); 653 658 654 var chart = svg. append("g")659 var chart = svg.select(".main").append("g") 655 660 .attr("class", "chart") 656 661 .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); … … 694 699 .attr("cy", function(d) { return y(d[value]); }) 695 700 .attr("opacity", 0.0); 696 701 697 702 if(touch_device) { 698 703 d3.selectAll(".dot") … … 714 719 var svg = figure.select("svg"); 715 720 716 var margin = {top: 20, right: 20, bottom: 40, left: 80},721 var margin = {top: 20, right: 20, bottom: 40, left: d3.max(data, function(d) { return 8*d[value].toString().length; })}, 717 722 width = parseInt(svg.attr("width")) - margin.left - margin.right, 718 723 height = parseInt(svg.attr("height")) - margin.top - margin.bottom; … … 824 829 825 830 var svg = figure.select("svg"); 826 827 var margin = {top: 20, right: 20, bottom: 40, left: 80},831 832 var margin = {top: 20, right: 30, bottom: 40, left: d3.max(data, function(d) { return 6*d[category].toString().length; })}, 828 833 width = parseInt(svg.attr("width")) - margin.left - margin.right, 829 834 height = parseInt(svg.attr("height")) - margin.top - margin.bottom; … … 838 843 .scale(x) 839 844 .orient("bottom") 840 .tickSize(height); 845 .tickSize(height) 846 .ticks(6); 841 847 842 848 var yAxis = d3.svg.axis() -
ipu-chart/tags/0.6.2/readme.txt
r714425 r716592 4 4 Requires at least: 3.0.1 5 5 Tested up to: 3.5.1 6 Stable tag: 0.6. 16 Stable tag: 0.6.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 9 10 Creates animated bar, pie, donut, line, scatter, bubble and world map charts out of your data. A d3/svg based shortcode with editor support.10 Creates SVG based, animated bar, pie, donut, line, scatter, bubble and world map charts out of your spreadsheet data. A powerful, easy to use shortcode. And even easier with the free [IPU-Chart Editor Online](https://www.ipublia.com/support/ipu-chart-editor-online/)! 11 11 12 12 == Description == … … 168 168 * Minor update for interoperability with the editor. 169 169 170 = 0.6.2 = 171 * Better calculation of left margin for bar, scatter and line charts 172 * Update for bubble charts with 0 values in the data series 173 * Sor for bubble charts 174 170 175 == Upgrade Notice == 171 176 … … 206 211 * Minor update for the interoperability with the IPU-Chart Editor 207 212 208 213 = 0.6.2 = 214 * Better calculation of left margin for bar, scatter and line charts 215 * Update for bubble charts with 0 values in the data series 216 * Sor for bubble charts 217 218 -
ipu-chart/trunk/ipu-chart.php
r714394 r716592 5 5 Description: Creates D3/SVG based charts out of your comma- or tab-separated data. Currently supports bar, pie, donut, line, scatter, bubble and world map charts. 6 6 Author: Thomas Müller Flury, ipublia 7 Version: 0.6. 17 Version: 0.6.2 8 8 Author URI: https://www.ipublia.com/author/thmufl/ 9 9 Text Domain: ipuchart … … 59 59 'title' => 'Set a title', 60 60 'description' => 'Set a description', 61 'sort' => ' none',61 'sort' => 'true', 62 62 'interpolate' => 'linear', 63 63 'animate' => 'none', -
ipu-chart/trunk/js/ipu-chart.js
r714394 r716592 213 213 color = toArray(color); 214 214 animate = toArray(animate); 215 sort = (sort.toLowerCase() == "true"); 215 216 216 217 if(animate[0] == "slow") animate = ["5000", "linear"]; … … 432 433 var svg = figure.select("svg"); 433 434 434 var margin = {top: 2, right: 2, bottom: 2, left: 2},435 var margin = {top: 8, right: 8, bottom: 8, left: 2}, 435 436 width = parseInt(svg.attr("width")) - margin.left - margin.right, 436 437 height = parseInt(svg.attr("height")) - margin.top - margin.bottom; 437 438 438 439 var g = svg.select("g.main"); 439 440 440 441 var pack = d3.layout.pack() 441 442 .size([width, height]) 442 443 .padding(1.5) 443 444 .value(function(d) { return d[value[0]]; }) 444 .sort( null);445 .sort(function(a, b) { return sort ? d3.descending(a.value, b.value) : a.value }); 445 446 446 447 var data = { name: "root", children: data }; … … 451 452 .attr("class", function(d) { return d.children ? "node" : "leaf node"; }) 452 453 .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; }) 454 .style("opacity", function(d) { return d.r != 0 ? defaultOpacity : 0; }) 453 455 .attr("d", function(d) { return d.__category = category; }) 454 456 .attr("d", function(d) { return d.__value = value; }); … … 502 504 .duration(3000) 503 505 .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; }) 506 .style("opacity", function(d) { return d[value[i]] != 0 ? defaultOpacity : 0; }) 504 507 .select("circle") 505 .attr("r", function(d) { return d.r; }); 508 .attr("r", function(d) { return d.r; }); 506 509 } 507 510 … … 525 528 var svg = figure.select("svg"); 526 529 527 var margin = {top: 20, right: 20, bottom: 40, left: 80},530 var margin = {top: 20, right: 20, bottom: 40, left: d3.max(data, function(d) { return 8 * d[value[1]].toString().length; })}, 528 531 width = parseInt(svg.attr("width")) - margin.left - margin.right, 529 532 height = parseInt(svg.attr("height")) - margin.top - margin.bottom; … … 538 541 .scale(x) 539 542 .orient("bottom") 540 .tickSize(height); 543 .tickSize(height) 544 .ticks(8); 541 545 542 546 var yAxis = d3.svg.axis() … … 623 627 624 628 var svg = figure.select("svg"); 625 626 var margin = {top: 20, right: 20, bottom: 40, left: 80},629 630 var margin = {top: 20, right: 10, bottom: 40, left: d3.max(data, function(d) { return 8*d[value].toString().length; })}, 627 631 width = parseInt(svg.attr("width")) - margin.left - margin.right, 628 632 height = parseInt(svg.attr("height")) - margin.top - margin.bottom; … … 637 641 .scale(x) 638 642 .orient("bottom") 639 .tickSize(height); 643 .tickSize(height) 644 .ticks(8); 640 645 641 646 var yAxis = d3.svg.axis() … … 652 657 y.domain(d3.extent(data, function(d) { return d[value]; })); 653 658 654 var chart = svg. append("g")659 var chart = svg.select(".main").append("g") 655 660 .attr("class", "chart") 656 661 .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); … … 694 699 .attr("cy", function(d) { return y(d[value]); }) 695 700 .attr("opacity", 0.0); 696 701 697 702 if(touch_device) { 698 703 d3.selectAll(".dot") … … 714 719 var svg = figure.select("svg"); 715 720 716 var margin = {top: 20, right: 20, bottom: 40, left: 80},721 var margin = {top: 20, right: 20, bottom: 40, left: d3.max(data, function(d) { return 8*d[value].toString().length; })}, 717 722 width = parseInt(svg.attr("width")) - margin.left - margin.right, 718 723 height = parseInt(svg.attr("height")) - margin.top - margin.bottom; … … 824 829 825 830 var svg = figure.select("svg"); 826 827 var margin = {top: 20, right: 20, bottom: 40, left: 80},831 832 var margin = {top: 20, right: 30, bottom: 40, left: d3.max(data, function(d) { return 6*d[category].toString().length; })}, 828 833 width = parseInt(svg.attr("width")) - margin.left - margin.right, 829 834 height = parseInt(svg.attr("height")) - margin.top - margin.bottom; … … 838 843 .scale(x) 839 844 .orient("bottom") 840 .tickSize(height); 845 .tickSize(height) 846 .ticks(6); 841 847 842 848 var yAxis = d3.svg.axis() -
ipu-chart/trunk/readme.txt
r714425 r716592 4 4 Requires at least: 3.0.1 5 5 Tested up to: 3.5.1 6 Stable tag: 0.6. 16 Stable tag: 0.6.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 9 10 Creates animated bar, pie, donut, line, scatter, bubble and world map charts out of your data. A d3/svg based shortcode with editor support.10 Creates SVG based, animated bar, pie, donut, line, scatter, bubble and world map charts out of your spreadsheet data. A powerful, easy to use shortcode. And even easier with the free [IPU-Chart Editor Online](https://www.ipublia.com/support/ipu-chart-editor-online/)! 11 11 12 12 == Description == … … 168 168 * Minor update for interoperability with the editor. 169 169 170 = 0.6.2 = 171 * Better calculation of left margin for bar, scatter and line charts 172 * Update for bubble charts with 0 values in the data series 173 * Sor for bubble charts 174 170 175 == Upgrade Notice == 171 176 … … 206 211 * Minor update for the interoperability with the IPU-Chart Editor 207 212 208 213 = 0.6.2 = 214 * Better calculation of left margin for bar, scatter and line charts 215 * Update for bubble charts with 0 values in the data series 216 * Sor for bubble charts 217 218
Note: See TracChangeset
for help on using the changeset viewer.