Skip to content

Commit

Permalink
feat(shape): add dotted triangle shape
Browse files Browse the repository at this point in the history
Signed-off-by: Akash Srivastava <akashsrivastava4927@gmail.com>
  • Loading branch information
qiell committed May 20, 2019
1 parent 2496b5f commit 151fc1d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/GraphNode/_GraphNodeStatic.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import MatchedText from '../MatchedText';

import ShapeCircle from './shapes/_ShapeCircle';
import ShapeTriangle from './shapes/_ShapeTriangle';
import ShapeDottedTriangle from './shapes/_ShapeDottedTriangle';
import ShapeSquare from './shapes/_ShapeSquare';
import ShapePentagon from './shapes/_ShapePentagon';
import ShapeHexagon from './shapes/_ShapeHexagon';
Expand All @@ -25,6 +26,7 @@ export const shapes = {
cloud: ShapeCloud,
cylinder: ShapeCylinder,
dottedcylinder: ShapeDottedCylinder,
dottedtriangle: ShapeDottedTriangle,
heptagon: ShapeHeptagon,
hexagon: ShapeHexagon,
octagon: ShapeOctagon,
Expand Down
13 changes: 13 additions & 0 deletions src/components/GraphNode/shapes/_ShapeDottedTriangle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';

import Shape, { curvedUnitPolygonPath } from './_Shape';

const renderTemplate = attrs => (
<path d={curvedUnitPolygonPath(3)} strokeDasharray="0.1, 0.05" {...attrs} />
);

export default class ShapeDottedTriangle extends React.Component {
render() {
return <Shape renderTemplate={renderTemplate} {...this.props} />;
}
}

0 comments on commit 151fc1d

Please sign in to comment.