Skip to content

Commit 2bdec56

Browse files
committed
feat: add support for remaining tick 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 aff47d3 commit 2bdec56

File tree

23 files changed

+1138
-1
lines changed

23 files changed

+1138
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var prop = require( './properties.js' );
3232

3333
// VARIABLES //
3434

35-
var debug = logger( 'vega:title:set:'+prop.name );
35+
var debug = logger( 'vega:axis:set:'+prop.name );
3636

3737

3838
// MAIN //

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

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,22 @@ var getTickDash = require( './tick-dash/get.js' );
147147
var setTickDash = require( './tick-dash/set.js' );
148148
var getTickDashOffset = require( './tick-dash-offset/get.js' );
149149
var setTickDashOffset = require( './tick-dash-offset/set.js' );
150+
var getTickExtra = require( './tick-extra/get.js' );
151+
var setTickExtra = require( './tick-extra/set.js' );
152+
var getTickMinStep = require( './tick-min-step/get.js' );
153+
var setTickMinStep = require( './tick-min-step/set.js' );
154+
var getTickOffset = require( './tick-offset/get.js' );
155+
var setTickOffset = require( './tick-offset/set.js' );
156+
var getTickOpacity = require( './tick-opacity/get.js' );
157+
var setTickOpacity = require( './tick-opacity/set.js' );
158+
var getTickRound = require( './tick-round/get.js' );
159+
var setTickRound = require( './tick-round/set.js' );
150160
var getTicks = require( './ticks/get.js' );
151161
var setTicks = require( './ticks/set.js' );
162+
var getTickSize = require( './tick-size/get.js' );
163+
var setTickSize = require( './tick-size/set.js' );
164+
var getTickWidth = require( './tick-width/get.js' );
165+
var setTickWidth = require( './tick-width/set.js' );
152166

153167
var getTitle = require( './title/get.js' );
154168
var setTitle = require( './title/set.js' );
@@ -1295,6 +1309,102 @@ setReadWriteAccessor( Axis.prototype, 'tickDash', getTickDash, setTickDash );
12951309
*/
12961310
setReadWriteAccessor( Axis.prototype, 'tickDashOffset', getTickDashOffset, setTickDashOffset );
12971311

1312+
/**
1313+
* Boolean indicating whether an extra axis tick mark should be added for the initial position of an axis.
1314+
*
1315+
* @name tickExtra
1316+
* @memberof Axis.prototype
1317+
* @type {(boolean|void)}
1318+
*
1319+
* @example
1320+
* var axis = new Axis({
1321+
* 'scale': 'xScale',
1322+
* 'orient': 'bottom',
1323+
* 'tickExtra': true
1324+
* });
1325+
*
1326+
* var v = axis.tickExtra;
1327+
* // returns true
1328+
*/
1329+
setReadWriteAccessor( Axis.prototype, 'tickExtra', getTickExtra, setTickExtra );
1330+
1331+
/**
1332+
* Minimum desired step between axis tick marks in terms of axis scale domain values.
1333+
*
1334+
* @name tickMinStep
1335+
* @memberof Axis.prototype
1336+
* @type {(number|void)}
1337+
*
1338+
* @example
1339+
* var axis = new Axis({
1340+
* 'scale': 'xScale',
1341+
* 'orient': 'bottom',
1342+
* 'tickMinStep': 10
1343+
* });
1344+
*
1345+
* var v = axis.tickMinStep;
1346+
* // returns 10
1347+
*/
1348+
setReadWriteAccessor( Axis.prototype, 'tickMinStep', getTickMinStep, setTickMinStep );
1349+
1350+
/**
1351+
* Position offset (in pixels) to apply to axis tick marks, labels, and gridlines.
1352+
*
1353+
* @name tickOffset
1354+
* @memberof Axis.prototype
1355+
* @type {(number|void)}
1356+
*
1357+
* @example
1358+
* var axis = new Axis({
1359+
* 'scale': 'xScale',
1360+
* 'orient': 'bottom',
1361+
* 'tickOffset': 5
1362+
* });
1363+
*
1364+
* var v = axis.tickOffset;
1365+
* // returns 5
1366+
*/
1367+
setReadWriteAccessor( Axis.prototype, 'tickOffset', getTickOffset, setTickOffset );
1368+
1369+
/**
1370+
* Opacity of axis tick marks.
1371+
*
1372+
* @name tickOpacity
1373+
* @memberof Axis.prototype
1374+
* @type {number}
1375+
* @default 1.0
1376+
*
1377+
* @example
1378+
* var axis = new Axis({
1379+
* 'scale': 'xScale',
1380+
* 'orient': 'bottom',
1381+
* 'tickOpacity': 0.5
1382+
* });
1383+
*
1384+
* var v = axis.tickOpacity;
1385+
* // returns 0.5
1386+
*/
1387+
setReadWriteAccessor( Axis.prototype, 'tickOpacity', getTickOpacity, setTickOpacity );
1388+
1389+
/**
1390+
* Boolean indicating whether pixel position values should be rounded to the nearest integer.
1391+
*
1392+
* @name tickRound
1393+
* @memberof Axis.prototype
1394+
* @type {(boolean|void)}
1395+
*
1396+
* @example
1397+
* var axis = new Axis({
1398+
* 'scale': 'xScale',
1399+
* 'orient': 'bottom',
1400+
* 'tickRound': true
1401+
* });
1402+
*
1403+
* var v = axis.tickRound;
1404+
* // returns true
1405+
*/
1406+
setReadWriteAccessor( Axis.prototype, 'tickRound', getTickRound, setTickRound );
1407+
12981408
/**
12991409
* Boolean indicating whether axis tick marks should be included as part of the axis.
13001410
*
@@ -1315,6 +1425,44 @@ setReadWriteAccessor( Axis.prototype, 'tickDashOffset', getTickDashOffset, setTi
13151425
*/
13161426
setReadWriteAccessor( Axis.prototype, 'ticks', getTicks, setTicks );
13171427

