From cdc48b0f2822e3034a1f7b0964ccf4bfd4c13c04 Mon Sep 17 00:00:00 2001 From: Sachinn-64 Date: Fri, 31 Jul 2026 22:43:14 +0530 Subject: [PATCH 1/4] feat: add plot/vega/mark/path/encoding-set --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../mark/path/encoding-set/examples/index.js | 34 ++ .../mark/path/encoding-set/lib/angle/get.js | 43 +++ .../path/encoding-set/lib/angle/properties.js | 33 ++ .../mark/path/encoding-set/lib/angle/set.js | 66 ++++ .../path/encoding-set/lib/change_event.js | 41 +++ .../vega/mark/path/encoding-set/lib/index.js | 40 ++ .../vega/mark/path/encoding-set/lib/main.js | 344 ++++++++++++++++++ .../mark/path/encoding-set/lib/path/get.js | 43 +++ .../path/encoding-set/lib/path/properties.js | 33 ++ .../mark/path/encoding-set/lib/path/set.js | 66 ++++ .../path/encoding-set/lib/properties.json | 29 ++ .../path/encoding-set/lib/properties/get.js | 41 +++ .../mark/path/encoding-set/lib/scale-x/get.js | 43 +++ .../encoding-set/lib/scale-x/properties.js | 33 ++ .../mark/path/encoding-set/lib/scale-x/set.js | 66 ++++ .../mark/path/encoding-set/lib/scale-y/get.js | 43 +++ .../encoding-set/lib/scale-y/properties.js | 33 ++ .../mark/path/encoding-set/lib/scale-y/set.js | 66 ++++ .../vega/mark/path/encoding-set/package.json | 62 ++++ 19 files changed, 1159 insertions(+) create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/examples/index.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/angle/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/angle/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/angle/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/change_event.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/index.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/main.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/path/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/path/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/path/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/properties.json create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/properties/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-x/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-x/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-x/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-y/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-y/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-y/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/package.json diff --git a/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/examples/index.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/examples/index.js new file mode 100644 index 000000000000..fd2cfd3f8f3d --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/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 PathEncodingSet = require( './../lib' ); + +var encoding = new PathEncodingSet({ + '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/path/encoding-set/lib/angle/get.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/angle/get.js new file mode 100644 index 000000000000..58552882f446 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/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. +* +* @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/path/encoding-set/lib/angle/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/angle/properties.js new file mode 100644 index 000000000000..5889ae58645a --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/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/path/encoding-set/lib/angle/set.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/angle/set.js new file mode 100644 index 000000000000..ab96fb9e2db2 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/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:path: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/path/encoding-set/lib/change_event.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/change_event.js new file mode 100644 index 000000000000..359afbfa206b --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/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/path/encoding-set/lib/index.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/index.js new file mode 100644 index 000000000000..f94c39f5f19e --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/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'; + +/** +* Path mark encoding set constructor. +* +* @module @stdlib/plot/vega/mark/path/encoding-set +* +* @example +* var PathEncodingSet = require( '@stdlib/plot/vega/mark/path/encoding-set' ); +* +* var encoding = new PathEncodingSet(); +* // returns +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/main.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/main.js new file mode 100644 index 000000000000..b348549bdc30 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/main.js @@ -0,0 +1,344 @@ +/** +* @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 getPath = require( './path/get.js' ); +var setPath = require( './path/set.js' ); + +var getProperties = require( './properties/get.js' ); + +var getScaleX = require( './scale-x/get.js' ); +var setScaleX = require( './scale-x/set.js' ); + +var getScaleY = require( './scale-y/get.js' ); +var setScaleY = require( './scale-y/set.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:mark:path:encoding-set:main' ); + + +// MAIN // + +/** +* Path 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.path] - SVG path string +* @param {Value} [options.scaleX] - horizontal scale factor +* @param {Value} [options.scaleY] - vertical scale factor +* @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 {PathEncodingSet} encoding set instance +* +* @example +* var encoding = new PathEncodingSet(); +* // returns +*/ +function PathEncodingSet( options ) { + var nargs; + var v; + var k; + var i; + + nargs = arguments.length; + if ( !( this instanceof PathEncodingSet ) ) { + if ( nargs === 0 ) { + return new PathEncodingSet(); + } + return new PathEncodingSet( 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( PathEncodingSet, EncodingSet ); + +/** +* Constructor name. +* +* @private +* @name name +* @memberof PathEncodingSet +* @readonly +* @type {string} +*/ +setNonEnumerableReadOnly( PathEncodingSet, 'name', 'PathEncodingSet' ); + +/** +* Encoding specifying a rotation angle (in degrees). +* +* @name angle +* @memberof PathEncodingSet.prototype +* @type {(Value|void)} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new PathEncodingSet({ +* 'angle': new Value({ +* 'value': 45 +* }) +* }); +* +* var v = encoding.angle; +* // returns +*/ +setReadWriteAccessor( PathEncodingSet.prototype, 'angle', getAngle, setAngle ); + +/** +* Encoding specifying an SVG path string. +* +* @name path +* @memberof PathEncodingSet.prototype +* @type {(Value|void)} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new PathEncodingSet({ +* 'path': new Value({ +* 'value': 'M-50,-50 L50,50 V-50 L-50,50 Z' +* }) +* }); +* +* var v = encoding.path; +* // returns +*/ +setReadWriteAccessor( PathEncodingSet.prototype, 'path', getPath, setPath ); + +/** +* EncodingSet properties. +* +* @name properties +* @memberof PathEncodingSet.prototype +* @type {Array} +* +* @example +* var encoding = new PathEncodingSet(); +* +* var v = encoding.properties; +* // returns [...] +*/ +setNonEnumerableReadOnlyAccessor( PathEncodingSet.prototype, 'properties', getProperties ); + +/** +* Encoding specifying a horizontal scale factor. +* +* @name scaleX +* @memberof PathEncodingSet.prototype +* @type {(Value|void)} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new PathEncodingSet({ +* 'scaleX': new Value({ +* 'value': 2 +* }) +* }); +* +* var v = encoding.scaleX; +* // returns +*/ +setReadWriteAccessor( PathEncodingSet.prototype, 'scaleX', getScaleX, setScaleX ); + +/** +* Encoding specifying a vertical scale factor. +* +* @name scaleY +* @memberof PathEncodingSet.prototype +* @type {(Value|void)} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new PathEncodingSet({ +* 'scaleY': new Value({ +* 'value': 2 +* }) +* }); +* +* var v = encoding.scaleY; +* // returns +*/ +setReadWriteAccessor( PathEncodingSet.prototype, 'scaleY', getScaleY, setScaleY ); + +/** +* Encoding specifying a mark secondary x-coordinate (in pixels). +* +* ## Notes +* +* - This property is inherited from the parent prototype and is not applicable to path mark types. +* +* @name x2 +* @memberof PathEncodingSet.prototype +* @readonly +* @type {void} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new PathEncodingSet(); +* +* var v = encoding.x2; +* // returns undefined +*/ +setNonEnumerableReadOnlyProperty( PathEncodingSet.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 path mark types. +* +* @name xc +* @memberof PathEncodingSet.prototype +* @readonly +* @type {void} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new PathEncodingSet(); +* +* var v = encoding.xc; +* // returns undefined +*/ +setNonEnumerableReadOnlyProperty( PathEncodingSet.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 path mark types. +* +* @name y2 +* @memberof PathEncodingSet.prototype +* @readonly +* @type {void} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new PathEncodingSet(); +* +* var v = encoding.y2; +* // returns undefined +*/ +setNonEnumerableReadOnlyProperty( PathEncodingSet.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 path mark types. +* +* @name yc +* @memberof PathEncodingSet.prototype +* @readonly +* @type {void} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new PathEncodingSet(); +* +* var v = encoding.yc; +* // returns undefined +*/ +setNonEnumerableReadOnlyProperty( PathEncodingSet.prototype, 'yc', void 0 ); + + +// EXPORTS // + +module.exports = PathEncodingSet; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/path/get.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/path/get.js new file mode 100644 index 000000000000..0d71c4808c0f --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/path/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 an SVG path string. +* +* @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/path/encoding-set/lib/path/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/path/properties.js new file mode 100644 index 000000000000..0a634413abfe --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/path/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( 'path' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/path/set.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/path/set.js new file mode 100644 index 000000000000..de20328debff --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/path/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:path:encoding-set:set:'+prop.name ); + + +// MAIN // + +/** +* Sets an SVG path string. +* +* ## 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/path/encoding-set/lib/properties.json b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/properties.json new file mode 100644 index 000000000000..f0a83293a858 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/properties.json @@ -0,0 +1,29 @@ +[ + "aria", + "blend", + "cursor", + "description", + "fill", + "fillOpacity", + "height", + "href", + "opacity", + "stroke", + "strokeCap", + "strokeDash", + "strokeDashOffset", + "strokeJoin", + "strokeMiterLimit", + "strokeOpacity", + "strokeWidth", + "tooltip", + "width", + "x", + "y", + "zindex", + + "angle", + "path", + "scaleX", + "scaleY" +] diff --git a/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/properties/get.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/properties/get.js new file mode 100644 index 000000000000..f3cbb28454ea --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/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/path/encoding-set/lib/scale-x/get.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-x/get.js new file mode 100644 index 000000000000..5a5d14dcac98 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-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 a value reference specifying a horizontal scale factor. +* +* @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/path/encoding-set/lib/scale-x/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-x/properties.js new file mode 100644 index 000000000000..334f11137117 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-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( 'scaleX' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-x/set.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-x/set.js new file mode 100644 index 000000000000..51518d42283c --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-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 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:path:encoding-set:set:'+prop.name ); + + +// MAIN // + +/** +* Sets a horizontal scale factor. +* +* ## 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/path/encoding-set/lib/scale-y/get.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-y/get.js new file mode 100644 index 000000000000..6d36b9e03c37 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-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 a value reference specifying a vertical scale factor. +* +* @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/path/encoding-set/lib/scale-y/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-y/properties.js new file mode 100644 index 000000000000..62831aa423f4 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-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( 'scaleY' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-y/set.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-y/set.js new file mode 100644 index 000000000000..19d32573a52f --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/scale-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 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:path:encoding-set:set:'+prop.name ); + + +// MAIN // + +/** +* Sets a vertical scale factor. +* +* ## 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/path/encoding-set/package.json b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/package.json new file mode 100644 index 000000000000..a3963f3c9b6f --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/package.json @@ -0,0 +1,62 @@ +{ + "name": "@stdlib/plot/vega/mark/path/encoding-set", + "version": "0.0.0", + "description": "Path 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", + "path", + "mark", + "encoding", + "constructor", + "ctor" + ], + "__stdlib__": {} +} From c2b900e219aa59f6222506ba80a607525fb2701b Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 31 Jul 2026 17:39:22 -0700 Subject: [PATCH 2/4] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../@stdlib/plot/vega/mark/path/encoding-set/lib/main.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/main.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/main.js index b348549bdc30..7f95b86ea31c 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/main.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/main.js @@ -70,7 +70,6 @@ var debug = logger( 'vega:mark:path:encoding-set:main' ); * @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.path] - SVG path string @@ -85,7 +84,6 @@ var debug = logger( 'vega:mark:path:encoding-set:main' ); * @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 From c32c1c3da599ba2da23a4294fb3ef951f68eed44 Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 31 Jul 2026 17:39:59 -0700 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../plot/vega/mark/path/encoding-set/lib/properties.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/properties.json b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/properties.json index f0a83293a858..4e5544b874b6 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/properties.json +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/properties.json @@ -5,7 +5,6 @@ "description", "fill", "fillOpacity", - "height", "href", "opacity", "stroke", @@ -17,7 +16,6 @@ "strokeOpacity", "strokeWidth", "tooltip", - "width", "x", "y", "zindex", From 6027a681edf11c17bd446f96a8b5b5fe999a195c Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 31 Jul 2026 17:41:39 -0700 Subject: [PATCH 4/4] fix: disable unused properties Signed-off-by: Athan --- .../vega/mark/path/encoding-set/lib/main.js | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/main.js b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/main.js index 7f95b86ea31c..a9a2086bd47b 100644 --- a/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/main.js +++ b/lib/node_modules/@stdlib/plot/vega/mark/path/encoding-set/lib/main.js @@ -171,7 +171,29 @@ setNonEnumerableReadOnly( PathEncodingSet, 'name', 'PathEncodingSet' ); setReadWriteAccessor( PathEncodingSet.prototype, 'angle', getAngle, setAngle ); /** -* Encoding specifying an SVG path string. +* Encoding specifying a mark height (in pixels). +* +* ## Notes +* +* - This property is inherited from the parent prototype and is not applicable to path mark types. +* +* @name height +* @memberof PathEncodingSet.prototype +* @readonly +* @type {void} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new PathEncodingSet(); +* +* var v = encoding.height; +* // returns undefined +*/ +setNonEnumerableReadOnlyProperty( PathEncodingSet.prototype, 'height', void 0 ); + +/** +* Encoding specifying an SVG path string describing the geometry of the path. * * @name path * @memberof PathEncodingSet.prototype @@ -248,6 +270,28 @@ setReadWriteAccessor( PathEncodingSet.prototype, 'scaleX', getScaleX, setScaleX */ setReadWriteAccessor( PathEncodingSet.prototype, 'scaleY', getScaleY, setScaleY ); +/** +* Encoding specifying a mark width (in pixels). +* +* ## Notes +* +* - This property is inherited from the parent prototype and is not applicable to path mark types. +* +* @name width +* @memberof PathEncodingSet.prototype +* @readonly +* @type {void} +* +* @example +* var Value = require( '@stdlib/plot/vega/value/ctor' ); +* +* var encoding = new PathEncodingSet(); +* +* var v = encoding.width; +* // returns undefined +*/ +setNonEnumerableReadOnlyProperty( PathEncodingSet.prototype, 'width', void 0 ); + /** * Encoding specifying a mark secondary x-coordinate (in pixels). *