@@ -27,7 +27,7 @@ function SunburstChart({
27
27
const hoverHandler = useRef ( onHover )
28
28
29
29
// this state stores the root node of the sunburst chart
30
- const [ root ] = useState (
30
+ const [ root ] = useState ( ( ) =>
31
31
Sentry . startSpan ( { name : 'SunburstChart.createRoot' } , ( ) => {
32
32
// go through the data and add `value` to each node
33
33
const stack = [ data ]
@@ -75,24 +75,24 @@ function SunburstChart({
75
75
const radius = width / 6
76
76
77
77
// Creates a function for creating arcs representing files and folders.
78
- const drawArc = Sentry . startSpan ( { name : 'SunburstChart.drawArc' } , ( ) =>
79
- arc ( )
78
+ const drawArc = Sentry . startSpan ( { name : 'SunburstChart.drawArc' } , ( ) => {
79
+ return arc ( )
80
80
. startAngle ( ( d ) => d . x0 )
81
81
. endAngle ( ( d ) => d . x1 )
82
82
. padAngle ( ( d ) => Math . min ( ( d . x1 - d . x0 ) / 2 , 0.005 ) )
83
83
. padRadius ( radius * 1.5 )
84
84
. innerRadius ( ( d ) => d . y0 * radius )
85
85
. outerRadius ( ( d ) => Math . max ( d . y0 * radius , d . y1 * radius - 1 ) )
86
- )
86
+ } )
87
87
88
88
// A color function you can pass a number from 0-100 to and get a color back from the specified color range
89
89
// Ex color(10.4)
90
- const color = Sentry . startSpan ( { name : 'SunburstChart.color' } , ( ) =>
91
- scaleSequential ( )
90
+ const color = Sentry . startSpan ( { name : 'SunburstChart.color' } , ( ) => {
91
+ return scaleSequential ( )
92
92
. domain ( [ colorDomainMin , colorDomainMax ] )
93
93
. interpolator ( colorRange )
94
94
. clamp ( true )
95
- )
95
+ } )
96
96
97
97
// Tracks previous location for rendering .. in the breadcrumb.
98
98
let previous
@@ -248,7 +248,7 @@ function SunburstChart({
248
248
parent . datum ( selected )
249
249
250
250
// Handle animating in/out of a folder
251
- Sentry . startSpan ( { name : 'SunburstChart.calculateCoordinates' } , ( ) =>
251
+ Sentry . startSpan ( { name : 'SunburstChart.calculateCoordinates' } , ( ) => {
252
252
root . each ( ( d ) => {
253
253
// determine x0 and y0
254
254
const x0Min = Math . min (
@@ -268,12 +268,12 @@ function SunburstChart({
268
268
269
269
d . target = { x0, y0, x1, y1 }
270
270
} )
271
- )
271
+ } )
272
272
273
273
// Transition the data on all arcs, even the ones that aren’t visible,
274
274
// so that if this transition is interrupted, entering arcs will start
275
275
// the next transition from the desired position.
276
- Sentry . startSpan ( { name : 'SunburstChart.transitionArcs' } , ( ) =>
276
+ Sentry . startSpan ( { name : 'SunburstChart.transitionArcs' } , ( ) => {
277
277
path
278
278
. transition ( transition )
279
279
. tween ( 'data' , ( d ) => {
@@ -290,7 +290,7 @@ function SunburstChart({
290
290
arcVisible ( d . target ) ? 'auto' : 'none'
291
291
)
292
292
. attrTween ( 'd' , ( d ) => ( ) => drawArc ( d . current ) )
293
- )
293
+ } )
294
294
} )
295
295
296
296
function handleTextUpdate ( { current, selected, transition } ) {
0 commit comments