@@ -379,59 +379,43 @@ function radialLabels<TDatum>(
379379): PolarMark <TDatum >
380380```
381381
382- `radialLabels ` draws outside labels with connectors for pie and donut slices ,
383- and keeps crowded labels readable . `angle ` defaults to the numeric `angle `
384- field of each row , so `pie ()` output needs no angle channel . `radius ` defaults
385- to `1`, the outer edge of a `[0, 1]` radius scale . Connectors start at the
386- largest mapped radius , bend at an elbow 16 pixels outside it on the slice
387- angle , and run horizontally to a text column 12 pixels beyond the outermost
388- visible elbow on that side . The text starts 4 pixels after the column . Every
389- connector stays on the inner side of the column , so no connector crosses
390- another label 's text .
391-
392- Labels form one vertical stack on each side of the center , in angular order .
393- Each label gets `fontSize * 1.4` pixels of height (`fontSize ` defaults to
394- 12). When labels overlap , the mark moves them apart as little as
395- possible , and keeps every label inside the polar container 's chart bounds .
396- When a side has more labels than fit , the labels with the lowest `priority `
397- are hidden first . `priority ` defaults to the numeric `value ` field , so the
398- smallest `pie ()` slices are hidden first . On equal priority , the later row is
399- hidden first . Set `maxShift ` to also hide labels that would move more than
400- that many pixels from their slice ; the mark hides the lowest -priority label
401- in the crowded group and lays out again .
402-
403- The mark measures each label with the chart 's text measurer and keeps every
404- label inside the left and right chart edges . A label that does not fit even
405- beside its own elbow is hidden first . While the widest remaining label still
406- does not fit beside the column , the mark hides the lower -priority one of that
407- label and the label with the outermost elbow ; on equal priority it hides the
408- outermost -elbow label , because that label sets the column . Long labels and
409- narrow charts therefore lose labels instead of overflowing ; widen the chart ,
410- lower `radiusRatio `, or shorten `text ` to keep more labels . Layout runs on every
411- render , so a resized chart can show labels that a smaller size hid .
412-
413- The mark also accepts `angleScale `, `radiusScale `, `text `, `key `, `z `,
414- `color `, fill , font size and weight , opacity , and connector `stroke `,
415- `strokeOpacity `, and `strokeWidth `. `stroke ` defaults to the label fill . Each
416- visible label emits one interaction point at its final text position . Hidden
417- labels emit no nodes and no points , so pair the mark with a tooltip or legend
418- when every slice name must stay available .
419-
420- The mark emits only label and polyline scene nodes , so SVG , Canvas , and React
421- Native paint it the same way . Label keys come from `key `; each connector uses
422- the label key with a `:connector ` suffix . With the motion renderer , kept labels
423- and connectors move to their new layout , and hidden or removed labels fade
424- out .
425-
426- ```tsx
427- radialLabels (slices , {
428- text: (row ) => ` ${row .name } ${row .share }% ` ,
429- key: ' name' ,
430- color: ' name' ,
431- fontSize: 12 ,
432- maxShift: 24 ,
433- })
434- ```
382+ `radialLabels ` renders outside slice labels with elbow connectors and keeps
383+ crowded labels readable .
384+
385+ | Option | Meaning |
386+ | ------------------------------ | -------------------------------------------------------------- |
387+ | `id `, `className ` | Stable layer ID and optional class |
388+ | `angle ` | Angle channel ; defaults to datum `angle ` |
389+ | `radius ` | Connector start radius ; defaults to `1` |
390+ | `text ` | Label text |
391+ | `priority ` | Lower priority hides first ; defaults to datum `value ` |
392+ | `maxShift ` | Hides a label that would move more pixels from its slice |
393+ | `key ` | Stable label identity ; defaults to top /nested `id `, then index |
394+ | `z ` | Interaction group |
395+ | `color ` | Color -scale value ; defaults to `z ` |
396+ | `fill ` | Final constant or datum -derived text paint |
397+ | `fontSize `, `fontWeight ` | Text size , default 12, and weight |
398+ | `opacity ` | Label and connector opacity |
399+ | `stroke ` | Connector paint ; defaults to the label fill |
400+ | `strokeOpacity `, `strokeWidth ` | Connector opacity and width |
401+
402+ Labels stack on each side of the center in angular order , `fontSize * 1.4`
403+ pixels apart . Overlapping labels move apart as little as possible and stay
404+ inside the chart bounds . Each side places its text in one column outside its
405+ outermost visible connector elbow , so no connector crosses another label .
406+
407+ A label is hidden when its side runs out of height , when its text would cross
408+ the left or right chart edge , or when it would move more than `maxShift `
409+ pixels . Lower -priority labels hide first ; on equal priority , the later row
410+ hides first , except that the width check hides the outermost -elbow label
411+ first because it sets the column . Hidden labels emit no nodes or interaction
412+ points , so pair the mark with a tooltip or legend when every slice name must
413+ stay available .
414+
415+ The mark emits label and polyline scene nodes , so SVG , Canvas , and React
416+ Native paint it the same way . Connector keys add `:connector ` to the label
417+ key . With the motion renderer , kept labels and connectors move to their new
418+ layout , and hidden labels fade out .
435419
436420## `radialRule `
437421
0 commit comments