1428+
/**
1429+
* Length (in pixels) of axis tick marks.
1430+
*
1431+
* @name tickSize
1432+
* @memberof Axis.prototype
1433+
* @type {(NonNegativeNumber|void)}
1434+
*
1435+
* @example
1436+
* var axis = new Axis({
1437+
* 'scale': 'xScale',
1438+
* 'orient': 'bottom',
1439+
* 'tickSize': 10
1440+
* });
1441+
*
1442+
* var v = axis.tickSize;
1443+
* // returns 10
1444+
*/
1445+
setReadWriteAccessor( Axis.prototype, 'tickSize', getTickSize, setTickSize );
1446+
1447+
/**
1448+
* Width (in pixels) of axis tick marks.
1449+
*
1450+
* @name tickWidth
1451+
* @memberof Axis.prototype
1452+
* @type {(NonNegativeNumber|void)}
1453+
*
1454+
* @example
1455+
* var axis = new Axis({
1456+
* 'scale': 'xScale',
1457+
* 'orient': 'bottom',
1458+
* 'tickWidth': 2
1459+
* });
1460+
*
1461+
* var v = axis.tickWidth;
1462+
* // returns 2
1463+
*/
1464+
setReadWriteAccessor( Axis.prototype, 'tickWidth', getTickWidth, setTickWidth );
1465+
13181466
/**
13191467
* Axis title.
13201468
*
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/* eslint-disable no-invalid-this */
20+
21+
'use strict';
22+
23+
// MODULES //
24+
25+
var prop = require( './properties.js' );
26+
27+
28+
// MAIN //
29+
30+
/**
31+
* Returns a boolean indicating whether an extra axis tick mark should be added for the initial position of an axis.
32+
*
33+
* @private
34+
* @returns {(boolean|void)} boolean flag
35+
*/
36+
function get() {
37+
return this[ prop.private ];
38+
}
39+
40+
41+
// EXPORTS //
42+
43+
module.exports = get;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var property2object = require( '@stdlib/plot/vega/base/property2object' );
24+
25+
26+
// MAIN //
27+
28+
var obj = property2object( 'tickExtra' );
29+
30+
31+
// EXPORTS //
32+
33+
module.exports = obj;
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/* eslint-disable no-invalid-this */
20+
21+
'use strict';
22+
23+
// MODULES //
24+
25+
var logger = require( 'debug' );
26+
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
27+
var isUndefined = require( '@stdlib/assert/is-undefined' );
28+
var format = require( '@stdlib/string/format' );
29+
var changeEvent = require( './../change_event.js' );
30+
var prop = require( './properties.js' );
31+
32+
33+
// VARIABLES //
34+
35+
var debug = logger( 'vega:axis:set:'+prop.name );
36+
37+
38+
// MAIN //
39+
40+
/**
41+
* Sets a boolean flag indicating whether an extra axis tick mark should be added for the initial position of an axis.
42+
*
43+
* ## Notes
44+
*
45+
* - Providing `undefined` "unsets" the configured value.
46+
*
47+
* @private
48+
* @param {(boolean|void)} value - input value
49+
* @throws {TypeError} must be a boolean
50+
* @returns {void}
51+
*/
52+
function set( value ) {
53+
if ( !isBoolean( value ) && !isUndefined( value ) ) {
54+
throw new TypeError( format( 'invalid assignment. `%s` must be a boolean. Value: `%s`.', prop.name, value ) );
55+
}
56+
if ( value !== this[ prop.private ] ) {
57+
debug( 'Current value: %s. New value: %s.', this[ prop.private ], value );
58+
this[ prop.private ] = value;
59+
this.emit( 'change', changeEvent( prop.name ) );
60+
}
61+
}
62+
63+
64+
// EXPORTS //
65+
66+
module.exports = set;
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/* eslint-disable no-invalid-this */
20+
21+
'use strict';
22+
23+
// MODULES //
24+
25+
var prop = require( './properties.js' );
26+
27+
28+
// MAIN //
29+
30+
/**
31+
* Returns the minimum desired step between axis tick marks in terms of axis scale domain values.
32+
*
33+
* @private
34+
* @returns {(number|void)} step
35+
*/
36+
function get() {
37+
return this[ prop.private ];
38+
}
39+
40+
41+
// EXPORTS //
42+
43+
module.exports = get;

0 commit comments

Comments
 (0)