Skip to content

Commit ff6cf26

Browse files
committed
fix: d3 preview improvements
1 parent 0f58474 commit ff6cf26

File tree

8 files changed

+38
-32
lines changed

8 files changed

+38
-32
lines changed

classes/Visualizer/ChartBuilder/src/AIBuilder/DataSource.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ export default function DataSource( { chartId, uploadNonce, onDataReady, dataLoa
439439
</Flex>
440440
<Box
441441
as="textarea"
442-
display="block" w="100%" h="96px"
443-
border="none" outline="none" resize="none"
442+
display="block" w="100%" minH="96px"
443+
border="none" outline="none" resize="vertical"
444444
px="12px" py="10px"
445445
fontFamily="'SF Mono', 'Fira Code', monospace" fontSize="12px" lineHeight="1.6"
446446
color={ C.dark }

classes/Visualizer/ChartBuilder/src/AIBuilder/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -829,13 +829,14 @@ export default function AIBuilder( { onClose, initialChartId = null } ) {
829829
ref={ previewRef }
830830
flex="1"
831831
minH="320px"
832-
overflow="visible"
832+
overflow="auto"
833833
position="relative"
834834
display={ code ? 'flex' : 'none' }
835-
alignItems="center"
836-
justifyContent="center"
835+
alignItems="flex-start"
836+
justifyContent="flex-start"
837837
sx={ {
838838
'> svg': { width: '100% !important', height: '100% !important', display: 'block' },
839+
'> iframe': { maxWidth: '100%', maxHeight: '100%' },
839840
} }
840841
>
841842
</Box>

classes/Visualizer/ChartBuilder/src/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@
270270
width: 100%;
271271
flex: 1;
272272
min-height: 0;
273+
overflow: auto;
273274
> svg {
274275
width: 100% !important;
275276
height: 100% !important;

classes/Visualizer/Module/Wizard.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,9 @@ private function setup_wizard_install_plugin() {
580580
// Update wizard data.
581581
$wizard_data['enable_otter_blocks'] = true;
582582
$wizard_data_updated = true;
583-
update_option( 'themeisle_blocks_settings_onboarding', false );
583+
// Suppress Otter's post-activation redirects so the user stays in Visualizer.
584+
update_option( 'themeisle_blocks_settings_redirect', '0' );
585+
update_option( 'themeisle_blocks_settings_onboarding', '0' );
584586
}
585587
if ( 'wp-cloudflare-page-cache' === $slug ) {
586588
// Update wizard data.

classes/Visualizer/Render/Sidebar.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,13 @@ protected function _renderManualConfigDescription() {
155155
*/
156156
protected function _renderManualConfigExample() {
157157
return json_encode(
158-
[
159-
'vAxis' => [
160-
'ticks' => [ 5, 10, 15, 20 ],
161-
'titleTextStyle' => [ 'color' => 'red' ],
158+
array(
159+
'vAxis' => array(
160+
'ticks' => array( 5, 10, 15, 20 ),
161+
'titleTextStyle' => array( 'color' => 'red' ),
162162
'textPosition' => 'in',
163-
],
164-
],
163+
),
164+
),
165165
JSON_PRETTY_PRINT
166166
);
167167
}

classes/Visualizer/Render/Sidebar/ChartJS.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,10 @@ protected function _renderManualConfigDescription() {
404404
*/
405405
protected function _renderManualConfigExample() {
406406
return json_encode(
407-
[
407+
array(
408408
'cutoutPercentage' => 5,
409409
'rotation' => 60,
410-
],
410+
),
411411
JSON_PRETTY_PRINT
412412
);
413413
}

css/style-wizard.css

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,13 +1129,15 @@ display: none;
11291129
content: "!";
11301130
}
11311131
.pro-label{
1132-
background: #007CBA;
1133-
border-radius: 6px;
1134-
color: #ffffff;
1135-
text-transform: uppercase;
1136-
font-size: 16px;
1137-
line-height: 19px;
1138-
padding: 2px 9px 4px;
1132+
display: inline;
1133+
width: 74px;
1134+
height: 17px;
1135+
border: none;
1136+
color: #fff;
1137+
z-index: 4;
1138+
background: #d63638;
1139+
letter-spacing: 0.5px;
1140+
text-align: center;
11391141
}
11401142
.pro-label.free-label{
11411143
background: #BDE6EB;

templates/setup-wizard.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
<input type="radio" class="vz-radio-btn" id="vz-chart-5" readonly>
118118
<div class="vz-pro-label-wrap">
119119
<h3><?php esc_html_e( 'Geo chart', 'visualizer' ); ?></h3>
120-
<span class="pro-label"><?php esc_html_e( 'PRO', 'visualizer' ); ?></span>
120+
<span class="pro-label"><?php esc_html_e( 'PREMIUM', 'visualizer' ); ?></span>
121121
</div>
122122
<div class="img type-box-geo"></div>
123123
<div class="bg"></div>
@@ -136,7 +136,7 @@ class="btn btn-secondary" target="_blank"><?php esc_html_e( 'Upgrade to Pro', 'v
136136
<input type="radio" class="vz-radio-btn" id="vz-chart-6" readonly>
137137
<div class="vz-pro-label-wrap">
138138
<h3><?php esc_html_e( 'Area chart', 'visualizer' ); ?></h3>
139-
<span class="pro-label"><?php esc_html_e( 'PRO', 'visualizer' ); ?></span>
139+
<span class="pro-label"><?php esc_html_e( 'PREMIUM', 'visualizer' ); ?></span>
140140
</div>
141141
<div class="img type-box-area"></div>
142142
<div class="bg"></div>
@@ -155,7 +155,7 @@ class="btn btn-secondary" target="_blank"><?php esc_html_e( 'Upgrade to Pro', 'v
155155
<input type="radio" class="vz-radio-btn" id="vz-chart-7" readonly>
156156
<div class="vz-pro-label-wrap">
157157
<h3><?php esc_html_e( 'Column chart', 'visualizer' ); ?></h3>
158-
<span class="pro-label"><?php esc_html_e( 'PRO', 'visualizer' ); ?></span>
158+
<span class="pro-label"><?php esc_html_e( 'PREMIUM', 'visualizer' ); ?></span>
159159
</div>
160160
<div class="img type-box-column"></div>
161161
<div class="bg"></div>
@@ -174,7 +174,7 @@ class="btn btn-secondary" target="_blank"><?php esc_html_e( 'Upgrade to Pro', 'v
174174
<input type="radio" class="vz-radio-btn" id="vz-chart-8" readonly>
175175
<div class="vz-pro-label-wrap">
176176
<h3><?php esc_html_e( 'Bubble chart', 'visualizer' ); ?></h3>
177-
<span class="pro-label"><?php esc_html_e( 'PRO', 'visualizer' ); ?></span>
177+
<span class="pro-label"><?php esc_html_e( 'PREMIUM', 'visualizer' ); ?></span>
178178
</div>
179179
<div class="img type-box-bubble"></div>
180180
<div class="bg"></div>
@@ -193,7 +193,7 @@ class="btn btn-secondary" target="_blank"><?php esc_html_e( 'Upgrade to Pro', 'v
193193
<input type="radio" class="vz-radio-btn" id="vz-chart-9" readonly>
194194
<div class="vz-pro-label-wrap">
195195
<h3><?php esc_html_e( 'Scatter chart', 'visualizer' ); ?></h3>
196-
<span class="pro-label"><?php esc_html_e( 'PRO', 'visualizer' ); ?></span>
196+
<span class="pro-label"><?php esc_html_e( 'PREMIUM', 'visualizer' ); ?></span>
197197
</div>
198198
<div class="img type-box-scatter"></div>
199199
<div class="bg"></div>
@@ -212,7 +212,7 @@ class="btn btn-secondary" target="_blank"><?php esc_html_e( 'Upgrade to Pro', 'v
212212
<input type="radio" class="vz-radio-btn" id="vz-chart-10" readonly>
213213
<div class="vz-pro-label-wrap">
214214
<h3><?php esc_html_e( 'Gauge chart', 'visualizer' ); ?></h3>
215-
<span class="pro-label"><?php esc_html_e( 'PRO', 'visualizer' ); ?></span>
215+
<span class="pro-label"><?php esc_html_e( 'PREMIUM', 'visualizer' ); ?></span>
216216
</div>
217217
<div class="img type-box-gauge"></div>
218218
<div class="bg"></div>
@@ -231,7 +231,7 @@ class="btn btn-secondary" target="_blank"><?php esc_html_e( 'Upgrade to Pro', 'v
231231
<input type="radio" class="vz-radio-btn" id="vz-chart-11" readonly>
232232
<div class="vz-pro-label-wrap">
233233
<h3><?php esc_html_e( 'Candlestick chart', 'visualizer' ); ?></h3>
234-
<span class="pro-label"><?php esc_html_e( 'PRO', 'visualizer' ); ?></span>
234+
<span class="pro-label"><?php esc_html_e( 'PREMIUM', 'visualizer' ); ?></span>
235235
</div>
236236
<div class="img type-box-candlestick"></div>
237237
<div class="bg"></div>
@@ -250,7 +250,7 @@ class="btn btn-secondary" target="_blank"><?php esc_html_e( 'Upgrade to Pro', 'v
250250
<input type="radio" class="vz-radio-btn" id="vz-chart-12" readonly>
251251
<div class="vz-pro-label-wrap">
252252
<h3><?php esc_html_e( 'Timeline', 'visualizer' ); ?></h3>
253-
<span class="pro-label"><?php esc_html_e( 'PRO', 'visualizer' ); ?></span>
253+
<span class="pro-label"><?php esc_html_e( 'PREMIUM', 'visualizer' ); ?></span>
254254
</div>
255255
<div class="img type-box-timeline"></div>
256256
<div class="bg"></div>
@@ -269,7 +269,7 @@ class="btn btn-secondary" target="_blank"><?php esc_html_e( 'Upgrade to Pro', 'v
269269
<input type="radio" class="vz-radio-btn" id="vz-chart-13" readonly>
270270
<div class="vz-pro-label-wrap">
271271
<h3><?php esc_html_e( 'Combo', 'visualizer' ); ?></h3>
272-
<span class="pro-label"><?php esc_html_e( 'PRO', 'visualizer' ); ?></span>
272+
<span class="pro-label"><?php esc_html_e( 'PREMIUM', 'visualizer' ); ?></span>
273273
</div>
274274
<div class="img type-box-combo"></div>
275275
<div class="bg"></div>
@@ -288,7 +288,7 @@ class="btn btn-secondary" target="_blank"><?php esc_html_e( 'Upgrade to Pro', 'v
288288
<input type="radio" class="vz-radio-btn" id="vz-chart-14" readonly>
289289
<div class="vz-pro-label-wrap">
290290
<h3><?php esc_html_e( 'Polar Area', 'visualizer' ); ?></h3>
291-
<span class="pro-label"><?php esc_html_e( 'PRO', 'visualizer' ); ?></span>
291+
<span class="pro-label"><?php esc_html_e( 'PREMIUM', 'visualizer' ); ?></span>
292292
</div>
293293
<div class="img type-box-polarArea"></div>
294294
<div class="bg"></div>
@@ -307,7 +307,7 @@ class="btn btn-secondary" target="_blank"><?php esc_html_e( 'Upgrade to Pro', 'v
307307
<input type="radio" class="vz-radio-btn" id="vz-chart-15" readonly>
308308
<div class="vz-pro-label-wrap">
309309
<h3><?php esc_html_e( 'Radar', 'visualizer' ); ?></h3>
310-
<span class="pro-label"><?php esc_html_e( 'PRO', 'visualizer' ); ?></span>
310+
<span class="pro-label"><?php esc_html_e( 'PREMIUM', 'visualizer' ); ?></span>
311311
</div>
312312
<div class="img type-box-radar"></div>
313313
<div class="bg"></div>

0 commit comments

Comments
 (0)