Skip to content

Commit aff47d3

Browse files
committed
fix: remove default for label baseline
The Vega specification appears to be incorrect here. The baseline default depends on axis orientation and likely other properties. --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 84b8a1a commit aff47d3

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

lib/node_modules/@stdlib/plot/vega/axis/ctor/lib/defaults.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ function defaults() {
6565
// Boolean indicating whether axis tick labels should be included as part of an axis:
6666
'labels': true,
6767

68-
// Vertical text baseline of axis tick labels:
69-
'labelBaseline': 'alphabetic',
70-
7168
// Boolean indicating whether to hide axis tick labels which exceed the axis range:
7269
'labelBound': false,
7370

lib/node_modules/@stdlib/plot/vega/axis/ctor/lib/label-baseline/get.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var prop = require( './properties.js' );
3131
* Returns the vertical baseline of axis tick labels.
3232
*
3333
* @private
34-
* @returns {string} vertical baseline
34+
* @returns {(void|string)} vertical baseline
3535
*/
3636
function get() {
3737
return this[ prop.private ];

lib/node_modules/@stdlib/plot/vega/axis/ctor/lib/label-baseline/set.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
var logger = require( 'debug' );
2626
var isVerticalBaseline = require( '@stdlib/plot/vega/base/assert/is-vertical-baseline' );
27+
var isUndefined = require( '@stdlib/assert/is-undefined' );
2728
var join = require( '@stdlib/array/base/join' );
2829
var verticalBaselines = require( '@stdlib/plot/vega/base/vertical-baselines' );
2930
var format = require( '@stdlib/string/format' );
@@ -42,12 +43,12 @@ var debug = logger( 'vega:axis:set:'+prop.name );
4243
* Sets the vertical baseline position of axis tick labels.
4344
*
4445
* @private
45-
* @param {string} value - input value
46+
* @param {(string|void)} value - input value
4647
* @throws {TypeError} must be a valid vertical baseline
4748
* @returns {void}
4849
*/
4950
function set( value ) {
50-
if ( !isVerticalBaseline( value ) ) {
51+
if ( !isVerticalBaseline( value ) && !isUndefined( value ) ) {
5152
throw new TypeError( format( 'invalid assignment. `%s` must be one of the following: "%s". Value: `%s`.', prop.name, join( verticalBaselines(), '", "' ), value ) );
5253
}
5354
if ( value !== this[ prop.private ] ) {

lib/node_modules/@stdlib/plot/vega/axis/ctor/lib/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,8 +723,7 @@ setReadWriteAccessor( Axis.prototype, 'labelAngle', getLabelAngle, setLabelAngle
723723
*
724724
* @name labelBaseline
725725
* @memberof Axis.prototype
726-
* @type {string}
727-
* @default 'alphabetic'
726+
* @type {(string|void)}
728727
*
729728
* @example
730729
* var axis = new Axis({

0 commit comments

Comments
 (0)