Skip to content

Commit

Permalink
v5.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
novykh committed Jun 11, 2024
1 parent 8afeee1 commit f438168
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 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.1.1",
"version": "5.1.2",
"description": "Netdata frontend SDK and chart utilities",
"main": "dist/index.js",
"module": "dist/es6/index.js",
Expand Down
3 changes: 2 additions & 1 deletion src/components/hocs/withTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ export const HeadWrapper = ({ children, customChildren, hasFilters = true, ...re
[chart]
)

const hasToolbox = useAttributeValue("hasToolbox")
const shadowColor = useColor("themeShadow")
const debouncedFocused = useDebouncedValue(focused, 400)
const value = useLatestValue("selected", { valueKey: "arp" }) || 0

return (
<ChartHeadWrapper size={size} {...rest} ref={hoverRef}>
{focused && debouncedFocused && (
{hasToolbox && focused && debouncedFocused && (
<Toolbox
position="absolute"
top="-16px"
Expand Down
3 changes: 2 additions & 1 deletion src/components/line/chartContentWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const ChartContentWrapper = ({ uiName }) => {
const initialLoading = useInitialLoading()
const empty = useEmpty()
const hasToolbox = useAttributeValue("hasToolbox")
const hasHoverPopover = useAttributeValue("hasHoverPopover")
const processing = useAttributeValue("processing")

return (
Expand All @@ -66,7 +67,7 @@ const ChartContentWrapper = ({ uiName }) => {
{initialLoading && <Skeleton />}
{hasToolbox && hovered && !empty && <NavigationToolbox />}
{processing && <Processing />}
<Popover uiName={uiName} />
{hasHoverPopover && <Popover uiName={uiName} />}
</Container>
)
}
Expand Down
1 change: 1 addition & 0 deletions src/sdk/initialAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export default {
enabledXAxis: true,

hasToolbox: true,
hasHoverPopover: true,
expandable: false,

hasYlabel: true,
Expand Down
13 changes: 7 additions & 6 deletions src/sdk/makeChart/camelizePayload.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const transformResult = result => {

const getStsByContext = (groups, units, dimensions, contextsArray) => {
if (!Array.isArray(groups)) return [[], {}]
if (!Array.isArray(contextsArray) || !contextsArray.length) return [[], {}]

const unitsByKey = {}

Expand Down Expand Up @@ -133,15 +134,15 @@ export default (payload, chart) => {
labels = [],
alerts = [],
contexts: contextsArray = [],
},
} = {},
functions = [],
totals: {
contexts: contextsTotals = {},
dimensions: dimensionsTotals = {},
instances: instancesTotals = {},
label_key_values: labelsTotals = {},
nodes: nodesTotals = {},
},
} = {},
db: {
update_every: updateEvery,
first_entry: firstEntry,
Expand All @@ -150,16 +151,16 @@ export default (payload, chart) => {
per_tier: perTier,
dimensions: dbDimensions,
units: dbUnits,
},
} = {},
view: {
title,
update_every: viewUpdateEvery,
units,
dimensions: viewDimensions,
dimensions: viewDimensions = {},
chart_type: chartType,
min,
max,
},
} = {},
result,
...rest
} = payload
Expand Down Expand Up @@ -188,7 +189,7 @@ export default (payload, chart) => {
return h
}, {})

const grouped = viewDimensions.grouped_by
const grouped = viewDimensions?.grouped_by

const [dimContexts, unitsStsByContext] = getStsByContext(
grouped,
Expand Down

0 comments on commit f438168

Please sign in to comment.