diff --git a/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/README.md b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/README.md new file mode 100644 index 000000000000..a24423f893b5 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/README.md @@ -0,0 +1,117 @@ + + +# gridAlignments + +> List of supported Vega grid alignments. + + + +
+ +
+ + + + + +
+ +## Usage + +```javascript +var gridAlignments = require( '@stdlib/plot/vega/base/grid-alignments' ); +``` + +#### gridAlignments() + +Returns a list of grid alignments. + +```javascript +var out = gridAlignments(); +// returns [ 'all', 'each', 'none' ] +``` + +
+ + + + + +
+ +
+ + + + + +
+ +## Examples + + + +```javascript +var contains = require( '@stdlib/array/base/assert/contains' ).factory; +var gridAlignments = require( '@stdlib/plot/vega/base/grid-alignments' ); + +var isGridAlignment = contains( gridAlignments() ); + +var bool = isGridAlignment( 'all' ); +// returns true + +bool = isGridAlignment( 'each' ); +// returns true + +bool = isGridAlignment( 'beep' ); +// returns false + +bool = isGridAlignment( 'boop' ); +// returns false +``` + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/benchmark/benchmark.js b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/benchmark/benchmark.js new file mode 100644 index 000000000000..44f1b2c53372 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/benchmark/benchmark.js @@ -0,0 +1,48 @@ +/** +* @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 bench = require( '@stdlib/bench' ); +var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives; +var pkg = require( './../package.json' ).name; +var gridAlignments = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var out; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + out = gridAlignments(); + if ( out.length < 2 ) { + b.fail( 'should return an array' ); + } + } + b.toc(); + if ( !isStringArray( out ) ) { + b.fail( 'should return an array of strings' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/docs/repl.txt b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/docs/repl.txt new file mode 100644 index 000000000000..a07c36dd59bf --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/docs/repl.txt @@ -0,0 +1,17 @@ + +{{alias}}() + Returns a list of grid alignments. + + Returns + ------- + out: Array + List of grid alignments. + + Examples + -------- + > var out = {{alias}}() + [ 'all', 'each', 'none' ] + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/docs/types/index.d.ts b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/docs/types/index.d.ts new file mode 100644 index 000000000000..af0f22e1e25b --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/docs/types/index.d.ts @@ -0,0 +1,35 @@ +/* +* @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. +*/ + +// TypeScript Version: 4.1 + +/** +* Returns a list of grid alignments. +* +* @returns list of grid alignments +* +* @example +* var list = gridAlignments(); +* // returns [ 'all', 'each', 'none' ] +*/ +declare function gridAlignments(): Array; + + +// EXPORTS // + +export = gridAlignments; diff --git a/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/docs/types/test.ts b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/docs/types/test.ts new file mode 100644 index 000000000000..7959faa6f3a8 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/docs/types/test.ts @@ -0,0 +1,32 @@ +/* +* @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. +*/ + +import gridAlignments = require( './index' ); + + +// TESTS // + +// The function returns an array of strings... +{ + gridAlignments(); // $ExpectType string[] +} + +// The compiler throws an error if the function is provided any arguments... +{ + gridAlignments( 9 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/examples/index.js b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/examples/index.js new file mode 100644 index 000000000000..7107125971d9 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/examples/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'; + +var contains = require( '@stdlib/array/base/assert/contains' ).factory; +var gridAlignments = require( './../lib' ); + +var isGridAlignment = contains( gridAlignments() ); + +var bool = isGridAlignment( 'all' ); +console.log( bool ); +// => true + +bool = isGridAlignment( 'each' ); +console.log( bool ); +// => true + +bool = isGridAlignment( 'beep' ); +console.log( bool ); +// => false + +bool = isGridAlignment( 'boop' ); +console.log( bool ); +// => false diff --git a/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/lib/data.json b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/lib/data.json new file mode 100644 index 000000000000..76cb09905b71 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/lib/data.json @@ -0,0 +1,5 @@ +[ + "all", + "each", + "none" +] diff --git a/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/lib/index.js b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/lib/index.js new file mode 100644 index 000000000000..586356e8ce4b --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/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'; + +/** +* Return a list of grid alignments. +* +* @module @stdlib/plot/vega/base/grid-alignments +* +* @example +* var gridAlignments = require( '@stdlib/plot/vega/base/grid-alignments' ); +* +* var out = gridAlignments(); +* // returns [ 'all', 'each', 'none' ] +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/lib/main.js b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/lib/main.js new file mode 100644 index 000000000000..06fb582c0724 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/lib/main.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'; + +// MODULES // + +var DATA = require( './data.json' ); + + +// MAIN // + +/** +* Returns a list of grid alignments. +* +* @returns {StringArray} list of grid alignments +* +* @example +* var out = gridAlignments(); +* // returns [ 'all', 'each', 'none' ] +*/ +function gridAlignments() { + return DATA.slice(); +} + + +// EXPORTS // + +module.exports = gridAlignments; diff --git a/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/package.json b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/package.json new file mode 100644 index 000000000000..661d0e8827be --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/package.json @@ -0,0 +1,65 @@ +{ + "name": "@stdlib/plot/vega/base/grid-alignments", + "version": "0.0.0", + "description": "List of supported Vega grid alignments.", + "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", + "grid", + "alignment", + "align", + "layout", + "utilities", + "utility", + "utils", + "util" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/test/test.js b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/test/test.js new file mode 100644 index 000000000000..fe729e513ce0 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/base/grid-alignments/test/test.js @@ -0,0 +1,48 @@ +/** +* @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 tape = require( 'tape' ); +var gridAlignments = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof gridAlignments, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function returns a list of grid alignments', function test( t ) { + var expected; + var actual; + + expected = [ + 'all', + 'each', + 'none' + ]; + actual = gridAlignments(); + + t.deepEqual( actual, expected, 'returns expected value' ); + t.end(); +});