-
Notifications
You must be signed in to change notification settings - Fork 652
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
13 changed files
with
306 additions
and
37 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 |
---|---|---|
|
@@ -36,7 +36,6 @@ describe('index', () => { | |
</group> | ||
); | ||
render(profile, canvas); | ||
console.log(canvas); | ||
canvas.draw(); | ||
}); | ||
}); |
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,68 @@ | ||
// @ts-nocheck | ||
|
||
export default (props: any) => { | ||
const { items, active } = props; | ||
const len = items.length; | ||
const firstItem = items[0]; | ||
|
||
return ( | ||
<group style={{ | ||
maxWidth: '800px', | ||
padding: [10, 0, 0, 0] | ||
// justifyContent: 'center', | ||
}} attrs={{ | ||
radius: '8px', | ||
fill: active ? '#E7F1FF' : undefined, | ||
}}> | ||
<group style={{ | ||
flexDirection: 'row', | ||
padding: ['4px', '60px'], | ||
}}> | ||
{ | ||
items.map((item: any, index: number) => { | ||
const { name, value } = item; | ||
return ( | ||
<group style={{ | ||
flexDirection: 'row', | ||
justifyContent: index === 0 ? 'flex-start' : index === len - 1 ? 'flex-end' : 'center', | ||
flex: 1, | ||
}}> | ||
<group> | ||
<group style={{ | ||
width: '100px', | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
}}> | ||
<rect style={{ | ||
marginRight: '8px', | ||
width: '24px', | ||
height: '4px', | ||
}} attrs={{ | ||
radius: '4px', | ||
fill: item.color, | ||
}}/> | ||
<text attrs={{ | ||
textBaseline: 'middle', | ||
fontSize: '24px', | ||
fill: '#333333', | ||
fontWeight: '500', | ||
text: name, | ||
}} /> | ||
{/* <text attrs={{ | ||
textBaseline: 'middle', | ||
// marginLeft: '32px', | ||
// marginTop: '8px', | ||
fontSize: '24px', | ||
fill: '#333333', | ||
text: value, | ||
}} /> */} | ||
</group> | ||
</group> | ||
</group> | ||
); | ||
}) | ||
} | ||
</group> | ||
</group> | ||
); | ||
} |
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,5 +1,6 @@ | ||
import withLegend from './withLegend'; | ||
import View from './view'; | ||
import Fund from './fund'; | ||
|
||
export { withLegend, View }; | ||
export default withLegend(View); | ||
export { withLegend, View, Fund}; | ||
export default withLegend(Fund); |
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,17 @@ | ||
{ | ||
"name": "f2x-line", | ||
"version": "0.0.1", | ||
"main": "lib/index.js", | ||
"module": "es/index.js", | ||
"dependencies": { | ||
"@antv/f2": "^3.8.1" | ||
}, | ||
"devDependencies": { | ||
"f2-jsx": "*" | ||
}, | ||
"files": [ | ||
"src", | ||
"dist" | ||
], | ||
"author": "yezengyue@gmail.com" | ||
} |
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,8 @@ | ||
import model from './model'; | ||
|
||
const View = () => { | ||
return null; | ||
} | ||
|
||
export { model, View }; | ||
export default model(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// @ts-nocheck | ||
|
||
import { Component } from '../../component/src/index'; | ||
|
||
export default View => { | ||
return class Line extends Component { | ||
mount() { | ||
const { chart, props } = this; | ||
const { position, color } = props; | ||
const geom = chart.line().position(position); | ||
if (color) { | ||
if (Array.isArray(color)) { | ||
geom.color(color[0], color[1]); | ||
} else { | ||
geom.color(color); | ||
} | ||
} | ||
} | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "../../tsconfig.json" | ||
} |
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 @@ | ||
import '../../typings'; |
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.