Skip to content

Commit 151fc1d

Browse files
committed
feat(shape): add dotted triangle shape
Signed-off-by: Akash Srivastava <akashsrivastava4927@gmail.com>
1 parent 2496b5f commit 151fc1d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/components/GraphNode/_GraphNodeStatic.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import MatchedText from '../MatchedText';
88

99
import ShapeCircle from './shapes/_ShapeCircle';
1010
import ShapeTriangle from './shapes/_ShapeTriangle';
11+
import ShapeDottedTriangle from './shapes/_ShapeDottedTriangle';
1112
import ShapeSquare from './shapes/_ShapeSquare';
1213
import ShapePentagon from './shapes/_ShapePentagon';
1314
import ShapeHexagon from './shapes/_ShapeHexagon';
@@ -25,6 +26,7 @@ export const shapes = {
2526
cloud: ShapeCloud,
2627
cylinder: ShapeCylinder,
2728
dottedcylinder: ShapeDottedCylinder,
29+
dottedtriangle: ShapeDottedTriangle,
2830
heptagon: ShapeHeptagon,
2931
hexagon: ShapeHexagon,
3032
octagon: ShapeOctagon,
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react';
2+
3+
import Shape, { curvedUnitPolygonPath } from './_Shape';
4+
5+
const renderTemplate = attrs => (
6+
<path d={curvedUnitPolygonPath(3)} strokeDasharray="0.1, 0.05" {...attrs} />
7+
);
8+
9+
export default class ShapeDottedTriangle extends React.Component {
10+
render() {
11+
return <Shape renderTemplate={renderTemplate} {...this.props} />;
12+
}
13+
}

0 commit comments

Comments
 (0)