Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
feature/COR-1901-rwzi-municipal-pages (#4977)
Browse files Browse the repository at this point in the history
* feat(COR-1901): Change RWZI line visually

* feat(COR-1901): Add opacity parameter to timeSeries linechart and gappedlinechart

* feat(COR-1901): Add opacity to legend items too
  • Loading branch information
ben-van-eekelen authored Feb 7, 2024
1 parent 577293c commit fda6a8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ export function LineTrend({ series, style = DEFAULT_STYLE, strokeWidth = DEFAULT
interface LineTrendIconProps {
color: string;
style?: 'solid' | 'dashed';
opacity?: number;
strokeWidth?: number;
width?: number;
height?: number;
}

export function LineTrendIcon({ color, strokeWidth = DEFAULT_STROKE_WIDTH, style = DEFAULT_STYLE, width = 15, height = 15 }: LineTrendIconProps) {
export function LineTrendIcon({ color, strokeWidth = DEFAULT_STROKE_WIDTH, style = DEFAULT_STYLE, opacity, width = 15, height = 15 }: LineTrendIconProps) {
return (
<svg width={width} height={height} viewBox={`0 0 ${width} ${height}`}>
<line
Expand All @@ -77,6 +78,7 @@ export function LineTrendIcon({ color, strokeWidth = DEFAULT_STROKE_WIDTH, style
strokeDasharray={style === 'dashed' ? 4 : undefined}
strokeLinecap="round"
strokeLinejoin="round"
opacity={opacity}
x1={2}
y1={height / 2}
x2={width - 2}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function SeriesIcon<T extends TimestampedValue>({ config, value }: Series
switch (config.type) {
case 'line':
case 'gapped-line':
return <LineTrendIcon color={config.color} strokeWidth={config.strokeWidth} style={config.style} />;
return <LineTrendIcon color={config.color} strokeWidth={config.strokeWidth} style={config.style} opacity={config.opacity} />;
case 'scatter-plot':
return <ScatterPlotIcon color={config.color} />;
case 'range':
Expand Down

0 comments on commit fda6a8f

Please sign in to comment.