Skip to content

Commit

Permalink
RadarChart
Browse files Browse the repository at this point in the history
  • Loading branch information
jmfrancois committed Jul 17, 2023
1 parent b03a38d commit 73d9b3a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .changeset/wet-dolls-compare.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ We have updated the following components:
* GuidedTour
* GridLayout aka Dashboard
* HeaderBar
* List (Virtualized and Composition)
* ListView
* MultiSelect
* Notification
* ObjectViewer
* PieChart
* Progress
* RadarChart
* ResourceList
* ResourcePicker
* RichLayout
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@use '~@talend/bootstrap-theme/src/theme/guidelines' as *;

@use '~@talend/design-tokens/lib/tokens';

$custom-quality-bar-placeholder-line-hover-height: 0.4rem;
Expand Down
4 changes: 3 additions & 1 deletion packages/components/src/RadarChart/RadarChart.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Radar,
PolarAngleAxis,
} from 'recharts';
import tokens from '@talend/design-tokens';
import PropTypes from 'prop-types';
import radarChartCssModule from './RadarChart.module.scss';
import { getTheme } from '../theme';
Expand Down Expand Up @@ -51,6 +52,7 @@ export function RadarChart({
width={width}
height={height}
data={data}
fill={tokens.coralColorNeutralBorder}
>
<PolarGrid />
<PolarRadiusAxis domain={domain} tick={tick} axisLine={tickLine} />
Expand Down Expand Up @@ -138,7 +140,7 @@ Dot.propTypes = {
* @param {Object} props the current props of the Radar
*/
function DotWithClick(props) {
const { activeAxis, fill, index, onClick, ...rest } = props;
const { activeAxis, fill = tokens.coralColorNeutralBorder, index, onClick, ...rest } = props;
const STATE = {
DEFAULT_RADIUS: 2,
DEFAULT_STROKE_WIDTH: 12,
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/RadarChart/RadarChart.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use '~@talend/bootstrap-theme/src/theme/guidelines' as *;
@use '~@talend/design-tokens/lib/tokens';

.tc-radar-chart {
:global {
Expand All @@ -14,6 +15,6 @@
}

.tc-radar-chart-label--selected {
fill: $regal-blue;
fill: tokens.$coral-color-charts-default-strong;
font-weight: 600;
}
26 changes: 14 additions & 12 deletions packages/components/src/RadarChart/RadarChart.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { action } from '@storybook/addon-actions';
import tokens from '@talend/design-tokens';

import RadarChart from '.';

const ExampleDataSingle = [
Expand Down Expand Up @@ -42,8 +44,8 @@ export const RadarChartSingle = () => (
name="Trust score"
dataKey="A"
dot={true}
stroke="#19426c"
fill="#19426c"
stroke={tokens.coralColorChartsDefault}
fill={tokens.coralColorChartsDefault}
fillOpacity={0.1}
/>
</RadarChart>
Expand All @@ -60,16 +62,16 @@ export const RadarChartMultiple = () => (
name="Trust score 2019"
dataKey="A"
dot={false}
stroke="#19426c"
fill="#19426c"
stroke={tokens.coralColorChartsDefault}
fill={tokens.coralColorChartsDefault}
fillOpacity={0.1}
/>
<RadarChart.Radar
name="Trust score 2020"
dataKey="B"
dot={false}
stroke="#EA8330"
fill="#EA8330"
stroke={tokens.coralColorChartsWarning}
fill={tokens.coralColorChartsWarning}
fillOpacity={0.1}
/>
</RadarChart>
Expand All @@ -89,10 +91,10 @@ export const RadarChartClickableLabel = () => (
<RadarChart.Radar
dataKey="A"
dot={false}
fill="#19426c"
stroke={tokens.coralColorChartsDefault}
fill={tokens.coralColorChartsDefault}
fillOpacity={0.1}
name="Trust score"
stroke="#19426c"
/>
</RadarChart>
</div>
Expand All @@ -107,10 +109,10 @@ export const RadarChartClickableDot = () => (
<RadarChart.Radar
dataKey="A"
dot={<RadarChart.DotWithClick activeAxis={2} onClick={action('Axis dot was clicked')} />}
fill="#19426c"
stroke={tokens.coralColorChartsDefault}
fill={tokens.coralColorChartsDefault}
fillOpacity={0.1}
name="Trust score"
stroke="#19426c"
/>
</RadarChart>
</div>
Expand All @@ -125,10 +127,10 @@ export const RadarChartCustomDot = () => (
<RadarChart.Radar
dataKey="A"
dot={<RadarChart.Dot activeAxis={2} />}
fill="#19426c"
stroke={tokens.coralColorChartsDefault}
fill={tokens.coralColorChartsDefault}
fillOpacity={0.1}
name="Trust score"
stroke="#19426c"
/>
</RadarChart>

Expand Down

0 comments on commit 73d9b3a

Please sign in to comment.