From dc19da747ce0d0f4fe0f49212e3c6e70947eb7b1 Mon Sep 17 00:00:00 2001 From: orthodox-64 Date: Sat, 4 Apr 2026 02:58:53 +0530 Subject: [PATCH] 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__": {} +}