fix: apply vector-effect: non-scaling-stroke to svg path element (#835)
Also avoid passing a class called undefined to the svg element
This commit is contained in:
parent
05d8cb3605
commit
113daee5ad
@ -1,6 +1,7 @@
|
|||||||
import { extent } from 'd3-array';
|
import { extent } from 'd3-array';
|
||||||
import { scaleLinear } from 'd3-scale';
|
import { scaleLinear } from 'd3-scale';
|
||||||
import { line } from 'd3-shape';
|
import { line } from 'd3-shape';
|
||||||
|
import classNames from 'classnames';
|
||||||
import isEqual from 'lodash/isEqual';
|
import isEqual from 'lodash/isEqual';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
@ -84,7 +85,7 @@ export const SparklineView = ({
|
|||||||
return (
|
return (
|
||||||
<svg
|
<svg
|
||||||
data-testid="sparkline-svg"
|
data-testid="sparkline-svg"
|
||||||
className={`pt-px pr-0 w-full overflow-visible ${className}`}
|
className={classNames('pt-px pr-0 w-full overflow-visible', className)}
|
||||||
width={width}
|
width={width}
|
||||||
height={height}
|
height={height}
|
||||||
viewBox="0 0 100 100"
|
viewBox="0 0 100 100"
|
||||||
@ -104,7 +105,7 @@ export const SparklineView = ({
|
|||||||
<path
|
<path
|
||||||
data-testid="sparkline-path"
|
data-testid="sparkline-path"
|
||||||
d={mainPath}
|
d={mainPath}
|
||||||
className={strokeClassName}
|
className={`[vector-effect:non-scaling-stroke] ${strokeClassName}`}
|
||||||
stroke="strokeCurrent"
|
stroke="strokeCurrent"
|
||||||
strokeWidth={2}
|
strokeWidth={2}
|
||||||
fill="transparent"
|
fill="transparent"
|
||||||
|
Loading…
Reference in New Issue
Block a user