@redsift/charts 11.4.0 → 11.4.1-muiv5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -3
- package/index.js.map +1 -1
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -2506,9 +2506,10 @@ const RenderedLinearBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2506
2506
|
let from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2507
2507
|
let to = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
2508
2508
|
let categories = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ['default'];
|
|
2509
|
+
let hasSectionTitle = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
2509
2510
|
const domain = extent(bars.filter(bar => categories.includes(bar.category)), d => d.cumulativeValue);
|
|
2510
|
-
domain[0] = (_ref7 = yAxisMinValue) !== null && _ref7 !== void 0 ? _ref7 : domain[0]
|
|
2511
|
-
domain[1] = (_ref8 = yAxisMaxValue) !== null && _ref8 !== void 0 ? _ref8 : domain[1] * 1.1;
|
|
2511
|
+
domain[0] = (_ref7 = yAxisMinValue) !== null && _ref7 !== void 0 ? _ref7 : domain[0];
|
|
2512
|
+
domain[1] = (_ref8 = yAxisMaxValue) !== null && _ref8 !== void 0 ? _ref8 : domain[1] * (hasSectionTitle ? 1.2 : 1);
|
|
2512
2513
|
if (domain[1] === 0 && domain[0] === 0) {
|
|
2513
2514
|
domain[1] = 1;
|
|
2514
2515
|
}
|
|
@@ -2573,7 +2574,7 @@ const RenderedLinearBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2573
2574
|
let enhancedChild = child;
|
|
2574
2575
|
if (isComponent('BarChartSection')(child)) {
|
|
2575
2576
|
const categories = React__default.Children.toArray(child.props.children).filter(c => isComponent('BarChartBars')(c)).map(c => c.props.category);
|
|
2576
|
-
const scaleY = getScaleY(child.props.direction || 'up', child.props.from, child.props.to, categories);
|
|
2577
|
+
const scaleY = getScaleY(child.props.direction || 'up', child.props.from, child.props.to, categories, child.props.title !== '');
|
|
2577
2578
|
multipleScaleY.push(scaleY);
|
|
2578
2579
|
enhancedChild = /*#__PURE__*/React__default.cloneElement(child, _objectSpread2({
|
|
2579
2580
|
scaleX: scaleX,
|