Skip to content

Commit

Permalink
v5.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
novykh committed Jul 2, 2024
1 parent bd02690 commit 6587bbb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netdata/charts",
"version": "5.2.2",
"version": "5.2.3",
"description": "Netdata frontend SDK and chart utilities",
"main": "dist/index.js",
"module": "dist/es6/index.js",
Expand Down
8 changes: 4 additions & 4 deletions src/chartLibraries/dygraph/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ export default (sdk, chart) => {
drawGapEdgePoints: true,
ylabel: chart.getAttribute("hasYlabel") && chart.getUnitSign({ long: true }),
digitsAfterDecimal:
chart.getAttribute("unitsConversionFractionDigits") < 0
chart.getAttribute("unitsConversionFractionDigits")[0] < 0
? 0
: chart.getAttribute("unitsConversionFractionDigits"),
: chart.getAttribute("unitsConversionFractionDigits")[0],
yLabelWidth: 12,
yRangePad: 30,
labelsSeparateLines: true,
Expand Down Expand Up @@ -438,9 +438,9 @@ export default (sdk, chart) => {
...makeColorOptions(),
...makeChartTypeOptions(),
digitsAfterDecimal:
chart.getAttribute("unitsConversionFractionDigits") < 0
chart.getAttribute("unitsConversionFractionDigits")[0] < 0
? 0
: chart.getAttribute("unitsConversionFractionDigits"),
: chart.getAttribute("unitsConversionFractionDigits")[0],
...makeSparklineOptions(),
})

Expand Down
2 changes: 2 additions & 0 deletions src/components/line/navigationToolbox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const ZoomReset = ({ log = () => {} }) => {
const chart = useChart()
const after = useAttributeValue("after")

if (!chart.getAttribute("enabledResetRange")) return null

const onResetZoom = () => {
chart.resetNavigation()
log({
Expand Down
3 changes: 2 additions & 1 deletion src/sdk/makeNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ export default ({ sdk, parent = null, attributes: initialAttributes }) => {
}

const resetNavigation = () => {
const pristineValue = getAttribute("pristineStaticValueRange")
if (!getAttribute("enabledResetRange")) return

const pristineValue = getAttribute("pristineStaticValueRange")
if (pristineValue !== undefined) return resetStaticValueRange()

moveX(-900)
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/plugins/unitConversion/getConversionUnits.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const getConversionAttributes = (chart, unit, { min, max, maxDecimals = 5

const delta = Math.abs(cMin === cMax ? cMin : cMax - cMin)

const fractionDigits = isNaN(delta) ? -1 : getFractionDigits(delta)
const fractionDigits = isNaN(delta) || delta === 0 ? -1 : getFractionDigits(delta)

return {
method,
Expand Down

0 comments on commit 6587bbb

Please sign in to comment.