Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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() );
42 changes: 42 additions & 0 deletions lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/index.js
Original file line number Diff line number Diff line change
@@ -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 <QuantileScale>
*/

// MODULES //

var main = require( './main.js' );


// EXPORTS //

module.exports = main;
110 changes: 110 additions & 0 deletions lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/main.js
Original file line number Diff line number Diff line change
@@ -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' );

Check failure on line 28 in lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/main.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

cannot resolve module: "@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
Comment on lines +41 to +47
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This properties here are same to the ordinal scale. How to determine properties?
There is nothing mentioned in the quantile scales documentation. Also why ordinal scale do not have all general properties of scales

* @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 <QuantileScale>
*/
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;
41 changes: 41 additions & 0 deletions lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/type/get.js
Original file line number Diff line number Diff line change
@@ -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;
46 changes: 46 additions & 0 deletions lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/type/set.js
Original file line number Diff line number Diff line change
@@ -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;
23 changes: 23 additions & 0 deletions lib/node_modules/@stdlib/plot/vega/scale/quantile/lib/type/type.js
Original file line number Diff line number Diff line change
@@ -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';
63 changes: 63 additions & 0 deletions lib/node_modules/@stdlib/plot/vega/scale/quantile/package.json
Original file line number Diff line number Diff line change
@@ -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__": {}
}
Loading