]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Rename lineTension back to tension (#7978)
authorJukka Kurkela <jukka.kurkela@gmail.com>
Sat, 31 Oct 2020 12:54:14 +0000 (14:54 +0200)
committerGitHub <noreply@github.com>
Sat, 31 Oct 2020 12:54:14 +0000 (14:54 +0200)
24 files changed:
docs/docs/charts/line.mdx
docs/docs/charts/radar.mdx
docs/docs/getting-started/v3-migration.md
samples/charts/line/interpolation-modes.html
samples/scales/financial.html
src/controllers/controller.line.js
src/controllers/controller.radar.js
test/fixtures/element.line/skip/all.js
test/fixtures/element.line/skip/first-span.js
test/fixtures/element.line/skip/first.js
test/fixtures/element.line/skip/last-span.js
test/fixtures/element.line/skip/last.js
test/fixtures/element.line/skip/middle-span.js
test/fixtures/element.line/skip/middle.js
test/fixtures/element.line/stepped/after.js
test/fixtures/element.line/stepped/before.js
test/fixtures/element.line/stepped/default.js
test/fixtures/element.line/stepped/middle.js
test/fixtures/element.line/tension/one.js
test/fixtures/element.line/tension/zero.js
test/fixtures/plugin.filler/fill-line-dataset-interpolated.js
test/fixtures/scale.timeseries/financial-daily.js
test/specs/controller.line.tests.js
test/specs/controller.radar.tests.js

index 65edb6127c4a41fdc3e52190be1ec3d99badf6c3..8ee843a8ab27cd1ce63cddb32056f49c5b525042 100644 (file)
@@ -25,7 +25,7 @@ export const ExampleChart = () => {
           data: [65, 59, 80, 81, 56, 55, 40],
           fill: false,
           borderColor: 'rgb(75, 192, 192)',
-          lineTension: 0.1
+          tension: 0.1
         }]
       },
       options: {
@@ -72,7 +72,7 @@ The line chart allows a number of properties to be specified for each dataset. T
 | [`hoverBorderJoinStyle`](#line-styling) | `string` | Yes | - | `undefined`
 | [`hoverBorderWidth`](#line-styling) | `number` | Yes | - | `undefined`
 | [`label`](#general) | `string` | - | - | `''`
-| [`lineTension`](#line-styling) | `number` | - | - | `0`
+| [`tension`](#line-styling) | `number` | - | - | `0`
 | [`order`](#general) | `number` | - | - | `0`
 | [`pointBackgroundColor`](#point-styling) | `Color` | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
 | [`pointBorderColor`](#point-styling) | `Color` | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
@@ -131,7 +131,7 @@ The style of the line can be controlled with the following properties:
 | `borderJoinStyle` | Line joint style. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin).
 | `borderWidth` | The line width (in pixels).
 | `fill` | How to fill the area under the line. See [area charts](area.md).
-| `lineTension` | Bezier curve tension of the line. Set to 0 to draw straightlines. This option is ignored if monotone cubic interpolation is used.
+| `tension` | Bezier curve tension of the line. Set to 0 to draw straightlines. This option is ignored if monotone cubic interpolation is used.
 | `showLine` | If false, the line is not drawn for this dataset.
 | `spanGaps` | If true, lines will be drawn between points with no or null data. If false, points with `NaN` data will create a break in the line. Can also be a number specifying the maximum gap length to span. The unit of the value depends on the scale used.
 
@@ -171,7 +171,7 @@ The following values are supported for `stepped`.
 * `'after'`: Step-after Interpolation
 * `'middle'`: Step-middle Interpolation
 
-If the `stepped` value is set to anything other than false, `lineTension` will be ignored.
+If the `stepped` value is set to anything other than false, `tension` will be ignored.
 
 ## Configuration Options
 
index 9086aed4fa1ded1c30ab8082003bfba2d97c752a..2c305a2fe8edcafad55255e8327cca65179c4662 100644 (file)
@@ -96,7 +96,7 @@ The radar chart allows a number of properties to be specified for each dataset.
 | [`fill`](#line-styling) | <code>boolean&#124;string</code> | Yes | - | `true`
 | [`label`](#general) | `string` | - | - | `''`
 | [`order`](#general) | `number` | - | - | `0`
-| [`lineTension`](#line-styling) | `number` | - | - | `0`
+| [`tension`](#line-styling) | `number` | - | - | `0`
 | [`pointBackgroundColor`](#point-styling) | `Color` | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
 | [`pointBorderColor`](#point-styling) | `Color` | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
 | [`pointBorderWidth`](#point-styling) | `number` | Yes | Yes | `1`
@@ -148,7 +148,7 @@ The style of the line can be controlled with the following properties:
 | `borderJoinStyle` | Line joint style. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin).
 | `borderWidth` | The line width (in pixels).
 | `fill` | How to fill the area under the line. See [area charts](area.md).
-| `lineTension` | Bezier curve tension of the line. Set to 0 to draw straight lines.
+| `tension` | Bezier curve tension of the line. Set to 0 to draw straight lines.
 | `spanGaps` | If true, lines will be drawn between points with no or null data. If false, points with `NaN` data will create a break in the line.
 
 If the value is `undefined`, `spanGaps` fallback to the associated [chart configuration options](#configuration-options). The rest of the values fallback to the associated [`elements.line.*`](../configuration/elements.md#line-configuration) options.
index 8e908567806a7b74a843f25369b2721630ad0bd1..907390b85d5ecda9d3a3969196c6cf1ca896e4c9 100644 (file)
@@ -90,7 +90,6 @@ A number of changes were made to the configuration options passed to the `Chart`
 * `scales.[x/y]Axes.time.min` was renamed to `scales[id].min`
 * `scales.[x/y]Axes.zeroLine*` options of axes were removed. Use scriptable scale options instead.
 * The dataset option `steppedLine` was removed. Use `stepped`
-* The dataset option `tension` was removed. Use `lineTension`
 * The chart option `showLines` was renamed to `showLine` to match the dataset option.
 * Dataset options are now configured as `options[type].datasets` rather than `options.datasets[type]`
 * To override the platform class used in a chart instance, pass `platform: PlatformClass` in the config object. Note that the class should be passed, not an instance of the class.
index f6154539dcbac9b84a1dcbaa7bcd74be6d6e3bf0..6a7550f54ca5706ae47801fdab0d8de14b9b278f 100644 (file)
@@ -51,7 +51,7 @@
                                        borderColor: window.chartColors.green,
                                        backgroundColor: 'rgba(0, 0, 0, 0)',
                                        fill: false,
-                                       lineTension: 0
+                                       tension: 0
                                }]
                        },
                        options: {
index 425f1657f47171da3d1deb4f0a30f1b1ee122cf6..7b1a83bce020f9f8990fb4f85c603a81b1fa6910 100644 (file)
                                        type: 'line',
                                        pointRadius: 0,
                                        fill: false,
-                                       lineTension: 0,
+                                       tension: 0,
                                        borderWidth: 2
                                }]
                        },
index c59b2df89658d6f5affe4997a763e47e8b8b504a..c3ecf7991ae4358c857da0be2ab63a4b62863a6c 100644 (file)
@@ -93,7 +93,7 @@ export default class LineController extends DatasetController {
                // to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158
                // This option gives lines the ability to span gaps
                values.spanGaps = valueOrDefault(config.spanGaps, options.spanGaps);
-               values.tension = valueOrDefault(config.lineTension, lineOptions.tension);
+               values.tension = valueOrDefault(config.tension, lineOptions.tension);
                values.stepped = resolve([config.stepped, lineOptions.stepped]);
 
                if (!showLine) {
index 6dfb3b5ccb8a8a88ba36c301986b7ab176c46877..9c81e08e216c541aecc9fbaad65e07ca89dfe7e5 100644 (file)
@@ -79,7 +79,7 @@ export default class RadarController extends DatasetController {
                const showLine = valueOrDefault(config.showLine, options.showLine);
 
                values.spanGaps = valueOrDefault(config.spanGaps, options.spanGaps);
-               values.tension = valueOrDefault(config.lineTension, options.elements.line.tension);
+               values.tension = valueOrDefault(config.tension, options.elements.line.tension);
 
                if (!showLine) {
                        values.borderWidth = 0;
index dd313913c36dbae0e183a75f693064dc9ab7bd32..89cbe98e73af1eeaa71aa3b2b29f1e44e250006e 100644 (file)
@@ -7,7 +7,7 @@ module.exports = {
                                        data: [{x: 0, y: NaN}, {x: NaN, y: 0}, {x: NaN, y: -10}, {x: 19, y: NaN}],
                                        borderColor: 'red',
                                        fill: true,
-                                       lineTension: 0
+                                       tension: 0
                                }
                        ]
                },
index c0ac21a6757acf9845408998bdfe7e02325056f5..f2afa7f456144475bbc4ca4360583357cbe1b70a 100644 (file)
@@ -8,7 +8,7 @@ module.exports = {
                                        borderColor: 'red',
                                        fill: true,
                                        spanGaps: true,
-                                       lineTension: 0
+                                       tension: 0
                                }
                        ]
                },
index ec2f9b5087f3bcee09e02bd53bb7a32fd061ee83..bdab6c83d05f4cb1975a4cab043f2376ee03ec49 100644 (file)
@@ -7,7 +7,7 @@ module.exports = {
                                        data: [{x: NaN, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
                                        borderColor: 'red',
                                        fill: true,
-                                       lineTension: 0
+                                       tension: 0
                                }
                        ]
                },
index b038232f97f35733756e362ca09b369c8085b4bf..d05226a30ba4c1debc6edf0309f1d32f2dbe26fb 100644 (file)
@@ -8,7 +8,7 @@ module.exports = {
                                        borderColor: 'red',
                                        fill: true,
                                        spanGaps: true,
-                                       lineTension: 0
+                                       tension: 0
                                }
                        ]
                },
index 7ffcac2111f298b6dd1a8d57c58d0ae1b27dce10..5afe55fc1dd5c55ac26fb3e6ea1d3bf70cd337f1 100644 (file)
@@ -7,7 +7,7 @@ module.exports = {
                                        data: [{x: 0, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: NaN, y: -5}],
                                        borderColor: 'red',
                                        fill: true,
-                                       lineTension: 0
+                                       tension: 0
                                }
                        ]
                },
index 52ecb1fe3da0e3165e48f18c8e134a0391668530..990731370dc6facb8c6bbb8361a18be087c2c8ab 100644 (file)
@@ -8,7 +8,7 @@ module.exports = {
                                        borderColor: 'red',
                                        fill: true,
                                        spanGaps: true,
-                                       lineTension: 0
+                                       tension: 0
                                }
                        ]
                },
index 8e312604e6a0633c9a7844a2519c1744caba1db3..9128fbb9de9fa9b9c5b6f33f1e575a569bd818bb 100644 (file)
@@ -7,7 +7,7 @@ module.exports = {
                                        data: [{x: 0, y: 10}, {x: 5, y: 0}, {x: NaN, y: -10}, {x: 19, y: -5}],
                                        borderColor: 'red',
                                        fill: true,
-                                       lineTension: 0
+                                       tension: 0
                                }
                        ]
                },
index 5bf19f80d0a6752d901df9662f4579c9027ef1cb..43462374864986e89c04dc490b7331965f375aa0 100644 (file)
@@ -7,7 +7,7 @@ module.exports = {
                                        data: [{x: 1, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
                                        borderColor: 'red',
                                        fill: false,
-                                       lineTension: 0,
+                                       tension: 0,
                                        stepped: 'after'
                                }
                        ]
index f12f6a2466f8b5f9e50f05189f0f844ade7fecc9..1d483b9b2e7618bd718310a8de679f6167a976c0 100644 (file)
@@ -7,7 +7,7 @@ module.exports = {
                                        data: [{x: 1, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
                                        borderColor: 'red',
                                        fill: false,
-                                       lineTension: 0,
+                                       tension: 0,
                                        stepped: 'before'
                                }
                        ]
index b2bfd3a5368b89f7441401a17596a640815014ec..f907158fdae044c9fcbc9f69affc1b37376373e4 100644 (file)
@@ -7,7 +7,7 @@ module.exports = {
                                        data: [{x: 1, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
                                        borderColor: 'red',
                                        fill: false,
-                                       lineTension: 0,
+                                       tension: 0,
                                        stepped: true
                                }
                        ]
index bdcda092c9c7f770c35647000abd2b0abe0daeb4..58ad4edf822b90a667cae63a123a314403c42625 100644 (file)
@@ -7,7 +7,7 @@ module.exports = {
                                        data: [{x: 1, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
                                        borderColor: 'red',
                                        fill: false,
-                                       lineTension: 0,
+                                       tension: 0,
                                        stepped: 'middle'
                                }
                        ]
index 144c98a24a1a9c63a17abb6b053222311954967d..0631023a79088ae655e9741b92be608db84c30dc 100644 (file)
@@ -7,7 +7,7 @@ module.exports = {
                                        data: [{x: 1, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
                                        borderColor: 'red',
                                        fill: false,
-                                       lineTension: 1
+                                       tension: 1
                                }
                        ]
                },
index 31d7165b93bfebfe295be77adc9a74052bb311e5..7e738a73963889105a5375f3b269128a6d1703fd 100644 (file)
@@ -7,7 +7,7 @@ module.exports = {
                                        data: [{x: 1, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
                                        borderColor: 'red',
                                        fill: false,
-                                       lineTension: 0
+                                       tension: 0
                                }
                        ]
                },
index d0b26190e65f47980ff13323439aba37d5539749..bfba6fd72d6eb89a495a7fd75066e3a614c753a4 100644 (file)
@@ -43,7 +43,7 @@ module.exports = {
                        title: false,
                        line: {
                                datasets: {
-                                       lineTension: 0.4,
+                                       tension: 0.4,
                                        borderWidth: 1,
                                        pointRadius: 1.5,
                                }
index fab4328fda6a2edcd4874992bb925b17957cf3fa..49ef34654b8d62d0e6760a8317222c7a8a7810c3 100644 (file)
@@ -9,7 +9,7 @@ module.exports = {
                                type: 'line',
                                pointRadius: 0,
                                fill: false,
-                               lineTension: 0,
+                               tension: 0,
                                borderWidth: 2
                        }]
                },
index f8249261d2df6511e77aa31dde9f04409cce3839..fa2e87eb1d5d530cd765fef32f9184f494a8ee5e 100644 (file)
@@ -512,7 +512,7 @@ describe('Chart.controllers.line', function() {
 
                        Chart.helpers.merge(Chart.defaults.controllers.line.datasets, {
                                spanGaps: true,
-                               lineTension: 0.231,
+                               tension: 0.231,
                                backgroundColor: '#add',
                                borderWidth: '#daa',
                                borderColor: '#dad',
@@ -555,7 +555,7 @@ describe('Chart.controllers.line', function() {
 
                        Chart.helpers.merge(Chart.defaults.controllers.line.datasets, {
                                spanGaps: true,
-                               lineTension: 0.231
+                               tension: 0.231
                        });
 
                        var chart = window.acquireChart({
@@ -572,7 +572,7 @@ describe('Chart.controllers.line', function() {
                                options: {
                                        line: {
                                                datasets: {
-                                                       lineTension: 0.345,
+                                                       tension: 0.345,
                                                        backgroundColor: '#add'
                                                }
                                        }
@@ -604,7 +604,7 @@ describe('Chart.controllers.line', function() {
                                line: {
                                        datasets: {
                                                spanGaps: true,
-                                               lineTension: 0.231,
+                                               tension: 0.231,
                                                backgroundColor: '#add',
                                                borderWidth: '#daa',
                                                borderColor: '#dad',
@@ -642,7 +642,7 @@ describe('Chart.controllers.line', function() {
                                        data: [0, 0],
                                        label: 'dataset1',
                                        spanGaps: true,
-                                       lineTension: 0.231,
+                                       tension: 0.231,
                                        backgroundColor: '#add',
                                        borderWidth: '#daa',
                                        borderColor: '#dad',
index 4660cd23987c87dd68b72cc1d99ad02bd9f6e89e..c343bbd72a6d97f94d4be1e2335f51117c7872df 100644 (file)
@@ -174,7 +174,7 @@ describe('Chart.controllers.radar', function() {
                });
 
                // Use dataset level styles for lines & points
-               chart.data.datasets[0].lineTension = 0;
+               chart.data.datasets[0].tension = 0;
                chart.data.datasets[0].backgroundColor = 'rgb(98, 98, 98)';
                chart.data.datasets[0].borderColor = 'rgb(8, 8, 8)';
                chart.data.datasets[0].borderWidth = 0.55;