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

feat(docs): use gatsby-theme-patternfly-org #3146

Merged
merged 36 commits into from
Oct 18, 2019
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3445c73
replace '## (.*)\njs title=' in md files
redallen Oct 7, 2019
9fd69f2
chore(docs): replaced spaces with dashes in MD files where js title=T…
evwilkin Oct 7, 2019
bf8d5bf
examples are rendering
redallen Oct 8, 2019
7331abb
Add ## Examples for table of contents
redallen Oct 8, 2019
4f396d1
add example titles
redallen Oct 8, 2019
bed30f9
bump plugin
redallen Oct 9, 2019
7fcd955
fix(docs): created example folders for all components & updated scss …
evwilkin Oct 9, 2019
4172225
added title with withOuia and hiddenPages to gatsby-config
evwilkin Oct 10, 2019
a6895ce
Moved experimental docs into examples directories
evwilkin Oct 10, 2019
526806e
fix build in patternfly-react
redallen Oct 11, 2019
1f7cdc6
fix theme
redallen Oct 11, 2019
514c487
Update component titles
jessiehuff Oct 14, 2019
e5a96f3
Update titles in layout, experimental, etc
jessiehuff Oct 14, 2019
9ebb3cf
Missed one file
jessiehuff Oct 14, 2019
3bc82a9
Switch and Text update
jessiehuff Oct 14, 2019
38c0c0f
fix copyStyles for submodule in submodule
redallen Oct 14, 2019
0510b89
don't let gatsby use eslint
redallen Oct 15, 2019
9dd008e
bump theme version
evwilkin Oct 15, 2019
beaba5d
fix PageLayout demos
redallen Oct 15, 2019
51eee72
fix icons page
redallen Oct 15, 2019
c785d04
merge origin/master
redallen Oct 15, 2019
d6bb1a9
bump versions
redallen Oct 15, 2019
59a20df
bump yarn.lock
redallen Oct 15, 2019
1b07d18
Refactor chart docs for new theme
redallen Oct 16, 2019
d27f1a3
chore(docs): fixed hyphenated titles and converted scss to css for la…
evwilkin Oct 16, 2019
5854420
Merge branch 'gatsby-theme-patternfly-org' of github.com:patternfly/p…
evwilkin Oct 16, 2019
2eb8041
charts titles, remove sass
redallen Oct 16, 2019
bfbb88c
Chart content consistency
redallen Oct 17, 2019
4717d5c
bump theme
redallen Oct 17, 2019
1019735
Merge remote-tracking branch 'upstream/master' into gatsby-theme-patt…
redallen Oct 17, 2019
b01c4fa
fix script syntax
redallen Oct 17, 2019
a73b09b
tweak upload script
redallen Oct 17, 2019
ed566ce
Remove missing prop components
redallen Oct 17, 2019
cb3befe
Update ChartBullet.md
redallen Oct 17, 2019
e8d37c7
use good gatsby+react version
redallen Oct 17, 2019
467a161
Merge remote-tracking branch 'upstream/master' into gatsby-theme-patt…
redallen Oct 18, 2019
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
9 changes: 6 additions & 3 deletions .circleci/upload-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
USERNAME=${CIRCLE_PROJECT_USERNAME}
REPONAME=${CIRCLE_PROJECT_REPONAME}
PR_NUM=${CIRCLE_PR_NUMBER}
PR_BRANCH=${CIRCLE_BRANCH}

if [ -n "${PR_NUM}" ] # If build is a PR
then
# Domain names follow the RFC1123 spec [a-Z] [0-9] [-] limited to 253 characters
# https://en.wikipedia.org/wiki/Domain_Name_System#Domain_name_syntax
# So, just replace "/" or "." with "-"
DEPLOY_SUBDOMAIN=`echo "${REPONAME}-pr-$PR_NUM" | tr '[\/|\.]' '-' | cut -c1-253`
ALREADY_DEPLOYED=`npx surge list | grep ${DEPLOY_SUBDOMAIN}`
else
DEPLOY_SUBDOMAIN=`echo "${REPONAME}-pr-${PR_NUM}" | tr '[\/|\.]' '-' | cut -c1-253`
elif [ "${PR_BRANCH}" = "master" ]
DEPLOY_SUBDOMAIN=${REPONAME}
else
DEPLOY_SUBDOMAIN=`echo "${REPONAME}-pr-${PR_BRANCH}" | tr '[\/|\.]' '-' | cut -c1-253`
fi

