-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(calendar): port CalendarD3 features to Calendar
- Loading branch information
Raphael Benitte
committed
May 11, 2016
1 parent
4058b9f
commit e11737d
Showing
7 changed files
with
238 additions
and
63 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
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
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
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,44 @@ | ||
/* | ||
* This file is part of the nivo library. | ||
* | ||
* (c) Raphaël Benitte | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
'use strict'; | ||
|
||
import React, { Component, PropTypes } from 'react'; | ||
|
||
|
||
class CalendarDay extends Component { | ||
render() { | ||
const { x, y, size, borderWidth, borderColor } = this.props; | ||
|
||
return ( | ||
<rect | ||
className="nivo_calendar_day" | ||
x={x} y={y} | ||
width={size} height={size} | ||
style={{ | ||
fill: 'rgba(0, 0, 0, .15)', | ||
strokeWidth: borderWidth, | ||
stroke: borderColor, | ||
}} | ||
/> | ||
); | ||
} | ||
} | ||
|
||
const { number, string } = PropTypes; | ||
|
||
CalendarDay.propTypes = { | ||
x: number.isRequired, | ||
y: number.isRequired, | ||
size: number.isRequired, | ||
borderWidth: number.isRequired, | ||
borderColor: string.isRequired, | ||
}; | ||
|
||
|
||
export default CalendarDay; |
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,41 @@ | ||
/* | ||
* This file is part of the nivo library. | ||
* | ||
* (c) Raphaël Benitte | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
'use strict'; | ||
|
||
import React, { Component, PropTypes } from 'react'; | ||
|
||
|
||
class CalendarMonthPath extends Component { | ||
render() { | ||
const { path, borderWidth, borderColor } = this.props; | ||
|
||
return ( | ||
<path | ||
className="nivo_calendar_month" | ||
d={path} | ||
style={{ | ||
fill: 'none', | ||
strokeWidth: borderWidth, | ||
stroke: borderColor, | ||
}} | ||
/> | ||
); | ||
} | ||
} | ||
|
||
const { number, string } = PropTypes; | ||
|
||
CalendarMonthPath.propTypes = { | ||
path: string.isRequired, | ||
borderWidth: number.isRequired, | ||
borderColor: string.isRequired, | ||
}; | ||
|
||
|
||
export default CalendarMonthPath; |
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
Oops, something went wrong.