-
Notifications
You must be signed in to change notification settings - Fork 730
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #399 from hshoff/harry-docgen
[docs] generate api docs from prop-types, sync to website
- Loading branch information
Showing
219 changed files
with
12,745 additions
and
5,164 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 |
---|---|---|
@@ -1,59 +1,93 @@ | ||
# @vx/annotation | ||
|
||
<p> | ||
<a title="@vx/annotation npm downloads" href="https://www.npmjs.com/package/@vx/annotation"> | ||
<img src="https://img.shields.io/npm/dm/@vx/annotation.svg?style=flat-square" /> | ||
</a> | ||
</p> | ||
|
||
**Status** | ||
|
||
We recommend using [react-annotation](http://react-annotation.susielu.com/) by @susielu. This package is a work in progress. In the future we may make some helpers built on top of react-annotation. | ||
|
||
|
||
## Installation | ||
|
||
``` | ||
npm install --save @vx/annotation | ||
``` | ||
|
||
## LinePathAnnotation | ||
|
||
Line Path Annotations add a bit of text and a line coming from a point. They're useful for adding info to your graphs. | ||
|
||
``` javascript | ||
import { LinePathAnnotation } from '@vx/annotation'; | ||
// or | ||
// import * as Annotation from '@vx/annotation'; | ||
// <Annotation.LinePathAnnotation /> | ||
|
||
const annotation = ( | ||
<LinePathAnnotation | ||
label={'expected from deploy'} | ||
stroke={'white'} | ||
labelFill={'white'} | ||
labelStroke={'none'} | ||
labelStrokeWidth={2} | ||
points={[ | ||
annotationPoint, | ||
new Point({ | ||
x: annotationPoint.x + (width / allData.length), | ||
y: annotationPoint.y - (height / allData.length), | ||
}) | ||
]} | ||
/> | ||
); | ||
``` | ||
|
||
 | ||
|
||
## Properties | ||
|
||
| Name | Default | Type | Description | | ||
|:-------------------- |:---------- |:------ |:------------------------------------------------------------------------------------------------------ | | ||
| top | 0 | number | Margin on top | | ||
| left | 0 | number | Margin on left | | ||
| points | | array | Points describing the line path | | ||
| stroke | black | string | The color of the line | | ||
| strokeWidth | 1 | number | The pixel width of the line | | ||
| className | | string | The class name associated of the LinePath shape | | ||
| label | | string | The text for your label | | ||
| labelAnchor | left | string | The label's textAnchor | | ||
| labelDx | 0 | number | The x-coordinate shift to the label | | ||
| labelDy | 0 | number | The y-coordinate shift to the label | | ||
| labelFill | <stroke> | string | The color of label. Defaults to the stroke color | | ||
| labelFontSize | 10 | number | The font size of the label text | | ||
| labelStroke | white | string | The color of the label | | ||
| labelStrokeWidth | 3 | number | The stroke width of the label text | | ||
| labelPaintOrder | stroke | string | The label's SVG [paint-order](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/paint-order). | | ||
## Components | ||
|
||
|
||
|
||
- [LinePathAnnotation](#linepathannotation-) | ||
|
||
## API | ||
|
||
|
||
|
||
<h3 id="linepathannotation-"><LinePathAnnotation /></h3> | ||
|
||
|
||
|
||
<a id="#LinePathAnnotation__className" name="LinePathAnnotation__className" href="#LinePathAnnotation__className">#</a> *LinePathAnnotation*.**className**<string> | ||
|
||
Add a class name to the line path. | ||
|
||
<a id="#LinePathAnnotation__label" name="LinePathAnnotation__label" href="#LinePathAnnotation__label">#</a> *LinePathAnnotation*.**label**<string> | ||
|
||
The text for your label. | ||
|
||
<a id="#LinePathAnnotation__labelAnchor" name="LinePathAnnotation__labelAnchor" href="#LinePathAnnotation__labelAnchor">#</a> *LinePathAnnotation*.**labelAnchor**<enum('start'|'middle'|'end')> | ||
|
||
The label's textAnchor. <table><tr><td><strong>Default</strong></td><td>'middle'</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelDx" name="LinePathAnnotation__labelDx" href="#LinePathAnnotation__labelDx">#</a> *LinePathAnnotation*.**labelDx**<number> | ||
|
||
The x-coordinate shift to the label. <table><tr><td><strong>Default</strong></td><td>0</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelDy" name="LinePathAnnotation__labelDy" href="#LinePathAnnotation__labelDy">#</a> *LinePathAnnotation*.**labelDy**<number> | ||
|
||
The y-coordinate shift to the label <table><tr><td><strong>Default</strong></td><td>0</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelFill" name="LinePathAnnotation__labelFill" href="#LinePathAnnotation__labelFill">#</a> *LinePathAnnotation*.**labelFill**<string> | ||
|
||
The color of label. Defaults to *props*.**stroke**. | ||
|
||
<a id="#LinePathAnnotation__labelFontSize" name="LinePathAnnotation__labelFontSize" href="#LinePathAnnotation__labelFontSize">#</a> *LinePathAnnotation*.**labelFontSize**<number> | ||
|
||
The font size of the label text. <table><tr><td><strong>Default</strong></td><td>10</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelPaintOrder" name="LinePathAnnotation__labelPaintOrder" href="#LinePathAnnotation__labelPaintOrder">#</a> *LinePathAnnotation*.**labelPaintOrder**<string> | ||
|
||
The label's SVG [paint-order](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/paint-order). <table><tr><td><strong>Default</strong></td><td>'stroke'</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelStroke" name="LinePathAnnotation__labelStroke" href="#LinePathAnnotation__labelStroke">#</a> *LinePathAnnotation*.**labelStroke**<string> | ||
|
||
The color of the label. <table><tr><td><strong>Default</strong></td><td>'white'</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelStrokeWidth" name="LinePathAnnotation__labelStrokeWidth" href="#LinePathAnnotation__labelStrokeWidth">#</a> *LinePathAnnotation*.**labelStrokeWidth**<number> | ||
|
||
The stroke width of the label text. <table><tr><td><strong>Default</strong></td><td>3</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__left" name="LinePathAnnotation__left" href="#LinePathAnnotation__left">#</a> *LinePathAnnotation*.**left**<number> | ||
|
||
A left pixel offset applied to the entire bar group. <table><tr><td><strong>Default</strong></td><td>0</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__points" name="LinePathAnnotation__points" href="#LinePathAnnotation__points">#</a> *LinePathAnnotation*.**points**<array> | ||
|
||
An array of points describing the line path. <table><tr><td><strong>Default</strong></td><td>[]</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__stroke" name="LinePathAnnotation__stroke" href="#LinePathAnnotation__stroke">#</a> *LinePathAnnotation*.**stroke**<string> | ||
|
||
The color of the line. <table><tr><td><strong>Default</strong></td><td>'black'</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__strokeWidth" name="LinePathAnnotation__strokeWidth" href="#LinePathAnnotation__strokeWidth">#</a> *LinePathAnnotation*.**strokeWidth**<number> | ||
|
||
The pixel width of the line. <table><tr><td><strong>Default</strong></td><td>1</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__top" name="LinePathAnnotation__top" href="#LinePathAnnotation__top">#</a> *LinePathAnnotation*.**top**<number> | ||
|
||
A top pixel offset applied to the entire bar group. <table><tr><td><strong>Default</strong></td><td>0</td></td></table> |
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,63 @@ | ||
<h3 id="linepathannotation-"><LinePathAnnotation /></h3> | ||
|
||
|
||
|
||
<a id="#LinePathAnnotation__className" name="LinePathAnnotation__className" href="#LinePathAnnotation__className">#</a> *LinePathAnnotation*.**className**<string> | ||
|
||
Add a class name to the line path. | ||
|
||
<a id="#LinePathAnnotation__label" name="LinePathAnnotation__label" href="#LinePathAnnotation__label">#</a> *LinePathAnnotation*.**label**<string> | ||
|
||
The text for your label. | ||
|
||
<a id="#LinePathAnnotation__labelAnchor" name="LinePathAnnotation__labelAnchor" href="#LinePathAnnotation__labelAnchor">#</a> *LinePathAnnotation*.**labelAnchor**<enum('start'|'middle'|'end')> | ||
|
||
The label's textAnchor. <table><tr><td><strong>Default</strong></td><td>'middle'</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelDx" name="LinePathAnnotation__labelDx" href="#LinePathAnnotation__labelDx">#</a> *LinePathAnnotation*.**labelDx**<number> | ||
|
||
The x-coordinate shift to the label. <table><tr><td><strong>Default</strong></td><td>0</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelDy" name="LinePathAnnotation__labelDy" href="#LinePathAnnotation__labelDy">#</a> *LinePathAnnotation*.**labelDy**<number> | ||
|
||
The y-coordinate shift to the label <table><tr><td><strong>Default</strong></td><td>0</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelFill" name="LinePathAnnotation__labelFill" href="#LinePathAnnotation__labelFill">#</a> *LinePathAnnotation*.**labelFill**<string> | ||
|
||
The color of label. Defaults to *props*.**stroke**. | ||
|
||
<a id="#LinePathAnnotation__labelFontSize" name="LinePathAnnotation__labelFontSize" href="#LinePathAnnotation__labelFontSize">#</a> *LinePathAnnotation*.**labelFontSize**<number> | ||
|
||
The font size of the label text. <table><tr><td><strong>Default</strong></td><td>10</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelPaintOrder" name="LinePathAnnotation__labelPaintOrder" href="#LinePathAnnotation__labelPaintOrder">#</a> *LinePathAnnotation*.**labelPaintOrder**<string> | ||
|
||
The label's SVG [paint-order](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/paint-order). <table><tr><td><strong>Default</strong></td><td>'stroke'</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelStroke" name="LinePathAnnotation__labelStroke" href="#LinePathAnnotation__labelStroke">#</a> *LinePathAnnotation*.**labelStroke**<string> | ||
|
||
The color of the label. <table><tr><td><strong>Default</strong></td><td>'white'</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelStrokeWidth" name="LinePathAnnotation__labelStrokeWidth" href="#LinePathAnnotation__labelStrokeWidth">#</a> *LinePathAnnotation*.**labelStrokeWidth**<number> | ||
|
||
The stroke width of the label text. <table><tr><td><strong>Default</strong></td><td>3</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__left" name="LinePathAnnotation__left" href="#LinePathAnnotation__left">#</a> *LinePathAnnotation*.**left**<number> | ||
|
||
A left pixel offset applied to the entire bar group. <table><tr><td><strong>Default</strong></td><td>0</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__points" name="LinePathAnnotation__points" href="#LinePathAnnotation__points">#</a> *LinePathAnnotation*.**points**<array> | ||
|
||
An array of points describing the line path. <table><tr><td><strong>Default</strong></td><td>[]</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__stroke" name="LinePathAnnotation__stroke" href="#LinePathAnnotation__stroke">#</a> *LinePathAnnotation*.**stroke**<string> | ||
|
||
The color of the line. <table><tr><td><strong>Default</strong></td><td>'black'</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__strokeWidth" name="LinePathAnnotation__strokeWidth" href="#LinePathAnnotation__strokeWidth">#</a> *LinePathAnnotation*.**strokeWidth**<number> | ||
|
||
The pixel width of the line. <table><tr><td><strong>Default</strong></td><td>1</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__top" name="LinePathAnnotation__top" href="#LinePathAnnotation__top">#</a> *LinePathAnnotation*.**top**<number> | ||
|
||
A top pixel offset applied to the entire bar group. <table><tr><td><strong>Default</strong></td><td>0</td></td></table> |
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,11 @@ | ||
# @vx/annotation | ||
|
||
<p> | ||
<a title="@vx/annotation npm downloads" href="https://www.npmjs.com/package/@vx/annotation"> | ||
<img src="https://img.shields.io/npm/dm/@vx/annotation.svg?style=flat-square" /> | ||
</a> | ||
</p> | ||
|
||
**Status** | ||
|
||
We recommend using [react-annotation](http://react-annotation.susielu.com/) by @susielu. This package is a work in progress. In the future we may make some helpers built on top of react-annotation. |
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,93 @@ | ||
# @vx/annotation | ||
|
||
<p> | ||
<a title="@vx/annotation npm downloads" href="https://www.npmjs.com/package/@vx/annotation"> | ||
<img src="https://img.shields.io/npm/dm/@vx/annotation.svg?style=flat-square" /> | ||
</a> | ||
</p> | ||
|
||
**Status** | ||
|
||
We recommend using [react-annotation](http://react-annotation.susielu.com/) by @susielu. This package is a work in progress. In the future we may make some helpers built on top of react-annotation. | ||
|
||
|
||
## Installation | ||
|
||
``` | ||
npm install --save @vx/annotation | ||
``` | ||
|
||
|
||
## Components | ||
|
||
|
||
|
||
- [LinePathAnnotation](#linepathannotation-) | ||
|
||
## API | ||
|
||
|
||
|
||
<h3 id="linepathannotation-"><LinePathAnnotation /></h3> | ||
|
||
|
||
|
||
<a id="#LinePathAnnotation__className" name="LinePathAnnotation__className" href="#LinePathAnnotation__className">#</a> *LinePathAnnotation*.**className**<string> | ||
|
||
Add a class name to the line path. | ||
|
||
<a id="#LinePathAnnotation__label" name="LinePathAnnotation__label" href="#LinePathAnnotation__label">#</a> *LinePathAnnotation*.**label**<string> | ||
|
||
The text for your label. | ||
|
||
<a id="#LinePathAnnotation__labelAnchor" name="LinePathAnnotation__labelAnchor" href="#LinePathAnnotation__labelAnchor">#</a> *LinePathAnnotation*.**labelAnchor**<enum('start'|'middle'|'end')> | ||
|
||
The label's textAnchor. <table><tr><td><strong>Default</strong></td><td>'middle'</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelDx" name="LinePathAnnotation__labelDx" href="#LinePathAnnotation__labelDx">#</a> *LinePathAnnotation*.**labelDx**<number> | ||
|
||
The x-coordinate shift to the label. <table><tr><td><strong>Default</strong></td><td>0</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelDy" name="LinePathAnnotation__labelDy" href="#LinePathAnnotation__labelDy">#</a> *LinePathAnnotation*.**labelDy**<number> | ||
|
||
The y-coordinate shift to the label <table><tr><td><strong>Default</strong></td><td>0</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelFill" name="LinePathAnnotation__labelFill" href="#LinePathAnnotation__labelFill">#</a> *LinePathAnnotation*.**labelFill**<string> | ||
|
||
The color of label. Defaults to *props*.**stroke**. | ||
|
||
<a id="#LinePathAnnotation__labelFontSize" name="LinePathAnnotation__labelFontSize" href="#LinePathAnnotation__labelFontSize">#</a> *LinePathAnnotation*.**labelFontSize**<number> | ||
|
||
The font size of the label text. <table><tr><td><strong>Default</strong></td><td>10</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelPaintOrder" name="LinePathAnnotation__labelPaintOrder" href="#LinePathAnnotation__labelPaintOrder">#</a> *LinePathAnnotation*.**labelPaintOrder**<string> | ||
|
||
The label's SVG [paint-order](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/paint-order). <table><tr><td><strong>Default</strong></td><td>'stroke'</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelStroke" name="LinePathAnnotation__labelStroke" href="#LinePathAnnotation__labelStroke">#</a> *LinePathAnnotation*.**labelStroke**<string> | ||
|
||
The color of the label. <table><tr><td><strong>Default</strong></td><td>'white'</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__labelStrokeWidth" name="LinePathAnnotation__labelStrokeWidth" href="#LinePathAnnotation__labelStrokeWidth">#</a> *LinePathAnnotation*.**labelStrokeWidth**<number> | ||
|
||
The stroke width of the label text. <table><tr><td><strong>Default</strong></td><td>3</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__left" name="LinePathAnnotation__left" href="#LinePathAnnotation__left">#</a> *LinePathAnnotation*.**left**<number> | ||
|
||
A left pixel offset applied to the entire bar group. <table><tr><td><strong>Default</strong></td><td>0</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__points" name="LinePathAnnotation__points" href="#LinePathAnnotation__points">#</a> *LinePathAnnotation*.**points**<array> | ||
|
||
An array of points describing the line path. <table><tr><td><strong>Default</strong></td><td>[]</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__stroke" name="LinePathAnnotation__stroke" href="#LinePathAnnotation__stroke">#</a> *LinePathAnnotation*.**stroke**<string> | ||
|
||
The color of the line. <table><tr><td><strong>Default</strong></td><td>'black'</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__strokeWidth" name="LinePathAnnotation__strokeWidth" href="#LinePathAnnotation__strokeWidth">#</a> *LinePathAnnotation*.**strokeWidth**<number> | ||
|
||
The pixel width of the line. <table><tr><td><strong>Default</strong></td><td>1</td></td></table> | ||
|
||
<a id="#LinePathAnnotation__top" name="LinePathAnnotation__top" href="#LinePathAnnotation__top">#</a> *LinePathAnnotation*.**top**<number> | ||
|
||
A top pixel offset applied to the entire bar group. <table><tr><td><strong>Default</strong></td><td>0</td></td></table> |
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 @@ | ||
## Installation | ||
|
||
``` | ||
npm install --save @vx/annotation | ||
``` |
Oops, something went wrong.