diff --git a/lib/node_modules/@stdlib/plot/vega/transform/sequence/examples/index.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/examples/index.js new file mode 100644 index 000000000000..789ef92f0ec7 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/examples/index.js @@ -0,0 +1,29 @@ +/** +* @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 SequenceTransform = require( './../lib' ); + +var transform = new SequenceTransform({ + 'start': 0, + 'stop': 5, + 'step': 1 +}); + +console.log( transform.toJSON() ); diff --git a/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/as/get.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/as/get.js new file mode 100644 index 000000000000..ef26ef4afb72 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/as/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 output field name for the sequence values. +* +* @private +* @returns {string} field name +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/as/properties.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/as/properties.js new file mode 100644 index 000000000000..3f2304dc2f08 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/as/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( 'as' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/as/set.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/as/set.js new file mode 100644 index 000000000000..27dc0803aeba --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/as/set.js @@ -0,0 +1,61 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var 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:sequence-transform:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the output field name for the sequence values. +* +* @private +* @param {string} value - input value +* @throws {TypeError} must be a string +* @returns {void} +*/ +function set( value ) { + if ( !isString( 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/transform/sequence/lib/change_event.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/change_event.js new file mode 100644 index 000000000000..e444f9c667b0 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/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': 'transform', + 'property': property + }; +} + + +// EXPORTS // + +module.exports = event; diff --git a/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/defaults.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/defaults.js new file mode 100644 index 000000000000..27056881ac5f --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/defaults.js @@ -0,0 +1,46 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MAIN // + +/** +* Returns defaults. +* +* @private +* @returns {Object} default options +* +* @example +* var o = defaults(); +* // returns {...} +*/ +function defaults() { + return { + // The name of the output field for sequence values: + 'as': 'data', + + // The step value between sequence entries: + 'step': 1 + }; +} + + +// EXPORTS // + +module.exports = defaults; diff --git a/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/index.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/index.js new file mode 100644 index 000000000000..1f8a2b870b32 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/index.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. +*/ + +'use strict'; + +/** +* Sequence transform constructor. +* +* @module @stdlib/plot/vega/transform/sequence +* +* @example +* var SequenceTransform = require( '@stdlib/plot/vega/transform/sequence' ); +* +* var transform = new SequenceTransform({ +* 'start': 0, +* 'stop': 5, +* 'step': 1 +* }); +* // returns +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/main.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/main.js new file mode 100644 index 000000000000..079e76102839 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/main.js @@ -0,0 +1,275 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-restricted-syntax, no-invalid-this, stdlib/no-empty-lines-between-requires */ + +'use strict'; + +// MODULES // + +var EventEmitter = require( 'events' ).EventEmitter; +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 setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' ); +var hasProp = require( '@stdlib/assert/has-property' ); +var inherit = require( '@stdlib/utils/inherit' ); +var objectKeys = require( '@stdlib/utils/keys' ); +var instance2json = require( '@stdlib/plot/vega/base/to-json' ); +var transformErrorMessage = require( '@stdlib/plot/vega/base/transform-validation-message' ); +var format = require( '@stdlib/string/format' ); +var properties = require( './properties.json' ); +var defaults = require( './defaults.js' ); + +// Note: keep the following in alphabetical order according to the `require` path... +var getAs = require( './as/get.js' ); +var setAs = require( './as/set.js' ); + +var getStart = require( './start/get.js' ); +var setStart = require( './start/set.js' ); + +var getStep = require( './step/get.js' ); +var setStep = require( './step/set.js' ); + +var getStop = require( './stop/get.js' ); +var setStop = require( './stop/set.js' ); + +var getProperties = require( './properties/get.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:sequence-transform:main' ); + + +// MAIN // + +/** +* Sequence transform constructor. +* +* @constructor +* @param {Options} options - constructor options +* @param {number} options.start - starting value of the sequence +* @param {number} options.stop - ending value (exclusive) of the sequence +* @param {number} [options.step=1] - step value between sequence entries +* @param {string} [options.as='data'] - output field name for the sequence values +* @throws {TypeError} options argument must be an object +* @throws {Error} must provide valid options +* @returns {SequenceTransform} sequence transform instance +* +* @example +* var transform = new SequenceTransform({ +* 'start': 0, +* 'stop': 5, +* 'step': 1 +* }); +* // returns +*/ +function SequenceTransform( options ) { + var opts; + var keys; + var v; + var k; + var i; + if ( !( this instanceof SequenceTransform ) ) { + return new SequenceTransform( options ); + } + EventEmitter.call( this ); + + if ( !isObject( options ) ) { + throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); + } + + // Check for required properties... + if ( !hasProp( options, 'start' ) ) { + throw new TypeError( 'invalid argument. Options argument must specify a starting value.' ); + } + if ( !hasProp( options, 'stop' ) ) { + throw new TypeError( 'invalid argument. Options argument must specify an ending value.' ); + } + + // Resolve the default configuration: + opts = defaults(); + + // Set internal properties according to the default configuration... + keys = objectKeys( opts ); + for ( i = 0; i < keys.length; i++ ) { + k = keys[ i ]; + this[ '_'+k ] = opts[ k ]; + } + + // Validate provided options by attempting to assign option values to corresponding fields... + for ( i = 0; i < properties.length; i++ ) { + k = properties[ i ]; + if ( !hasProp( options, k ) ) { + continue; + } + v = options[ k ]; + try { + this[ k ] = v; + } catch ( err ) { + debug( 'Encountered an error. Error: %s', err.message ); + + // FIXME: retain thrown error type + throw new Error( transformErrorMessage( err.message ) ); + } + } + return this; +} + +/* +* Inherit from the `EventEmitter` prototype. +*/ +inherit( SequenceTransform, EventEmitter ); + +/** +* Constructor name. +* +* @private +* @name name +* @memberof SequenceTransform +* @readonly +* @type {string} +*/ +setNonEnumerableReadOnly( SequenceTransform, 'name', 'SequenceTransform' ); + +/** +* Output field name for the sequence values. +* +* @name as +* @memberof SequenceTransform.prototype +* @type {string} +* @default 'data' +* +* @example +* var transform = new SequenceTransform({ +* 'start': 0, +* 'stop': 5, +* 'as': 'x' +* }); +* +* var v = transform.as; +* // returns 'x' +*/ +setReadWriteAccessor( SequenceTransform.prototype, 'as', getAs, setAs ); + +/** +* Starting value of the sequence. +* +* @name start +* @memberof SequenceTransform.prototype +* @type {number} +* +* @example +* var transform = new SequenceTransform({ +* 'start': 0, +* 'stop': 5 +* }); +* +* var v = transform.start; +* // returns 0 +*/ +setReadWriteAccessor( SequenceTransform.prototype, 'start', getStart, setStart ); + +/** +* Ending value (exclusive) of the sequence. +* +* @name stop +* @memberof SequenceTransform.prototype +* @type {number} +* +* @example +* var transform = new SequenceTransform({ +* 'start': 0, +* 'stop': 5 +* }); +* +* var v = transform.stop; +* // returns 5 +*/ +setReadWriteAccessor( SequenceTransform.prototype, 'stop', getStop, setStop ); + +/** +* Step value between sequence entries. +* +* @name step +* @memberof SequenceTransform.prototype +* @type {number} +* @default 1 +* +* @example +* var transform = new SequenceTransform({ +* 'start': 0, +* 'stop': 10, +* 'step': 2 +* }); +* +* var v = transform.step; +* // returns 2 +*/ +setReadWriteAccessor( SequenceTransform.prototype, 'step', getStep, setStep ); + +/** +* Sequence transform properties. +* +* @name properties +* @memberof SequenceTransform.prototype +* @type {Array} +* +* @example +* var transform = new SequenceTransform({ +* 'start': 0, +* 'stop': 5 +* }); +* +* var v = transform.properties; +* // returns [...] +*/ +setNonEnumerableReadOnlyAccessor( SequenceTransform.prototype, 'properties', getProperties ); + +/** +* Serializes an instance to a JSON object. +* +* ## Notes +* +* - This method is implicitly invoked by `JSON.stringify`. +* +* @name toJSON +* @memberof SequenceTransform.prototype +* @type {Function} +* @returns {Object} JSON object +* +* @example +* var transform = new SequenceTransform({ +* 'start': 0, +* 'stop': 5, +* 'step': 1 +* }); +* +* var v = transform.toJSON(); +* // returns {...} +*/ +setNonEnumerableReadOnly( SequenceTransform.prototype, 'toJSON', function toJSON() { + return instance2json( this, properties ); +}); + + +// EXPORTS // + +module.exports = SequenceTransform; diff --git a/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/properties.json b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/properties.json new file mode 100644 index 000000000000..0d60be57d046 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/properties.json @@ -0,0 +1,6 @@ +[ + "as", + "start", + "step", + "stop" +] diff --git a/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/properties/get.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/properties/get.js new file mode 100644 index 000000000000..f3cbb28454ea --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/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/transform/sequence/lib/start/get.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/start/get.js new file mode 100644 index 000000000000..0c872c7b4e5f --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/start/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 starting value of the sequence. +* +* @private +* @returns {number} start value +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/start/properties.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/start/properties.js new file mode 100644 index 000000000000..0e39e350def4 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/start/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( 'start' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/start/set.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/start/set.js new file mode 100644 index 000000000000..5edaed7f5d3a --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/start/set.js @@ -0,0 +1,61 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:sequence-transform:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the starting value of the sequence. +* +* @private +* @param {NonNegativeNumber} value - input value +* @throws {TypeError} must be a nonnegative number +* @returns {void} +*/ +function set( value ) { + if ( !isNonNegativeNumber( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a 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/transform/sequence/lib/step/get.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/step/get.js new file mode 100644 index 000000000000..500ce90ddc94 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/step/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 step value between sequence entries. +* +* @private +* @returns {number} step value +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/step/properties.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/step/properties.js new file mode 100644 index 000000000000..7378229ee6fc --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/step/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( 'step' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/step/set.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/step/set.js new file mode 100644 index 000000000000..2f17f167fdd5 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/step/set.js @@ -0,0 +1,61 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:sequence-transform:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the step value between sequence entries. +* +* @private +* @param {number} value - input value +* @throws {TypeError} must be a number +* @returns {void} +*/ +function set( value ) { + if ( !isNumber( 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/transform/sequence/lib/stop/get.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/stop/get.js new file mode 100644 index 000000000000..ac645310c029 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/stop/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 ending value (exclusive) of the sequence. +* +* @private +* @returns {number} stop value +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/stop/properties.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/stop/properties.js new file mode 100644 index 000000000000..0971d7684c4d --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/stop/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( 'stop' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/stop/set.js b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/stop/set.js new file mode 100644 index 000000000000..275900e7f9c4 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/lib/stop/set.js @@ -0,0 +1,61 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:sequence-transform:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the ending value (exclusive) of the sequence. +* +* @private +* @param {NonNegativeNumber} value - input value +* @throws {TypeError} must be a nonnegative number +* @returns {void} +*/ +function set( value ) { + if ( !isNonNegativeNumber( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a 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/transform/sequence/package.json b/lib/node_modules/@stdlib/plot/vega/transform/sequence/package.json new file mode 100644 index 000000000000..ef88dd7dc830 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/sequence/package.json @@ -0,0 +1,61 @@ +{ + "name": "@stdlib/plot/vega/transform/sequence", + "version": "0.0.0", + "description": "Sequence transform 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", + "transform", + "sequence", + "constructor", + "ctor" + ], + "__stdlib__": {} +}