-
Notifications
You must be signed in to change notification settings - Fork 645
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
26 changed files
with
432 additions
and
119 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 was deleted.
Oops, something went wrong.
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,3 @@ | ||
export default (props: any) => { | ||
return null | ||
} |
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,5 @@ | ||
import withGuide from './withGuide'; | ||
import guideView from './guideView'; | ||
|
||
export { withGuide, guideView }; | ||
export default withGuide(guideView); |
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,3 +1,15 @@ | ||
export default () => { | ||
return null; | ||
// @ts-nocheck | ||
|
||
export default (props: any) => { | ||
const { points, color, size } = props; | ||
return ( | ||
<polyline attrs={{ | ||
points, | ||
lineJoin: 'round', | ||
lineCap: 'round', | ||
lineWidth: size, | ||
strokeStyle: color, | ||
}} | ||
/> | ||
); | ||
} |
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,55 +1,14 @@ | ||
// @ts-nocheck | ||
import Bottom from './bottom'; | ||
import Left from './left'; | ||
|
||
export default (props: any) => { | ||
const { ticks, plot, position } = props; | ||
const { tl, tr, br, bl } = plot; | ||
let start = tl; | ||
let end = bl; | ||
let textAlign = 'center'; | ||
const { position } = props; | ||
|
||
if (position === 'top') { | ||
start = tl; | ||
end = tr; | ||
} else if (position === 'right') { | ||
start = tr; | ||
end = br; | ||
textAlign = 'left'; | ||
} else if (position === 'bottom') { | ||
start = bl; | ||
end = br; | ||
} else { | ||
textAlign = 'right'; | ||
if (position === 'bottom') { | ||
return ( | ||
<Bottom { ...props } /> | ||
); | ||
} | ||
|
||
return ( | ||
<group> | ||
{ | ||
ticks.map(tick => { | ||
const { x, y, text } = tick; | ||
return ( | ||
<group> | ||
<text attrs={{ | ||
x, | ||
y, | ||
text, | ||
fill: '#CCCCCC', | ||
textAlign, | ||
textBaseline: 'top', | ||
fontSize: '20px' | ||
}} /> | ||
<line attrs={{ | ||
x1: start.x, | ||
y1: start.y, | ||
x2: end.x, | ||
y2: end.y, | ||
stroke: '#EDEDED', | ||
lineWidth: '1px', | ||
}} /> | ||
</group> | ||
); | ||
}) | ||
} | ||
|
||
</group> | ||
); | ||
return <Left { ...props } /> | ||
} |
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,70 @@ | ||
// @ts-nocheck | ||
|
||
export default (props: any) => { | ||
const { plot, labelOffset, ticks, line, label, tickLine, grid } = props; | ||
const { tl, br, bl } = plot; | ||
const total = ticks.length; | ||
|
||
return ( | ||
<group> | ||
{ | ||
line ? | ||
<line attrs={{ | ||
x1: bl.x, | ||
y1: bl.y, | ||
x2: br.x, | ||
y2: br.y, | ||
...line, | ||
}} /> | ||
: | ||
null | ||
} | ||
{ | ||
ticks.map((tick, index) => { | ||
const { x, y, text } = tick; | ||
return ( | ||
<group> | ||
{ | ||
label ? | ||
<text attrs={{ | ||
x, | ||
y: y + labelOffset, | ||
textAlign: index === 0 ? 'start' : index === total - 1 ? 'end' : 'center', | ||
textBaseline: 'top', | ||
text, | ||
...label, | ||
}} /> | ||
: | ||
null | ||
} | ||
{ | ||
grid ? | ||
<line attrs={{ | ||
x1: x, | ||
y1: tl.y, | ||
x2: x, | ||
y2: bl.y, | ||
...grid, | ||
}} /> | ||
: | ||
null | ||
} | ||
{ | ||
tickLine ? | ||
<line attrs={{ | ||
x1: x, | ||
y1: bl.y, | ||
x2: x, | ||
y2: bl.y + (tickLine.length || 0), // 默认为0 | ||
...tickLine, | ||
}} /> | ||
: | ||
null | ||
} | ||
</group> | ||
); | ||
}) | ||
} | ||
</group> | ||
); | ||
} |
Oops, something went wrong.