react-vertical-bar-chart
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -454,3 +454,3 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
if (d && d.value >= centerLineValue && orderedData[i + 1] && orderedData[i + 1].value < centerLineValue) { | ||
if (d && d.value >= centerLineValue && (!orderedData[i + 1] || orderedData[i + 1].value < centerLineValue)) { | ||
rows.push(React__default.createElement(BufferRow, { | ||
@@ -483,5 +483,59 @@ key: 'vertical-bar-chart-midline', | ||
}))); | ||
} else if (d && d.value < centerLineValue && i === 0) { | ||
rows.unshift(React__default.createElement(BufferRow, { | ||
key: 'vertical-bar-chart-midline', | ||
style: { | ||
height: rowHeight, | ||
visibility: chartWidth ? undefined : 'hidden' | ||
} | ||
}, React__default.createElement(Midline, { | ||
style: { | ||
height: rowHeight / 2 | ||
} | ||
}, React__default.createElement(Cell, { | ||
style: { | ||
height: rowHeight, | ||
width: "calc(" + textWidth + "px + 2rem)", | ||
backgroundColor: '#fff' | ||
} | ||
}), React__default.createElement(MidlineOverText, { | ||
"$dynamicFont": "clamp(0.75rem, " + chartWidth * 0.025 + "px, 1rem)" | ||
}, overMideLineLabel, " \u2191"), React__default.createElement(MidlineUnderText, { | ||
"$dynamicFont": "clamp(0.75rem, " + chartWidth * 0.025 + "px, 1rem)" | ||
}, underMideLineLabel, " \u2193")), React__default.createElement(Cell, { | ||
style: { | ||
height: rowHeight, | ||
width: "calc(" + textWidth + "px + 2rem)", | ||
borderRight: 'solid 1px #333' | ||
} | ||
}))); | ||
} | ||
}); | ||
var remainingSpace = totalTopValues - rows.length; | ||
if (remainingSpace > 0) { | ||
for (var _i = 0; _i < remainingSpace - 1; _i++) { | ||
var d = { | ||
id: 'empty-row-buffer-' + _i, | ||
title: '', | ||
value: 0, | ||
color: 'transparent' | ||
}; | ||
rows.push(React__default.createElement(Row$1, { | ||
key: d.id, | ||
d: d, | ||
rowHeight: rowHeight, | ||
gridHeight: gridHeight, | ||
max: maxValue, | ||
onRowHover: undefined, | ||
range: maxValue, | ||
layout: layout, | ||
highlighted: undefined, | ||
textWidth: textWidth, | ||
chartWidth: chartWidth, | ||
lessThan1: true | ||
})); | ||
} | ||
} | ||
if (layout === exports.Layout.Right) { | ||
@@ -488,0 +542,0 @@ rows.reverse(); |
@@ -452,3 +452,3 @@ import React, { useState, useRef, useEffect } from 'react'; | ||
if (d && d.value >= centerLineValue && orderedData[i + 1] && orderedData[i + 1].value < centerLineValue) { | ||
if (d && d.value >= centerLineValue && (!orderedData[i + 1] || orderedData[i + 1].value < centerLineValue)) { | ||
rows.push(React.createElement(BufferRow, { | ||
@@ -481,5 +481,59 @@ key: 'vertical-bar-chart-midline', | ||
}))); | ||
} else if (d && d.value < centerLineValue && i === 0) { | ||
rows.unshift(React.createElement(BufferRow, { | ||
key: 'vertical-bar-chart-midline', | ||
style: { | ||
height: rowHeight, | ||
visibility: chartWidth ? undefined : 'hidden' | ||
} | ||
}, React.createElement(Midline, { | ||
style: { | ||
height: rowHeight / 2 | ||
} | ||
}, React.createElement(Cell, { | ||
style: { | ||
height: rowHeight, | ||
width: "calc(" + textWidth + "px + 2rem)", | ||
backgroundColor: '#fff' | ||
} | ||
}), React.createElement(MidlineOverText, { | ||
"$dynamicFont": "clamp(0.75rem, " + chartWidth * 0.025 + "px, 1rem)" | ||
}, overMideLineLabel, " \u2191"), React.createElement(MidlineUnderText, { | ||
"$dynamicFont": "clamp(0.75rem, " + chartWidth * 0.025 + "px, 1rem)" | ||
}, underMideLineLabel, " \u2193")), React.createElement(Cell, { | ||
style: { | ||
height: rowHeight, | ||
width: "calc(" + textWidth + "px + 2rem)", | ||
borderRight: 'solid 1px #333' | ||
} | ||
}))); | ||
} | ||
}); | ||
var remainingSpace = totalTopValues - rows.length; | ||
if (remainingSpace > 0) { | ||
for (var _i = 0; _i < remainingSpace - 1; _i++) { | ||
var d = { | ||
id: 'empty-row-buffer-' + _i, | ||
title: '', | ||
value: 0, | ||
color: 'transparent' | ||
}; | ||
rows.push(React.createElement(Row$1, { | ||
key: d.id, | ||
d: d, | ||
rowHeight: rowHeight, | ||
gridHeight: gridHeight, | ||
max: maxValue, | ||
onRowHover: undefined, | ||
range: maxValue, | ||
layout: layout, | ||
highlighted: undefined, | ||
textWidth: textWidth, | ||
chartWidth: chartWidth, | ||
lessThan1: true | ||
})); | ||
} | ||
} | ||
if (layout === Layout.Right) { | ||
@@ -486,0 +540,0 @@ rows.reverse(); |
{ | ||
"name": "react-vertical-bar-chart", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Vertical scrolling bar chart for React", | ||
@@ -5,0 +5,0 @@ "author": "wsoeltz", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
127040
1210