forked from ddrilling/asb_cloud_front
Улучшена работа с типами в renderPoints
This commit is contained in:
parent
69222104a6
commit
e8fb9281b5
@ -50,7 +50,7 @@ export const renderPoint = <DataType extends Record<string, unknown>>(
|
|||||||
currentPoints.enter().append(config.shape)
|
currentPoints.enter().append(config.shape)
|
||||||
|
|
||||||
const newPoints = getPointsRoot()
|
const newPoints = getPointsRoot()
|
||||||
.selectAll(config.shape)
|
.selectAll<d3.BaseType, DataType>(config.shape)
|
||||||
.transition()
|
.transition()
|
||||||
.duration(chart.animDurationMs ?? 0)
|
.duration(chart.animDurationMs ?? 0)
|
||||||
|
|
||||||
@ -58,14 +58,14 @@ export const renderPoint = <DataType extends Record<string, unknown>>(
|
|||||||
default:
|
default:
|
||||||
case 'circle':
|
case 'circle':
|
||||||
newPoints.attr('r', config.radius)
|
newPoints.attr('r', config.radius)
|
||||||
.attr('cx', (d: any) => xAxis(chart.x(d)))
|
.attr('cx', (d) => xAxis(chart.x(d)))
|
||||||
.attr('cy', (d: any) => yAxis(chart.y(d)))
|
.attr('cy', (d) => yAxis(chart.y(d)))
|
||||||
break
|
break
|
||||||
case 'line':
|
case 'line':
|
||||||
newPoints.attr('x1', (d: any) => xAxis(chart.x(d)))
|
newPoints.attr('x1', (d) => xAxis(chart.x(d)))
|
||||||
.attr('x2', (d: any) => xAxis(chart.x(d)))
|
.attr('x2', (d) => xAxis(chart.x(d)))
|
||||||
.attr('y1', (d: any) => yAxis(chart.y(d)) - config.radius)
|
.attr('y1', (d) => yAxis(chart.y(d)) - config.radius)
|
||||||
.attr('y2', (d: any) => yAxis(chart.y(d)) + config.radius)
|
.attr('y2', (d) => yAxis(chart.y(d)) + config.radius)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user