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
|
||||
|
||||
let top = mouseState.y + offsetY
|
||||
if (top + height >= sizes.chartsHeight) {
|
||||
if (mouseState.y >= sizes.chartsHeight / 2) {
|
||||
setPosition('bottom')
|
||||
top = mouseState.y - offsetY - height
|
||||
} else {
|
||||
@ -186,7 +186,9 @@ const _D3HorizontalCursor = <DataType,>({
|
||||
pointerEvents={fixed ? 'all' : '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'}>
|
||||
{tooltipBodies[i]}
|
||||
</div>
|
||||
|
@ -568,6 +568,7 @@ const _D3MonitoringCharts = <DataType extends Record<string, unknown>>({
|
||||
groups={groups}
|
||||
sizes={sizes}
|
||||
data={data}
|
||||
height={height}
|
||||
/>
|
||||
</D3MouseZone>
|
||||
</svg>
|
||||
|
@ -255,7 +255,7 @@ const Archive = memo(() => {
|
||||
plugins={{
|
||||
menu: { enabled: false },
|
||||
cursor: {
|
||||
width: 200,
|
||||
width: 220,
|
||||
render: cursorRender,
|
||||
}
|
||||
}}
|
||||
|
@ -28,7 +28,7 @@ export const cursorRender = (group, data) => {
|
||||
<Fragment key={chart.key}>
|
||||
<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={3} style={{ paddingRight: 0 }}>{xFormat(chart)}</GridItem>
|
||||
<GridItem row={i+2} col={3} style={{ paddingRight: 0, textAlign: 'end' }}>{xFormat(chart)}</GridItem>
|
||||
</Fragment>
|
||||
)
|
||||
})}
|
||||
|
@ -295,7 +295,7 @@ const TelemetryView = memo(() => {
|
||||
plugins={{
|
||||
menu: { enabled: false },
|
||||
cursor: {
|
||||
width: 200,
|
||||
width: 220,
|
||||
render: cursorRender,
|
||||
},
|
||||
}}
|
||||
|
Loading…
Reference in New Issue
Block a user