diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/blend/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/blend/get.js new file mode 100644 index 000000000000..b2f1787b2c5c --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/blend/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 color blend mode for drawing an item on its current background. +* +* @private +* @returns {(string|void)} blend mode +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/blend/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/blend/properties.js new file mode 100644 index 000000000000..0b93331a25ee --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/blend/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( 'blend' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/blend/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/blend/set.js new file mode 100644 index 000000000000..0993c521449c --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/blend/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the color blend mode for drawing an item on its current background. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(string|void)} value - input value +* @throws {TypeError} must be a string +* @returns {void} +*/ +function set( value ) { + if ( !isString( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a string. 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/base/ctor/lib/clip/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/clip/get.js new file mode 100644 index 000000000000..3b52b6fca379 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/clip/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 setting indicating whether to clip marks to a specified shape. +* +* @private +* @returns {(boolean|Clip)} clip configuration +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/clip/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/clip/properties.js new file mode 100644 index 000000000000..c11defca131d --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/clip/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( 'clip' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/clip/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/clip/set.js new file mode 100644 index 000000000000..f3abdd339ab2 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/clip/set.js @@ -0,0 +1,67 @@ +/** +* @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 isClip = require( '@stdlib/plot/vega/base/assert/is-clip' ); +var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var Clip = require( '@stdlib/plot/vega/mark/clip' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the setting indicating whether to clip marks to a specified shape. +* +* @private +* @param {(boolean|Clip)} value - input value +* @throws {TypeError} must be either a boolean or a Clip instance +* @returns {void} +*/ +function set( value ) { + if ( isBoolean( value ) && value ) { + value = new Clip(); + } else if ( !isClip( value ) && !isBoolean( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be either a boolean, an clip instance, or a signal. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + this._removeChangeListener( this[ prop.private ] ); + debug( 'Current value: %s. New value: %s.', JSON.stringify( this[ prop.private ] ), JSON.stringify( value ) ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + this._addChangeListener( this[ prop.private ] ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/cursor/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/cursor/get.js new file mode 100644 index 000000000000..a50eaba9fb55 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/cursor/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 mouse cursor used over the mark. +* +* @private +* @returns {(string|void)} cursor +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/cursor/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/cursor/properties.js new file mode 100644 index 000000000000..d6e36598838e --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/cursor/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( 'cursor' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/cursor/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/cursor/set.js new file mode 100644 index 000000000000..11400fe3c674 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/cursor/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the mouse cursor used over the mark. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(string|void)} value - input value +* @throws {TypeError} must be a string +* @returns {void} +*/ +function set( value ) { + if ( !isString( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a string. 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/base/ctor/lib/description/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/description/get.js new file mode 100644 index 000000000000..5a07a23b8bbf --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/description/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 text description of a mark for ARIA accessibility. +* +* @private +* @returns {(string|void)} mark description +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/description/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/description/properties.js new file mode 100644 index 000000000000..58e0d898ddeb --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/description/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( 'description' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/description/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/description/set.js new file mode 100644 index 000000000000..f5c4ff75d98a --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/description/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the text description of a mark for ARIA accessibility. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(string|void)} value - input value +* @throws {TypeError} must be a string +* @returns {void} +*/ +function set( value ) { + if ( !isString( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a string. 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/base/ctor/lib/fill/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/fill/get.js new file mode 100644 index 000000000000..e5f9b6ee4bd7 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/fill/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 fill color. +* +* @private +* @returns {(string|void)} fill color +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/fill/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/fill/properties.js new file mode 100644 index 000000000000..6ce7aa5bd188 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/fill/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( 'fill' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/fill/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/fill/set.js new file mode 100644 index 000000000000..5cfee324a9f3 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/fill/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the fill color. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(string|void)} value - input value +* @throws {TypeError} must be a string +* @returns {void} +*/ +function set( value ) { + if ( !isString( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a string. 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/base/ctor/lib/fillOpacity/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/fillOpacity/get.js new file mode 100644 index 000000000000..7ba46ef3d3bb --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/fillOpacity/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 fill opacity from 0 (transparent) to 1 (opaque). +* +* @private +* @returns {(number|void)} fill opacity +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/fillOpacity/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/fillOpacity/properties.js new file mode 100644 index 000000000000..0464b366824b --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/fillOpacity/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( 'fillOpacity' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/fillOpacity/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/fillOpacity/set.js new file mode 100644 index 000000000000..a6791ea163c6 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/fillOpacity/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the fill opacity from 0 (transparent) to 1 (opaque). +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(NonNegativeNumber|void)} value - input value +* @throws {TypeError} must be a nonnegative number +* @returns {void} +*/ +function set( 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 ] ) { + 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/base/ctor/lib/height/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/height/get.js new file mode 100644 index 000000000000..c24e8f4fcb41 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/height/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 height of the mark in pixels. +* +* @private +* @returns {(number|void)} height +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/height/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/height/properties.js new file mode 100644 index 000000000000..78fa700b71f6 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/height/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( 'height' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/height/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/height/set.js new file mode 100644 index 000000000000..474ae45daf0c --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/height/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the height of the mark in pixels. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(NonNegativeNumber|void)} value - input value +* @throws {TypeError} must be a nonnegative number +* @returns {void} +*/ +function set( 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 ] ) { + 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/base/ctor/lib/href/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/href/get.js new file mode 100644 index 000000000000..ecc118fb3a42 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/href/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 a URL to load upon mouse click. +* +* @private +* @returns {(string|void)} URL +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/href/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/href/properties.js new file mode 100644 index 000000000000..2d60ef37e511 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/href/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( 'href' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/href/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/href/set.js new file mode 100644 index 000000000000..a4763f7a3541 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/href/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets a URL to load upon mouse click. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(string|void)} value - input value +* @throws {TypeError} must be a string +* @returns {void} +*/ +function set( value ) { + if ( !isString( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a string. 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/base/ctor/lib/interactive/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/interactive/get.js new file mode 100644 index 000000000000..53209537821e --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/interactive/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 a boolean indicating whether a mark can serve as an input event source. +* +* @private +* @returns {(boolean|Signal)} boolean flag or signal +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/interactive/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/interactive/properties.js new file mode 100644 index 000000000000..7448e9d47cb7 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/interactive/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( 'interactive' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/interactive/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/interactive/set.js new file mode 100644 index 000000000000..3a7e7fcdf761 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/interactive/set.js @@ -0,0 +1,62 @@ +/** +* @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 isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var isObject = require( '@stdlib/assert/is-object' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets a boolean indicating whether a mark can serve as an input event source. +* +* @private +* @param {boolean} value - input value +* @throws {TypeError} must be a boolean +* @returns {void} +*/ +function set( value ) { + if ( !isBoolean( value ) && !isObject( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be either boolean or a signal. 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/base/ctor/lib/main.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/main.js index 93d0846e4457..ccf535299f8b 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/main.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/main.js @@ -16,7 +16,7 @@ * limitations under the License. */ -/* eslint-disable no-restricted-syntax, no-invalid-this */ +/* eslint-disable no-restricted-syntax, no-invalid-this, stdlib/no-empty-lines-between-requires */ 'use strict'; @@ -41,20 +41,110 @@ var defaults = require( './defaults.js' ); var getARIA = require( './aria/get.js' ); var setARIA = require( './aria/set.js' ); +var getBlend = require( './blend/get.js' ); +var setBlend = require( './blend/set.js' ); + +var getClip = require( './clip/get.js' ); +var setClip = require( './clip/set.js' ); + +var getCursor = require( './cursor/get.js' ); +var setCursor = require( './cursor/set.js' ); + +var getDescription = require( './description/get.js' ); +var setDescription = require( './description/set.js' ); + var getEncode = require( './encode/get.js' ); var setEncode = require( './encode/set.js' ); +var getFill = require( './fill/get.js' ); +var setFill = require( './fill/set.js' ); + +var getFillOpacity = require( './fillOpacity/get.js' ); +var setFillOpacity = require( './fillOpacity/set.js' ); + var getFrom = require( './from/get.js' ); var setFrom = require( './from/set.js' ); +var getHeight = require( './height/get.js' ); +var setHeight = require( './height/set.js' ); + +var getHref = require( './href/get.js' ); +var setHref = require( './href/set.js' ); + +var getInteractive = require( './interactive/get.js' ); +var setInteractive = require( './interactive/set.js' ); + +var getName = require( './name/get.js' ); +var setName = require( './name/set.js' ); + +var getOpacity = require( './opacity/get.js' ); +var setOpacity = require( './opacity/set.js' ); + var getProperties = require( './properties/get.js' ); +var getRole = require( './role/get.js' ); +var setRole = require( './role/set.js' ); + +var getSort = require( './sort/get.js' ); +var setSort = require( './sort/set.js' ); + +var getStroke = require( './stroke/get.js' ); +var setStroke = require( './stroke/set.js' ); + +var getStrokeCap = require( './strokeCap/get.js' ); +var setStrokeCap = require( './strokeCap/set.js' ); + +var getStrokeDash = require( './strokeDash/get.js' ); +var setStrokeDash = require( './strokeDash/set.js' ); + +var getStrokeDashOffset = require( './strokeDashOffset/get.js' ); +var setStrokeDashOffset = require( './strokeDashOffset/set.js' ); + +var getStrokeJoin = require( './strokeJoin/get.js' ); +var setStrokeJoin = require( './strokeJoin/set.js' ); + +var getStrokeMiterLimit = require( './strokeMiterLimit/get.js' ); +var setStrokeMiterLimit = require( './strokeMiterLimit/set.js' ); + +var getStrokeOpacity = require( './strokeOpacity/get.js' ); +var setStrokeOpacity = require( './strokeOpacity/set.js' ); + +var getStrokeWidth = require( './strokeWidth/get.js' ); +var setStrokeWidth = require( './strokeWidth/set.js' ); + +var getStyle = require( './style/get.js' ); +var setStyle = require( './style/set.js' ); + +var getTooltip = require( './tooltip/get.js' ); +var setTooltip = require( './tooltip/set.js' ); + var getTriggers = require( './triggers/get.js' ); var setTriggers = require( './triggers/set.js' ); var getType = require( './type/get.js' ); var setType = require( './type/set.js' ); +var getWidth = require( './width/get.js' ); +var setWidth = require( './width/set.js' ); + +var getX = require( './x/get.js' ); +var setX = require( './x/set.js' ); + +var getX2 = require( './x2/get.js' ); +var setX2 = require( './x2/set.js' ); + +var getXc = require( './xc/get.js' ); +var setXc = require( './xc/set.js' ); + +var getY = require( './y/get.js' ); +var setY = require( './y/set.js' ); + +var getY2 = require( './y2/get.js' ); +var setY2 = require( './y2/set.js' ); + +var getYc = require( './yc/get.js' ); +var setYc = require( './yc/set.js' ); + var getZIndex = require( './zindex/get.js' ); var setZIndex = require( './zindex/set.js' ); @@ -73,18 +163,41 @@ var debug = logger( 'vega:mark:main' ); * @param {Options} options - constructor options * @param {string} options.type - mark type * @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 {string} [options.blend] - color blend mode for drawing an item on its current background +* @param {(boolean|Clip)} [options.clip=false] - setting indicating whether to clip marks to a specified shape +* @param {string} [options.cursor] - mouse cursor used over the mark * @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 {string} [options.fill] - fill color +* @param {number} [options.fillOpacity] - fill opacity from 0 (transparent) to 1 (opaque) * @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 {number} [options.height] - height of the mark in pixels +* @param {string} [options.href] - URL to load upon mouse click +* @param {(boolean|Signal)} [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 {number} [options.opacity] - mark opacity from 0 (transparent) to 1 (opaque) * @param {string} [options.role] - metadata string indicating the role of a mark +* @param {Compare} [options.sort] - comparator for sorting mark items +* @param {string} [options.stroke] - stroke color +* @param {string} [options.strokeCap] - stroke cap for line ending style +* @param {NumericArray} [options.strokeDash] - array of [stroke, space] lengths for creating dashed or dotted lines +* @param {number} [options.strokeDashOffset] - pixel offset at which to start the stroke dash array +* @param {string} [options.strokeJoin] - stroke line join method +* @param {number} [options.strokeMiterLimit] - miter limit at which to bevel a line join +* @param {number} [options.strokeOpacity] - stroke opacity from 0 (transparent) to 1 (opaque) +* @param {number} [options.strokeWidth] - stroke width in pixels * @param {(string|Array)} [options.style] - custom styles to apply to a mark +* @param {*} [options.tooltip] - tooltip text to show upon mouse hover +* @param {Array} [options.transforms=[]] - list of post-encoding transforms to apply after any "encode" blocks and which operate directly on mark scenegraph items +* @param {Array} [options.triggers=[]] - list of triggers for modifying mark properties in response to signal changes +* @param {number} [options.width] - width of the mark in pixels +* @param {number} [options.x] - primary x-coordinate in pixels +* @param {number} [options.x2] - secondary x-coordinate in pixels +* @param {number} [options.xc] - center x-coordinate +* @param {number} [options.y] - primary y-coordinate in pixels +* @param {number} [options.y2] - secondary y-coordinate in pixels +* @param {number} [options.yc] - center y-coordinate * @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 {Error} must provide valid options @@ -97,18 +210,24 @@ var debug = logger( 'vega:mark:main' ); * // returns */ function Mark( options ) { + var self; var opts; var keys; var v; var k; var i; if ( !( this instanceof Mark ) ) { - return new Mark( options ); + if ( arguments.length ) { + return new Mark( options ); + } + return new Mark(); } - EventEmitter.call( this ); if ( !isObject( options ) ) { throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); } + self = this; + EventEmitter.call( this ); + // Resolve the default configuration: opts = defaults(); @@ -127,6 +246,15 @@ function Mark( options ) { if ( !hasProp( options, 'type' ) ) { throw new TypeError( 'invalid argument. Options argument must specify the mark type.' ); } + // Define an internal change event listener: + this._onChange = onChange; + + // Add change listeners to default event emitters: + if ( this._clip && typeof this._clip.on === 'function' ) { + this._addChangeListener( this._clip ); + } + this._addChangeListener( this._sort ); + // Validate provided options by attempting to assign option values to corresponding fields... for ( i = 0; i < properties.length; i++ ) { k = properties[ i ]; @@ -148,6 +276,17 @@ function Mark( options ) { } } return this; + + /** + * Callback invoked upon a change event. + * + * @private + * @param {Object} event - event object + */ + function onChange( event ) { + debug( 'Received a change event: %s', JSON.stringify( event ) ); + self.emit( 'change', event ); + } } /* @@ -166,6 +305,76 @@ inherit( Mark, EventEmitter ); */ setNonEnumerableReadOnly( Mark, 'name', 'Mark' ); +/** +* Adds an internal listener to a change event on a child instance. +* +* @private +* @name _addChangeListener +* @memberof Mark.prototype +* @type {Function} +* @param {Object} emitter - event emitter +* @returns {Mark} visualization instance +*/ +setNonEnumerableReadOnly( Mark.prototype, '_addChangeListener', function addChangeListener( emitter ) { + if ( emitter && typeof emitter.on === 'function' ) { + emitter.on( 'change', this._onChange ); + } + return this; +}); + +/** +* Adds internal listeners to change events on child instances. +* +* @private +* @name _addChangeListeners +* @memberof Mark.prototype +* @type {Function} +* @param {ArrayLikeObject} emitters - list of event emitters +* @returns {Mark} visualization instance +*/ +setNonEnumerableReadOnly( Mark.prototype, '_addChangeListeners', function addChangeListeners( emitters ) { + var i; + for ( i = 0; i < emitters.length; i++ ) { + this._addChangeListener( emitters[ i ] ); + } + return this; +}); + +/** +* Removes an internal listener to a change event on a child instance. +* +* @private +* @name _removeChangeListener +* @memberof Mark.prototype +* @type {Function} +* @param {Object} emitter - event emitter +* @returns {Mark} visualization instance +*/ +setNonEnumerableReadOnly( Mark.prototype, '_removeChangeListener', function removeChangeListener( emitter ) { + if ( emitter && typeof emitter.removeListener === 'function' ) { + emitter.removeListener( 'change', this._onChange ); + } + return this; +}); + +/** +* Removes internal listeners to change events on child instances. +* +* @private +* @name _removeChangeListeners +* @memberof Mark.prototype +* @type {Function} +* @param {ArrayLikeObject} emitters - list of event emitters +* @returns {Mark} visualization instance +*/ +setNonEnumerableReadOnly( Mark.prototype, '_removeChangeListeners', function removeChangeListeners( emitters ) { + var i; + for ( i = 0; i < emitters.length; i++ ) { + this._removeChangeListener( emitters[ i ] ); + } + return this; +}); + /** * Boolean indicating whether to include ARIA attributes in SVG output. * @@ -185,6 +394,82 @@ setNonEnumerableReadOnly( Mark, 'name', 'Mark' ); */ setReadWriteAccessor( Mark.prototype, 'aria', getARIA, setARIA ); +/** +* Color blend mode for drawing an item on its current background. +* +* @name blend +* @memberof Mark.prototype +* @type {(string|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'blend': 'multiply' +* }); +* +* var v = mark.blend; +* // returns 'multiply' +*/ +setReadWriteAccessor( Mark.prototype, 'blend', getBlend, setBlend ); + +/** +* Setting indicating whether to clip marks to a specified shape. +* +* @name clip +* @memberof Mark.prototype +* @type {(boolean|Clip)} +* @default false +* +* @example +* var Clip = require( '@stdlib/plot/vega/mark/clip' ); +* +* var clip = new Clip(); +* var mark = new Mark({ +* 'type': 'line', +* 'clip': clip +* }); +* +* var v = mark.clip; +* // returns +*/ +setReadWriteAccessor( Mark.prototype, 'clip', getClip, setClip ); + +/** +* Mouse cursor used over the mark. +* +* @name cursor +* @memberof Mark.prototype +* @type {(string|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'cursor': 'pointer' +* }); +* +* var v = mark.cursor; +* // returns 'pointer' +*/ +setReadWriteAccessor( Mark.prototype, 'cursor', getCursor, setCursor ); + +/** +* Text description of a mark for ARIA accessibility in SVG output. +* +* @name description +* @memberof Mark.prototype +* @type {(string|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'description': '' +* }); +* +* var v = mark.description; +* // returns '' +*/ +setReadWriteAccessor( Mark.prototype, 'description', getDescription, setDescription ); + /** * Visual encoding rules for mark properties. * @@ -209,6 +494,42 @@ setReadWriteAccessor( Mark.prototype, 'aria', getARIA, setARIA ); */ setReadWriteAccessor( Mark.prototype, 'encode', getEncode, setEncode ); +/** +* Fill color. +* +* @name fill +* @memberof Mark.prototype +* @type {(string|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'fill': 'steelblue' +* }); +* +* var v = mark.fill; +* // returns 'steelblue' +*/ +setReadWriteAccessor( Mark.prototype, 'fill', getFill, setFill ); + +/** +* Fill opacity from 0 (transparent) to 1 (opaque). +* +* @name fillOpacity +* @memberof Mark.prototype +* @type {(number|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'fillOpacity': 0.5 +* }); +* +* var v = mark.fillOpacity; +* // returns 0.5 +*/ +setReadWriteAccessor( Mark.prototype, 'fillOpacity', getFillOpacity, setFillOpacity ); + /** * Mark data source. * @@ -229,6 +550,97 @@ setReadWriteAccessor( Mark.prototype, 'encode', getEncode, setEncode ); */ setReadWriteAccessor( Mark.prototype, 'from', getFrom, setFrom ); +/** +* Height of the mark in pixels. +* +* @name height +* @memberof Mark.prototype +* @type {(number|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'rect', +* 'height': 100 +* }); +* +* var v = mark.height; +* // returns 100 +*/ +setReadWriteAccessor( Mark.prototype, 'height', getHeight, setHeight ); + +/** +* URL to load upon mouse click. +* +* @name href +* @memberof Mark.prototype +* @type {(string|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'href': 'https://example.com' +* }); +* +* var v = mark.href; +* // returns 'https://example.com' +*/ +setReadWriteAccessor( Mark.prototype, 'href', getHref, setHref ); + +/** +* Boolean indicating whether a mark can serve as an input event source. +* +* @name interactive +* @memberof Mark.prototype +* @type {(boolean|Signal)} +* @default true +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'interactive': true +* }); +* +* var v = mark.interactive; +* // returns true +*/ +setReadWriteAccessor( Mark.prototype, 'interactive', getInteractive, setInteractive ); + +/** +* Unique name. +* +* @name name +* @memberof Mark.prototype +* @type {(string|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'name': '' +* }); +* +* var v = mark.name; +* // returns '' +*/ +setReadWriteAccessor( Mark.prototype, 'name', getName, setName ); + +/** +* Mark opacity from 0 (transparent) to 1 (opaque). +* +* @name opacity +* @memberof Mark.prototype +* @type {(number|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'opacity': 0.8 +* }); +* +* var v = mark.opacity; +* // returns 0.8 +*/ +setReadWriteAccessor( Mark.prototype, 'opacity', getOpacity, setOpacity ); + /** * Mark properties. * @@ -246,6 +658,227 @@ setReadWriteAccessor( Mark.prototype, 'from', getFrom, setFrom ); */ setNonEnumerableReadOnlyAccessor( Mark.prototype, 'properties', getProperties ); +/** +* Metadata string indicating the role of a mark. +* +* @name role +* @memberof Mark.prototype +* @type {(string|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'role': '' +* }); +* +* var v = mark.role; +* // returns '' +*/ +setReadWriteAccessor( Mark.prototype, 'role', getRole, setRole ); + +/** +* Comparator for sorting mark items. +* +* @name sort +* @memberof Mark.prototype +* @type {(Compare|void)} +* +* @example +* var Compare = require( '@stdlib/plot/vega/compare/ctor' ); +* +* var compare = new Compare({ +* 'field': 'amount' +* }); +* var mark = new Mark({ +* 'type': 'line', +* 'sort': compare +* }); +* +* var v = mark.sort; +* // returns +*/ +setReadWriteAccessor( Mark.prototype, 'sort', getSort, setSort ); + +/** +* Stroke color. +* +* @name stroke +* @memberof Mark.prototype +* @type {(string|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'stroke': 'red' +* }); +* +* var v = mark.stroke; +* // returns 'red' +*/ +setReadWriteAccessor( Mark.prototype, 'stroke', getStroke, setStroke ); + +/** +* Stroke cap for line ending style. +* +* @name strokeCap +* @memberof Mark.prototype +* @type {(string|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'strokeCap': 'round' +* }); +* +* var v = mark.strokeCap; +* // returns 'round' +*/ +setReadWriteAccessor( Mark.prototype, 'strokeCap', getStrokeCap, setStrokeCap ); + +/** +* Stroke dash array of [stroke, space] lengths for creating dashed or dotted lines. +* +* @name strokeDash +* @memberof Mark.prototype +* @type {(NumericArray|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'strokeDash': [ 4, 2 ] +* }); +* +* var v = mark.strokeDash; +* // returns [ 4, 2 ] +*/ +setReadWriteAccessor( Mark.prototype, 'strokeDash', getStrokeDash, setStrokeDash ); + +/** +* Pixel offset at which to start the stroke dash array. +* +* @name strokeDashOffset +* @memberof Mark.prototype +* @type {(number|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'strokeDashOffset': 2 +* }); +* +* var v = mark.strokeDashOffset; +* // returns 2 +*/ +setReadWriteAccessor( Mark.prototype, 'strokeDashOffset', getStrokeDashOffset, setStrokeDashOffset ); + +/** +* Stroke line join method. +* +* @name strokeJoin +* @memberof Mark.prototype +* @type {(string|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'strokeJoin': 'round' +* }); +* +* var v = mark.strokeJoin; +* // returns 'round' +*/ +setReadWriteAccessor( Mark.prototype, 'strokeJoin', getStrokeJoin, setStrokeJoin ); + +/** +* Miter limit at which to bevel a line join. +* +* @name strokeMiterLimit +* @memberof Mark.prototype +* @type {(number|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'strokeMiterLimit': 10 +* }); +* +* var v = mark.strokeMiterLimit; +* // returns 10 +*/ +setReadWriteAccessor( Mark.prototype, 'strokeMiterLimit', getStrokeMiterLimit, setStrokeMiterLimit ); + +/** +* Stroke opacity from 0 (transparent) to 1 (opaque). +* +* @name strokeOpacity +* @memberof Mark.prototype +* @type {(number|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'strokeOpacity': 0.5 +* }); +* +* var v = mark.strokeOpacity; +* // returns 0.5 +*/ +setReadWriteAccessor( Mark.prototype, 'strokeOpacity', getStrokeOpacity, setStrokeOpacity ); + +/** +* Stroke width in pixels. +* +* @name strokeWidth +* @memberof Mark.prototype +* @type {(number|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'strokeWidth': 2 +* }); +* +* var v = mark.strokeWidth; +* // returns 2 +*/ +setReadWriteAccessor( Mark.prototype, 'strokeWidth', getStrokeWidth, setStrokeWidth ); + +/** +* Custom styles to apply to a mark. +* +* @name style +* @memberof Mark.prototype +* @type {(string|Array)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'style': [ '' ] +* }); +* +* var v = mark.style; +* // returns [ '' ] +*/ +setReadWriteAccessor( Mark.prototype, 'style', getStyle, setStyle ); + +/** +* Tooltip text to show upon mouse hover. +* +* @name tooltip +* @memberof Mark.prototype +* @type {*} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'tooltip': 'Hello' +* }); +* +* var v = mark.tooltip; +* // returns 'Hello' +*/ +setReadWriteAccessor( Mark.prototype, 'tooltip', getTooltip, setTooltip ); + /** * List of triggers for modifying mark properties in response to signal changes. * @@ -281,12 +914,138 @@ setReadWriteAccessor( Mark.prototype, 'triggers', getTriggers, setTriggers ); */ setReadWriteAccessor( Mark.prototype, 'type', getType, setType ); +/** +* Width of the mark in pixels. +* +* @name width +* @memberof Mark.prototype +* @type {(number|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'rect', +* 'width': 200 +* }); +* +* var v = mark.width; +* // returns 200 +*/ +setReadWriteAccessor( Mark.prototype, 'width', getWidth, setWidth ); + +/** +* Primary x-coordinate in pixels. +* +* @name x +* @memberof Mark.prototype +* @type {(number|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'x': 10 +* }); +* +* var v = mark.x; +* // returns 10 +*/ +setReadWriteAccessor( Mark.prototype, 'x', getX, setX ); + +/** +* Secondary x-coordinate in pixels. +* +* @name x2 +* @memberof Mark.prototype +* @type {(number|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'rect', +* 'x2': 100 +* }); +* +* var v = mark.x2; +* // returns 100 +*/ +setReadWriteAccessor( Mark.prototype, 'x2', getX2, setX2 ); + +/** +* Center x-coordinate. +* +* @name xc +* @memberof Mark.prototype +* @type {(number|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'rect', +* 'xc': 50 +* }); +* +* var v = mark.xc; +* // returns 50 +*/ +setReadWriteAccessor( Mark.prototype, 'xc', getXc, setXc ); + +/** +* Primary y-coordinate in pixels. +* +* @name y +* @memberof Mark.prototype +* @type {(number|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'line', +* 'y': 20 +* }); +* +* var v = mark.y; +* // returns 20 +*/ +setReadWriteAccessor( Mark.prototype, 'y', getY, setY ); + +/** +* Secondary y-coordinate in pixels. +* +* @name y2 +* @memberof Mark.prototype +* @type {(number|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'rect', +* 'y2': 200 +* }); +* +* var v = mark.y2; +* // returns 200 +*/ +setReadWriteAccessor( Mark.prototype, 'y2', getY2, setY2 ); + +/** +* Center y-coordinate. +* +* @name yc +* @memberof Mark.prototype +* @type {(number|void)} +* +* @example +* var mark = new Mark({ +* 'type': 'rect', +* 'yc': 100 +* }); +* +* var v = mark.yc; +* // returns 100 +*/ +setReadWriteAccessor( Mark.prototype, 'yc', getYc, setYc ); + /** * Integer z-index indicating the layering of a mark relative to other marks. * * @name zindex * @memberof Mark.prototype -* @type {string} +* @type {number} * @default 0 * * @example diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/name/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/name/get.js new file mode 100644 index 000000000000..b9ce2f7cd45c --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/name/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 unique name. +* +* @private +* @returns {(string|void)} mark name +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/name/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/name/properties.js new file mode 100644 index 000000000000..73c88d38ea23 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/name/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( 'name' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/name/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/name/set.js new file mode 100644 index 000000000000..eceb4e35b8f8 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/name/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the unique name. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(string|void)} value - input value +* @throws {TypeError} must be a string +* @returns {void} +*/ +function set( value ) { + if ( !isString( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a string. 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/base/ctor/lib/opacity/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/opacity/get.js new file mode 100644 index 000000000000..b29f948eb59d --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/opacity/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 mark opacity from 0 (transparent) to 1 (opaque). +* +* @private +* @returns {(number|void)} opacity +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/opacity/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/opacity/properties.js new file mode 100644 index 000000000000..41bb0d21d7c4 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/opacity/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( 'opacity' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/opacity/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/opacity/set.js new file mode 100644 index 000000000000..49d6cce0f71d --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/opacity/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the mark opacity from 0 (transparent) to 1 (opaque). +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(NonNegativeNumber|void)} value - input value +* @throws {TypeError} must be a nonnegative number +* @returns {void} +*/ +function set( 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 ] ) { + 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/base/ctor/lib/properties.json b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/properties.json index 2dcc6947bb2e..eeaca56c6623 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/properties.json +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/properties.json @@ -1,17 +1,40 @@ [ "aria", + "blend", "clip", + "cursor", "description", "encode", + "fill", + "fillOpacity", "from", + "height", + "href", "interactive", "key", "name", + "opacity", "role", "sort", + "stroke", + "strokeCap", + "strokeDash", + "strokeDashOffset", + "strokeJoin", + "strokeMiterLimit", + "strokeOpacity", + "strokeWidth", "style", + "tooltip", "transform", "triggers", "type", + "width", + "x", + "x2", + "xc", + "y", + "y2", + "yc", "zindex" ] diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/role/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/role/get.js new file mode 100644 index 000000000000..39bfb31806d7 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/role/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 metadata string indicating the role of a mark. +* +* @private +* @returns {(string|void)} mark role +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/role/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/role/properties.js new file mode 100644 index 000000000000..2211e8226fd1 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/role/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( 'role' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/role/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/role/set.js new file mode 100644 index 000000000000..95c5782bc70b --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/role/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the metadata string indicating the role of a mark. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(string|void)} value - input value +* @throws {TypeError} must be a string +* @returns {void} +*/ +function set( value ) { + if ( !isString( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a string. 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/base/ctor/lib/sort/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/sort/get.js new file mode 100644 index 000000000000..280925a2bd11 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/sort/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 comparator for sorting mark items. +* +* @private +* @returns {(Object|void)} comparator +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/sort/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/sort/properties.js new file mode 100644 index 000000000000..9a3846787a90 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/sort/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( 'sort' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/sort/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/sort/set.js new file mode 100644 index 000000000000..be9d09ec54bc --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/sort/set.js @@ -0,0 +1,64 @@ +/** +* @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 isCompare = require( '@stdlib/plot/vega/base/assert/is-compare' ); +var isUndefined = require( '@stdlib/assert/is-undefined' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the comparator for sorting mark items. +* +* @private +* @param {(Object|void)} value - input value +* @throws {TypeError} must be a Compare instance +* @returns {void} +*/ +function set( value ) { + if ( !isCompare( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be either a clip instance, or a signal. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + this._removeChangeListener( this[ prop.private ] ); + debug( 'Current value: %s. New value: %s.', JSON.stringify( this[ prop.private ] ), JSON.stringify( value ) ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + this._addChangeListener( this[ prop.private ] ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/stroke/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/stroke/get.js new file mode 100644 index 000000000000..2e1c88ae5027 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/stroke/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 stroke color. +* +* @private +* @returns {(string|void)} stroke color +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/stroke/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/stroke/properties.js new file mode 100644 index 000000000000..e3fbbfdfdfd9 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/stroke/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( 'stroke' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/stroke/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/stroke/set.js new file mode 100644 index 000000000000..3ae325236695 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/stroke/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the stroke color. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(string|void)} value - input value +* @throws {TypeError} must be a string +* @returns {void} +*/ +function set( value ) { + if ( !isString( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a string. 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/base/ctor/lib/strokeCap/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeCap/get.js new file mode 100644 index 000000000000..30b5a07b23bc --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeCap/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 stroke cap for line ending style. +* +* @private +* @returns {(string|void)} stroke cap +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeCap/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeCap/properties.js new file mode 100644 index 000000000000..1e7b0b5f8a1c --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeCap/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( 'strokeCap' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeCap/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeCap/set.js new file mode 100644 index 000000000000..a7991ce5accf --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeCap/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var isStrokeCap = require( '@stdlib/plot/vega/base/assert/is-stroke-cap' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the stroke cap for line ending style. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(string|void)} value - input value +* @throws {TypeError} must be a supported stroke cap +* @returns {void} +*/ +function set( value ) { + if ( !isStrokeCap( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a supported stroke cap. 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/base/ctor/lib/strokeDash/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDash/get.js new file mode 100644 index 000000000000..9d1367bee3a0 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDash/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 stroke dash array of [stroke, space] lengths. +* +* @private +* @returns {(Array|void)} stroke dash array +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDash/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDash/properties.js new file mode 100644 index 000000000000..244d6ce6d967 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDash/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( 'strokeDash' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDash/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDash/set.js new file mode 100644 index 000000000000..3cbd1f722c85 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDash/set.js @@ -0,0 +1,78 @@ +/** +* @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 isNumericArray = require( '@stdlib/assert/is-numeric-array' ); +var isEmptyCollection = require( '@stdlib/assert/is-empty-collection' ); +var isUndefined = require( '@stdlib/assert/is-undefined' ); +var hasSameValues = require( '@stdlib/array/base/assert/has-same-values' ); +var copy = require( '@stdlib/array/base/copy' ); +var join = require( '@stdlib/array/base/join' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the stroke dash array of [stroke, space] lengths for creating dashed or dotted lines. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(NumericArray|void)} value - input value +* @throws {TypeError} must be a numeric array +* @returns {void} +*/ +function set( value ) { + if ( isUndefined( 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 ) ); + } + return; + } + if ( !isNumericArray( value ) && !isEmptyCollection( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a numeric array. Value: `%s`.', prop.name, value ) ); + } + if ( !this[ prop.private ] || !hasSameValues( value, this[ prop.private ] ) ) { + debug( 'Current value: [%s]. New value: [%s].', this[ prop.private ] ? join( this[ prop.private ], ', ' ) : '', join( value, ', ' ) ); + this[ prop.private ] = copy( value ); + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDashOffset/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDashOffset/get.js new file mode 100644 index 000000000000..db7b165b5136 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDashOffset/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 pixel offset at which to start the stroke dash array. +* +* @private +* @returns {(number|void)} stroke dash offset +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDashOffset/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDashOffset/properties.js new file mode 100644 index 000000000000..0306964ec414 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDashOffset/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( 'strokeDashOffset' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDashOffset/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDashOffset/set.js new file mode 100644 index 000000000000..487fa55595df --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeDashOffset/set.js @@ -0,0 +1,66 @@ +/** +* @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 isNumber = require( '@stdlib/assert/is-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' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the pixel offset at which to start the stroke dash array. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(number|void)} value - input value +* @throws {TypeError} must be a number +* @returns {void} +*/ +function set( value ) { + if ( !isNumber( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a 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/base/ctor/lib/strokeJoin/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeJoin/get.js new file mode 100644 index 000000000000..4aea1c25b243 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeJoin/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 stroke line join method. +* +* @private +* @returns {(string|void)} stroke join +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeJoin/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeJoin/properties.js new file mode 100644 index 000000000000..4e0e7656b5b4 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeJoin/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( 'strokeJoin' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeJoin/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeJoin/set.js new file mode 100644 index 000000000000..64ed6eeb13d4 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeJoin/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var isStrokeJoin = require( '@stdlib/plot/vega/base/assert/is-stroke-join' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the stroke line join method. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(string|void)} value - input value +* @throws {TypeError} must be a supported stroke join +* @returns {void} +*/ +function set( value ) { + if ( !isStrokeJoin( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a supported stroke join. 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/base/ctor/lib/strokeMiterLimit/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeMiterLimit/get.js new file mode 100644 index 000000000000..d5a360a96624 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeMiterLimit/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 miter limit at which to bevel a line join. +* +* @private +* @returns {(number|void)} stroke miter limit +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeMiterLimit/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeMiterLimit/properties.js new file mode 100644 index 000000000000..ccd5b4e36705 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeMiterLimit/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( 'strokeMiterLimit' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeMiterLimit/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeMiterLimit/set.js new file mode 100644 index 000000000000..9b975885f54c --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeMiterLimit/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the miter limit at which to bevel a line join. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(NonNegativeNumber|void)} value - input value +* @throws {TypeError} must be a nonnegative number +* @returns {void} +*/ +function set( 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 ] ) { + 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/base/ctor/lib/strokeOpacity/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeOpacity/get.js new file mode 100644 index 000000000000..92848dc5aa0b --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeOpacity/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 stroke opacity from 0 (transparent) to 1 (opaque). +* +* @private +* @returns {(number|void)} stroke opacity +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeOpacity/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeOpacity/properties.js new file mode 100644 index 000000000000..8aa0b2358a57 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeOpacity/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( 'strokeOpacity' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeOpacity/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeOpacity/set.js new file mode 100644 index 000000000000..09742fe6568d --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeOpacity/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the stroke opacity from 0 (transparent) to 1 (opaque). +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(NonNegativeNumber|void)} value - input value +* @throws {TypeError} must be a nonnegative number +* @returns {void} +*/ +function set( 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 ] ) { + 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/base/ctor/lib/strokeWidth/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeWidth/get.js new file mode 100644 index 000000000000..1a96e2e385af --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeWidth/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 stroke width in pixels. +* +* @private +* @returns {(number|void)} stroke width +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeWidth/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeWidth/properties.js new file mode 100644 index 000000000000..ef10d4ed24b7 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeWidth/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( 'strokeWidth' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeWidth/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeWidth/set.js new file mode 100644 index 000000000000..25b9e1913bb9 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/strokeWidth/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the stroke width in pixels. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(NonNegativeNumber|void)} value - input value +* @throws {TypeError} must be a nonnegative number +* @returns {void} +*/ +function set( 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 ] ) { + 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/base/ctor/lib/style/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/style/get.js new file mode 100644 index 000000000000..092b43382f67 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/style/get.js @@ -0,0 +1,44 @@ +/** +* @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 copy = require( '@stdlib/array/base/copy-indexed' ); +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the custom styles to apply to a mark. +* +* @private +* @returns {Array} mark style +*/ +function get() { + return copy( this[ prop.private ] ); +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/style/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/style/properties.js new file mode 100644 index 000000000000..555d3c7660f3 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/style/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( 'style' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/style/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/style/set.js new file mode 100644 index 000000000000..9510d53fad91 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/style/set.js @@ -0,0 +1,68 @@ +/** +* @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 isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives; +var hasEqualValues = require( '@stdlib/array/base/assert/has-equal-values' ); +var copy = require( '@stdlib/array/base/copy' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the custom styles to apply to a mark. +* +* @private +* @param {(string|StringArray)} value - input value +* @throws {TypeError} must be a string +* @returns {void} +*/ +function set( value ) { + var isStr = isString( value ); + if ( !isStr && !isStringArray( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a string or an array of strings. Value: `%s`.', prop.name, value ) ); + } + if ( isStr ) { + value = [ value ]; + } + if ( !hasEqualValues( value, this[ prop.private ] ) ) { + debug( 'Current value: %s. New value: %s.', JSON.stringify( this[ prop.private ] ), JSON.stringify( value ) ); + this[ prop.private ] = copy( value ); + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/tooltip/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/tooltip/get.js new file mode 100644 index 000000000000..87493fd17081 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/tooltip/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 tooltip text to show upon mouse hover. +* +* @private +* @returns {*} tooltip +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/tooltip/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/tooltip/properties.js new file mode 100644 index 000000000000..122d13d5ae61 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/tooltip/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( 'tooltip' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/tooltip/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/tooltip/set.js new file mode 100644 index 000000000000..bf804eca309b --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/tooltip/set.js @@ -0,0 +1,59 @@ +/** +* @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 changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the tooltip text to show upon mouse hover. +* +* ## Notes +* +* - The value can be of any type. If the value is an object (other than a Date or an array), then all key-value pairs in the object will be shown in the tooltip. +* +* @private +* @param {*} value - input value +* @returns {void} +*/ +function set( 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/base/ctor/lib/width/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/width/get.js new file mode 100644 index 000000000000..2c226dae0e76 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/width/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 width of the mark in pixels. +* +* @private +* @returns {(number|void)} width +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/width/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/width/properties.js new file mode 100644 index 000000000000..d23f389096cb --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/width/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( 'width' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/width/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/width/set.js new file mode 100644 index 000000000000..97dd73bae3a8 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/width/set.js @@ -0,0 +1,66 @@ +/** +* @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 isUndefined = require( '@stdlib/assert/is-undefined' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the width of the mark in pixels. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(number|void)} value - input value +* @throws {TypeError} must be a nonnegative number +* @returns {void} +*/ +function set( 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 ] ) { + 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/base/ctor/lib/x/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/x/get.js new file mode 100644 index 000000000000..a9c5fb610a14 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/x/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 primary x-coordinate in pixels. +* +* @private +* @returns {(number|void)} x-coordinate +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/x/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/x/properties.js new file mode 100644 index 000000000000..8562bbadefc2 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/x/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( 'x' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/x/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/x/set.js new file mode 100644 index 000000000000..813c4d9c8c1c --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/x/set.js @@ -0,0 +1,66 @@ +/** +* @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 isNumber = require( '@stdlib/assert/is-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' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the primary x-coordinate in pixels. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(number|void)} value - input value +* @throws {TypeError} must be a number +* @returns {void} +*/ +function set( value ) { + if ( !isNumber( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a 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/base/ctor/lib/x2/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/x2/get.js new file mode 100644 index 000000000000..94492fba4e73 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/x2/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 secondary x-coordinate in pixels. +* +* @private +* @returns {(number|void)} secondary x-coordinate +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/x2/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/x2/properties.js new file mode 100644 index 000000000000..841b935128e3 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/x2/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( 'x2' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/x2/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/x2/set.js new file mode 100644 index 000000000000..51aa6bd08d2e --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/x2/set.js @@ -0,0 +1,66 @@ +/** +* @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 isNumber = require( '@stdlib/assert/is-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' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the secondary x-coordinate in pixels. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(number|void)} value - input value +* @throws {TypeError} must be a number +* @returns {void} +*/ +function set( value ) { + if ( !isNumber( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a 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/base/ctor/lib/xc/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/xc/get.js new file mode 100644 index 000000000000..c3e117a15077 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/xc/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 center x-coordinate. +* +* @private +* @returns {(number|void)} center x-coordinate +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/xc/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/xc/properties.js new file mode 100644 index 000000000000..2928c10500e8 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/xc/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( 'xc' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/xc/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/xc/set.js new file mode 100644 index 000000000000..d9e38558e29b --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/xc/set.js @@ -0,0 +1,66 @@ +/** +* @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 isNumber = require( '@stdlib/assert/is-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' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the center x-coordinate. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(number|void)} value - input value +* @throws {TypeError} must be a number +* @returns {void} +*/ +function set( value ) { + if ( !isNumber( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a 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/base/ctor/lib/y/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/y/get.js new file mode 100644 index 000000000000..bb6aa2c46649 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/y/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 primary y-coordinate in pixels. +* +* @private +* @returns {(number|void)} y-coordinate +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/y/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/y/properties.js new file mode 100644 index 000000000000..3b4027c694ff --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/y/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( 'y' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/y/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/y/set.js new file mode 100644 index 000000000000..8d357934a2e0 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/y/set.js @@ -0,0 +1,66 @@ +/** +* @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 isNumber = require( '@stdlib/assert/is-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' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the primary y-coordinate in pixels. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(number|void)} value - input value +* @throws {TypeError} must be a number +* @returns {void} +*/ +function set( value ) { + if ( !isNumber( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a 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/base/ctor/lib/y2/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/y2/get.js new file mode 100644 index 000000000000..7f0805253fd4 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/y2/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 secondary y-coordinate in pixels. +* +* @private +* @returns {(number|void)} secondary y-coordinate +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/y2/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/y2/properties.js new file mode 100644 index 000000000000..a8087af6d385 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/y2/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( 'y2' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/y2/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/y2/set.js new file mode 100644 index 000000000000..362fb757fbc2 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/y2/set.js @@ -0,0 +1,66 @@ +/** +* @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 isNumber = require( '@stdlib/assert/is-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' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the secondary y-coordinate in pixels. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(number|void)} value - input value +* @throws {TypeError} must be a number +* @returns {void} +*/ +function set( value ) { + if ( !isNumber( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a 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/base/ctor/lib/yc/get.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/yc/get.js new file mode 100644 index 000000000000..4e3c710756e4 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/yc/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 center y-coordinate. +* +* @private +* @returns {(number|void)} center y-coordinate +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/yc/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/yc/properties.js new file mode 100644 index 000000000000..b06a3d4e7121 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/yc/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( 'yc' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/yc/set.js b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/yc/set.js new file mode 100644 index 000000000000..3407beb3cd71 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/base/ctor/lib/yc/set.js @@ -0,0 +1,66 @@ +/** +* @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 isNumber = require( '@stdlib/assert/is-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' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the center y-coordinate. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(number|void)} value - input value +* @throws {TypeError} must be a number +* @returns {void} +*/ +function set( value ) { + if ( !isNumber( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a 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;