-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests and a sample for radar scriptable line options (#6263)
* Add tests and a sample for radar scriptable line options * Improve image tests
- Loading branch information
Showing
53 changed files
with
918 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+9.57 KB
(150%)
test/fixtures/controller.radar/backgroundColor/scriptable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions
63
test/fixtures/controller.radar/borderCapStyle/scriptable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
module.exports = { | ||
config: { | ||
type: 'radar', | ||
data: { | ||
labels: [0, 1, 2], | ||
datasets: [ | ||
{ | ||
// option in dataset | ||
data: [null, 3, 3], | ||
borderCapStyle: function(ctx) { | ||
var index = (ctx.datasetIndex % 2); | ||
return index === 0 ? 'round' | ||
: index === 1 ? 'square' | ||
: 'butt'; | ||
} | ||
}, | ||
{ | ||
// option in element (fallback) | ||
data: [null, 2, 2] | ||
}, | ||
{ | ||
// option in element (fallback) | ||
data: [null, 1, 1] | ||
} | ||
] | ||
}, | ||
options: { | ||
legend: false, | ||
title: false, | ||
elements: { | ||
line: { | ||
borderCapStyle: function(ctx) { | ||
var index = (ctx.datasetIndex % 3); | ||
return index === 0 ? 'round' | ||
: index === 1 ? 'square' | ||
: 'butt'; | ||
}, | ||
borderColor: '#ff0000', | ||
borderWidth: 32, | ||
fill: false | ||
}, | ||
point: { | ||
radius: 10 | ||
} | ||
}, | ||
layout: { | ||
padding: 32 | ||
}, | ||
scale: { | ||
display: false, | ||
ticks: { | ||
beginAtZero: true | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
canvas: { | ||
height: 512, | ||
width: 512 | ||
} | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
module.exports = { | ||
config: { | ||
type: 'radar', | ||
data: { | ||
labels: [0, 1, 2], | ||
datasets: [ | ||
{ | ||
// option in dataset | ||
data: [null, 3, 3], | ||
borderCapStyle: 'round' | ||
}, | ||
{ | ||
// option in dataset | ||
data: [null, 2, 2], | ||
borderCapStyle: 'square' | ||
}, | ||
{ | ||
// option in element (fallback) | ||
data: [null, 1, 1] | ||
} | ||
] | ||
}, | ||
options: { | ||
legend: false, | ||
title: false, | ||
elements: { | ||
line: { | ||
borderCapStyle: 'butt', | ||
borderColor: '#00ff00', | ||
borderWidth: 32, | ||
fill: false | ||
}, | ||
point: { | ||
radius: 10 | ||
} | ||
}, | ||
layout: { | ||
padding: 32 | ||
}, | ||
scale: { | ||
display: false, | ||
ticks: { | ||
beginAtZero: true | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
canvas: { | ||
height: 512, | ||
width: 512 | ||
} | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.