Skip to content

Commit

Permalink
fix: add className to all annotation pins (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
TCL735 authored Oct 20, 2021
1 parent d6425a9 commit c17f289
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion giraffe/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@influxdata/giraffe",
"version": "2.18.8",
"version": "2.18.9",
"main": "dist/index.js",
"module": "src/index.js",
"license": "MIT",
Expand Down
11 changes: 7 additions & 4 deletions giraffe/src/components/AnnotationLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export const AnnotationLine: FunctionComponent<AnnotationLineProps> = props => {
{pin === 'circle' &&
createElement('circle', {
r: PIN_CIRCLE_RADIUS,
className: 'giraffe-annotation-click-target',
fill: color,
cx: length - PIN_CIRCLE_RADIUS,
cy: clampedStart,
Expand All @@ -100,10 +101,10 @@ export const AnnotationLine: FunctionComponent<AnnotationLineProps> = props => {
points: `${length - PIN_TRIANGLE_HEIGHT}, ${clampedStart} ${length -
PIN_TRIANGLE_HEIGHT / 2}, ${clampedStart +
PIN_TRIANGLE_WIDTH} ${length}, ${clampedStart}`,
className: 'giraffe-annotation-click-target',
fill: color,
style: {cursor: 'pointer'},
id: props.id,
className: 'giraffe-annotation-click-target',
style: {cursor: 'pointer'},
})}
{pin === 'stop' &&
createElement('polygon', {
Expand Down Expand Up @@ -133,6 +134,7 @@ export const AnnotationLine: FunctionComponent<AnnotationLineProps> = props => {
${clampedEnd + pixelMargin}, 0
${clampedEnd + pixelMargin}, ${RANGE_HEIGHT}
${clampedStart - pixelMargin}, ${RANGE_HEIGHT}`,
className: 'giraffe-annotation-click-target',
fill: color,
id: props.id,
style: {cursor: 'pointer', opacity: '60%'},
Expand Down Expand Up @@ -167,6 +169,7 @@ export const AnnotationLine: FunctionComponent<AnnotationLineProps> = props => {
case 'circle':
return createElement('circle', {
r: PIN_CIRCLE_RADIUS,
className: 'giraffe-annotation-click-target',
fill: color,
cx: clampedStart,
cy: PIN_CIRCLE_RADIUS,
Expand All @@ -176,10 +179,10 @@ export const AnnotationLine: FunctionComponent<AnnotationLineProps> = props => {
points: `${clampedStart - PIN_TRIANGLE_WIDTH}, 0
${clampedStart + PIN_TRIANGLE_WIDTH}, 0
${clampedStart}, ${PIN_TRIANGLE_HEIGHT}`,
className: 'giraffe-annotation-click-target',
fill: color,
style: {cursor: 'pointer'},
id: props.id,
className: 'giraffe-annotation-click-target',
style: {cursor: 'pointer'},
onMouseEnter: () => {
onHover(true)
},
Expand Down
2 changes: 1 addition & 1 deletion stories/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@influxdata/giraffe-stories",
"version": "2.18.7",
"version": "2.18.9",
"license": "MIT",
"scripts": {
"lint": "eslint '{src,../giraffe/src}/**/*.{ts,tsx}'",
Expand Down

0 comments on commit c17f289

Please sign in to comment.