From dc19da747ce0d0f4fe0f49212e3c6e70947eb7b1 Mon Sep 17 00:00:00 2001 From: orthodox-64 Date: Sat, 4 Apr 2026 02:58:53 +0530 Subject: [PATCH 1/4] feat: add plot/vega/mark/rect/ctor --- 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: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../vega/mark/rect/ctor/examples/index.js | 27 ++ .../vega/mark/rect/ctor/lib/change_event.js | 41 +++ .../mark/rect/ctor/lib/corner_radius/get.js | 43 +++ .../rect/ctor/lib/corner_radius/properties.js | 33 ++ .../mark/rect/ctor/lib/corner_radius/set.js | 61 ++++ .../ctor/lib/corner_radius_bottom_left/get.js | 43 +++ .../corner_radius_bottom_left/properties.js | 33 ++ .../ctor/lib/corner_radius_bottom_left/set.js | 61 ++++ .../lib/corner_radius_bottom_right/get.js | 43 +++ .../corner_radius_bottom_right/properties.js | 33 ++ .../lib/corner_radius_bottom_right/set.js | 61 ++++ .../ctor/lib/corner_radius_top_left/get.js | 43 +++ .../lib/corner_radius_top_left/properties.js | 33 ++ .../ctor/lib/corner_radius_top_left/set.js | 61 ++++ .../ctor/lib/corner_radius_top_right/get.js | 43 +++ .../lib/corner_radius_top_right/properties.js | 33 ++ .../ctor/lib/corner_radius_top_right/set.js | 61 ++++ .../plot/vega/mark/rect/ctor/lib/defaults.js | 55 +++ .../plot/vega/mark/rect/ctor/lib/index.js | 42 +++ .../plot/vega/mark/rect/ctor/lib/main.js | 326 ++++++++++++++++++ .../vega/mark/rect/ctor/lib/properties.json | 23 ++ .../vega/mark/rect/ctor/lib/properties/get.js | 41 +++ .../plot/vega/mark/rect/ctor/lib/type/get.js | 41 +++ .../plot/vega/mark/rect/ctor/lib/type/set.js | 46 +++ .../plot/vega/mark/rect/ctor/lib/type/type.js | 23 ++ .../plot/vega/mark/rect/ctor/package.json | 62 ++++ 26 files changed, 1412 insertions(+) create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/examples/index.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/change_event.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/defaults.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/index.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/main.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/properties.json create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/properties/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/type.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/package.json diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/examples/index.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/examples/index.js new file mode 100644 index 000000000000..bf463ba70b9c --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/examples/index.js @@ -0,0 +1,27 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var RectMark = require( './../lib' ); + +var mark = new RectMark({ + 'cornerRadius': 5 +}); + +console.log( mark.toJSON() ); diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/change_event.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/change_event.js new file mode 100644 index 000000000000..359afbfa206b --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/change_event.js @@ -0,0 +1,41 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MAIN // + +/** +* Returns a new change event object. +* +* @private +* @param {string} property - property name +* @returns {Object} event object +*/ +function event( property ) { // eslint-disable-line stdlib/no-redeclare + return { + 'type': 'update', + 'source': 'mark', + 'property': property + }; +} + + +// EXPORTS // + +module.exports = event; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/get.js new file mode 100644 index 000000000000..75476cbc7cf0 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/get.js @@ -0,0 +1,43 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the corner radius for all four corners. +* +* @private +* @returns {number} corner radius +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/properties.js new file mode 100644 index 000000000000..00b6324d2957 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/properties.js @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'cornerRadius' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/set.js new file mode 100644 index 000000000000..01912db213a3 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/set.js @@ -0,0 +1,61 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:rect-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the corner radius for all four corners. +* +* @private +* @param {NonNegativeNumber} value - input value +* @throws {TypeError} must be a nonnegative number +* @returns {void} +*/ +function set( value ) { + if ( !isNonNegativeNumber( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative number. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/get.js new file mode 100644 index 000000000000..5657b3b1737c --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/get.js @@ -0,0 +1,43 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the corner radius for the bottom left corner. +* +* @private +* @returns {number} corner radius +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/properties.js new file mode 100644 index 000000000000..689bbd9def1c --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/properties.js @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'cornerRadiusBottomLeft' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/set.js new file mode 100644 index 000000000000..ee8bc42dc572 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/set.js @@ -0,0 +1,61 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:rect-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the corner radius for the bottom left corner. +* +* @private +* @param {NonNegativeNumber} value - input value +* @throws {TypeError} must be a nonnegative number +* @returns {void} +*/ +function set( value ) { + if ( !isNonNegativeNumber( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative number. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/get.js new file mode 100644 index 000000000000..cf516904d819 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/get.js @@ -0,0 +1,43 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the corner radius for the bottom right corner. +* +* @private +* @returns {number} corner radius +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/properties.js new file mode 100644 index 000000000000..8a04d8019397 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/properties.js @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'cornerRadiusBottomRight' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/set.js new file mode 100644 index 000000000000..83a5c1289468 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/set.js @@ -0,0 +1,61 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:rect-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the corner radius for the bottom right corner. +* +* @private +* @param {NonNegativeNumber} value - input value +* @throws {TypeError} must be a nonnegative number +* @returns {void} +*/ +function set( value ) { + if ( !isNonNegativeNumber( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative number. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/get.js new file mode 100644 index 000000000000..c8dfeab6912c --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/get.js @@ -0,0 +1,43 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the corner radius for the top left corner. +* +* @private +* @returns {number} corner radius +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/properties.js new file mode 100644 index 000000000000..9c57fc55cf61 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/properties.js @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'cornerRadiusTopLeft' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/set.js new file mode 100644 index 000000000000..bdbfcc229c29 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/set.js @@ -0,0 +1,61 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:rect-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the corner radius for the top left corner. +* +* @private +* @param {NonNegativeNumber} value - input value +* @throws {TypeError} must be a nonnegative number +* @returns {void} +*/ +function set( value ) { + if ( !isNonNegativeNumber( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative number. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/get.js new file mode 100644 index 000000000000..848a342e05ab --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/get.js @@ -0,0 +1,43 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the corner radius for the top right corner. +* +* @private +* @returns {number} corner radius +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/properties.js new file mode 100644 index 000000000000..48e338d55626 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/properties.js @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'cornerRadiusTopRight' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/set.js new file mode 100644 index 000000000000..97fcb2c09638 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/set.js @@ -0,0 +1,61 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:rect-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the corner radius for the top right corner. +* +* @private +* @param {NonNegativeNumber} value - input value +* @throws {TypeError} must be a nonnegative number +* @returns {void} +*/ +function set( value ) { + if ( !isNonNegativeNumber( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative number. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/defaults.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/defaults.js new file mode 100644 index 000000000000..4b6a9ea41b9b --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/defaults.js @@ -0,0 +1,55 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MAIN // + +/** +* Returns defaults. +* +* @private +* @returns {Object} default options +* +* @example +* var o = defaults(); +* // returns {...} +*/ +function defaults() { + return { + // Radius in pixels of rounded rectangle corners for all four corners: + 'cornerRadius': 0, + + // Radius in pixels of rounded rectangle corner for the top left corner: + 'cornerRadiusTopLeft': 0, + + // Radius in pixels of rounded rectangle corner for the top right corner: + 'cornerRadiusTopRight': 0, + + // Radius in pixels of rounded rectangle corner for the bottom left corner: + 'cornerRadiusBottomLeft': 0, + + // Radius in pixels of rounded rectangle corner for the bottom right corner: + 'cornerRadiusBottomRight': 0 + }; +} + + +// EXPORTS // + +module.exports = defaults; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/index.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/index.js new file mode 100644 index 000000000000..373a676d19bd --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/index.js @@ -0,0 +1,42 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Rect mark constructor. +* +* @module @stdlib/plot/vega/mark/rect/ctor +* +* @example +* var RectMark = require( '@stdlib/plot/vega/mark/rect/ctor' ); +* +* var mark = new RectMark({ +* 'cornerRadius': 5 +* }); +* // returns +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/main.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/main.js new file mode 100644 index 000000000000..3752c3f06bf6 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/main.js @@ -0,0 +1,326 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-restricted-syntax, no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isObject = require( '@stdlib/assert/is-object' ); +var setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' ); +var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var setNonEnumerableReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' ); // eslint-disable-line id-length +var hasProp = require( '@stdlib/assert/has-property' ); +var inherit = require( '@stdlib/utils/inherit' ); +var objectKeys = require( '@stdlib/utils/keys' ); +var transformErrorMessage = require( '@stdlib/plot/vega/base/transform-validation-message' ); +var instance2json = require( '@stdlib/plot/vega/base/to-json' ); +var Mark = require( '@stdlib/plot/vega/mark/base/ctor' ); +var format = require( '@stdlib/string/format' ); +var properties = require( './properties.json' ); +var defaults = require( './defaults.js' ); + +// Note: keep the following in alphabetical order according to the `require` path... +var getCornerRadius = require( './corner_radius/get.js' ); +var setCornerRadius = require( './corner_radius/set.js' ); + +var getCornerRadiusBottomLeft = require( './corner_radius_bottom_left/get.js' ); +var setCornerRadiusBottomLeft = require( './corner_radius_bottom_left/set.js' ); + +var getCornerRadiusBottomRight = require( './corner_radius_bottom_right/get.js' ); +var setCornerRadiusBottomRight = require( './corner_radius_bottom_right/set.js' ); + +var getCornerRadiusTopLeft = require( './corner_radius_top_left/get.js' ); +var setCornerRadiusTopLeft = require( './corner_radius_top_left/set.js' ); + +var getCornerRadiusTopRight = require( './corner_radius_top_right/get.js' ); +var setCornerRadiusTopRight = require( './corner_radius_top_right/set.js' ); + +var getProperties = require( './properties/get.js' ); + +var getType = require( './type/get.js' ); +var setType = require( './type/set.js' ); + +var TYPE = require( './type/type.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:rect-mark:main' ); + + +// MAIN // + +/** +* Rect mark constructor. +* +* @constructor +* @param {Options} [options] - constructor options +* @param {boolean} [options.aria=true] - boolean indicating whether to include ARIA attributes in SVG output +* @param {(boolean|Signal|Object)} [options.clip=false] - setting indicating whether to clip marks to a specified shape +* @param {NonNegativeNumber} [options.cornerRadius=0] - radius in pixels of rounded rectangle corners for all four corners +* @param {NonNegativeNumber} [options.cornerRadiusTopLeft=0] - radius in pixels of rounded rectangle corner for the top left corner +* @param {NonNegativeNumber} [options.cornerRadiusTopRight=0] - radius in pixels of rounded rectangle corner for the top right corner +* @param {NonNegativeNumber} [options.cornerRadiusBottomLeft=0] - radius in pixels of rounded rectangle corner for the bottom left corner +* @param {NonNegativeNumber} [options.cornerRadiusBottomRight=0] - radius in pixels of rounded rectangle corner for the bottom right corner +* @param {string} [options.description] - text description of a mark for ARIA accessibility +* @param {Object} [options.encode] - object containing visual encoding rules for mark properties +* @param {Object} [options.from] - object describing the data a mark should visualize +* @param {boolean} [options.interactive=true] - boolean indicating whether a mark can serve as an input event source +* @param {(string|Object)} [options.key] - data field to use as a unique key for data binding +* @param {string} [options.name] - unique name +* @param {Array} [options.triggers=[]] - list of triggers for modifying mark properties in response to signal changes +* @param {Object} [options.sort] - comparator for sorting mark items +* @param {Array} [options.transforms=[]] - list of post-encoding transforms to apply after any "encode" blocks and which operate directly on mark scenegraph items +* @param {string} [options.role] - metadata string indicating the role of a mark +* @param {(string|Array)} [options.style] - custom styles to apply to a mark +* @param {number} [options.zindex=0] - integer z-index indicating the layering of a mark relative to other marks +* @throws {TypeError} options argument must be an object +* @throws {TypeError} `type` option, if provided, must be equal to "rect" +* @throws {Error} must provide valid options +* @returns {RectMark} rect mark instance +* +* @example +* var mark = new RectMark({ +* 'cornerRadius': 5 +* }); +* // returns +*/ +function RectMark( options ) { + var opts; + var keys; + var v; + var k; + var i; + if ( !( this instanceof RectMark ) ) { + if ( arguments.length === 0 ) { + return new RectMark( {} ); + } + return new RectMark( options ); + } + if ( arguments.length === 0 ) { + options = {}; + } + if ( !isObject( options ) ) { + throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); + } + if ( hasProp( options, 'type' ) && options.type !== TYPE ) { + throw new TypeError( format( 'invalid argument. `%s` option must be equal to "%s". Option: `%s`.', 'type', TYPE, options.type ) ); + } + // Inject the mark type into the options before calling the parent constructor: + options.type = TYPE; + Mark.call( this, options ); + + // Resolve the default configuration: + opts = defaults(); + + // Set internal properties according to the default configuration... + keys = objectKeys( opts ); + for ( i = 0; i < keys.length; i++ ) { + k = keys[ i ]; + this[ '_'+k ] = opts[ k ]; + } + // Validate provided options by attempting to assign option values to corresponding fields... + for ( i = 0; i < properties.length; i++ ) { + k = properties[ i ]; + if ( !hasProp( options, k ) ) { + continue; + } + v = options[ k ]; + try { + this[ k ] = v; + } catch ( err ) { + debug( 'Encountered an error. Error: %s', err.message ); + + // FIXME: retain thrown error type + throw new Error( transformErrorMessage( err.message ) ); + } + } + this._type = TYPE; + return this; +} + +/* +* Inherit from a parent prototype. +*/ +inherit( RectMark, Mark ); + +/** +* Constructor name. +* +* @private +* @name name +* @memberof RectMark +* @readonly +* @type {string} +*/ +setNonEnumerableReadOnly( RectMark, 'name', 'RectMark' ); + +/** +* Radius in pixels of rounded rectangle corners for all four corners. +* +* @name cornerRadius +* @memberof RectMark.prototype +* @type {NonNegativeNumber} +* @default 0 +* +* @example +* var mark = new RectMark({ +* 'cornerRadius': 5 +* }); +* +* var v = mark.cornerRadius; +* // returns 5 +*/ +setReadWriteAccessor( RectMark.prototype, 'cornerRadius', getCornerRadius, setCornerRadius ); + +/** +* Radius in pixels of rounded rectangle corner for the bottom left corner. +* +* @name cornerRadiusBottomLeft +* @memberof RectMark.prototype +* @type {NonNegativeNumber} +* @default 0 +* +* @example +* var mark = new RectMark({ +* 'cornerRadiusBottomLeft': 3 +* }); +* +* var v = mark.cornerRadiusBottomLeft; +* // returns 3 +*/ +setReadWriteAccessor( RectMark.prototype, 'cornerRadiusBottomLeft', getCornerRadiusBottomLeft, setCornerRadiusBottomLeft ); + +/** +* Radius in pixels of rounded rectangle corner for the bottom right corner. +* +* @name cornerRadiusBottomRight +* @memberof RectMark.prototype +* @type {NonNegativeNumber} +* @default 0 +* +* @example +* var mark = new RectMark({ +* 'cornerRadiusBottomRight': 3 +* }); +* +* var v = mark.cornerRadiusBottomRight; +* // returns 3 +*/ +setReadWriteAccessor( RectMark.prototype, 'cornerRadiusBottomRight', getCornerRadiusBottomRight, setCornerRadiusBottomRight ); + +/** +* Radius in pixels of rounded rectangle corner for the top left corner. +* +* @name cornerRadiusTopLeft +* @memberof RectMark.prototype +* @type {NonNegativeNumber} +* @default 0 +* +* @example +* var mark = new RectMark({ +* 'cornerRadiusTopLeft': 3 +* }); +* +* var v = mark.cornerRadiusTopLeft; +* // returns 3 +*/ +setReadWriteAccessor( RectMark.prototype, 'cornerRadiusTopLeft', getCornerRadiusTopLeft, setCornerRadiusTopLeft ); + +/** +* Radius in pixels of rounded rectangle corner for the top right corner. +* +* @name cornerRadiusTopRight +* @memberof RectMark.prototype +* @type {NonNegativeNumber} +* @default 0 +* +* @example +* var mark = new RectMark({ +* 'cornerRadiusTopRight': 3 +* }); +* +* var v = mark.cornerRadiusTopRight; +* // returns 3 +*/ +setReadWriteAccessor( RectMark.prototype, 'cornerRadiusTopRight', getCornerRadiusTopRight, setCornerRadiusTopRight ); + +/** +* Mark properties. +* +* @name properties +* @memberof RectMark.prototype +* @type {Array} +* +* @example +* var mark = new RectMark({}); +* +* var v = mark.properties; +* // returns [...] +*/ +setNonEnumerableReadOnlyAccessor( RectMark.prototype, 'properties', getProperties ); + +/** +* Mark type. +* +* @name type +* @memberof RectMark.prototype +* @type {string} +* @default 'rect' +* +* @example +* var mark = new RectMark({ +* 'cornerRadius': 5 +* }); +* +* var v = mark.type; +* // returns 'rect' +*/ +setReadWriteAccessor( RectMark.prototype, 'type', getType, setType ); + +/** +* Serializes an instance to a JSON object. +* +* ## Notes +* +* - This method is implicitly invoked by `JSON.stringify`. +* +* @name toJSON +* @memberof RectMark.prototype +* @type {Function} +* @returns {Object} JSON object +* +* @example +* var mark = new RectMark({ +* 'cornerRadius': 5 +* }); +* +* var v = mark.toJSON(); +* // returns {...} +*/ +setNonEnumerableReadOnly( RectMark.prototype, 'toJSON', function toJSON() { + return instance2json( this, properties ); +}); + + +// EXPORTS // + +module.exports = RectMark; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/properties.json b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/properties.json new file mode 100644 index 000000000000..591c315a2402 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/properties.json @@ -0,0 +1,23 @@ +[ + "aria", + "clip", + "description", + "encode", + "from", + "interactive", + "key", + "name", + "role", + "sort", + "style", + "transform", + "triggers", + "type", + "zindex", + + "cornerRadius", + "cornerRadiusBottomLeft", + "cornerRadiusBottomRight", + "cornerRadiusTopLeft", + "cornerRadiusTopRight" +] diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/properties/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/properties/get.js new file mode 100644 index 000000000000..f3cbb28454ea --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/properties/get.js @@ -0,0 +1,41 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var properties = require( './../properties.json' ); + + +// MAIN // + +/** +* Returns the list of enumerable properties. +* +* @private +* @returns {Array} properties +*/ +function get() { + return properties.slice(); +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/get.js new file mode 100644 index 000000000000..84cc34fbacd5 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/get.js @@ -0,0 +1,41 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var TYPE = require( './type.js' ); + + +// MAIN // + +/** +* Returns the mark type. +* +* @private +* @returns {string} mark type +*/ +function get() { + return TYPE; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/set.js new file mode 100644 index 000000000000..9e06599a5a16 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/set.js @@ -0,0 +1,46 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var format = require( '@stdlib/string/format' ); +var TYPE = require( './type.js' ); + + +// MAIN // + +/** +* Sets the mark type. +* +* @private +* @param {string} value - input value +* @throws {TypeError} must be a valid mark type +* @returns {void} +*/ +function set( value ) { + if ( value !== TYPE ) { + throw new TypeError( format( 'invalid assignment. `%s` must be equal to "%s". Value: `%s`.', 'type', TYPE, value ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/type.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/type.js new file mode 100644 index 000000000000..bf4803cdc206 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/type.js @@ -0,0 +1,23 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// EXPORTS // + +module.exports = 'rect'; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/package.json b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/package.json new file mode 100644 index 000000000000..9c94ba0c3cbc --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/package.json @@ -0,0 +1,62 @@ +{ + "name": "@stdlib/plot/vega/mark/rect/ctor", + "version": "0.0.0", + "description": "Rect mark constructor.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "plot", + "vega", + "mark", + "rect", + "rectangle", + "constructor", + "ctor" + ], + "__stdlib__": {} +} From 281aa0b7d0d268759af27657690aaed38632fd2b Mon Sep 17 00:00:00 2001 From: orthodox-64 Date: Wed, 8 Apr 2026 22:25:59 +0530 Subject: [PATCH 2/4] fix: some changes --- 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: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../mark/rect/{ctor => }/examples/index.js | 0 .../mark/rect/{ctor => }/lib/change_event.js | 0 .../rect/{ctor => }/lib/corner_radius/get.js | 0 .../lib/corner_radius/properties.js | 0 .../rect/{ctor => }/lib/corner_radius/set.js | 0 .../lib/corner_radius_bottom_left/get.js | 0 .../corner_radius_bottom_left/properties.js | 0 .../lib/corner_radius_bottom_left/set.js | 9 ++++++-- .../lib/corner_radius_bottom_right/get.js | 0 .../corner_radius_bottom_right/properties.js | 0 .../lib/corner_radius_bottom_right/set.js | 9 ++++++-- .../lib/corner_radius_top_left/get.js | 0 .../lib/corner_radius_top_left/properties.js | 0 .../lib/corner_radius_top_left/set.js | 9 ++++++-- .../lib/corner_radius_top_right/get.js | 0 .../lib/corner_radius_top_right/properties.js | 0 .../lib/corner_radius_top_right/set.js | 9 ++++++-- .../vega/mark/rect/{ctor => }/lib/defaults.js | 14 +---------- .../vega/mark/rect/{ctor => }/lib/index.js | 4 ++-- .../vega/mark/rect/{ctor => }/lib/main.js | 23 ++++++++----------- .../mark/rect/{ctor => }/lib/properties.json | 0 .../rect/{ctor => }/lib/properties/get.js | 0 .../vega/mark/rect/{ctor => }/lib/type/get.js | 0 .../vega/mark/rect/{ctor => }/lib/type/set.js | 0 .../mark/rect/{ctor => }/lib/type/type.js | 0 .../vega/mark/rect/{ctor => }/package.json | 6 ++--- 26 files changed, 42 insertions(+), 41 deletions(-) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/examples/index.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/change_event.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/corner_radius/get.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/corner_radius/properties.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/corner_radius/set.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/corner_radius_bottom_left/get.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/corner_radius_bottom_left/properties.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/corner_radius_bottom_left/set.js (86%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/corner_radius_bottom_right/get.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/corner_radius_bottom_right/properties.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/corner_radius_bottom_right/set.js (86%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/corner_radius_top_left/get.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/corner_radius_top_left/properties.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/corner_radius_top_left/set.js (86%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/corner_radius_top_right/get.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/corner_radius_top_right/properties.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/corner_radius_top_right/set.js (86%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/defaults.js (67%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/index.js (88%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/main.js (92%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/properties.json (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/properties/get.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/type/get.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/type/set.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/lib/type/type.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/{ctor => }/package.json (92%) diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/examples/index.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/examples/index.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/examples/index.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/examples/index.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/change_event.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/change_event.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/change_event.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/change_event.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius/get.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/get.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius/get.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius/properties.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/properties.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius/properties.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius/set.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius/set.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius/set.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_left/get.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/get.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_left/get.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_left/properties.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/properties.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_left/properties.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_left/set.js similarity index 86% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/set.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_left/set.js index ee8bc42dc572..8cfac939d1d7 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_left/set.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_left/set.js @@ -24,6 +24,7 @@ var logger = require( 'debug' ); var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive; +var isUndefined = require( '@stdlib/assert/is-undefined' ); var format = require( '@stdlib/string/format' ); var changeEvent = require( './../change_event.js' ); var prop = require( './properties.js' ); @@ -39,13 +40,17 @@ var debug = logger( 'vega:rect-mark:set:'+prop.name ); /** * Sets the corner radius for the bottom left corner. * +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* * @private -* @param {NonNegativeNumber} value - input value +* @param {(NonNegativeNumber|void)} value - input value * @throws {TypeError} must be a nonnegative number * @returns {void} */ function set( value ) { - if ( !isNonNegativeNumber( value ) ) { + if ( !isNonNegativeNumber( value ) && !isUndefined( value ) ) { throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative number. Value: `%s`.', prop.name, value ) ); } if ( value !== this[ prop.private ] ) { diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_right/get.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/get.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_right/get.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_right/properties.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/properties.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_right/properties.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_right/set.js similarity index 86% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/set.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_right/set.js index 83a5c1289468..8cf1b0ea842d 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_bottom_right/set.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_right/set.js @@ -24,6 +24,7 @@ var logger = require( 'debug' ); var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive; +var isUndefined = require( '@stdlib/assert/is-undefined' ); var format = require( '@stdlib/string/format' ); var changeEvent = require( './../change_event.js' ); var prop = require( './properties.js' ); @@ -39,13 +40,17 @@ var debug = logger( 'vega:rect-mark:set:'+prop.name ); /** * Sets the corner radius for the bottom right corner. * +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* * @private -* @param {NonNegativeNumber} value - input value +* @param {(NonNegativeNumber|void)} value - input value * @throws {TypeError} must be a nonnegative number * @returns {void} */ function set( value ) { - if ( !isNonNegativeNumber( value ) ) { + if ( !isNonNegativeNumber( value ) && !isUndefined( value ) ) { throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative number. Value: `%s`.', prop.name, value ) ); } if ( value !== this[ prop.private ] ) { diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_left/get.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/get.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_left/get.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_left/properties.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/properties.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_left/properties.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_left/set.js similarity index 86% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/set.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_left/set.js index bdbfcc229c29..b6553a48d3fa 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_left/set.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_left/set.js @@ -24,6 +24,7 @@ var logger = require( 'debug' ); var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive; +var isUndefined = require( '@stdlib/assert/is-undefined' ); var format = require( '@stdlib/string/format' ); var changeEvent = require( './../change_event.js' ); var prop = require( './properties.js' ); @@ -39,13 +40,17 @@ var debug = logger( 'vega:rect-mark:set:'+prop.name ); /** * Sets the corner radius for the top left corner. * +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* * @private -* @param {NonNegativeNumber} value - input value +* @param {(NonNegativeNumber|void)} value - input value * @throws {TypeError} must be a nonnegative number * @returns {void} */ function set( value ) { - if ( !isNonNegativeNumber( value ) ) { + if ( !isNonNegativeNumber( value ) && !isUndefined( value ) ) { throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative number. Value: `%s`.', prop.name, value ) ); } if ( value !== this[ prop.private ] ) { diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_right/get.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/get.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_right/get.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_right/properties.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/properties.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_right/properties.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_right/set.js similarity index 86% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/set.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_right/set.js index 97fcb2c09638..d9b2a8ab9c39 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/corner_radius_top_right/set.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_right/set.js @@ -24,6 +24,7 @@ var logger = require( 'debug' ); var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive; +var isUndefined = require( '@stdlib/assert/is-undefined' ); var format = require( '@stdlib/string/format' ); var changeEvent = require( './../change_event.js' ); var prop = require( './properties.js' ); @@ -39,13 +40,17 @@ var debug = logger( 'vega:rect-mark:set:'+prop.name ); /** * Sets the corner radius for the top right corner. * +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* * @private -* @param {NonNegativeNumber} value - input value +* @param {(NonNegativeNumber|void)} value - input value * @throws {TypeError} must be a nonnegative number * @returns {void} */ function set( value ) { - if ( !isNonNegativeNumber( value ) ) { + if ( !isNonNegativeNumber( value ) && !isUndefined( value ) ) { throw new TypeError( format( 'invalid assignment. `%s` must be a nonnegative number. Value: `%s`.', prop.name, value ) ); } if ( value !== this[ prop.private ] ) { diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/defaults.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/defaults.js similarity index 67% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/defaults.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/defaults.js index 4b6a9ea41b9b..a1042929c8db 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/defaults.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/defaults.js @@ -33,19 +33,7 @@ function defaults() { return { // Radius in pixels of rounded rectangle corners for all four corners: - 'cornerRadius': 0, - - // Radius in pixels of rounded rectangle corner for the top left corner: - 'cornerRadiusTopLeft': 0, - - // Radius in pixels of rounded rectangle corner for the top right corner: - 'cornerRadiusTopRight': 0, - - // Radius in pixels of rounded rectangle corner for the bottom left corner: - 'cornerRadiusBottomLeft': 0, - - // Radius in pixels of rounded rectangle corner for the bottom right corner: - 'cornerRadiusBottomRight': 0 + 'cornerRadius': 0 }; } diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/index.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/index.js similarity index 88% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/index.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/index.js index 373a676d19bd..ffd14ea5e686 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/index.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/index.js @@ -21,10 +21,10 @@ /** * Rect mark constructor. * -* @module @stdlib/plot/vega/mark/rect/ctor +* @module @stdlib/plot/vega/mark/rect * * @example -* var RectMark = require( '@stdlib/plot/vega/mark/rect/ctor' ); +* var RectMark = require( '@stdlib/plot/vega/mark/rect' ); * * var mark = new RectMark({ * 'cornerRadius': 5 diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/main.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/main.js similarity index 92% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/main.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/main.js index 3752c3f06bf6..93851fc094b6 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/main.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/main.js @@ -76,10 +76,10 @@ var debug = logger( 'vega:rect-mark:main' ); * @param {boolean} [options.aria=true] - boolean indicating whether to include ARIA attributes in SVG output * @param {(boolean|Signal|Object)} [options.clip=false] - setting indicating whether to clip marks to a specified shape * @param {NonNegativeNumber} [options.cornerRadius=0] - radius in pixels of rounded rectangle corners for all four corners -* @param {NonNegativeNumber} [options.cornerRadiusTopLeft=0] - radius in pixels of rounded rectangle corner for the top left corner -* @param {NonNegativeNumber} [options.cornerRadiusTopRight=0] - radius in pixels of rounded rectangle corner for the top right corner -* @param {NonNegativeNumber} [options.cornerRadiusBottomLeft=0] - radius in pixels of rounded rectangle corner for the bottom left corner -* @param {NonNegativeNumber} [options.cornerRadiusBottomRight=0] - radius in pixels of rounded rectangle corner for the bottom right corner +* @param {NonNegativeNumber} [options.cornerRadiusTopLeft] - radius in pixels of rounded rectangle corner for the top left corner +* @param {NonNegativeNumber} [options.cornerRadiusTopRight] - radius in pixels of rounded rectangle corner for the top right corner +* @param {NonNegativeNumber} [options.cornerRadiusBottomLeft] - radius in pixels of rounded rectangle corner for the bottom left corner +* @param {NonNegativeNumber} [options.cornerRadiusBottomRight] - radius in pixels of rounded rectangle corner for the bottom right corner * @param {string} [options.description] - text description of a mark for ARIA accessibility * @param {Object} [options.encode] - object containing visual encoding rules for mark properties * @param {Object} [options.from] - object describing the data a mark should visualize @@ -124,9 +124,9 @@ function RectMark( options ) { if ( hasProp( options, 'type' ) && options.type !== TYPE ) { throw new TypeError( format( 'invalid argument. `%s` option must be equal to "%s". Option: `%s`.', 'type', TYPE, options.type ) ); } - // Inject the mark type into the options before calling the parent constructor: options.type = TYPE; Mark.call( this, options ); + this._type = TYPE; // Resolve the default configuration: opts = defaults(); @@ -153,7 +153,6 @@ function RectMark( options ) { throw new Error( transformErrorMessage( err.message ) ); } } - this._type = TYPE; return this; } @@ -196,8 +195,7 @@ setReadWriteAccessor( RectMark.prototype, 'cornerRadius', getCornerRadius, setCo * * @name cornerRadiusBottomLeft * @memberof RectMark.prototype -* @type {NonNegativeNumber} -* @default 0 +* @type {(NonNegativeNumber|void)} * * @example * var mark = new RectMark({ @@ -214,8 +212,7 @@ setReadWriteAccessor( RectMark.prototype, 'cornerRadiusBottomLeft', getCornerRad * * @name cornerRadiusBottomRight * @memberof RectMark.prototype -* @type {NonNegativeNumber} -* @default 0 +* @type {(NonNegativeNumber|void)} * * @example * var mark = new RectMark({ @@ -232,8 +229,7 @@ setReadWriteAccessor( RectMark.prototype, 'cornerRadiusBottomRight', getCornerRa * * @name cornerRadiusTopLeft * @memberof RectMark.prototype -* @type {NonNegativeNumber} -* @default 0 +* @type {(NonNegativeNumber|void)} * * @example * var mark = new RectMark({ @@ -250,8 +246,7 @@ setReadWriteAccessor( RectMark.prototype, 'cornerRadiusTopLeft', getCornerRadius * * @name cornerRadiusTopRight * @memberof RectMark.prototype -* @type {NonNegativeNumber} -* @default 0 +* @type {(NonNegativeNumber|void)} * * @example * var mark = new RectMark({ diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/properties.json b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/properties.json similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/properties.json rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/properties.json diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/properties/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/properties/get.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/properties/get.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/properties/get.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/type/get.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/get.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/type/get.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/type/set.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/set.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/type/set.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/type.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/type/type.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/lib/type/type.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/type/type.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/package.json b/lib/node_modules/@stdlib/plot/vega/mark/rect/package.json similarity index 92% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/package.json rename to lib/node_modules/@stdlib/plot/vega/mark/rect/package.json index 9c94ba0c3cbc..cfafc97bff51 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/ctor/package.json +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/package.json @@ -1,5 +1,5 @@ { - "name": "@stdlib/plot/vega/mark/rect/ctor", + "name": "@stdlib/plot/vega/mark/rect", "version": "0.0.0", "description": "Rect mark constructor.", "license": "Apache-2.0", @@ -54,9 +54,7 @@ "vega", "mark", "rect", - "rectangle", - "constructor", - "ctor" + "rectangle" ], "__stdlib__": {} } From 7ba01fcee5066d326c8c1663b0fe63f3fa9ddc81 Mon Sep 17 00:00:00 2001 From: orthodox-64 Date: Thu, 9 Apr 2026 16:42:33 +0530 Subject: [PATCH 3/4] fix: changes --- 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../get.js | 0 .../properties.js | 0 .../set.js | 0 .../get.js | 2 +- .../properties.js | 0 .../set.js | 0 .../get.js | 2 +- .../properties.js | 0 .../set.js | 0 .../get.js | 2 +- .../properties.js | 0 .../set.js | 0 .../{corner_radius => corner-radius}/get.js | 2 +- .../properties.js | 0 .../{corner_radius => corner-radius}/set.js | 0 .../@stdlib/plot/vega/mark/rect/lib/main.js | 96 +++++++++---------- 16 files changed, 50 insertions(+), 54 deletions(-) rename lib/node_modules/@stdlib/plot/vega/mark/rect/lib/{corner_radius_bottom_left => corner-radius-bottom-left}/get.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/lib/{corner_radius_bottom_left => corner-radius-bottom-left}/properties.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/lib/{corner_radius_bottom_left => corner-radius-bottom-left}/set.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/lib/{corner_radius_bottom_right => corner-radius-bottom-right}/get.js (96%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/lib/{corner_radius_bottom_right => corner-radius-bottom-right}/properties.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/lib/{corner_radius_bottom_right => corner-radius-bottom-right}/set.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/lib/{corner_radius_top_left => corner-radius-top-left}/get.js (96%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/lib/{corner_radius_top_left => corner-radius-top-left}/properties.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/lib/{corner_radius_top_left => corner-radius-top-left}/set.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/lib/{corner_radius_top_right => corner-radius-top-right}/get.js (96%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/lib/{corner_radius_top_right => corner-radius-top-right}/properties.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/lib/{corner_radius_top_right => corner-radius-top-right}/set.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/lib/{corner_radius => corner-radius}/get.js (96%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/lib/{corner_radius => corner-radius}/properties.js (100%) rename lib/node_modules/@stdlib/plot/vega/mark/rect/lib/{corner_radius => corner-radius}/set.js (100%) diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_left/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-left/get.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_left/get.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-left/get.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_left/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-left/properties.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_left/properties.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-left/properties.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_left/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-left/set.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_left/set.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-left/set.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_right/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-right/get.js similarity index 96% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_right/get.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-right/get.js index cf516904d819..8070ac36121e 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_right/get.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-right/get.js @@ -34,7 +34,7 @@ var prop = require( './properties.js' ); * @returns {number} corner radius */ function get() { - return this[ prop.private ]; + return this[prop.private]; } diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_right/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-right/properties.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_right/properties.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-right/properties.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_right/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-right/set.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_bottom_right/set.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-right/set.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_left/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-left/get.js similarity index 96% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_left/get.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-left/get.js index c8dfeab6912c..4308e3601418 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_left/get.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-left/get.js @@ -34,7 +34,7 @@ var prop = require( './properties.js' ); * @returns {number} corner radius */ function get() { - return this[ prop.private ]; + return this[prop.private]; } diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_left/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-left/properties.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_left/properties.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-left/properties.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_left/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-left/set.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_left/set.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-left/set.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_right/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-right/get.js similarity index 96% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_right/get.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-right/get.js index 848a342e05ab..5da843e559ed 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_right/get.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-right/get.js @@ -34,7 +34,7 @@ var prop = require( './properties.js' ); * @returns {number} corner radius */ function get() { - return this[ prop.private ]; + return this[prop.private]; } diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_right/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-right/properties.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_right/properties.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-right/properties.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_right/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-right/set.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius_top_right/set.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-right/set.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius/get.js similarity index 96% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius/get.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius/get.js index 75476cbc7cf0..b2569e045d00 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius/get.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius/get.js @@ -34,7 +34,7 @@ var prop = require( './properties.js' ); * @returns {number} corner radius */ function get() { - return this[ prop.private ]; + return this[prop.private]; } diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius/properties.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius/properties.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius/properties.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius/set.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius/set.js similarity index 100% rename from lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner_radius/set.js rename to lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius/set.js diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/main.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/main.js index 93851fc094b6..b020375ae35b 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/main.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/main.js @@ -36,34 +36,30 @@ var Mark = require( '@stdlib/plot/vega/mark/base/ctor' ); var format = require( '@stdlib/string/format' ); var properties = require( './properties.json' ); var defaults = require( './defaults.js' ); +var getCornerRadius = require( './corner-radius/get.js' ); +var setCornerRadius = require( './corner-radius/set.js' ); -// Note: keep the following in alphabetical order according to the `require` path... -var getCornerRadius = require( './corner_radius/get.js' ); -var setCornerRadius = require( './corner_radius/set.js' ); +var getCornerRadiusBottomLeft = require( './corner-radius-bottom-left/get.js' ); +var setCornerRadiusBottomLeft = require( './corner-radius-bottom-left/set.js' ); -var getCornerRadiusBottomLeft = require( './corner_radius_bottom_left/get.js' ); -var setCornerRadiusBottomLeft = require( './corner_radius_bottom_left/set.js' ); +var getCornerRadiusBottomRight = require( './corner-radius-bottom-right/get.js' ); // eslint-disable-line id-length +var setCornerRadiusBottomRight = require( './corner-radius-bottom-right/set.js' ); // eslint-disable-line id-length -var getCornerRadiusBottomRight = require( './corner_radius_bottom_right/get.js' ); -var setCornerRadiusBottomRight = require( './corner_radius_bottom_right/set.js' ); +var getCornerRadiusTopLeft = require( './corner-radius-top-left/get.js' ); +var setCornerRadiusTopLeft = require( './corner-radius-top-left/set.js' ); -var getCornerRadiusTopLeft = require( './corner_radius_top_left/get.js' ); -var setCornerRadiusTopLeft = require( './corner_radius_top_left/set.js' ); - -var getCornerRadiusTopRight = require( './corner_radius_top_right/get.js' ); -var setCornerRadiusTopRight = require( './corner_radius_top_right/set.js' ); +var getCornerRadiusTopRight = require( './corner-radius-top-right/get.js' ); +var setCornerRadiusTopRight = require( './corner-radius-top-right/set.js' ); var getProperties = require( './properties/get.js' ); - var getType = require( './type/get.js' ); var setType = require( './type/set.js' ); - var TYPE = require( './type/type.js' ); // VARIABLES // -var debug = logger( 'vega:rect-mark:main' ); +var debug = logger('vega:rect-mark:main'); // MAIN // @@ -103,63 +99,63 @@ var debug = logger( 'vega:rect-mark:main' ); * }); * // returns */ -function RectMark( options ) { +function RectMark(options) { var opts; var keys; var v; var k; var i; - if ( !( this instanceof RectMark ) ) { - if ( arguments.length === 0 ) { - return new RectMark( {} ); + if (!(this instanceof RectMark)) { + if (arguments.length === 0) { + return new RectMark({}); } - return new RectMark( options ); + return new RectMark(options); } - if ( arguments.length === 0 ) { + if (arguments.length === 0) { options = {}; } - if ( !isObject( options ) ) { - throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); + if (!isObject(options)) { + throw new TypeError(format('invalid argument. Options argument must be an object. Value: `%s`.', options)); } - if ( hasProp( options, 'type' ) && options.type !== TYPE ) { - throw new TypeError( format( 'invalid argument. `%s` option must be equal to "%s". Option: `%s`.', 'type', TYPE, options.type ) ); + if (hasProp(options, 'type') && options.type !== TYPE) { + throw new TypeError(format('invalid argument. `%s` option must be equal to "%s". Option: `%s`.', 'type', TYPE, options.type)); } options.type = TYPE; - Mark.call( this, options ); - this._type = TYPE; + Mark.call(this, options); // Resolve the default configuration: opts = defaults(); // Set internal properties according to the default configuration... - keys = objectKeys( opts ); - for ( i = 0; i < keys.length; i++ ) { - k = keys[ i ]; - this[ '_'+k ] = opts[ k ]; + keys = objectKeys(opts); + for (i = 0; i < keys.length; i++) { + k = keys[i]; + this['_' + k] = opts[k]; } // Validate provided options by attempting to assign option values to corresponding fields... - for ( i = 0; i < properties.length; i++ ) { - k = properties[ i ]; - if ( !hasProp( options, k ) ) { + for (i = 0; i < properties.length; i++) { + k = properties[i]; + if (!hasProp(options, k)) { continue; } - v = options[ k ]; + v = options[k]; try { - this[ k ] = v; - } catch ( err ) { - debug( 'Encountered an error. Error: %s', err.message ); + this[k] = v; + } catch (err) { + debug('Encountered an error. Error: %s', err.message); // FIXME: retain thrown error type - throw new Error( transformErrorMessage( err.message ) ); + throw new Error(transformErrorMessage(err.message)); } } + this._type = TYPE; return this; } /* * Inherit from a parent prototype. */ -inherit( RectMark, Mark ); +inherit(RectMark, Mark); /** * Constructor name. @@ -170,7 +166,7 @@ inherit( RectMark, Mark ); * @readonly * @type {string} */ -setNonEnumerableReadOnly( RectMark, 'name', 'RectMark' ); +setNonEnumerableReadOnly(RectMark, 'name', 'RectMark'); /** * Radius in pixels of rounded rectangle corners for all four corners. @@ -188,7 +184,7 @@ setNonEnumerableReadOnly( RectMark, 'name', 'RectMark' ); * var v = mark.cornerRadius; * // returns 5 */ -setReadWriteAccessor( RectMark.prototype, 'cornerRadius', getCornerRadius, setCornerRadius ); +setReadWriteAccessor(RectMark.prototype, 'cornerRadius', getCornerRadius, setCornerRadius); /** * Radius in pixels of rounded rectangle corner for the bottom left corner. @@ -205,7 +201,7 @@ setReadWriteAccessor( RectMark.prototype, 'cornerRadius', getCornerRadius, setCo * var v = mark.cornerRadiusBottomLeft; * // returns 3 */ -setReadWriteAccessor( RectMark.prototype, 'cornerRadiusBottomLeft', getCornerRadiusBottomLeft, setCornerRadiusBottomLeft ); +setReadWriteAccessor(RectMark.prototype, 'cornerRadiusBottomLeft', getCornerRadiusBottomLeft, setCornerRadiusBottomLeft); /** * Radius in pixels of rounded rectangle corner for the bottom right corner. @@ -222,7 +218,7 @@ setReadWriteAccessor( RectMark.prototype, 'cornerRadiusBottomLeft', getCornerRad * var v = mark.cornerRadiusBottomRight; * // returns 3 */ -setReadWriteAccessor( RectMark.prototype, 'cornerRadiusBottomRight', getCornerRadiusBottomRight, setCornerRadiusBottomRight ); +setReadWriteAccessor(RectMark.prototype, 'cornerRadiusBottomRight', getCornerRadiusBottomRight, setCornerRadiusBottomRight); /** * Radius in pixels of rounded rectangle corner for the top left corner. @@ -239,7 +235,7 @@ setReadWriteAccessor( RectMark.prototype, 'cornerRadiusBottomRight', getCornerRa * var v = mark.cornerRadiusTopLeft; * // returns 3 */ -setReadWriteAccessor( RectMark.prototype, 'cornerRadiusTopLeft', getCornerRadiusTopLeft, setCornerRadiusTopLeft ); +setReadWriteAccessor(RectMark.prototype, 'cornerRadiusTopLeft', getCornerRadiusTopLeft, setCornerRadiusTopLeft); /** * Radius in pixels of rounded rectangle corner for the top right corner. @@ -256,7 +252,7 @@ setReadWriteAccessor( RectMark.prototype, 'cornerRadiusTopLeft', getCornerRadius * var v = mark.cornerRadiusTopRight; * // returns 3 */ -setReadWriteAccessor( RectMark.prototype, 'cornerRadiusTopRight', getCornerRadiusTopRight, setCornerRadiusTopRight ); +setReadWriteAccessor(RectMark.prototype, 'cornerRadiusTopRight', getCornerRadiusTopRight, setCornerRadiusTopRight); /** * Mark properties. @@ -271,7 +267,7 @@ setReadWriteAccessor( RectMark.prototype, 'cornerRadiusTopRight', getCornerRadiu * var v = mark.properties; * // returns [...] */ -setNonEnumerableReadOnlyAccessor( RectMark.prototype, 'properties', getProperties ); +setNonEnumerableReadOnlyAccessor(RectMark.prototype, 'properties', getProperties); /** * Mark type. @@ -289,7 +285,7 @@ setNonEnumerableReadOnlyAccessor( RectMark.prototype, 'properties', getPropertie * var v = mark.type; * // returns 'rect' */ -setReadWriteAccessor( RectMark.prototype, 'type', getType, setType ); +setReadWriteAccessor(RectMark.prototype, 'type', getType, setType); /** * Serializes an instance to a JSON object. @@ -311,8 +307,8 @@ setReadWriteAccessor( RectMark.prototype, 'type', getType, setType ); * var v = mark.toJSON(); * // returns {...} */ -setNonEnumerableReadOnly( RectMark.prototype, 'toJSON', function toJSON() { - return instance2json( this, properties ); +setNonEnumerableReadOnly(RectMark.prototype, 'toJSON', function toJSON() { + return instance2json(this, properties); }); From c7bc0970223c07cec2d4c6acc38cf74f4204c7f8 Mon Sep 17 00:00:00 2001 From: orthodox-64 Date: Thu, 9 Apr 2026 21:02:24 +0530 Subject: [PATCH 4/4] fix: spacing --- 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../lib/corner-radius-bottom-right/get.js | 2 +- .../rect/lib/corner-radius-top-left/get.js | 2 +- .../rect/lib/corner-radius-top-right/get.js | 2 +- .../vega/mark/rect/lib/corner-radius/get.js | 2 +- .../@stdlib/plot/vega/mark/rect/lib/main.js | 74 ++++++++++--------- 5 files changed, 43 insertions(+), 39 deletions(-) diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-right/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-right/get.js index 8070ac36121e..cf516904d819 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-right/get.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-bottom-right/get.js @@ -34,7 +34,7 @@ var prop = require( './properties.js' ); * @returns {number} corner radius */ function get() { - return this[prop.private]; + return this[ prop.private ]; } diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-left/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-left/get.js index 4308e3601418..c8dfeab6912c 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-left/get.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-left/get.js @@ -34,7 +34,7 @@ var prop = require( './properties.js' ); * @returns {number} corner radius */ function get() { - return this[prop.private]; + return this[ prop.private ]; } diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-right/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-right/get.js index 5da843e559ed..848a342e05ab 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-right/get.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius-top-right/get.js @@ -34,7 +34,7 @@ var prop = require( './properties.js' ); * @returns {number} corner radius */ function get() { - return this[prop.private]; + return this[ prop.private ]; } diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius/get.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius/get.js index b2569e045d00..75476cbc7cf0 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius/get.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/corner-radius/get.js @@ -34,7 +34,7 @@ var prop = require( './properties.js' ); * @returns {number} corner radius */ function get() { - return this[prop.private]; + return this[ prop.private ]; } diff --git a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/main.js b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/main.js index b020375ae35b..ed786a66d637 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/main.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/rect/lib/main.js @@ -36,6 +36,8 @@ var Mark = require( '@stdlib/plot/vega/mark/base/ctor' ); var format = require( '@stdlib/string/format' ); var properties = require( './properties.json' ); var defaults = require( './defaults.js' ); + +// Note: keep the following in alphabetical order according to the `require` path... var getCornerRadius = require( './corner-radius/get.js' ); var setCornerRadius = require( './corner-radius/set.js' ); @@ -52,14 +54,16 @@ var getCornerRadiusTopRight = require( './corner-radius-top-right/get.js' ); var setCornerRadiusTopRight = require( './corner-radius-top-right/set.js' ); var getProperties = require( './properties/get.js' ); + var getType = require( './type/get.js' ); var setType = require( './type/set.js' ); + var TYPE = require( './type/type.js' ); // VARIABLES // -var debug = logger('vega:rect-mark:main'); +var debug = logger(' vega:rect-mark:main '); // MAIN // @@ -99,53 +103,53 @@ var debug = logger('vega:rect-mark:main'); * }); * // returns */ -function RectMark(options) { +function RectMark( options ) { var opts; var keys; var v; var k; var i; - if (!(this instanceof RectMark)) { - if (arguments.length === 0) { - return new RectMark({}); + if ( !( this instanceof RectMark ) ) { + if ( arguments.length === 0 ) { + return new RectMark( {} ); } - return new RectMark(options); + return new RectMark( options ); } - if (arguments.length === 0) { + if ( arguments.length === 0 ) { options = {}; } - if (!isObject(options)) { - throw new TypeError(format('invalid argument. Options argument must be an object. Value: `%s`.', options)); + if ( !isObject( options ) ) { + throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); } - if (hasProp(options, 'type') && options.type !== TYPE) { - throw new TypeError(format('invalid argument. `%s` option must be equal to "%s". Option: `%s`.', 'type', TYPE, options.type)); + if ( hasProp( options, 'type' ) && options.type !== TYPE ) { + throw new TypeError( format( 'invalid argument. `%s` option must be equal to "%s". Option: `%s`.', 'type', TYPE, options.type ) ); } options.type = TYPE; - Mark.call(this, options); + Mark.call( this, options ); // Resolve the default configuration: opts = defaults(); // Set internal properties according to the default configuration... - keys = objectKeys(opts); - for (i = 0; i < keys.length; i++) { - k = keys[i]; - this['_' + k] = opts[k]; + keys = objectKeys( opts ); + for ( i = 0; i < keys.length; i++ ) { + k = keys[ i ]; + this[ '_'+k ] = opts[ k ]; } // Validate provided options by attempting to assign option values to corresponding fields... - for (i = 0; i < properties.length; i++) { - k = properties[i]; - if (!hasProp(options, k)) { + for ( i = 0; i < properties.length; i++ ) { + k = properties[ i ]; + if ( !hasProp( options, k ) ) { continue; } - v = options[k]; + v = options[ k ]; try { - this[k] = v; - } catch (err) { - debug('Encountered an error. Error: %s', err.message); + this[ k ] = v; + } catch ( err ) { + debug( 'Encountered an error. Error: %s', err.message ); // FIXME: retain thrown error type - throw new Error(transformErrorMessage(err.message)); + throw new Error( transformErrorMessage( err.message ) ); } } this._type = TYPE; @@ -155,7 +159,7 @@ function RectMark(options) { /* * Inherit from a parent prototype. */ -inherit(RectMark, Mark); +inherit( RectMark, Mark ); /** * Constructor name. @@ -166,7 +170,7 @@ inherit(RectMark, Mark); * @readonly * @type {string} */ -setNonEnumerableReadOnly(RectMark, 'name', 'RectMark'); +setNonEnumerableReadOnly( RectMark, 'name', 'RectMark' ); /** * Radius in pixels of rounded rectangle corners for all four corners. @@ -184,7 +188,7 @@ setNonEnumerableReadOnly(RectMark, 'name', 'RectMark'); * var v = mark.cornerRadius; * // returns 5 */ -setReadWriteAccessor(RectMark.prototype, 'cornerRadius', getCornerRadius, setCornerRadius); +setReadWriteAccessor( RectMark.prototype, 'cornerRadius', getCornerRadius, setCornerRadius ); /** * Radius in pixels of rounded rectangle corner for the bottom left corner. @@ -201,7 +205,7 @@ setReadWriteAccessor(RectMark.prototype, 'cornerRadius', getCornerRadius, setCor * var v = mark.cornerRadiusBottomLeft; * // returns 3 */ -setReadWriteAccessor(RectMark.prototype, 'cornerRadiusBottomLeft', getCornerRadiusBottomLeft, setCornerRadiusBottomLeft); +setReadWriteAccessor( RectMark.prototype, 'cornerRadiusBottomLeft', getCornerRadiusBottomLeft, setCornerRadiusBottomLeft ); /** * Radius in pixels of rounded rectangle corner for the bottom right corner. @@ -218,7 +222,7 @@ setReadWriteAccessor(RectMark.prototype, 'cornerRadiusBottomLeft', getCornerRadi * var v = mark.cornerRadiusBottomRight; * // returns 3 */ -setReadWriteAccessor(RectMark.prototype, 'cornerRadiusBottomRight', getCornerRadiusBottomRight, setCornerRadiusBottomRight); +setReadWriteAccessor( RectMark.prototype, 'cornerRadiusBottomRight', getCornerRadiusBottomRight, setCornerRadiusBottomRight ); /** * Radius in pixels of rounded rectangle corner for the top left corner. @@ -235,7 +239,7 @@ setReadWriteAccessor(RectMark.prototype, 'cornerRadiusBottomRight', getCornerRad * var v = mark.cornerRadiusTopLeft; * // returns 3 */ -setReadWriteAccessor(RectMark.prototype, 'cornerRadiusTopLeft', getCornerRadiusTopLeft, setCornerRadiusTopLeft); +setReadWriteAccessor( RectMark.prototype, 'cornerRadiusTopLeft', getCornerRadiusTopLeft, setCornerRadiusTopLeft ); /** * Radius in pixels of rounded rectangle corner for the top right corner. @@ -252,7 +256,7 @@ setReadWriteAccessor(RectMark.prototype, 'cornerRadiusTopLeft', getCornerRadiusT * var v = mark.cornerRadiusTopRight; * // returns 3 */ -setReadWriteAccessor(RectMark.prototype, 'cornerRadiusTopRight', getCornerRadiusTopRight, setCornerRadiusTopRight); +setReadWriteAccessor( RectMark.prototype, 'cornerRadiusTopRight', getCornerRadiusTopRight, setCornerRadiusTopRight ); /** * Mark properties. @@ -267,7 +271,7 @@ setReadWriteAccessor(RectMark.prototype, 'cornerRadiusTopRight', getCornerRadius * var v = mark.properties; * // returns [...] */ -setNonEnumerableReadOnlyAccessor(RectMark.prototype, 'properties', getProperties); +setNonEnumerableReadOnlyAccessor( RectMark.prototype, 'properties', getProperties ); /** * Mark type. @@ -285,7 +289,7 @@ setNonEnumerableReadOnlyAccessor(RectMark.prototype, 'properties', getProperties * var v = mark.type; * // returns 'rect' */ -setReadWriteAccessor(RectMark.prototype, 'type', getType, setType); +setReadWriteAccessor( RectMark.prototype, 'type', getType, setType ); /** * Serializes an instance to a JSON object. @@ -307,8 +311,8 @@ setReadWriteAccessor(RectMark.prototype, 'type', getType, setType); * var v = mark.toJSON(); * // returns {...} */ -setNonEnumerableReadOnly(RectMark.prototype, 'toJSON', function toJSON() { - return instance2json(this, properties); +setNonEnumerableReadOnly( RectMark.prototype, 'toJSON', function toJSON() { + return instance2json( this, properties ); });