cogni-reports
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -63,6 +63,10 @@ "use strict"; | ||
title: item.id | ||
}, item.legend)); | ||
}, item.legend, { | ||
hasData: item.data.length | ||
})); | ||
} | ||
allKeys.push(item.id); | ||
if (item.data.length) { | ||
allKeys.push(item.id); | ||
} | ||
}); | ||
@@ -194,3 +198,3 @@ return _react["default"].createElement(LineChartInner, (0, _extends2["default"])({ | ||
onClick: function onClick() { | ||
return _onClick(s.title); | ||
return s.hasData && _onClick(s.title); | ||
} | ||
@@ -197,0 +201,0 @@ }); |
{ | ||
"name": "cogni-reports", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -37,6 +37,9 @@ import React, { useState } from 'react'; | ||
...item.legend, | ||
hasData: item.data.length, | ||
}); | ||
} | ||
allKeys.push(item.id); | ||
if (item.data.length) { | ||
allKeys.push(item.id); | ||
} | ||
}); | ||
@@ -141,3 +144,6 @@ | ||
<Statistics sub data={statisticData.map(s => ({ ...s, onClick: () => onClick(s.title) }))} /> | ||
<Statistics | ||
sub | ||
data={statisticData.map(s => ({ ...s, onClick: () => s.hasData && onClick(s.title) }))} | ||
/> | ||
@@ -144,0 +150,0 @@ <div style={{ height: 300 }}> |
@@ -21,2 +21,3 @@ import React, { useRef, useEffect, useState } from 'react'; | ||
const [isMobile, setMobile] = useState(false); | ||
useEffect(() => { | ||
@@ -23,0 +24,0 @@ setMobile(cogniCardRef?.current?.offsetWidth < 610); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1883368
47802