-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
115 additions
and
92 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 |
---|---|---|
@@ -1,30 +1,10 @@ | ||
import { jsx } from '@ali/f2-jsx'; | ||
import { withGeometry } from '../geometry/index'; | ||
import Geometry from '../geometry'; | ||
|
||
export default View => { | ||
return class Area extends withGeometry(View) { | ||
mount() { | ||
this.props = { | ||
...this.props, | ||
type: 'area', | ||
} | ||
super.mount(); | ||
return class Area extends Geometry { | ||
render() { | ||
return <View />; | ||
} | ||
|
||
renderShape(props) { | ||
const { points } = props; | ||
let topPoints = []; | ||
let bottomPoints = []; | ||
points.forEach((point) => { | ||
bottomPoints.push(point[0]); | ||
topPoints.push(point[1]); | ||
}); | ||
bottomPoints.reverse(); | ||
topPoints = this.parsePoints(topPoints); | ||
bottomPoints = this.parsePoints(bottomPoints); | ||
const newPoints = topPoints.concat(bottomPoints); | ||
|
||
return <View { ...props } points={ newPoints } /> | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -13,4 +13,7 @@ export interface Animation { | |
start?: any; | ||
// end 的 attrs | ||
end?: any; | ||
// 每一帧的处理函数 | ||
onFrame?: any; | ||
onEnd?: any; | ||
} |
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 |
---|---|---|
|
@@ -76,6 +76,7 @@ class ContainerComponent extends Component { | |
width, | ||
height, | ||
// plot, | ||
layout, | ||
} | ||
} | ||
|
||
|
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 |
---|---|---|
@@ -1,18 +1,10 @@ | ||
import { jsx } from '@ali/f2-jsx'; | ||
import { withGeometry } from '../geometry/index'; | ||
import Geometry from '../geometry'; | ||
|
||
export default View => { | ||
return class Interval extends withGeometry(View) { | ||
mount() { | ||
this.props = { | ||
...this.props, | ||
type: 'interval', | ||
} | ||
super.mount(); | ||
} | ||
renderShape(props) { | ||
const points = this.parsePoints(props.points); | ||
return <View { ...props } points={ points }/> | ||
return class Interval extends Geometry { | ||
render() { | ||
return <View /> | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,13 +1,10 @@ | ||
import { withGeometry } from '../geometry/index'; | ||
import { jsx } from '@ali/f2-jsx'; | ||
import Geometry from '../geometry'; | ||
|
||
export default View => { | ||
return class Point extends withGeometry(View) { | ||
mount() { | ||
this.props = { | ||
...this.props, | ||
type: 'point', | ||
} | ||
super.mount(); | ||
return class Point extends Geometry { | ||
render() { | ||
return <View /> | ||
} | ||
} | ||
} |
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
Oops, something went wrong.