From: Jukka Kurkela Date: Mon, 22 Feb 2021 13:53:13 +0000 (+0200) Subject: Add linting of .mdx files + fix errors (#8496) X-Git-Tag: v3.0.0-beta.12~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=311292da7e818ccb1758679618d91d34254f1880;p=thirdparty%2FChart.js.git Add linting of .mdx files + fix errors (#8496) --- diff --git a/docs/docs/axes/cartesian/linear.mdx b/docs/docs/axes/cartesian/linear.mdx index 5d0af157d..ac1418389 100644 --- a/docs/docs/axes/cartesian/linear.mdx +++ b/docs/docs/axes/cartesian/linear.mdx @@ -24,9 +24,9 @@ Namespace: `options.scales[scaleId]` ## Tick Configuration -### Linear Axis specific options +### Linear Axis specific tick options -Namespace: `options.scales[scaleId]` +Namespace: `options.scales[scaleId].ticks` | Name | Type | Default | Description | ---- | ---- | ------- | ----------- diff --git a/docs/docs/axes/radial/linear.mdx b/docs/docs/axes/radial/linear.mdx index 9456c2dc5..47c57291f 100644 --- a/docs/docs/axes/radial/linear.mdx +++ b/docs/docs/axes/radial/linear.mdx @@ -26,7 +26,7 @@ Namespace: `options.scales[scaleId]` ## Tick Configuration -### Linear Radial Axis specific options +### Linear Radial Axis specific tick options Namespace: `options.scales[scaleId].ticks` diff --git a/docs/docs/charts/bar.mdx b/docs/docs/charts/bar.mdx index 1b65ab8fd..820c65670 100644 --- a/docs/docs/charts/bar.mdx +++ b/docs/docs/charts/bar.mdx @@ -176,7 +176,7 @@ The bar chart accepts the following configuration from the associated dataset op | `maxBarThickness` | `number` | | Set this to ensure that bars are not sized thicker than this. | `minBarLength` | `number` | | Set this to ensure that bars have a minimum length in pixels. -### Example Usage +### Example dataset configuration ```javascript data: { @@ -215,7 +215,7 @@ The bar chart sets unique default values for the following configuration from th | `offset` | `boolean` | `true` | If true, extra space is added to both edges and the axis is scaled to fit into the chart area. | `gridLines.offsetGridLines` | `boolean` | `true` | If true, the bars for a particular data point fall between the grid lines. The grid line will move to the left by one half of the tick interval. If false, the grid line will go right down the middle of the bars. [more...](#offsetgridlines) -### Example Usage +### Example scale configuration ```javascript options = { @@ -305,7 +305,7 @@ export const ExampleChart1 = () => { data: { labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], datasets: [{ - axis: 'y', + axis: 'y', label: 'My First Dataset', data: [65, 59, 80, 81, 56, 55, 40], fill: false, @@ -331,7 +331,7 @@ export const ExampleChart1 = () => { }] }, options: { - indexAxis: 'y', + indexAxis: 'y', scales: { x: { beginAtZero: true @@ -354,12 +354,12 @@ var myBarChart = new Chart(ctx, { type: 'bar', data: data, options: { - indexAxis: 'y' + indexAxis: 'y' } }); ``` -### Config Options +### Horizontal Bar Chart config Options The configuration options for the horizontal bar chart are the same as for the [bar chart](#scale-configuration). However, any options specified on the x-axis in a bar chart, are applied to the y-axis in a horizontal bar chart. diff --git a/docs/docs/charts/doughnut.mdx b/docs/docs/charts/doughnut.mdx index b2b69e30f..63abd025f 100644 --- a/docs/docs/charts/doughnut.mdx +++ b/docs/docs/charts/doughnut.mdx @@ -121,7 +121,6 @@ The doughnut/pie chart allows a number of properties to be specified for each da | `clip` | How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside chartArea. `0` = clip at chartArea. Clipping can also be configured per side: `clip: {left: 5, top: false, right: -2, bottom: 0}` | `rotation` | Per-dataset override for the starting angle to draw arcs from - ### Styling The style of each arc can be controlled with the following properties: @@ -139,6 +138,7 @@ All these values, if `undefined`, fallback to the associated [`elements.arc.*`]( ### Border Alignment The following values are supported for `borderAlign`. + * `'center'` (default) * `'inner'` diff --git a/docs/docs/charts/line.mdx b/docs/docs/charts/line.mdx index c6856e3cc..3b0e603ea 100644 --- a/docs/docs/charts/line.mdx +++ b/docs/docs/charts/line.mdx @@ -224,50 +224,50 @@ To achieve this you will have to set the `indexAxis` property in the options obj The default for this property is `'x'` and thus will show horizontal lines. export const ExampleChart1 = () => { - useEffect(() => { - const cfg = { - type: 'line', - data: { - labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], - datasets: [{ - axis: 'y', - label: 'My First Dataset', - data: [65, 59, 80, 81, 56, 55, 40], - fill: false, - backgroundColor: [ - 'rgba(255, 99, 132, 0.2)', - 'rgba(255, 159, 64, 0.2)', - 'rgba(255, 205, 86, 0.2)', - 'rgba(75, 192, 192, 0.2)', - 'rgba(54, 162, 235, 0.2)', - 'rgba(153, 102, 255, 0.2)', - 'rgba(201, 203, 207, 0.2)' - ], - borderColor: [ - 'rgb(255, 99, 132)', - 'rgb(255, 159, 64)', - 'rgb(255, 205, 86)', - 'rgb(75, 192, 192)', - 'rgb(54, 162, 235)', - 'rgb(153, 102, 255)', - 'rgb(201, 203, 207)' - ], - borderWidth: 1 - }] - }, - options: { - indexAxis: 'y', - scales: { - x: { - beginAtZero: true - } - } - } - }; - const chart = new Chart(document.getElementById('chartjs-1').getContext('2d'), cfg); - return () => chart.destroy(); - }); - return
; + useEffect(() => { + const cfg = { + type: 'line', + data: { + labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], + datasets: [{ + axis: 'y', + label: 'My First Dataset', + data: [65, 59, 80, 81, 56, 55, 40], + fill: false, + backgroundColor: [ + 'rgba(255, 99, 132, 0.2)', + 'rgba(255, 159, 64, 0.2)', + 'rgba(255, 205, 86, 0.2)', + 'rgba(75, 192, 192, 0.2)', + 'rgba(54, 162, 235, 0.2)', + 'rgba(153, 102, 255, 0.2)', + 'rgba(201, 203, 207, 0.2)' + ], + borderColor: [ + 'rgb(255, 99, 132)', + 'rgb(255, 159, 64)', + 'rgb(255, 205, 86)', + 'rgb(75, 192, 192)', + 'rgb(54, 162, 235)', + 'rgb(153, 102, 255)', + 'rgb(201, 203, 207)' + ], + borderWidth: 1 + }] + }, + options: { + indexAxis: 'y', + scales: { + x: { + beginAtZero: true + } + } + } + }; + const chart = new Chart(document.getElementById('chartjs-1').getContext('2d'), cfg); + return () => chart.destroy(); + }); + return
; } @@ -279,7 +279,7 @@ var myLineChart = new Chart(ctx, { type: 'line', data: data, options: { - indexAxis: 'y' + indexAxis: 'y' } }); ``` diff --git a/package.json b/package.json index fe987b98e..c58235a82 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "dev": "karma start --auto-watch --no-single-run --browsers chrome --grep", "docs": "cd docs && npm install && npm run build", "lint-js": "eslint \"samples/**/*.html\" \"samples/**/*.js\" \"src/**/*.js\" \"test/**/*.js\"", - "lint-md": "markdownlint-cli2 \"**/*.md\" \"#**/node_modules\"", + "lint-md": "markdownlint-cli2 \"**/*.md\" \"**/*.mdx\" \"#**/node_modules\"", "lint-tsc": "tsc", "lint-types": "eslint \"types/**/*.d.ts\" && tsc -p types/tests/", "lint": "concurrently \"npm:lint-*\"",