Storybook: Add story for Cross#3539
Conversation
|
@akamfoad Have a look at this example. After this is merged, when can see whether the component behaves the same after refactoring in storybook. Also, please do review this PR. I could not get the Cross to work without the Customized wrapper. |
|
|
||
| # Cross | ||
|
|
||
| TODO |
There was a problem hiding this comment.
The parent component would be Customzied and no child support.
|
|
||
| # Cross | ||
|
|
||
| TODO |
There was a problem hiding this comment.
| TODO | |
| ## Parent Component | |
| The Cross can be used in combination with `<Customized />` to render inside all charts that Customized can be used. Rendering `Cross` directly inside charts doesn't have any effect. | |
| You can use Cross with Customized like below: (please remove the `\` I added it to escape GitHub automatic matching) | |
| \```jsx | |
| <Customized component={<Cross {...crossProps} />}> | |
| \``` | |
| ## Child component | |
| The Cross component is a leaf component, it doesn't render anything as its child. | |
| ## Properties | |
| Properties in the groups Other and Internal are not recommended to be used. | |
There was a problem hiding this comment.
Strictly speaking, Customised also is not a parent component.
Example
<LineChart>
<Line/>
</LineChart>
Here LineChart is a parent of Line.
But Cross can not be used as such with Customised.
Really all the shapes are helper components to customise anything.
Example: One can use Rectangles to create custom bar shapes.
So I would argue, Cross has neither child nor parent.
There was a problem hiding this comment.
You're right, please feel free to dismiss the Parent components part.
Co-authored-by: Akam Foad <[email protected]>

Description
Strangely I could not get the cross to work without the Customized wrapper, although I do not even use what Customized provides, namely access to chart content.
Either way, this does work, all props are usable controls, and it documents the Cross component, lets iterate.
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: