-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: change order of the doc feat: implement PlotObject documentation closes : #29 closes : #30
- Loading branch information
1 parent
a8a7d9f
commit aed780c
Showing
29 changed files
with
448 additions
and
206 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Introduction | ||
|
||
import Intro from './Intro.demo.tsx'; | ||
|
||
You can add as many plots as you want in your application. Each plot is a container for all the components that will be displayed in it. you have two different ways to add a plot to your application: | ||
|
||
- **[Plot](./100_plot.md)** | ||
- **[PlotObject](./200_plotObject.md)** | ||
|
||
## Example | ||
|
||
<Intro/> |
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,22 @@ | ||
# PlotObject | ||
|
||
import PlotObjectDemo from './PlotObject.demo.tsx'; | ||
|
||
`PlotObject` is is responsible for rendering a plot on an SVG element. It takes as prop an object that defines the properties of the plot, such as the data to be plotted, the type of plot (e.g., line, bar, scatter), and various formatting options such as colors, line widths, and axis labels. | ||
|
||
<PlotObjectDemo/> | ||
|
||
this example render a simple line plot with the given data on the x and y axes. You can customize the appearance of the plot by passing additional props to the PlotObject component, such as colors, axis labels, and other formatting options. | ||
|
||
## Props | ||
|
||
### Mandatory | ||
|
||
- **plot:** Object that defines the properties of the plot to be rendered. <br /> | ||
type: [`PlotObjectPlot`](../500_types/200_plotObjectPlot.md) | ||
|
||
### Optional | ||
|
||
- **children:** React children to be rendered inside the plot. <br /> | ||
type: `ReactNode`<br /> | ||
default: `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,30 @@ | ||
import React from 'react'; | ||
import PlotDemo from './Plot.demo'; | ||
import PlotObjectDemo from './PlotObject.demo'; | ||
|
||
export default function Intro() { | ||
return ( | ||
<div style={{ display: 'flex', gap: '3rem' }}> | ||
<div | ||
style={{ | ||
alignItems: 'center', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
}} | ||
> | ||
<PlotDemo /> | ||
<h3>Plot component</h3> | ||
</div> | ||
<div | ||
style={{ | ||
alignItems: 'center', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
}} | ||
> | ||
<PlotObjectDemo /> | ||
<h3>PlotObject component</h3> | ||
</div> | ||
</div> | ||
); | ||
} |
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
2 changes: 1 addition & 1 deletion
2
docs/plot/PlotMargin.demo.tsx → docs/070_container/PlotMargin.demo.tsx
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,35 @@ | ||
import React from 'react'; | ||
import { Axis, LineSeries, Plot, PlotObject } from 'react-plot'; | ||
|
||
export default function PlotObjectDemo() { | ||
return ( | ||
<PlotObject | ||
plot={{ | ||
axes: [ | ||
{ type: 'main', position: 'bottom' }, | ||
{ type: 'main', position: 'left' }, | ||
], | ||
content: [ | ||
{ | ||
type: 'line', | ||
data: [ | ||
{ x: 1, y: 1 }, | ||
{ x: 2, y: 2 }, | ||
{ x: 3, y: 3 }, | ||
{ x: 4, y: 2 }, | ||
{ x: 5, y: 1 }, | ||
], | ||
}, | ||
], | ||
dimensions: { | ||
width: 300, | ||
height: 300, | ||
}, | ||
seriesViewportStyle: { | ||
stroke: 'black', | ||
strokeWidth: 1, | ||
}, | ||
}} | ||
/> | ||
); | ||
} |
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 @@ | ||
label: 'Container' |
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
Oops, something went wrong.