File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { useTransitionStore } from "@/stores/transition";
14
14
export const ErrorWhiskers = ( ) => {
15
15
const {
16
16
getX,
17
+ getY,
17
18
getYErrorPresent,
18
19
getYErrorRange,
19
20
chartData,
@@ -37,10 +38,12 @@ export const ErrorWhiskers = () => {
37
38
const x0 = xScale ( getX ( d ) ) as number ;
38
39
const segment = getSegment ( d ) ;
39
40
const barWidth = 15 ;
41
+ const y = getY ( d ) as number ;
40
42
const [ y1 , y2 ] = getYErrorRange ( d ) ;
41
43
return {
42
44
key : `${ i } ` ,
43
45
x : x0 - barWidth / 2 ,
46
+ y : yScale ( y ) ,
44
47
y1 : yScale ( y1 ) ,
45
48
y2 : yScale ( y2 ) ,
46
49
width : barWidth ,
@@ -53,6 +56,7 @@ export const ErrorWhiskers = () => {
53
56
colors ,
54
57
getSegment ,
55
58
getX ,
59
+ getY ,
56
60
getYErrorPresent ,
57
61
getYErrorRange ,
58
62
showYUncertainty ,
Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ const ERROR_WHISKER_MIDDLE_CIRCLE_RADIUS = 3.5;
155
155
export type RenderWhiskerDatum = {
156
156
key : string ;
157
157
x : number ;
158
+ y : number ;
158
159
y1 : number ;
159
160
y2 : number ;
160
161
width : number ;
@@ -215,7 +216,7 @@ export const renderWhiskers = (
215
216
. append ( "circle" )
216
217
. attr ( "class" , "middle-circle" )
217
218
. attr ( "cx" , ( d ) => d . x + d . width / 2 )
218
- . attr ( "cy" , ( d ) => ( d . y1 + d . y2 ) / 2 )
219
+ . attr ( "cy" , ( d ) => d . y )
219
220
. attr ( "r" , ERROR_WHISKER_MIDDLE_CIRCLE_RADIUS )
220
221
. attr ( "fill" , ( d ) => d . fill ?? "black" )
221
222
. attr ( "stroke" , "none" )
@@ -259,7 +260,7 @@ export const renderWhiskers = (
259
260
g
260
261
. select ( ".middle-circle" )
261
262
. attr ( "cx" , ( d ) => d . x + d . width / 2 )
262
- . attr ( "cy" , ( d ) => ( d . y1 + d . y2 ) / 2 )
263
+ . attr ( "cy" , ( d ) => d . y )
263
264
. attr ( "r" , ERROR_WHISKER_MIDDLE_CIRCLE_RADIUS )
264
265
. attr ( "fill" , ( d ) => d . fill ?? "black" )
265
266
. attr ( "stroke" , "none" )
You can’t perform that action at this time.
0 commit comments