Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(vx-stats): convert to docgen #716

Merged
merged 2 commits into from
May 22, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/vx-demo/src/components/ApiTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const alphaSort = (a: PropInfo, b: PropInfo) => a.name.localeCompare(b.name);
/** Renders a list of props for the passed docgenInfo */
export default function ApiTable({ docgenInfo }: Props) {
const { displayName } = docgenInfo;
const isComponent = (displayName[0] || '').toLowerCase() !== displayName[0];
const isComponent = (displayName[0] || '').toLowerCase() !== displayName[0] || '';
const anchorId = displayName;

// required first, then abc order
Expand Down
4 changes: 2 additions & 2 deletions packages/vx-demo/src/components/PackageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ export default function PackageList({
{!compact && <p>Visualize nodes and links between them</p>}
</li>
<li className={cx(emphasizePackage === 'stats' && 'emphasize')}>
<a href="/static/docs/vx-stats.html">@vx/stats</a>
{!compact && <p>Visualize distributions</p>}
<a href="/docs/stats">@vx/stats</a>
{!compact && <p>Common ways to visualize distributions</p>}
</li>
</ul>
</div>
Expand Down
14 changes: 14 additions & 0 deletions packages/vx-demo/src/pages/docs/Stats.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import StatsReadme from '!!raw-loader!../../../../vx-stats/Readme.md';
import BoxPlot from '../../../../vx-stats/src/BoxPlot';
import ViolinPlot from '../../../../vx-stats/src/ViolinPlot';
import DocPage from '../../components/DocPage';
import { DocGenInfo } from '../../types';

const components = [BoxPlot, ViolinPlot].map(
component =>
// @ts-ignore
component.__docgenInfo,
) as DocGenInfo[];

export default () => <DocPage components={components} readme={StatsReadme} vxPackage="stats" />;
96 changes: 0 additions & 96 deletions packages/vx-demo/src/static/docs/vx-stats.html

This file was deleted.

94 changes: 2 additions & 92 deletions packages/vx-stats/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,101 +4,11 @@
<img src="https://img.shields.io/npm/dm/@vx/stats.svg?style=flat-square" />
</a>

The package provides `react` components for visualizing distributions, such as Box Plots and Violin
Plots

## Installation

```
npm install --save @vx/stats
```


## Components



- [BoxPlot](#boxplot-)
- [ViolinPlot](#violinplot-)

## API



<h3 id="boxplot-">&lt;BoxPlot /&gt;</h3>



<a id="#BoxPlot__boxProps" name="BoxPlot__boxProps" href="#BoxPlot__boxProps">#</a> *BoxPlot*.**boxProps**&lt;object&gt; <table><tr><td><strong>Default</strong></td><td>{}</td></td></table>

<a id="#BoxPlot__boxWidth" name="BoxPlot__boxWidth" href="#BoxPlot__boxWidth">#</a> *BoxPlot*.**boxWidth**&lt;number&gt;

<a id="#BoxPlot__children" name="BoxPlot__children" href="#BoxPlot__children">#</a> *BoxPlot*.**children**&lt;func&gt;

<a id="#BoxPlot__className" name="BoxPlot__className" href="#BoxPlot__className">#</a> *BoxPlot*.**className**&lt;string&gt;

<a id="#BoxPlot__container" name="BoxPlot__container" href="#BoxPlot__container">#</a> *BoxPlot*.**container**&lt;bool&gt; <table><tr><td><strong>Default</strong></td><td>false</td></td></table>

<a id="#BoxPlot__containerProps" name="BoxPlot__containerProps" href="#BoxPlot__containerProps">#</a> *BoxPlot*.**containerProps**&lt;object&gt; <table><tr><td><strong>Default</strong></td><td>{}</td></td></table>

<a id="#BoxPlot__fill" name="BoxPlot__fill" href="#BoxPlot__fill">#</a> *BoxPlot*.**fill**&lt;string&gt;

<a id="#BoxPlot__fillOpacity" name="BoxPlot__fillOpacity" href="#BoxPlot__fillOpacity">#</a> *BoxPlot*.**fillOpacity**&lt;union(number|string)&gt;

<a id="#BoxPlot__firstQuartile" name="BoxPlot__firstQuartile" href="#BoxPlot__firstQuartile">#</a> *BoxPlot*.**firstQuartile**&lt;number&gt;

<a id="#BoxPlot__horizontal" name="BoxPlot__horizontal" href="#BoxPlot__horizontal">#</a> *BoxPlot*.**horizontal**&lt;bool&gt;

<a id="#BoxPlot__left" name="BoxPlot__left" href="#BoxPlot__left">#</a> *BoxPlot*.**left**&lt;number&gt; <table><tr><td><strong>Default</strong></td><td>0</td></td></table>

<a id="#BoxPlot__max" name="BoxPlot__max" href="#BoxPlot__max">#</a> *BoxPlot*.**max**&lt;number&gt;

<a id="#BoxPlot__maxProps" name="BoxPlot__maxProps" href="#BoxPlot__maxProps">#</a> *BoxPlot*.**maxProps**&lt;object&gt; <table><tr><td><strong>Default</strong></td><td>{}</td></td></table>

<a id="#BoxPlot__median" name="BoxPlot__median" href="#BoxPlot__median">#</a> *BoxPlot*.**median**&lt;number&gt;

<a id="#BoxPlot__medianProps" name="BoxPlot__medianProps" href="#BoxPlot__medianProps">#</a> *BoxPlot*.**medianProps**&lt;object&gt; <table><tr><td><strong>Default</strong></td><td>{}</td></td></table>

<a id="#BoxPlot__min" name="BoxPlot__min" href="#BoxPlot__min">#</a> *BoxPlot*.**min**&lt;number&gt;

<a id="#BoxPlot__minProps" name="BoxPlot__minProps" href="#BoxPlot__minProps">#</a> *BoxPlot*.**minProps**&lt;object&gt; <table><tr><td><strong>Default</strong></td><td>{}</td></td></table>

<a id="#BoxPlot__outlierProps" name="BoxPlot__outlierProps" href="#BoxPlot__outlierProps">#</a> *BoxPlot*.**outlierProps**&lt;object&gt; <table><tr><td><strong>Default</strong></td><td>{}</td></td></table>

<a id="#BoxPlot__outliers" name="BoxPlot__outliers" href="#BoxPlot__outliers">#</a> *BoxPlot*.**outliers**&lt;array&gt; <table><tr><td><strong>Default</strong></td><td>[]</td></td></table>

<a id="#BoxPlot__rx" name="BoxPlot__rx" href="#BoxPlot__rx">#</a> *BoxPlot*.**rx**&lt;number&gt; <table><tr><td><strong>Default</strong></td><td>2</td></td></table>

<a id="#BoxPlot__ry" name="BoxPlot__ry" href="#BoxPlot__ry">#</a> *BoxPlot*.**ry**&lt;number&gt; <table><tr><td><strong>Default</strong></td><td>2</td></td></table>

<a id="#BoxPlot__stroke" name="BoxPlot__stroke" href="#BoxPlot__stroke">#</a> *BoxPlot*.**stroke**&lt;string&gt;

<a id="#BoxPlot__strokeWidth" name="BoxPlot__strokeWidth" href="#BoxPlot__strokeWidth">#</a> *BoxPlot*.**strokeWidth**&lt;union(number|string)&gt;

<a id="#BoxPlot__thirdQuartile" name="BoxPlot__thirdQuartile" href="#BoxPlot__thirdQuartile">#</a> *BoxPlot*.**thirdQuartile**&lt;number&gt;

<a id="#BoxPlot__top" name="BoxPlot__top" href="#BoxPlot__top">#</a> *BoxPlot*.**top**&lt;number&gt; <table><tr><td><strong>Default</strong></td><td>0</td></td></table>

<a id="#BoxPlot__valueScale" name="BoxPlot__valueScale" href="#BoxPlot__valueScale">#</a> *BoxPlot*.**valueScale**&lt;func&gt;

<h3 id="violinplot-">&lt;ViolinPlot /&gt;</h3>



<a id="#ViolinPlot__children" name="ViolinPlot__children" href="#ViolinPlot__children">#</a> *ViolinPlot*.**children**&lt;func&gt;

<a id="#ViolinPlot__className" name="ViolinPlot__className" href="#ViolinPlot__className">#</a> *ViolinPlot*.**className**&lt;string&gt;

<a id="#ViolinPlot__count" name="ViolinPlot__count" href="#ViolinPlot__count">#</a> *ViolinPlot*.**count**&lt;func&gt; <table><tr><td><strong>Default</strong></td><td>d => d.count</td></td></table>

<a id="#ViolinPlot__data" name="ViolinPlot__data" href="#ViolinPlot__data">#</a> *ViolinPlot*.**data**&lt;array&gt; `required`

<a id="#ViolinPlot__horizontal" name="ViolinPlot__horizontal" href="#ViolinPlot__horizontal">#</a> *ViolinPlot*.**horizontal**&lt;bool&gt;

<a id="#ViolinPlot__left" name="ViolinPlot__left" href="#ViolinPlot__left">#</a> *ViolinPlot*.**left**&lt;number&gt; <table><tr><td><strong>Default</strong></td><td>0</td></td></table>

<a id="#ViolinPlot__top" name="ViolinPlot__top" href="#ViolinPlot__top">#</a> *ViolinPlot*.**top**&lt;number&gt; <table><tr><td><strong>Default</strong></td><td>0</td></td></table>

<a id="#ViolinPlot__value" name="ViolinPlot__value" href="#ViolinPlot__value">#</a> *ViolinPlot*.**value**&lt;func&gt; <table><tr><td><strong>Default</strong></td><td>d => d.value</td></td></table>

<a id="#ViolinPlot__valueScale" name="ViolinPlot__valueScale" href="#ViolinPlot__valueScale">#</a> *ViolinPlot*.**valueScale**&lt;func&gt;

<a id="#ViolinPlot__width" name="ViolinPlot__width" href="#ViolinPlot__width">#</a> *ViolinPlot*.**width**&lt;number&gt;
Loading