diff --git a/lib/node_modules/@stdlib/plot/vega/scale/quantile/examples/index.js b/lib/node_modules/@stdlib/plot/vega/scale/quantile/examples/index.js new file mode 100644 index 000000000000..f3c64d65e270 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/scale/quantile/examples/index.js @@ -0,0 +1,27 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var DiscretizingScale = require( './../lib' ); + +var scale = new DiscretizingScale({ + 'name': 'colorScale' +}); + +console.log( scale.toJSON() ); diff --git a/lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/index.js b/lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/index.js new file mode 100644 index 000000000000..f07d21c1d8a3 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/index.js @@ -0,0 +1,42 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Quantile scale constructor. +* +* @module @stdlib/plot/vega/scale/quantile +* +* @example +* var QuantileScale = require( '@stdlib/plot/vega/scale/quantile' ); +* +* var scale = new QuantileScale({ +* 'name': 'colorScale' +* }); +* // returns +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/main.js b/lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/main.js new file mode 100644 index 000000000000..142dcc232ef9 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/main.js @@ -0,0 +1,110 @@ +/** +* @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 isObject = require( '@stdlib/assert/is-object' ); +var hasProp = require( '@stdlib/assert/has-property' ); +var setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' ); +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var inherit = require( '@stdlib/utils/inherit' ); +var DiscretizingScale = require( '@stdlib/plot/vega/scale/discretizing' ); +var format = require( '@stdlib/string/format' ); +var TYPE = require( './type/type.js' ); +var getType = require( './type/get.js' ); +var setType = require( './type/set.js' ); + + +// MAIN // + +/** +* Quantile scale constructor. +* +* @constructor +* @param {Options} options - constructor options +* @param {string} options.name - scale name +* @param {(Collection|Object|Signal)} [options.domain] - domain of associated data values +* @param {Collection} [options.domainRaw] - array of raw domain values which overrides the `domain` property +* @param {(string|Object)} [options.interpolate] - scale range interpolation method +* @param {(Collection|Object|Signal|string)} [options.range] - scale range +* @param {boolean} [options.reverse=false] - boolean indicating whether to reverse the order of the scale range +* @throws {TypeError} options argument must be an object +* @throws {Error} must provide valid options +* @returns {QuantileScale} scale instance +* +* @example +* var scale = new QuantileScale({ +* 'name': 'colorScale' +* }); +* // returns +*/ +function QuantileScale( options ) { + if ( !( this instanceof QuantileScale ) ) { + return new QuantileScale( options ); + } + if ( !isObject( options ) ) { + throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); + } + if ( hasProp( options, 'type' ) && options.type !== TYPE ) { + throw new TypeError( format( 'invalid argument. `%s` option must be equal to "%s". Option: `%s`.', 'type', TYPE, options.type ) ); + } + DiscretizingScale.call( this, options ); + this._type = TYPE; + return this; +} + +/* +* Inherit from a parent prototype. +*/ +inherit( QuantileScale, DiscretizingScale ); + +/** +* Constructor name. +* +* @private +* @name name +* @memberof QuantileScale +* @readonly +* @type {string} +*/ +setReadOnly( QuantileScale, 'name', 'QuantileScale' ); + +/** +* Scale type. +* +* @name type +* @memberof QuantileScale.prototype +* @type {string} +* @default 'quantile' +* +* @example +* var scale = new QuantileScale({ +* 'name': 'colorScale' +* }); +* +* var v = scale.type; +* // returns 'quantile' +*/ +setReadWriteAccessor( QuantileScale.prototype, 'type', getType, setType ); + + +// EXPORTS // + +module.exports = QuantileScale; diff --git a/lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/type/get.js b/lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/type/get.js new file mode 100644 index 000000000000..b0e023118efa --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/type/get.js @@ -0,0 +1,41 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var TYPE = require( './type.js' ); + + +// MAIN // + +/** +* Returns the scale type. +* +* @private +* @returns {string} scale type +*/ +function get() { + return TYPE; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/type/set.js b/lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/type/set.js new file mode 100644 index 000000000000..d14f0839d329 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/type/set.js @@ -0,0 +1,46 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var format = require( '@stdlib/string/format' ); +var TYPE = require( './type.js' ); + + +// MAIN // + +/** +* Sets the scale type. +* +* @private +* @param {string} value - input value +* @throws {TypeError} must be a valid scale +* @returns {void} +*/ +function set( value ) { + if ( value !== TYPE ) { + throw new TypeError( format( 'invalid assignment. `%s` must be equal to "%s". Value: `%s`.', 'type', TYPE, value ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/type/type.js b/lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/type/type.js new file mode 100644 index 000000000000..718338f297da --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/type/type.js @@ -0,0 +1,23 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// EXPORTS // + +module.exports = 'quantile'; diff --git a/lib/node_modules/@stdlib/plot/vega/scale/quantile/package.json b/lib/node_modules/@stdlib/plot/vega/scale/quantile/package.json new file mode 100644 index 000000000000..c9363cae51a3 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/scale/quantile/package.json @@ -0,0 +1,63 @@ +{ + "name": "@stdlib/plot/vega/scale/quantile", + "version": "0.0.0", + "description": "Quantile scale 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", + "scale", + "discrete", + "categorical", + "quantile", + "constructor", + "ctor" + ], + "__stdlib__": {} +}