Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1c1577a
[d3-chart] added example for other value in donut chart
ilyabrower Oct 21, 2026
190c28b
[d3-chart] added new Score Donut chart
ilyabrower Oct 21, 2026
9fc3690
Merge branch 'release/v18' into UIK-6021/other-value-in-donut
Valeria-Zimnitskaya Oct 23, 2026
17f76fe
[d3-chart] fixed hover state
ilyabrower Oct 26, 2026
dd741f5
Merge branch 'release/v18' into UIK-6021/other-value-in-donut
Valeria-Zimnitskaya Oct 26, 2026
32f1f0a
[stories] update test story
Valeria-Zimnitskaya Oct 26, 2026
761fd0b
[d3-chart] tests
Valeria-Zimnitskaya Oct 27, 2026
b4ed876
[d3-chart] fixed color for the score donut chart pattern, fixed patte…
ilyabrower Oct 27, 2026
34d51b1
[d3-chart] hide tooltip for the empty donut part
ilyabrower Oct 27, 2026
1281b6e
[d3-chart] some fixes for the 2 phase of donut chart redesign
ilyabrower Oct 27, 2026
2a98060
[d3-chart] in ScoreDonut use empty value pattern even with patterns
ilyabrower Oct 27, 2026
d5bea2b
[d3-chart] fixed donut size for differen heights
ilyabrower Oct 27, 2026
fc27ef5
[d3-chart] removed unused variable
ilyabrower Oct 27, 2026
c4c138c
[chore] Merge branch 'UIK-6021/other-value-in-donut' of https://githu…
Valeria-Zimnitskaya Oct 27, 2026
a2e1ace
[docs] update ScoreDonut examples
j-mnizhek Oct 28, 2026
4aa4cc0
[d3-chart] fixed animation in scroe donut
ilyabrower Oct 28, 2026
e5f179f
[chore] Merge branch 'UIK-6021/other-value-in-donut' of github.com:se…
ilyabrower Oct 28, 2026
719adde
[d3-chart] added default shape Circle to ScoreDonut
ilyabrower Oct 28, 2026
40f41ef
[d3-chart] removed empty donut for score donut
ilyabrower Oct 28, 2026
60b5df1
[d3-chart] added custom dataHintsHandlers for ScoreDonutChart
ilyabrower Oct 28, 2026
4a46982
Merge branch 'release/v18' into UIK-6021/other-value-in-donut
Valeria-Zimnitskaya Oct 28, 2026
b3a84de
Update semcore/d3-chart/src/style/bar.shadow.css
ilyabrower Oct 28, 2026
a68ee7d
[chore] Merge remote-tracking branch 'origin/release/v18' into UIK-59…
ilyabrower Oct 28, 2026
25660ab
[d3-chart] update pattern for ScoreDonut
j-mnizhek Oct 28, 2026
19aeadb
[docs] move ScoreDonut to Donut docs and examples
j-mnizhek Oct 28, 2026
6b5560b
[chore] Merge branch 'UIK-5922/donut-chart-rebrending-phase-2' into U…
ilyabrower Oct 29, 2026
734c6f9
[d3-chart] fixed value for score donut in a11y modal summary
ilyabrower Oct 29, 2026
ace6603
[d3-chart] donut pies in score donut are always not transparent
ilyabrower Oct 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions playground/entries/Chart/ScoreDonut.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import { Chart } from '@semcore/ui/d3-chart';
import { Text } from '@semcore/ui/typography';
import React from 'react';

import { getDefaultChartControls } from './common/controls';
import type { CommonChartProps, LegendChartProps } from './common/controls';
import type { JSXProps } from '../../types/JSXProps';
import type { PlaygroundEntry } from '../../types/Playground';
import createGithubLink from '../../utils/createGHLink';

type DonutChartProps = {
commonChartProps: Omit<CommonChartProps, 'showTotalInTooltip'>;
legendProps: Omit<LegendChartProps, 'direction'>;
donutProps: {
halfsize: boolean;
innerLabel: string;
};
};
export type DonutChartJSXProps = JSXProps<DonutChartProps>;

const data = {
value: 33,
};

function getJSX(props: DonutChartJSXProps) {
const legendProps = {
...props.legendProps,
};
return (
<Chart.ScoreDonut
plotWidth={300}
plotHeight={200}
data={data}
aria-label='Donut chart'
{...props.donutProps}
innerLabel={(
props.donutProps.halfsize
? (
<Text tag='tspan' dy='-1em'>
{props.donutProps.innerLabel}
</Text>
)
: props.donutProps.innerLabel
)}
{...props.commonChartProps}
{...(props.legendProps && {
legendProps,
showLegend: props.commonChartProps.showLegend as true,
})}
{...(props.legendProps?.patterns && { patterns: props.legendProps.patterns })}
/>
);
}

const entry: PlaygroundEntry<DonutChartJSXProps> = {
JSX: (props) => getJSX(props),
controls: {
donutProps: {
type: 'group',
groupName: 'Donut props',
controls: {
halfsize: {
type: 'boolean',
value: false,
displayName: 'Half size',
},
innerLabel: {
type: 'text',
value: 'Example',
displayName: 'Inner Label',
},
},
},
...getDefaultChartControls({
skip: {
commonChartProps: ['showTotalInTooltip'],
legendProps: ['direction'],
},
add: {
legendProps: {
shape: {
type: 'select',
value: 'Circle',
options: ['Checkbox', 'Circle', 'Pattern'],
displayName: 'Shape',
},
},
},
}),
},
link: createGithubLink('d3-chart'),
filterProps: ['data'],
};

export default entry;
2 changes: 2 additions & 0 deletions playground/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import ChartLine from './entries/Chart/Line';
import MiniChart from './entries/Chart/MiniChart';
import ChartRadar from './entries/Chart/Radar';
import ChartScatterPlot from './entries/Chart/ScatterPlot';
import ChartScoreDonut from './entries/Chart/ScoreDonut';
import ChartStackedArea from './entries/Chart/StackedArea';
import ChartStackedBar from './entries/Chart/StackedBar';
import ChartStackedHorizontalBar from './entries/Chart/StackedHorizontalBar';
Expand Down Expand Up @@ -89,6 +90,7 @@ const registry = {
'Chart.Cigarette': ChartCigarette,
'ChartLegend': ChartLegend,
'Chart.Donut': ChartDonut,
'Chart.ScoreDonut': ChartScoreDonut,
'Chart.Histogram': ChartHistogram,
'Chart.Line': ChartLine,
'MiniChart': MiniChart,
Expand Down
5 changes: 1 addition & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { expect, test, getAccessibilityViolations } from '@semcore/testing-utils/playwright';
import { loadPage } from '@semcore/testing-utils/shared/helpers';
import { TAG } from '@semcore/testing-utils/shared/tags';

test.describe(`@d3-chart @score-donut-chart ${TAG.ACCESSIBILITY}`, () => {
test('basic-usage', async ({ page }) => {
await loadPage(page, 'stories/components/d3-chart/docs/examples/score-donut-chart/basic-usage.tsx', 'en');
const violations = await getAccessibilityViolations({ page });
expect(violations).toEqual([]);
});

test('semi-donut', async ({ page }) => {
await loadPage(page, 'stories/components/d3-chart/docs/examples/score-donut-chart/semi-donut.tsx', 'en');
const violations = await getAccessibilityViolations({ page });
expect(violations).toEqual([]);
});
});
Loading
Loading