diff --git a/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/examples/index.js b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/examples/index.js new file mode 100644 index 000000000000..ceec1e535e7d --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/examples/index.js @@ -0,0 +1,34 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var Value = require( '@stdlib/plot/vega/value/ctor' ); +var SymbolEncodingSet = require( './../lib' ); + +var encoding = new SymbolEncodingSet({ + 'x': new Value({ + 'field': 'x', + 'scale': 'xScale' + }), + 'y': new Value({ + 'field': 'y', + 'scale': 'yScale' + }) +}); +console.log( encoding.toJSON() ); diff --git a/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/angle/get.js b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/angle/get.js new file mode 100644 index 000000000000..ad98ed73a93d --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/angle/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 value reference specifying a rotation angle (in degrees). +* +* @private +* @returns {(Value|void)} value reference +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/angle/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/angle/properties.js new file mode 100644 index 000000000000..5889ae58645a --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/angle/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( 'angle' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/angle/set.js b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/angle/set.js new file mode 100644 index 000000000000..15c58d50bdc8 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/angle/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 isValueReference = require( '@stdlib/plot/vega/base/assert/is-value-reference' ); +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:symbol:encoding-set:set:'+prop.name ); + + +// MAIN // + +/** +* Sets a rotation angle (in degrees). +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(Value|void)} value - input value +* @throws {TypeError} must be a value reference +* @returns {void} +*/ +function set( value ) { + if ( !isValueReference( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a value reference. 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/symbol/encoding-set/lib/change_event.js b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/change_event.js new file mode 100644 index 000000000000..359afbfa206b --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/change_event.js @@ -0,0 +1,41 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MAIN // + +/** +* Returns a new change event object. +* +* @private +* @param {string} property - property name +* @returns {Object} event object +*/ +function event( property ) { // eslint-disable-line stdlib/no-redeclare + return { + 'type': 'update', + 'source': 'mark', + 'property': property + }; +} + + +// EXPORTS // + +module.exports = event; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/index.js b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/index.js new file mode 100644 index 000000000000..e8c2d0075068 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/index.js @@ -0,0 +1,40 @@ +/** +* @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'; + +/** +* Symbol mark encoding set constructor. +* +* @module @stdlib/plot/vega/mark/symbol/encoding-set +* +* @example +* var SymbolEncodingSet = require( '@stdlib/plot/vega/mark/symbol/encoding-set' ); +* +* var encoding = new SymbolEncodingSet(); +* // returns +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/main.js b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/main.js new file mode 100644 index 000000000000..beeb7e2e681d --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/main.js @@ -0,0 +1,319 @@ +/** +* @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 stdlib/no-empty-lines-between-requires */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isObject = require( '@stdlib/assert/is-object' ); +var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var setNonEnumerableReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' ); // eslint-disable-line id-length +var setNonEnumerableReadOnlyProperty = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); // eslint-disable-line id-length +var setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' ); +var hasProp = require( '@stdlib/assert/has-property' ); +var inherit = require( '@stdlib/utils/inherit' ); +var transformErrorMessage = require( '@stdlib/plot/vega/base/transform-validation-message' ); +var EncodingSet = require( '@stdlib/plot/vega/mark/base/encoding-set' ); +var format = require( '@stdlib/string/format' ); +var properties = require( './properties.json' ); + +// Note: keep the following in alphabetical order according to the `require` path... +var getAngle = require( './angle/get.js' ); +var setAngle = require( './angle/set.js' ); + +var getProperties = require( './properties/get.js' ); + +var getShape = require( './shape/get.js' ); +var setShape = require( './shape/set.js' ); + +var getSize = require( './size/get.js' ); +var setSize = require( './size/set.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:symbol:encoding-set:main' ); + + +// MAIN // + +/** +* Symbol mark encoding set constructor. +* +* @constructor +* @param {Options} options - constructor options +* @param {Value} [options.angle] - rotation angle in degrees +* @param {Value} [options.aria] - flag indicating whether to include ARIA attributes in SVG output +* @param {Value} [options.blend] - color blend mode +* @param {Value} [options.cursor] - mouse cursor used over a mark +* @param {Value} [options.description] - text description of a mark item for ARIA accessibility +* @param {Value} [options.fill] - fill color +* @param {Value} [options.fillOpacity] - fill opacity +* @param {Value} [options.height] - mark height +* @param {Value} [options.href] - URL to load upon mouse click +* @param {Value} [options.opacity] - mark opacity +* @param {Value} [options.shape] - symbol shape +* @param {Value} [options.size] - symbol area in pixels squared +* @param {Value} [options.stroke] - stroke color +* @param {Value} [options.strokeCap] - stroke cap for line ending style +* @param {Value} [options.strokeDash] - stroke dash +* @param {Value} [options.strokeDashOffset] - pixel offset at which to start the dash array +* @param {Value} [options.strokeJoin] - stroke line join method +* @param {Value} [options.strokeMiterLimit] - miter limit at which to bevel a line join +* @param {Value} [options.strokeOpacity] - stroke opacity +* @param {Value} [options.strokeWidth] - stroke width +* @param {Value} [options.tooltip] - tooltip text to show upon mouse hover +* @param {Value} [options.width] - mark width +* @param {Value} [options.x] - primary x-coordinate +* @param {Value} [options.y] - primary y-coordinate +* @param {Value} [options.zindex] - layering order of sibling mark items +* @throws {TypeError} options argument must be an object +* @throws {Error} must provide valid options +* @returns {SymbolEncodingSet} encoding set instance +* +* @example +* var encoding = new SymbolEncodingSet(); +* // returns +*/ +function SymbolEncodingSet( options ) { + var nargs; + var v; + var k; + var i; + + nargs = arguments.length; + if ( !( this instanceof SymbolEncodingSet ) ) { + if ( nargs === 0 ) { + return new SymbolEncodingSet(); + } + return new SymbolEncodingSet( options ); + } + EncodingSet.call( this ); + if ( nargs ) { + if ( !isObject( options ) ) { + throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); + } + // Validate provided options by attempting to assign option values to corresponding fields... + for ( i = 0; i < properties.length; i++ ) { + k = properties[ i ]; + if ( !hasProp( options, k ) ) { + continue; + } + v = options[ k ]; + try { + this[ k ] = v; + } catch ( err ) { + debug( 'Encountered an error. Error: %s', err.message ); + + // FIXME: retain thrown error type + throw new Error( transformErrorMessage( err.message ) ); + } + } + } + return this; +} + +/* +* Inherit from the `EncodingSet` prototype. +*/ +inherit( SymbolEncodingSet, EncodingSet ); + +/** +* Constructor name. +* +* @private +* @name name +* @memberof SymbolEncodingSet +* @readonly +* @type {string} +*/ +setNonEnumerableReadOnly( SymbolEncodingSet, 'name', 'SymbolEncodingSet' ); + +/** +* Encoding specifying a rotation angle (in degrees). +* +* @name angle +* @memberof EncodingSet.prototype +* @type {(Value|void)} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new SymbolEncodingSet({ +* 'angle': new Value({ +* 'value': 45 +* }) +* }); +* +* var v = encoding.angle; +* // returns +*/ +setReadWriteAccessor( SymbolEncodingSet.prototype, 'angle', getAngle, setAngle ); + +/** +* EncodingSet properties. +* +* @name properties +* @memberof SymbolEncodingSet.prototype +* @type {Array} +* +* @example +* var encoding = new SymbolEncodingSet(); +* +* var v = encoding.properties; +* // returns [...] +*/ +setNonEnumerableReadOnlyAccessor( SymbolEncodingSet.prototype, 'properties', getProperties ); + +/** +* Encoding specifying a symbol shape. +* +* @name shape +* @memberof EncodingSet.prototype +* @type {(Value|void)} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new SymbolEncodingSet({ +* 'shape': new Value({ +* 'value': 'square' +* }) +* }); +* +* var v = encoding.shape; +* // returns +*/ +setReadWriteAccessor( SymbolEncodingSet.prototype, 'shape', getShape, setShape ); + +/** +* Encoding specifying a symbol area (in pixels squared). +* +* @name size +* @memberof EncodingSet.prototype +* @type {(Value|void)} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new SymbolEncodingSet({ +* 'size': new Value({ +* 'value': 100 +* }) +* }); +* +* var v = encoding.size; +* // returns +*/ +setReadWriteAccessor( SymbolEncodingSet.prototype, 'size', getSize, setSize ); + +/** +* Encoding specifying a mark secondary x-coordinate (in pixels). +* +* ## Notes +* +* - This property is inherited from the parent prototype and is not applicable to symbol mark types. +* +* @name x2 +* @memberof SymbolEncodingSet.prototype +* @readonly +* @type {void} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new SymbolEncodingSet(); +* +* var v = encoding.x2; +* // returns undefined +*/ +setNonEnumerableReadOnlyProperty( SymbolEncodingSet.prototype, 'x2', void 0 ); + +/** +* Encoding specifying a mark center x-coordinate (in pixels). +* +* ## Notes +* +* - This property is inherited from the parent prototype and is not applicable to symbol mark types. +* +* @name xc +* @memberof SymbolEncodingSet.prototype +* @readonly +* @type {void} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new SymbolEncodingSet(); +* +* var v = encoding.xc; +* // returns undefined +*/ +setNonEnumerableReadOnlyProperty( SymbolEncodingSet.prototype, 'xc', void 0 ); + +/** +* Encoding specifying a mark secondary y-coordinate (in pixels). +* +* ## Notes +* +* - This property is inherited from the parent prototype and is not applicable to symbol mark types. +* +* @name y2 +* @memberof SymbolEncodingSet.prototype +* @readonly +* @type {void} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new SymbolEncodingSet(); +* +* var v = encoding.y2; +* // returns undefined +*/ +setNonEnumerableReadOnlyProperty( SymbolEncodingSet.prototype, 'y2', void 0 ); + +/** +* Encoding specifying a mark center y-coordinate (in pixels). +* +* ## Notes +* +* - This property is inherited from the parent prototype and is not applicable to symbol mark types. +* +* @name yc +* @memberof SymbolEncodingSet.prototype +* @readonly +* @type {void} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new SymbolEncodingSet(); +* +* var v = encoding.yc; +* // returns undefined +*/ +setNonEnumerableReadOnlyProperty( SymbolEncodingSet.prototype, 'yc', void 0 ); + + +// EXPORTS // + +module.exports = SymbolEncodingSet; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/properties.json b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/properties.json new file mode 100644 index 000000000000..38caa761959b --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/properties.json @@ -0,0 +1,28 @@ +[ + "aria", + "blend", + "cursor", + "description", + "fill", + "fillOpacity", + "height", + "href", + "opacity", + "stroke", + "strokeCap", + "strokeDash", + "strokeDashOffset", + "strokeJoin", + "strokeMiterLimit", + "strokeOpacity", + "strokeWidth", + "tooltip", + "width", + "x", + "y", + "zindex", + + "angle", + "shape", + "size" +] diff --git a/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/properties/get.js b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/properties/get.js new file mode 100644 index 000000000000..f3cbb28454ea --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/properties/get.js @@ -0,0 +1,41 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var properties = require( './../properties.json' ); + + +// MAIN // + +/** +* Returns the list of enumerable properties. +* +* @private +* @returns {Array} properties +*/ +function get() { + return properties.slice(); +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/shape/get.js b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/shape/get.js new file mode 100644 index 000000000000..2377909e7d53 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/shape/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 value reference specifying a symbol shape. +* +* @private +* @returns {(Value|void)} value reference +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/shape/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/shape/properties.js new file mode 100644 index 000000000000..deb5b5c17de6 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/shape/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( 'shape' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/shape/set.js b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/shape/set.js new file mode 100644 index 000000000000..892ebfe9287e --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/shape/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 isValueReference = require( '@stdlib/plot/vega/base/assert/is-value-reference' ); +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:symbol:encoding-set:set:'+prop.name ); + + +// MAIN // + +/** +* Sets a symbol shape. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(Value|void)} value - input value +* @throws {TypeError} must be a value reference +* @returns {void} +*/ +function set( value ) { + if ( !isValueReference( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a value reference. 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/symbol/encoding-set/lib/size/get.js b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/size/get.js new file mode 100644 index 000000000000..28f8062e8e85 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/size/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 value reference specifying a symbol area (in pixels squared). +* +* @private +* @returns {(Value|void)} value reference +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/size/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/size/properties.js new file mode 100644 index 000000000000..bf1bd182f0eb --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/size/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( 'size' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/size/set.js b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/size/set.js new file mode 100644 index 000000000000..9906705bbfde --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/lib/size/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 isValueReference = require( '@stdlib/plot/vega/base/assert/is-value-reference' ); +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:symbol:encoding-set:set:'+prop.name ); + + +// MAIN // + +/** +* Sets a symbol area (in pixels squared). +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(Value|void)} value - input value +* @throws {TypeError} must be a value reference +* @returns {void} +*/ +function set( value ) { + if ( !isValueReference( value ) && !isUndefined( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a value reference. 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/symbol/encoding-set/package.json b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/package.json new file mode 100644 index 000000000000..bce21690fe37 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/symbol/encoding-set/package.json @@ -0,0 +1,62 @@ +{ + "name": "@stdlib/plot/vega/mark/symbol/encoding-set", + "version": "0.0.0", + "description": "Symbol mark encoding set constructor.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "plot", + "vega", + "symbol", + "mark", + "encoding", + "constructor", + "ctor" + ], + "__stdlib__": {} +}