PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.8.0
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.8.0
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | js/render-google.js +6 -34 3.10.153.8.0 View file →
@@ -4,9 +4,8 @@
4 4
5 5 // this will store the images for each chart rendered.
6 6 var __visualizer_chart_images = [];
7 7 var chartWrapperError = [];
8 -var isResizeRequest = false;
9 8
10 9 (function($) {
11 10 var gv;
12 11 var all_charts, objects;
@@ -13,20 +12,11 @@
13 12 // so that we know which charts belong to our library.
14 13 var rendered_charts = [];
15 14
16 15 function renderChart(id) {
17 -
18 - if ( ! all_charts || 0 === Object.keys( all_charts ).length ) {
19 - return;
20 - }
21 -
22 16 var chart = all_charts[id];
23 17 var hasAnnotation = false;
24 18
25 - if ( ! chart ) {
26 - return;
27 - }
28 -
29 19 // re-render the chart only if it doesn't have annotations and it is on the front-end
30 20 // this is to prevent the chart from showing "All series on a given axis must be of the same data type" during resize.
31 21 // remember, some charts do not support annotations so they should not be included in this.
32 22 var no_annotation_charts = ['tabular', 'timeline', 'gauge', 'geo', 'bubble', 'candlestick'];
@@ -49,14 +39,13 @@
49 39
50 40 function renderSpecificChart(id, chart) {
51 41 var render, container, series, data, table, settings, i, j, row, date, axis, property, format, formatter;
52 42
53 - if( chart.library !== 'google' ) {
43 + if ( $('#' + id).hasClass('visualizer-chart-loaded') ) {
54 44 return;
55 45 }
56 -
57 - // Bail if the chart is already rendered or is being rendered.
58 - if ( ! window.isResizeRequest && ( $('#' + id).hasClass('visualizer-chart-loaded') || ( 'canvas' !== id && $('#' + id).children( ':not(.loader, style)' ).length > 0 ) ) ) {
46 +
47 + if(chart.library !== 'google'){
59 48 return;
60 49 }
61 50 rendered_charts[id] = 'yes';
62 51
@@ -86,9 +75,9 @@
86 75 break;
87 76 }
88 77
89 78 var controlWrapperElement = document.getElementById( "control_wrapper_" + id ) || null;
90 - var withControlMode = ( typeof settings.controls !== 'undefined' && '' !== settings.controls.controlType ) && controlWrapperElement ? true : false;
79 + var withControlMode = typeof settings.controls !== 'undefined' && controlWrapperElement ? true : false;
91 80
92 81 if ( $( controlWrapperElement ).hasClass( 'no-filter' ) ) {
93 82 withControlMode = false;
94 83 }
@@ -127,13 +116,8 @@
127 116 {
128 117 settings['animation']['startup'] = true;
129 118 settings['animation']['duration'] = parseInt(settings['animation']['duration']);
130 119 }
131 - if ( settings['controls'] ) {
132 - settings['controls']['ui']['allowMultiple'] = 'true' === settings['controls']['allowMultiple'] ? true : false;
133 - settings['controls']['ui']['allowTyping'] = 'true' === settings['controls']['allowTyping'] ? true : false;
134 - settings['controls']['ui']['showRangeValues'] = 'true' === settings['controls']['showRangeValues'] ? true : false;
135 - }
136 120
137 121 // mark roles for series that have specified a role
138 122 // and then remove them from future processing
139 123 // and also adjust the indices of the series array so that
@@ -414,9 +398,8 @@
414 398 }
415 399 });
416 400
417 401 if ( withControlMode ) {
418 - // alert( chart.is_library_page );
419 402 // Create a control wrapper, passing some options.
420 403 var controlWrapper = new gv.ControlWrapper( {
421 404 containerId: 'control_wrapper_' + id,
422 405 controlType: settings.controls.controlType,
@@ -426,18 +409,8 @@
426 409 $('body').trigger('visualizer:chart:settings:extend', {id: id, chart: chart, settings: settings, data: table});
427 410 render.setOptions(settings);
428 411 chartWrapper.bind(controlWrapper, render);
429 412 chartWrapper.draw(table);
430 -
431 - gv.events.addListener(controlWrapper, 'ready', function ( err ) {
432 - if ( 'vertical' === settings.controls.ui.orientation ) {
433 - if ( 'canvas' === id ) {
434 - jQuery( '#' + id ).addClass( 'vz-vertical' );
435 - }
436 - } else {
437 - jQuery( '#' + id ).removeClass( 'vz-vertical' );
438 - }
439 - });
440 413 } else {
441 414 $('body').trigger('visualizer:chart:settings:extend', {id: id, chart: chart, settings: settings, data: table});
442 415 render.draw(table, settings);
443 416 }
@@ -492,11 +465,10 @@
492 465
493 466 var resizeTimeout;
494 467
495 468 $(document).ready(function() {
496 - $(window).resize(function(e) {
469 + $(window).resize(function() {
497 470 clearTimeout(resizeTimeout);
498 - window.isResizeRequest = 'undefined' !== typeof e.originalEvent ? true : false;
499 471 resizeTimeout = setTimeout(render, 100);
500 472 });
501 473
502 474 resizeHiddenContainers(true);
@@ -587,9 +559,9 @@
587 559
588 560 objects = {};
589 561 if ( 'object' === typeof google ) {
590 562 $chart_types.push( 'controls' );
591 - google.load( 'visualization', '51', {packages: $chart_types, mapsApiKey: v.map_api_key, 'language' : v.language,
563 + google.load( 'visualization', 'current', {packages: $chart_types, mapsApiKey: v.map_api_key, 'language' : v.language,
592 564 callback: function () {
593 565 gv = google.visualization;
594 566 all_charts = v.charts;
595 567 if(v.is_front == true && typeof v.id !== 'undefined'){ // jshint ignore:line