fix: getBestCenter - access .data property of panel object
getPanelData() returns {metadata, data}, not a plain array.
Fixed to use pdata.data instead of pdata directly.
This commit is contained in:
@@ -535,7 +535,7 @@ function WorldMap(selection) {
|
|||||||
AN: [0, -90]
|
AN: [0, -90]
|
||||||
};
|
};
|
||||||
function getBestCenter() {
|
function getBestCenter() {
|
||||||
var data = GoAccess.getPanelData(panelName) || [];
|
var pdata = GoAccess.getPanelData(panelName);var data = (pdata && pdata.data) ? pdata.data : [];
|
||||||
var bestCode = null, bestVisitors = 0;
|
var bestCode = null, bestVisitors = 0;
|
||||||
data.forEach(function(entry) {
|
data.forEach(function(entry) {
|
||||||
if (!entry.items) return;
|
if (!entry.items) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user