-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build ConnectionPoint dumb component
- Loading branch information
1 parent
dab8f82
commit 15e219e
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// @flow | ||
import React, { Component } from 'react'; | ||
var ReactDOM = require('react-dom'); | ||
var electron = require('electron'); | ||
|
||
const {Raphael,Paper,Set,Circle,Ellipse,Image,Rect,Text,Path,Line} = require('react-raphael'); | ||
|
||
export default class ConnectionPoint extends Component { | ||
// Props include id, x, and y. | ||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
hide: false, | ||
}; | ||
}; | ||
|
||
render() { | ||
// Use an offset of half the width from the (x,y) center points | ||
let size = 8; | ||
let tlx = this.props.x - (size / 2); | ||
let tly = this.props.y - (size / 2); | ||
|
||
console.log("Rendering CP (id: %s) at %d, %d\n", this.props.id, this.props.x, this.props.y); | ||
return ( | ||
<Rect x={tlx} y={tly} width={size} height={size} hide={this.state.hide} | ||
attr={{ | ||
"stroke":"#00FFFF", | ||
"stroke-width":1, | ||
"fill":"#00FFFF", | ||
}} | ||
/>); | ||
}; | ||
} |