ALREADY_DEPLOYED=`npx surge list | grep ${DEPLOY_SUBDOMAIN}`
DEPLOY_DOMAIN="https://${DEPLOY_SUBDOMAIN}.surge.sh"
npx surge --project docs --domain $DEPLOY_DOMAIN;

Expand Down
6 changes: 6 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
title: Release notes
section: root
hideTOC: true
---

# 2019.08 release notes (2019-10-01)
Packages released:
- [@patternfly/react-charts@5.0.13](https://www.npmjs.com/package/@patternfly/react-charts/v/5.0.13)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
title: 'Area'
section: 'charts'
typescript: true
propComponents:
[
'Chart',
'ChartAreaProps',
'ChartAxis',
'ChartGroup',
'ChartThreshold',
'ChartVoronoiContainer',
]
propComponents: [
'Chart',
'ChartAreaProps',
'ChartAxis',
'ChartGroup',
'ChartThreshold',
'ChartVoronoiContainer',
]
---

import { Chart, ChartArea, ChartAxis, ChartGroup, ChartThreshold, ChartThemeColor, ChartThemeVariant, ChartVoronoiContainer } from '@patternfly/react-charts';
import '@patternfly/patternfly/patternfly-charts.css';
import './chart-area.scss';

## Introduction
Note: PatternFly React charts live in its own package at [@patternfly/react-charts](https://www.npmjs.com/package/@patternfly/react-charts)!

PatternFly React charts are based on the [Victory](https://formidable.com/open-source/victory/docs/victory-chart/) chart library, along with additional functionality, custom components, and theming for PatternFly. This provides a collection of React based components you can use to build PatternFly patterns with consistent markup, styling, and behavior.
Expand All @@ -25,14 +24,14 @@ Learn to build an area chart using a Katacoda tutorial starting with a simple ch

[Start course](https://katacoda.com/patternfly/courses/charts/area-chart)

## Simple area chart with right aligned legend
```js
## Examples
```js title=Right--aligned-legend
redallen marked this conversation as resolved.
Show resolved Hide resolved
import React from 'react';
import { Chart, ChartArea, ChartAxis, ChartGroup, ChartVoronoiContainer } from '@patternfly/react-charts';
// import '@patternfly/patternfly/patternfly-charts.css'; // Required for mix-blend-mode CSS property

<div>
<div className="area-chart-legend-right">
RightAlignedLegend = (
<div style={{ height: '200px', width: '800px' }}>
<Chart
ariaDesc="Average number of pets"
ariaTitle="Area chart example"
Expand Down Expand Up @@ -85,17 +84,16 @@ import { Chart, ChartArea, ChartAxis, ChartGroup, ChartVoronoiContainer } from '
</ChartGroup>
</Chart>
</div>
</div>
)
```

## Cyan area chart with bottom aligned legend and axis label
redallen marked this conversation as resolved.
Show resolved Hide resolved
```js
```js title=Cyan-bottom--aligned-legend-and-axis-label
redallen marked this conversation as resolved.
Show resolved Hide resolved
import React from 'react';
import { Chart, ChartArea, ChartAxis, ChartGroup, ChartThemeColor } from '@patternfly/react-charts';
// import '@patternfly/patternfly/patternfly-charts.css'; // Required for mix-blend-mode CSS property

<div>
<div className="area-chart-legend-bottom">
BottomAlignedLegend = (
<div style={{ height: '250px', width: '650px' }}>
<Chart
ariaDesc="Average number of pets"
ariaTitle="Area chart example"
Expand Down Expand Up @@ -148,11 +146,10 @@ import { Chart, ChartArea, ChartAxis, ChartGroup, ChartThemeColor } from '@patte
</ChartGroup>
</Chart>
</div>
</div>
)
```

## Multi-color (unorderd) chart with bottom-left aligned legend and responsive container
```js
```js title=Multi--color-(unordered)-bottom--left--aligned-legend-and-responsive-container
redallen marked this conversation as resolved.
Show resolved Hide resolved
import React from 'react';
import { Chart, ChartArea, ChartAxis, ChartGroup, ChartThemeColor } from '@patternfly/react-charts';
// import '@patternfly/patternfly/patternfly-charts.css'; // Required for mix-blend-mode CSS property
Expand Down Expand Up @@ -184,75 +181,71 @@ class MultiColorChart extends React.Component {
const { width } = this.state;

return (
<div ref={this.containerRef}>
<div className="area-chart-legend-bottom-responsive">
<Chart
ariaDesc="Average number of pets"
ariaTitle="Area chart example"
containerComponent={<ChartVoronoiContainer labels={({ datum }) => `${datum.name}: ${datum.y}`} constrainToVisibleArea />}
legendData={[{ name: 'Cats' }, { name: 'Dogs' }, { name: 'Birds' }]}
legendPosition="bottom-left"
height={225}
padding={{
bottom: 75, // Adjusted to accommodate legend
left: 50,
right: 50,
top: 50,
}}
maxDomain={{y: 9}}
themeColor={ChartThemeColor.multiUnordered}
width={width}
>
<ChartAxis />
<ChartAxis dependentAxis showGrid />
<ChartGroup>
<ChartArea
data={[
{ name: 'Cats', x: '2015', y: 3 },
{ name: 'Cats', x: '2016', y: 4 },
{ name: 'Cats', x: '2017', y: 8 },
{ name: 'Cats', x: '2018', y: 6 }
]}
interpolation="basis"
/>
<ChartArea
data={[
{ name: 'Dogs', x: '2015', y: 2 },
{ name: 'Dogs', x: '2016', y: 3 },
{ name: 'Dogs', x: '2017', y: 4 },
{ name: 'Dogs', x: '2018', y: 5 },
{ name: 'Dogs', x: '2019', y: 6 }
]}
interpolation="basis"
/>
<ChartArea
data={[
{ name: 'Birds', x: '2015', y: 1 },
{ name: 'Birds', x: '2016', y: 2 },
{ name: 'Birds', x: '2017', y: 3 },
{ name: 'Birds', x: '2018', y: 2 },
{ name: 'Birds', x: '2019', y: 4 }
]}
interpolation="basis"
/>
</ChartGroup>
</Chart>
</div>
<div ref={this.containerRef} style={{ height: '250px' }}>
redallen marked this conversation as resolved.
Show resolved Hide resolved
<Chart
ariaDesc="Average number of pets"
ariaTitle="Area chart example"
containerComponent={<ChartVoronoiContainer labels={({ datum }) => `${datum.name}: ${datum.y}`} constrainToVisibleArea />}
legendData={[{ name: 'Cats' }, { name: 'Dogs' }, { name: 'Birds' }]}
legendPosition="bottom-left"
height={225}
padding={{
bottom: 75, // Adjusted to accommodate legend
left: 50,
right: 50,
top: 50,
}}
maxDomain={{y: 9}}
themeColor={ChartThemeColor.multiUnordered}
width={width}
>
<ChartAxis />
<ChartAxis dependentAxis showGrid />
<ChartGroup>
<ChartArea
data={[
{ name: 'Cats', x: '2015', y: 3 },
{ name: 'Cats', x: '2016', y: 4 },
{ name: 'Cats', x: '2017', y: 8 },
{ name: 'Cats', x: '2018', y: 6 }
]}
interpolation="basis"
/>
<ChartArea
data={[
{ name: 'Dogs', x: '2015', y: 2 },
{ name: 'Dogs', x: '2016', y: 3 },
{ name: 'Dogs', x: '2017', y: 4 },
{ name: 'Dogs', x: '2018', y: 5 },
{ name: 'Dogs', x: '2019', y: 6 }
]}
interpolation="basis"
/>
<ChartArea
data={[
{ name: 'Birds', x: '2015', y: 1 },
{ name: 'Birds', x: '2016', y: 2 },
{ name: 'Birds', x: '2017', y: 3 },
{ name: 'Birds', x: '2018', y: 2 },
{ name: 'Birds', x: '2019', y: 4 }
]}
interpolation="basis"
/>
</ChartGroup>
</Chart>
</div>
);
}
}
```

## Tips

## Documentation
- See Victory's [FAQ](https://formidable.com/open-source/victory/docs/faq)
- For single data points or zero values, you may want to set the `domain` prop
- `ChartLegend` may be used as a standalone component, instead of using `legendData`
- The `theme` and `themeColor` props should be applied at the most top level component
- Use `ChartGroup` to apply theme color scales and other properties to multiple components

## Docs
Currently, the generated documention below is not able to resolve type definitions from Victory imports. For the
components used in the examples above, Victory pass-thru props are also documented here:

Expand Down

This file was deleted.

Loading