Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[app] Fix tooltip in charts #387

Merged
merged 1 commit into from
Jul 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ NOTE: As semantic versioning states all 0.y.z releases can contain breaking chan

### Fixed

- [#387](https://github.com/kobsio/kobs/pull/#387): [app] Fix tooltip in charts.

### Changed

## [v0.9.1](https://github.com/kobsio/kobs/releases/tag/v0.9.1) (2022-07-08)
Expand Down
1 change: 1 addition & 0 deletions plugins/plugin-azure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@azure/arm-containerinstance": "^8.1.0",
"@azure/arm-containerservice": "^16.1.0",
"@kobsio/react-scripts": "5.0.1-1",
"@nivo/core": "^0.79.0",
"@nivo/line": "^0.79.1",
"@nivo/pie": "^0.79.1",
"@patternfly/patternfly": "^4.194.4",
Expand Down
1 change: 1 addition & 0 deletions plugins/plugin-istio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"private": true,
"dependencies": {
"@kobsio/react-scripts": "5.0.1-1",
"@nivo/core": "^0.79.0",
"@nivo/line": "^0.79.1",
"@nivo/scales": "^0.79.0",
"@patternfly/patternfly": "^4.194.4",
Expand Down
1 change: 1 addition & 0 deletions plugins/plugin-jaeger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"private": true,
"dependencies": {
"@kobsio/react-scripts": "5.0.1-1",
"@nivo/core": "^0.79.0",
"@nivo/scatterplot": "^0.79.1",
"@patternfly/patternfly": "^4.194.4",
"@patternfly/react-core": "^4.214.1",
Expand Down
1 change: 1 addition & 0 deletions plugins/plugin-kiali/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"private": true,
"dependencies": {
"@kobsio/react-scripts": "5.0.1-1",
"@nivo/core": "^0.79.0",
"@nivo/line": "^0.79.1",
"@patternfly/patternfly": "^4.194.4",
"@patternfly/react-core": "^4.214.1",
Expand Down
1 change: 1 addition & 0 deletions plugins/plugin-klogs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"dependencies": {
"@kobsio/react-scripts": "5.0.1-1",
"@nivo/bar": "^0.79.1",
"@nivo/core": "^0.79.0",
"@nivo/line": "^0.79.1",
"@nivo/pie": "^0.79.1",
"@patternfly/patternfly": "^4.194.4",
Expand Down
1 change: 1 addition & 0 deletions plugins/plugin-prometheus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"dependencies": {
"@kobsio/react-scripts": "5.0.1-1",
"@nivo/bar": "^0.79.1",
"@nivo/core": "^0.79.0",
"@nivo/line": "^0.79.1",
"@patternfly/patternfly": "^4.194.4",
"@patternfly/react-core": "^4.214.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const PageToolbarAutocomplete: React.FunctionComponent<IPageToolbarAutocomplete>
{inputFocused && data && data.length > 0 && !(data.length === 1 && data[0] === query) && (
<div
className="pf-c-search-input__menu"
style={{ height: '50vh', overflowX: 'auto' }}
style={{ maxHeight: '50vh', overflowX: 'auto' }}
onMouseEnter={(): void => setHovering(true)}
onMouseLeave={(): void => setHovering(false)}
>
Expand Down
4 changes: 2 additions & 2 deletions plugins/plugin-prometheus/src/components/panel/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export const Chart: React.FunctionComponent<IChartProps> = ({
enableGridX={false}
enableGridY={true}
enablePoints={false}
xFormat="time:%Y-%m-%d %H:%M:%S"
lineWidth={1}
margin={{ bottom: 25, left: 50, right: 0, top: 0 }}
theme={CHART_THEME}
Expand All @@ -86,9 +85,10 @@ export const Chart: React.FunctionComponent<IChartProps> = ({
/>
);
}}
xFormat="time:%Y-%m-%d %H:%M:%S"
xScale={{ max: new Date(endTime), min: new Date(startTime), type: 'time' }}
yScale={getYScale(options.yAxis, options.stacked, min, max)}
yFormat=" >-.4f"
yScale={getYScale(options.yAxis, options.stacked, min, max)}
/>
);
};
Expand Down
1 change: 1 addition & 0 deletions plugins/plugin-sql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"private": true,
"dependencies": {
"@kobsio/react-scripts": "5.0.1-1",
"@nivo/core": "^0.79.0",
"@nivo/line": "^0.79.1",
"@nivo/pie": "^0.79.1",
"@patternfly/patternfly": "^4.194.4",
Expand Down
35 changes: 16 additions & 19 deletions plugins/shared/src/components/chart/ChartTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,23 @@ export const ChartTooltip: React.FunctionComponent<IChartTooltipProps> = ({

return (
<TooltipWrapper anchor={anchorDefault} position={positionDefault}>
<div style={{ minWidth: '25vw' }}>
<div
style={{
background: '#151515',
color: '#f0f0f0',
fontFamily: '"RedHatText", "Overpass", overpass, helvetica, arial, sans-serif',
fontSize: '14px',
padding: '8px',
whiteSpace: 'nowrap',
width: 'fit-content',
}}
>
{title && (
<div>
<b>{title}</b>
</div>
)}
<div className="pf-u-text-break-word pf-u-text-wrap">
<SquareIcon color={color} /> {label}
<div
style={{
background: '#151515',
color: '#f0f0f0',
fontFamily: '"RedHatText", "Overpass", overpass, helvetica, arial, sans-serif',
fontSize: '14px',
padding: '8px',
width: '25vw',
}}
>
{title && (
<div>
<b>{title}</b>
</div>
)}
<div className="pf-u-text-break-word pf-u-text-wrap">
<SquareIcon color={color} /> {label}
</div>
</div>
</TooltipWrapper>
Expand Down