diff --git a/lib/node_modules/@stdlib/plot/vega/layout/bounds/README.md b/lib/node_modules/@stdlib/plot/vega/layout/bounds/README.md new file mode 100644 index 000000000000..aa10ce829a73 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/layout/bounds/README.md @@ -0,0 +1,123 @@ + + +# layoutBounds + +> List of supported Vega layout bounds. + + + +
+ +
+ + + + + +
+ +## Usage + +```javascript +var layoutBounds = require( '@stdlib/plot/vega/layout/bounds' ); +``` + +#### layoutBounds() + +Returns a list of layout bounds. + +```javascript +var out = layoutBounds(); +// returns [ 'full', 'flush' ] +``` + +
+ + + + + +
+ +## Notes + +- The bounds calculation method determines the extent of a sub-plot: + - `full`: The entire calculated bounds (including axes, title, and legend) will be used. + - `flush`: Only the specified width and height values for the group mark will be used. This setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure. + +
+ + + + + +
+ +## Examples + + + +```javascript +var contains = require( '@stdlib/array/base/assert/contains' ).factory; +var layoutBounds = require( '@stdlib/plot/vega/layout/bounds' ); + +var isLayoutBound = contains( layoutBounds() ); + +var bool = isLayoutBound( 'full' ); +// returns true + +bool = isLayoutBound( 'flush' ); +// returns true + +bool = isLayoutBound( 'beep' ); +// returns false + +bool = isLayoutBound( 'boop' ); +// returns false +``` + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/plot/vega/layout/bounds/benchmark/benchmark.js b/lib/node_modules/@stdlib/plot/vega/layout/bounds/benchmark/benchmark.js new file mode 100644 index 000000000000..124b8c3b849a --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/layout/bounds/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 layoutBounds = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var out; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + out = layoutBounds(); + 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/layout/bounds/docs/repl.txt b/lib/node_modules/@stdlib/plot/vega/layout/bounds/docs/repl.txt new file mode 100644 index 000000000000..f4a68d35bc8a --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/layout/bounds/docs/repl.txt @@ -0,0 +1,17 @@ + +{{alias}}() + Returns a list of layout bounds. + + Returns + ------- + out: Array + List of layout bounds. + + Examples + -------- + > var out = {{alias}}() + [ 'full', 'flush' ] + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/plot/vega/layout/bounds/docs/types/index.d.ts b/lib/node_modules/@stdlib/plot/vega/layout/bounds/docs/types/index.d.ts new file mode 100644 index 000000000000..8556a4bbe2cb --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/layout/bounds/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 layout bounds. +* +* @returns list of layout bounds +* +* @example +* var list = layoutBounds(); +* // returns [ 'full', 'flush' ] +*/ +declare function layoutBounds(): Array; + + +// EXPORTS // + +export = layoutBounds; diff --git a/lib/node_modules/@stdlib/plot/vega/layout/bounds/docs/types/test.ts b/lib/node_modules/@stdlib/plot/vega/layout/bounds/docs/types/test.ts new file mode 100644 index 000000000000..dd3c2de2c939 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/layout/bounds/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 layoutBounds = require( './index' ); + + +// TESTS // + +// The function returns an array of strings... +{ + layoutBounds(); // $ExpectType string[] +} + +// The compiler throws an error if the function is provided any arguments... +{ + layoutBounds( 9 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/plot/vega/layout/bounds/examples/index.js b/lib/node_modules/@stdlib/plot/vega/layout/bounds/examples/index.js new file mode 100644 index 000000000000..f891a448fa53 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/layout/bounds/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 layoutBounds = require( './../lib' ); + +var isLayoutBound = contains( layoutBounds() ); + +var bool = isLayoutBound( 'full' ); +console.log( bool ); +// => true + +bool = isLayoutBound( 'flush' ); +console.log( bool ); +// => true + +bool = isLayoutBound( 'beep' ); +console.log( bool ); +// => false + +bool = isLayoutBound( 'boop' ); +console.log( bool ); +// => false diff --git a/lib/node_modules/@stdlib/plot/vega/layout/bounds/lib/data.json b/lib/node_modules/@stdlib/plot/vega/layout/bounds/lib/data.json new file mode 100644 index 000000000000..9e738ad97b6a --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/layout/bounds/lib/data.json @@ -0,0 +1,4 @@ +[ + "full", + "flush" +] diff --git a/lib/node_modules/@stdlib/plot/vega/layout/bounds/lib/index.js b/lib/node_modules/@stdlib/plot/vega/layout/bounds/lib/index.js new file mode 100644 index 000000000000..d04cb97376e8 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/layout/bounds/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 layout bounds. +* +* @module @stdlib/plot/vega/layout/bounds +* +* @example +* var layoutBounds = require( '@stdlib/plot/vega/layout/bounds' ); +* +* var out = layoutBounds(); +* // returns [ 'full', 'flush' ] +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/plot/vega/layout/bounds/lib/main.js b/lib/node_modules/@stdlib/plot/vega/layout/bounds/lib/main.js new file mode 100644 index 000000000000..d44d867aa7d4 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/layout/bounds/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 layout bounds. +* +* @returns {StringArray} list of layout bounds +* +* @example +* var out = layoutBounds(); +* // returns [ 'full', 'flush' ] +*/ +function layoutBounds() { + return DATA.slice(); +} + + +// EXPORTS // + +module.exports = layoutBounds; diff --git a/lib/node_modules/@stdlib/plot/vega/layout/bounds/package.json b/lib/node_modules/@stdlib/plot/vega/layout/bounds/package.json new file mode 100644 index 000000000000..7202ea1bbe75 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/layout/bounds/package.json @@ -0,0 +1,63 @@ +{ + "name": "@stdlib/plot/vega/layout/bounds", + "version": "0.0.0", + "description": "List of supported Vega layout bounds.", + "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", + "layout", + "bounds", + "utilities", + "utility", + "utils", + "util" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/plot/vega/layout/bounds/test/test.js b/lib/node_modules/@stdlib/plot/vega/layout/bounds/test/test.js new file mode 100644 index 000000000000..ad686f93ce25 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/layout/bounds/test/test.js @@ -0,0 +1,47 @@ +/** +* @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 layoutBounds = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof layoutBounds, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function returns a list of layout bounds', function test( t ) { + var expected; + var actual; + + expected = [ + 'full', + 'flush' + ]; + actual = layoutBounds(); + + t.deepEqual( actual, expected, 'returns expected value' ); + t.end(); +});