Skip to content

Commit 118fb1c

Browse files
Merge branch '3.4.0' into issue-214
2 parents 7dae408 + 2b97024 commit 118fb1c

File tree

21 files changed

+338
-151
lines changed

21 files changed

+338
-151
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ matrix:
1717
env: TEST_SUITE=Wraith_Visual_Regression_Testing WRAITH_FAIL=5
1818
script: "./bin/wraith.sh"
1919
- name: Cypress
20-
if: branch = development
2120
language: node_js
2221
node_js:
2322
- 10.8
@@ -82,4 +81,4 @@ after_deploy:
8281
- ". ./bin/deploy.sh"
8382
after_failure:
8483
- cat "logs/phpcs.log"
85-
- cat "logs/jslogs.log"
84+
- cat "logs/jslogs.log"

classes/Visualizer/Module/Admin.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,12 @@ public static function _getChartTypesLocalized( $enabledOnly = false, $get2Darra
391391
'enabled' => true,
392392
'supports' => array( 'Google Charts', 'ChartJS' ),
393393
),
394+
'bubble' => array(
395+
'name' => esc_html__( 'Bubble', 'visualizer' ),
396+
'enabled' => true,
397+
// chartjs' bubble is ugly looking (and it won't work off the default bubble.csv) so it is being excluded for the time being.
398+
'supports' => array( 'Google Charts' ),
399+
),
394400
'scatter' => array(
395401
'name' => esc_html__( 'Scatter', 'visualizer' ),
396402
'enabled' => true,

classes/Visualizer/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
class Visualizer_Plugin {
2929

3030
const NAME = 'visualizer';
31-
const VERSION = '3.3.2';
31+
const VERSION = '3.4.0';
3232

3333
// custom post types
3434
const CPT_VISUALIZER = 'visualizer';

classes/Visualizer/Render/Page/Data.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,12 @@ class="dashicons dashicons-lock"></span></h2>
430430

431431
<?php $this->getPermissionsLink( $this->chart->ID ); ?>
432432

433-
<li class="viz-group bottom-fixed" id="vz-chart-copyright">Visualizer &copy; <?php echo date( 'Y', current_time( 'timestamp' ) ); ?></li>
433+
<li class="viz-group bottom-fixed" id="vz-chart-copyright">Visualizer &copy;
434+
<?php
435+
// phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date, WordPress.DateTime.CurrentTimeTimestamp.Requested
436+
echo date( 'Y', current_time( 'timestamp' ) );
437+
?>
438+
</li>
434439
</ul>
435440
<?php
436441
// changed by Ash/Upwork

classes/Visualizer/Render/Sidebar.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,8 @@ protected function _renderGeneralSettings() {
360360

361361
$this->_renderAnimationSettings();
362362

363+
do_action( 'visualizer_chart_settings', get_class( $this ), $this->_data, 'general', array( 'generic' => true ) );
364+
363365
self::_renderGroupEnd();
364366
}
365367

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
<?php
2+
3+
// +----------------------------------------------------------------------+
4+
// | Copyright 2013 Madpixels (email : [email protected]) |
5+
// +----------------------------------------------------------------------+
6+
// | This program is free software; you can redistribute it and/or modify |
7+
// | it under the terms of the GNU General Public License, version 2, as |
8+
// | published by the Free Software Foundation. |
9+
// | |
10+
// | This program is distributed in the hope that it will be useful, |
11+
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12+
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13+
// | GNU General Public License for more details. |
14+
// | |
15+
// | You should have received a copy of the GNU General Public License |
16+
// | along with this program; if not, write to the Free Software |
17+
// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
18+
// | MA 02110-1301 USA |
19+
// +----------------------------------------------------------------------+
20+
// | Author: Eugene Manuilov <[email protected]> |
21+
// +----------------------------------------------------------------------+
22+
/**
23+
* Class for area chart sidebar settings.
24+
*
25+
* @category Visualizer
26+
* @package Render
27+
* @subpackage Sidebar
28+
*
29+
* @since 1.0.0
30+
*/
31+
class Visualizer_Render_Sidebar_Type_GoogleCharts_Bubble extends Visualizer_Render_Sidebar_Linear {
32+
33+
/**
34+
* Constructor.
35+
*
36+
* @since 1.0.0
37+
*
38+
* @access public
39+
* @param array $data The data what has to be associated with this render.
40+
*/
41+
public function __construct( $data = array() ) {
42+
parent::__construct( $data );
43+
$this->_includeCurveTypes = false;
44+
}
45+
46+
/**
47+
* Renders template.
48+
*
49+
* @since 1.0.0
50+
*
51+
* @access protected
52+
*/
53+
protected function _toHTML() {
54+
$this->_renderGeneralSettings();
55+
$this->_renderAxesSettings();
56+
$this->_renderBubbleSettings();
57+
$this->_renderViewSettings();
58+
$this->_renderAdvancedSettings();
59+
}
60+
61+
/**
62+
* Renders bubble settings items.
63+
*
64+
* @since 3.4.0
65+
*
66+
* @access protected
67+
*/
68+
protected function _renderBubbleSettings() {
69+
self::_renderGroupStart( esc_html__( 'Bubble Settings', 'visualizer' ) );
70+
self::_renderSectionStart();
71+
self::_renderTextItem(
72+
esc_html__( 'Opacity', 'visualizer' ),
73+
'bubble[opacity]',
74+
isset( $this->bubble['opacity'] ) ? $this->bubble['opacity'] : 0.8,
75+
esc_html__( 'The default opacity of the bubbles, where 0.0 is fully transparent and 1.0 is fully opaque.', 'visualizer' ),
76+
0.8,
77+
'number',
78+
array( 'min' => 0.0, 'max' => 1.0, 'step' => 0.1 )
79+
);
80+
81+
self::_renderColorPickerItem(
82+
esc_html__( 'Stroke Color', 'visualizer' ),
83+
'bubble[stroke]',
84+
isset( $this->bubble[ $index ]['stroke'] ) ? $this->bubble[ $index ]['stroke'] : null,
85+
null
86+
);
87+
88+
self::_renderCheckboxItem(
89+
esc_html__( 'Sort Bubbles by Size', 'visualizer' ),
90+
'sortBubblesBySize',
91+
$this->sortBubblesBySize ? 1 : 0,
92+
1,
93+
esc_html__( 'If true, sorts the bubbles by size so the smaller bubbles appear above the larger bubbles. If false, bubbles are sorted according to their order in the DataTable.', 'visualizer' )
94+
);
95+
96+
self::_renderTextItem(
97+
esc_html__( 'Size (max)', 'visualizer' ),
98+
'sizeAxis[maxValue]',
99+
isset( $this->sizeAxis['maxValue'] ) ? $this->sizeAxis['maxValue'] : '',
100+
esc_html__( 'The size value (as appears in the chart data) to be mapped to sizeAxis.maxSize. Larger values will be cropped to this value.', 'visualizer' ),
101+
'',
102+
'number',
103+
array( 'step' => 1 )
104+
);
105+
106+
self::_renderTextItem(
107+
esc_html__( 'Size (min)', 'visualizer' ),
108+
'sizeAxis[minValue]',
109+
isset( $this->sizeAxis['minValue'] ) ? $this->sizeAxis['minValue'] : '',
110+
esc_html__( 'The size value (as appears in the chart data) to be mapped to sizeAxis.minSize. Smaller values will be cropped to this value.', 'visualizer' ),
111+
'',
112+
'number',
113+
array( 'step' => 1 )
114+
);
115+
116+
self::_renderSectionEnd();
117+
self::_renderGroupEnd();
118+
119+
}
120+
121+
122+
}

css/frame.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,14 +457,14 @@ div.viz-group-content .viz-group-description {
457457
padding: 15px;
458458
border: 1px solid #e0e0e0;
459459
background-color: white;
460-
background-image: url(../images/chart_types_june2019_g.png);
460+
background-image: url(../images/chart_types_v340_g.png);
461461
background-repeat: no-repeat;
462462
background-position: center center;
463463
}
464464

465465
.type-label-selected,
466466
.type-box > .type-label:hover {
467-
background-image: url(../images/chart_types_june2019.png);
467+
background-image: url(../images/chart_types_v340.png);
468468
}
469469

470470
.type-box-area .type-label {
@@ -499,6 +499,10 @@ div.viz-group-content .viz-group-description {
499499
background-position: -300px -225px;
500500
}
501501

502+
.type-box-bubble .type-label {
503+
background-position: -600px -906px;
504+
}
505+
502506
.type-box-column .type-label {
503507
background-position: -600px -225px;
504508
}

css/media.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Version: 3.3.2
2+
Version: 3.4.0
33
*/
44
#visualizer-library-view {
55
padding: 30px 10px 10px 30px;

cypress/fixtures/pie.csv

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Task,Hours per Day
2+
string,number
3+
Work,11
4+
Eat,2
5+
Commute,2
6+
Watch TV,2
7+
Sleep,7

cypress/integration/free-lifecycle.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('Test Free - lifecycle', function() {
1313
cy.visit(Cypress.env('urls').library );
1414

1515
// chart types
16-
cy.get('li.visualizer-list-item').should( "have.length", parseInt( Cypress.env('chart_types').free ) + parseInt( Cypress.env('chart_types').pro ) );
16+
cy.get('li.visualizer-list-item').should( "have.length", parseInt( Cypress.env('chart_types').free ) + parseInt( Cypress.env('chart_types').pro ) + 1 );
1717

1818
// pro chart types
1919
cy.get('li.visualizer-list-item a.visualizer-pro-only').should( "have.length", parseInt( Cypress.env('chart_types').pro ) );
@@ -40,10 +40,10 @@ describe('Test Free - lifecycle', function() {
4040
const $body = $iframe.contents().find('body');
4141

4242
// chart selection screen - types
43-
cy.wrap($body).find('.type-box').should( "have.length", 14 );
43+
cy.wrap($body).find('.type-box').should( "have.length", Cypress.env('chart_types').free + parseInt( Cypress.env('chart_types').pro ) );
4444

4545
// chart selection screen - pro types
46-
cy.wrap($body).find('.type-box span.visualizder-pro-label').should( "have.length", 6 );
46+
cy.wrap($body).find('.type-box span.visualizder-pro-label').should( "have.length", Cypress.env('chart_types').pro );
4747

4848
// toolbar
4949
// cancel button

0 commit comments

Comments
 (0)