forked from ddrilling/asb_cloud_front
Merged in feature/edit-tooltip (pull request #5)
Исправлена высота подсказки курсора для графиков мониторинга и архива Approved-by: Александр Васильевич Сироткин
This commit is contained in:
commit
00f7d6e9da
@ -139,7 +139,7 @@ const _D3HorizontalCursor = <DataType,>({
|
|||||||
if (!mouseState.visible || fixed) return
|
if (!mouseState.visible || fixed) return
|
||||||
|
|
||||||
let top = mouseState.y + offsetY
|
let top = mouseState.y + offsetY
|
||||||
if (top + height >= sizes.chartsHeight) {
|
if (mouseState.y >= sizes.chartsHeight / 2) {
|
||||||
setPosition('bottom')
|
setPosition('bottom')
|
||||||
top = mouseState.y - offsetY - height
|
top = mouseState.y - offsetY - height
|
||||||
} else {
|
} else {
|
||||||
@ -186,7 +186,9 @@ const _D3HorizontalCursor = <DataType,>({
|
|||||||
pointerEvents={fixed ? 'all' : 'none'}
|
pointerEvents={fixed ? 'all' : 'none'}
|
||||||
style={{ transition: 'opacity .1s ease-out', userSelect: fixed ? 'auto' : 'none' }}
|
style={{ transition: 'opacity .1s ease-out', userSelect: fixed ? 'auto' : 'none' }}
|
||||||
>
|
>
|
||||||
<div className={`tooltip ${position} ${className}`}>
|
<div className={`tooltip ${position} ${className}`}
|
||||||
|
style={{height: 'auto', bottom: `${position === 'bottom' ? '0' : ''}`}}
|
||||||
|
>
|
||||||
<div className={'tooltip-content'}>
|
<div className={'tooltip-content'}>
|
||||||
{tooltipBodies[i]}
|
{tooltipBodies[i]}
|
||||||
</div>
|
</div>
|
||||||
|
@ -568,6 +568,7 @@ const _D3MonitoringCharts = <DataType extends Record<string, unknown>>({
|
|||||||
groups={groups}
|
groups={groups}
|
||||||
sizes={sizes}
|
sizes={sizes}
|
||||||
data={data}
|
data={data}
|
||||||
|
height={height}
|
||||||
/>
|
/>
|
||||||
</D3MouseZone>
|
</D3MouseZone>
|
||||||
</svg>
|
</svg>
|
||||||
|
@ -255,7 +255,7 @@ const Archive = memo(() => {
|
|||||||
plugins={{
|
plugins={{
|
||||||
menu: { enabled: false },
|
menu: { enabled: false },
|
||||||
cursor: {
|
cursor: {
|
||||||
width: 200,
|
width: 220,
|
||||||
render: cursorRender,
|
render: cursorRender,
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
@ -28,7 +28,7 @@ export const cursorRender = (group, data) => {
|
|||||||
<Fragment key={chart.key}>
|
<Fragment key={chart.key}>
|
||||||
<GridItem row={i+2} col={1} style={{ padding: '4px 0' }}>{getChartIcon(chart)}</GridItem>
|
<GridItem row={i+2} col={1} style={{ padding: '4px 0' }}>{getChartIcon(chart)}</GridItem>
|
||||||
<GridItem row={i+2} col={2}>{chart.shortLabel || chart.label}</GridItem>
|
<GridItem row={i+2} col={2}>{chart.shortLabel || chart.label}</GridItem>
|
||||||
<GridItem row={i+2} col={3} style={{ paddingRight: 0 }}>{xFormat(chart)}</GridItem>
|
<GridItem row={i+2} col={3} style={{ paddingRight: 0, textAlign: 'end' }}>{xFormat(chart)}</GridItem>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
@ -295,7 +295,7 @@ const TelemetryView = memo(() => {
|
|||||||
plugins={{
|
plugins={{
|
||||||
menu: { enabled: false },
|
menu: { enabled: false },
|
||||||
cursor: {
|
cursor: {
|
||||||
width: 200,
|
width: 220,
|
||||||
render: cursorRender,
|
render: cursorRender,
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
Loading…
Reference in New Issue
Block a user