Changeset 723546
- Timestamp:
- 06/06/2013 02:58:37 PM (13 years ago)
- Location:
- ipu-chart
- Files:
-
- 8 added
- 8 edited
- 1 copied
-
assets/screenshot-1.png (modified) (previous)
-
assets/screenshot-2.png (modified) (previous)
-
tags/0.7.1 (copied) (copied from ipu-chart/trunk)
-
tags/0.7.1/img (added)
-
tags/0.7.1/img/ipuc-icon-16x16-bw.png (added)
-
tags/0.7.1/include (added)
-
tags/0.7.1/include/settings.php (added)
-
tags/0.7.1/ipu-chart.php (modified) (4 diffs)
-
tags/0.7.1/js/ipu-chart.js (modified) (4 diffs)
-
tags/0.7.1/readme.txt (modified) (3 diffs)
-
trunk/img (added)
-
trunk/img/ipuc-icon-16x16-bw.png (added)
-
trunk/include (added)
-
trunk/include/settings.php (added)
-
trunk/ipu-chart.php (modified) (4 diffs)
-
trunk/js/ipu-chart.js (modified) (4 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ipu-chart/tags/0.7.1/ipu-chart.php
r721286 r723546 5 5 Description: Creates D3/SVG based charts out of your csv, tsv or jason data. Currently supports bar, pie, donut, line, scatter, bubble and world map charts. 6 6 Author: Thomas Müller Flury, ipublia 7 Version: 0.7 7 Version: 0.7.1 8 8 Author URI: https://www.ipublia.com/author/thmufl/ 9 9 Text Domain: ipuchart … … 11 11 */ 12 12 13 // Plugin Folder Path 14 if (!defined('IPUC_PLUGIN_DIR')) 15 define( 'IPUC_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . basename(dirname( __FILE__ ) ) . '/'); 16 13 17 // Helper to display plugin version in console logs 14 18 function plugin_get_version() { … … 105 109 add_shortcode("table", "ipuc_table_func"); 106 110 111 // Second shortcode set for compability with some themes. 112 add_shortcode("ipu-csv", "ipuc_csv_func"); 113 add_shortcode("ipu-tsv", "ipuc_tsv_func"); 114 add_shortcode("ipu-json", "ipuc_tsv_func"); 115 add_shortcode("ipu-chart", "ipuc_chart_func"); 116 add_shortcode("ipu-table", "ipuc_table_func"); 117 107 118 function ipuc_render_csv($id, $content) { 108 119 return "<div id='{$id}' class='csv' style='display:none;white-space:pre;'>{$content}</div>"; … … 170 181 add_action('wp_enqueue_scripts', 'ipuc_add_custom_styles' ); 171 182 183 // Add settings page (licenses etc.) 184 function ipuc_settings_menu() { 185 add_menu_page('IPU-Chart Plugin Settings', 'IPU-Chart', 'administrator', __FILE__, 'ipuc_settings_page', plugins_url('img/ipuc-icon-16x16-bw.png', __FILE__)); 186 } 187 add_action('admin_menu', 'ipuc_settings_menu'); 172 188 173 // Create custom plugin settings menu 174 function ipuc_create_menu() { 175 //create new top-level menu 176 add_menu_page( 'IPU-Chart Plugin Settings', 'IPU-Chart', 'administrator', __FILE__, 'ipuc_settings_page', plugins_url('/img/ipuc-icon-16x16-framed.png', __FILE__)); 177 //call register settings function 178 add_action('admin_init', 'register_ipuc_settings'); 179 } 180 add_action('admin_menu', 'ipuc_create_menu'); 189 require_once IPUC_PLUGIN_DIR . 'include/settings.php'; 181 190 182 function register_ipuc_settings() {183 //register our settings184 register_setting( 'ipuc-settings-group', 'new_option_name' );185 register_setting( 'ipuc-settings-group', 'some_other_option' );186 register_setting( 'ipuc-settings-group', 'option_etc' );187 }188 189 function ipuc_settings_page() {190 191 ?> 191 <div class="wrap">192 <h2><?php _e('IPU-Chart Settings'); ?></h2>193 </div>194 <?php195 } ?> -
ipu-chart/tags/0.7.1/js/ipu-chart.js
r721286 r723546 349 349 else if(type.toLowerCase().trim() == "table") 350 350 renderTable(figure, data, category, value, debug); 351 352 else if(type.toLowerCase().trim() == "line.multi")353 render LineMulti(figure, data, category, value, format, color, sort, interpolate, animate, debug);351 352 else 353 renderMultiSeriesExtension(type, figure, data, category, value, format, color, sort, interpolate, animate, debug); 354 354 } 355 355 … … 885 885 var svg = figure.select("svg"); 886 886 887 var margin = {top: 20, right: 30, bottom: 40, left: d3.max(data, function(d) { return 6*d[category].toString().length; })},887 var margin = {top: 20, right: 30, bottom: 40, left: d3.max(data, function(d) { return 8*d[category].toString().length; })}, 888 888 width = parseInt(svg.attr("width")) - margin.left - margin.right, 889 889 height = parseInt(svg.attr("height")) - margin.top - margin.bottom; … … 906 906 907 907 y.domain(data.map(function(d) { return d[category]; })); 908 x.domain([d3.max(data, function(d) { return d[value]; }), 0]); 908 909 var min = d3.min(data, function(d) { return d[value]; }); 910 x.domain([d3.max(data, function(d) { return d[value]; }), d3.min([min, 0])]); 909 911 910 912 var chart = svg.append("g") … … 940 942 .enter().append("rect") 941 943 .attr("class", "bar") 942 .attr("x", 0)944 .attr("x", function(d) { return d[value] > 0 ? x(0) : x(d[value]); }) 943 945 .attr("y", function(d) { return y(d[category]); }) 944 946 .attr("height", y.rangeBand()) 945 .attr("width", function(d) { return x(d[value]);})947 .attr("width", function(d) { return d[value] > 0 ? x(d[value]) - x(0) : x(0) - x(d[value]); }) 946 948 .style("fill", function(d) { return color(d[category]); }) 947 949 .style("opacity", defaultOpacity); -
ipu-chart/tags/0.7.1/readme.txt
r721286 r723546 4 4 Requires at least: 3.0.1 5 5 Tested up to: 3.5.1 6 Stable tag: 0.7 6 Stable tag: 0.7.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 180 180 * Minor layout changes (tooltip). 181 181 182 = 0.7.1 = 183 * Support for negative values in horizontal bar charts added. 184 * Second shortcode set with prefix 'ipu-' added. 185 * Support for multi-series extension added. 186 182 187 == Upgrade Notice == 183 188 … … 228 233 * Minor layout changes (tooltip). 229 234 230 235 = 0.7.1 = 236 This version adds support for negative values for horizontal bar charts. A second shortcode set with the prefix 'ipu-' was added for interoperability with some plugins and themes. 237 238 -
ipu-chart/trunk/ipu-chart.php
r721286 r723546 5 5 Description: Creates D3/SVG based charts out of your csv, tsv or jason data. Currently supports bar, pie, donut, line, scatter, bubble and world map charts. 6 6 Author: Thomas Müller Flury, ipublia 7 Version: 0.7 7 Version: 0.7.1 8 8 Author URI: https://www.ipublia.com/author/thmufl/ 9 9 Text Domain: ipuchart … … 11 11 */ 12 12 13 // Plugin Folder Path 14 if (!defined('IPUC_PLUGIN_DIR')) 15 define( 'IPUC_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . basename(dirname( __FILE__ ) ) . '/'); 16 13 17 // Helper to display plugin version in console logs 14 18 function plugin_get_version() { … … 105 109 add_shortcode("table", "ipuc_table_func"); 106 110 111 // Second shortcode set for compability with some themes. 112 add_shortcode("ipu-csv", "ipuc_csv_func"); 113 add_shortcode("ipu-tsv", "ipuc_tsv_func"); 114 add_shortcode("ipu-json", "ipuc_tsv_func"); 115 add_shortcode("ipu-chart", "ipuc_chart_func"); 116 add_shortcode("ipu-table", "ipuc_table_func"); 117 107 118 function ipuc_render_csv($id, $content) { 108 119 return "<div id='{$id}' class='csv' style='display:none;white-space:pre;'>{$content}</div>"; … … 170 181 add_action('wp_enqueue_scripts', 'ipuc_add_custom_styles' ); 171 182 183 // Add settings page (licenses etc.) 184 function ipuc_settings_menu() { 185 add_menu_page('IPU-Chart Plugin Settings', 'IPU-Chart', 'administrator', __FILE__, 'ipuc_settings_page', plugins_url('img/ipuc-icon-16x16-bw.png', __FILE__)); 186 } 187 add_action('admin_menu', 'ipuc_settings_menu'); 172 188 173 // Create custom plugin settings menu 174 function ipuc_create_menu() { 175 //create new top-level menu 176 add_menu_page( 'IPU-Chart Plugin Settings', 'IPU-Chart', 'administrator', __FILE__, 'ipuc_settings_page', plugins_url('/img/ipuc-icon-16x16-framed.png', __FILE__)); 177 //call register settings function 178 add_action('admin_init', 'register_ipuc_settings'); 179 } 180 add_action('admin_menu', 'ipuc_create_menu'); 189 require_once IPUC_PLUGIN_DIR . 'include/settings.php'; 181 190 182 function register_ipuc_settings() {183 //register our settings184 register_setting( 'ipuc-settings-group', 'new_option_name' );185 register_setting( 'ipuc-settings-group', 'some_other_option' );186 register_setting( 'ipuc-settings-group', 'option_etc' );187 }188 189 function ipuc_settings_page() {190 191 ?> 191 <div class="wrap">192 <h2><?php _e('IPU-Chart Settings'); ?></h2>193 </div>194 <?php195 } ?> -
ipu-chart/trunk/js/ipu-chart.js
r721286 r723546 349 349 else if(type.toLowerCase().trim() == "table") 350 350 renderTable(figure, data, category, value, debug); 351 352 else if(type.toLowerCase().trim() == "line.multi")353 render LineMulti(figure, data, category, value, format, color, sort, interpolate, animate, debug);351 352 else 353 renderMultiSeriesExtension(type, figure, data, category, value, format, color, sort, interpolate, animate, debug); 354 354 } 355 355 … … 885 885 var svg = figure.select("svg"); 886 886 887 var margin = {top: 20, right: 30, bottom: 40, left: d3.max(data, function(d) { return 6*d[category].toString().length; })},887 var margin = {top: 20, right: 30, bottom: 40, left: d3.max(data, function(d) { return 8*d[category].toString().length; })}, 888 888 width = parseInt(svg.attr("width")) - margin.left - margin.right, 889 889 height = parseInt(svg.attr("height")) - margin.top - margin.bottom; … … 906 906 907 907 y.domain(data.map(function(d) { return d[category]; })); 908 x.domain([d3.max(data, function(d) { return d[value]; }), 0]); 908 909 var min = d3.min(data, function(d) { return d[value]; }); 910 x.domain([d3.max(data, function(d) { return d[value]; }), d3.min([min, 0])]); 909 911 910 912 var chart = svg.append("g") … … 940 942 .enter().append("rect") 941 943 .attr("class", "bar") 942 .attr("x", 0)944 .attr("x", function(d) { return d[value] > 0 ? x(0) : x(d[value]); }) 943 945 .attr("y", function(d) { return y(d[category]); }) 944 946 .attr("height", y.rangeBand()) 945 .attr("width", function(d) { return x(d[value]);})947 .attr("width", function(d) { return d[value] > 0 ? x(d[value]) - x(0) : x(0) - x(d[value]); }) 946 948 .style("fill", function(d) { return color(d[category]); }) 947 949 .style("opacity", defaultOpacity); -
ipu-chart/trunk/readme.txt
r721286 r723546 4 4 Requires at least: 3.0.1 5 5 Tested up to: 3.5.1 6 Stable tag: 0.7 6 Stable tag: 0.7.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 180 180 * Minor layout changes (tooltip). 181 181 182 = 0.7.1 = 183 * Support for negative values in horizontal bar charts added. 184 * Second shortcode set with prefix 'ipu-' added. 185 * Support for multi-series extension added. 186 182 187 == Upgrade Notice == 183 188 … … 228 233 * Minor layout changes (tooltip). 229 234 230 235 = 0.7.1 = 236 This version adds support for negative values for horizontal bar charts. A second shortcode set with the prefix 'ipu-' was added for interoperability with some plugins and themes. 237 238
Note: See TracChangeset
for help on using the changeset viewer.