Skip to content

Commit 2851a94

Browse files
authored
Migrate from GitBook to Docusaurus (#7295)
Migrate from GitBook to Docusaurus
1 parent 29f6c67 commit 2851a94

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+14877
-6428
lines changed

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ jobs:
4949
gulp test --coverage ${BROWSERS}
5050
- name: Package
5151
run: |
52-
gulp docs
52+
npm run docs
53+
npm run typedoc
5354
gulp package
5455
- name: Publish Test Results
5556
run: cat ./coverage/lcov.info | ./node_modules/.bin/coveralls

.gitignore

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
1-
/_book
21
/coverage
32
/custom
43
/dist
54
/docs/index.md
65
/gh-pages
76
/jsdoc
8-
/node_modules
9-
.DS_Store
107
.idea
118
.project
129
.settings
1310
.vscode
1411
*.log
1512
*.swp
1613
*.stackdump
14+
build
15+
16+
node_modules
17+
npm-debug.log*
18+
19+
.docusaurus
20+
.cache-loader
21+
22+
.DS_Store
23+
.env.local
24+
.env.development.local
25+
.env.test.local
26+
.env.production.local

.travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ services:
1111
script:
1212
- gulp build
1313
- gulp test --coverage
14-
- gulp docs
14+
- ./scripts/docs-config.sh
15+
- npm run docs
16+
- npm run typedoc
1517
- gulp package
1618
- cat ./coverage/lcov.info | ./node_modules/.bin/coveralls || true
1719

book.json

-32
This file was deleted.

docs/README.md

+33-63
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,33 @@
1-
# Chart.js
2-
3-
[![slack](https://img.shields.io/badge/slack-chartjs-blue.svg?style=flat-square&maxAge=3600)](https://chartjs-slack.herokuapp.com/)
4-
5-
## Installation
6-
7-
You can download the latest version of Chart.js from the [GitHub releases](https://github.com/chartjs/Chart.js/releases/latest) or use a [Chart.js CDN](https://www.jsdelivr.com/package/npm/chart.js). Detailed installation instructions can be found on the [installation](./getting-started/installation.md) page.
8-
9-
## Creating a Chart
10-
11-
It's easy to get started with Chart.js. All that's required is the script included in your page along with a single `<canvas>` node to render the chart.
12-
13-
In this example, we create a bar chart for a single dataset and render that in our page. You can see all the ways to use Chart.js in the [usage documentation](./getting-started/usage.md).
14-
```html
15-
<canvas id="myChart" width="400" height="400"></canvas>
16-
<script>
17-
var ctx = document.getElementById('myChart').getContext('2d');
18-
var myChart = new Chart(ctx, {
19-
type: 'bar',
20-
data: {
21-
labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
22-
datasets: [{
23-
label: '# of Votes',
24-
data: [12, 19, 3, 5, 2, 3],
25-
backgroundColor: [
26-
'rgba(255, 99, 132, 0.2)',
27-
'rgba(54, 162, 235, 0.2)',
28-
'rgba(255, 206, 86, 0.2)',
29-
'rgba(75, 192, 192, 0.2)',
30-
'rgba(153, 102, 255, 0.2)',
31-
'rgba(255, 159, 64, 0.2)'
32-
],
33-
borderColor: [
34-
'rgba(255, 99, 132, 1)',
35-
'rgba(54, 162, 235, 1)',
36-
'rgba(255, 206, 86, 1)',
37-
'rgba(75, 192, 192, 1)',
38-
'rgba(153, 102, 255, 1)',
39-
'rgba(255, 159, 64, 1)'
40-
],
41-
borderWidth: 1
42-
}]
43-
},
44-
options: {
45-
scales: {
46-
y: {
47-
beginAtZero: true
48-
}
49-
}
50-
}
51-
});
52-
</script>
53-
```
54-
55-
## Contributing
56-
57-
Before submitting an issue or a pull request to the project, please take a moment to look over the [contributing guidelines](./developers/contributing.md) first.
58-
59-
For support using Chart.js, please post questions with the [`chartjs` tag on Stack Overflow](https://stackoverflow.com/questions/tagged/chartjs).
60-
61-
## License
62-
63-
Chart.js is available under the [MIT license](https://opensource.org/licenses/MIT).
1+
# Website
2+
3+
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ npm install
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ npm run start
15+
```
16+
17+
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ npm run build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
```
30+
$ GIT_USER=<Your GitHub username> USE_SSH=true npm run deploy
31+
```
32+
33+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

docs/SUMMARY.md

-60
This file was deleted.

docs/charts/README.md

-14
This file was deleted.

docs/docs/README.md

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: Chart.js
3+
---
4+
5+
[![slack](https://img.shields.io/badge/slack-chartjs-blue.svg?style=flat-square&maxAge=3600)](https://chartjs-slack.herokuapp.com/)
6+
7+
## Installation
8+
9+
You can download the latest version of Chart.js from the [GitHub releases](https://github.com/chartjs/Chart.js/releases/latest) or use a [Chart.js CDN](https://www.jsdelivr.com/package/npm/chart.js). Detailed installation instructions can be found on the [installation](./getting-started/installation.md) page.
10+
11+
## Creating a Chart
12+
13+
It's easy to get started with Chart.js. All that's required is the script included in your page along with a single `<canvas>` node to render the chart.
14+
15+
In this example, we create a bar chart for a single dataset and render that in our page. You can see all the ways to use Chart.js in the [usage documentation](./getting-started/usage.md).
16+
```html
17+
<canvas id="myChart" width="400" height="400"></canvas>
18+
<script>
19+
var ctx = document.getElementById('myChart').getContext('2d');
20+
var myChart = new Chart(ctx, {
21+
type: 'bar',
22+
data: {
23+
labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
24+
datasets: [{
25+
label: '# of Votes',
26+
data: [12, 19, 3, 5, 2, 3],
27+
backgroundColor: [
28+
'rgba(255, 99, 132, 0.2)',
29+
'rgba(54, 162, 235, 0.2)',
30+
'rgba(255, 206, 86, 0.2)',
31+
'rgba(75, 192, 192, 0.2)',
32+
'rgba(153, 102, 255, 0.2)',
33+
'rgba(255, 159, 64, 0.2)'
34+
],
35+
borderColor: [
36+
'rgba(255, 99, 132, 1)',
37+
'rgba(54, 162, 235, 1)',
38+
'rgba(255, 206, 86, 1)',
39+
'rgba(75, 192, 192, 1)',
40+
'rgba(153, 102, 255, 1)',
41+
'rgba(255, 159, 64, 1)'
42+
],
43+
borderWidth: 1
44+
}]
45+
},
46+
options: {
47+
scales: {
48+
y: {
49+
beginAtZero: true
50+
}
51+
}
52+
}
53+
});
54+
</script>
55+
```
56+
57+
## Contributing
58+
59+
Before submitting an issue or a pull request to the project, please take a moment to look over the [contributing guidelines](./developers/contributing.md) first.
60+
61+
For support using Chart.js, please post questions with the [`chartjs` tag on Stack Overflow](https://stackoverflow.com/questions/tagged/chartjs).
62+
63+
## License
64+
65+
Chart.js is available under the [MIT license](https://opensource.org/licenses/MIT).

docs/axes/README.md renamed to docs/docs/axes/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Axes
1+
---
2+
title: Axes
3+
---
24

35
Axes are an integral part of a chart. They are used to determine how data maps to a pixel value on the chart. In a cartesian chart, there is 1 or more X axis and 1 or more Y axis to map points onto the 2 dimensional canvas. These axes are known as ['cartesian axes'](./cartesian/README.md#cartesian-axes).
46

docs/axes/cartesian/README.md renamed to docs/docs/axes/cartesian/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Cartesian Axes
1+
---
2+
title: Cartesian Axes
3+
---
24

35
Axes that follow a cartesian grid are known as 'Cartesian Axes'. Cartesian axes are used for line, bar, and bubble charts. Four cartesian axes are included in Chart.js by default.
46

docs/axes/cartesian/category.md renamed to docs/docs/axes/cartesian/category.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Category Cartesian Axis
1+
---
2+
title: Category Axis
3+
---
24

35
If global configuration is used, labels are drawn from one of the label arrays included in the chart data. If only `data.labels` is defined, this will be used. If `data.xLabels` is defined and the axis is horizontal, this will be used. Similarly, if `data.yLabels` is defined and the axis is vertical, this property will be used. Using both `xLabels` and `yLabels` together can create a chart that uses strings for both the X and Y axes.
46

docs/axes/cartesian/linear.md renamed to docs/docs/axes/cartesian/linear.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Linear Cartesian Axis
1+
---
2+
title: Linear Axis
3+
---
24

35
The linear scale is use to chart numerical data. It can be placed on either the x or y axis. The scatter chart type automatically configures a line chart to use one of these scales for the x axis. As the name suggests, linear interpolation is used to determine where a value lies on the axis.
46

docs/axes/cartesian/logarithmic.md renamed to docs/docs/axes/cartesian/logarithmic.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Logarithmic Cartesian Axis
1+
---
2+
title: Logarithmic Axis
3+
---
24

35
The logarithmic scale is use to chart numerical data. It can be placed on either the x or y axis. As the name suggests, logarithmic interpolation is used to determine where a value lies on the axis.
46

docs/axes/cartesian/time.md renamed to docs/docs/axes/cartesian/time.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Time Cartesian Axis
1+
---
2+
title: Time Cartesian Axis
3+
---
24

35
The time scale is used to display times and dates. When building its ticks, it will automatically calculate the most comfortable unit base on the size of the scale.
46

docs/axes/labelling.md renamed to docs/docs/axes/labelling.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Labeling Axes
1+
---
2+
title: Labeling Axes
3+
---
24

35
When creating a chart, you want to tell the viewer what data they are viewing. To do this, you need to label the axis.
46

docs/axes/radial/README.md renamed to docs/docs/axes/radial/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Radial Axes
1+
---
2+
title: Radial Axes
3+
---
24

35
Radial axes are used specifically for the radar and polar area chart types. These axes overlay the chart area, rather than being positioned on one of the edges. One radial axis is included by default in Chart.js.
46

docs/axes/radial/linear.md renamed to docs/docs/axes/radial/linear.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Linear Radial Axis
1+
---
2+
title: Linear Radial Axis
3+
---
24

35
The linear scale is used to chart numerical data. As the name suggests, linear interpolation is used to determine where a value lies in relation the center of the axis.
46

0 commit comments

Comments
 (0)