diff --git a/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/README.md b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/README.md new file mode 100644 index 000000000000..74254d56b2ee --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/README.md @@ -0,0 +1,117 @@ + + +# labelLineAnchorPositions + +> List of supported Vega label transform line anchor positions. + + + +
+ +
+ + + + + +
+ +## Usage + +```javascript +var labelLineAnchorPositions = require( '@stdlib/plot/vega/transform/label/line-anchor-positions' ); +``` + +#### labelLineAnchorPositions() + +Returns a list of label line anchor positions. + +```javascript +var out = labelLineAnchorPositions(); +// returns [ 'end', 'start' ] +``` + +
+ + + + + +
+ +
+ + + + + +
+ +## Examples + + + +```javascript +var contains = require( '@stdlib/array/base/assert/contains' ).factory; +var labelLineAnchorPositions = require( '@stdlib/plot/vega/transform/label/line-anchor-positions' ); + +var isLabelLineAnchorPosition = contains( labelLineAnchorPositions() ); + +var bool = isLabelLineAnchorPosition( 'start' ); +// returns true + +bool = isLabelLineAnchorPosition( 'end' ); +// returns true + +bool = isLabelLineAnchorPosition( 'beep' ); +// returns false + +bool = isLabelLineAnchorPosition( 'boop' ); +// returns false +``` + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/benchmark/benchmark.js b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/benchmark/benchmark.js new file mode 100644 index 000000000000..7b79f77737b2 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/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 labelLineAnchorPositions = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var out; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + out = labelLineAnchorPositions(); + 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/transform/label/line-anchor-positions/docs/repl.txt b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/docs/repl.txt new file mode 100644 index 000000000000..00da8c8fa167 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/docs/repl.txt @@ -0,0 +1,17 @@ + +{{alias}}() + Returns a list of label line anchor positions. + + Returns + ------- + out: Array + List of label line anchor positions. + + Examples + -------- + > var out = {{alias}}() + [ 'end', 'start' ] + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/docs/types/index.d.ts b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/docs/types/index.d.ts new file mode 100644 index 000000000000..1ee850a7a42a --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/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 label line anchor positions. +* +* @returns list of label line anchor positions +* +* @example +* var list = labelLineAnchorPositions(); +* // returns [ 'end', 'start' ] +*/ +declare function labelLineAnchorPositions(): Array; + + +// EXPORTS // + +export = labelLineAnchorPositions; diff --git a/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/docs/types/test.ts b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/docs/types/test.ts new file mode 100644 index 000000000000..7e4fb8620c34 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/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 labelLineAnchorPositions = require( './index' ); + + +// TESTS // + +// The function returns an array of strings... +{ + labelLineAnchorPositions(); // $ExpectType string[] +} + +// The compiler throws an error if the function is provided any arguments... +{ + labelLineAnchorPositions( 9 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/examples/index.js b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/examples/index.js new file mode 100644 index 000000000000..b9d024606de4 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/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 labelLineAnchorPositions = require( './../lib' ); + +var isLabelLineAnchorPosition = contains( labelLineAnchorPositions() ); + +var bool = isLabelLineAnchorPosition( 'start' ); +console.log( bool ); +// => true + +bool = isLabelLineAnchorPosition( 'end' ); +console.log( bool ); +// => true + +bool = isLabelLineAnchorPosition( 'beep' ); +console.log( bool ); +// => false + +bool = isLabelLineAnchorPosition( 'boop' ); +console.log( bool ); +// => false diff --git a/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/lib/data.json b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/lib/data.json new file mode 100644 index 000000000000..d9a165f9c74e --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/lib/data.json @@ -0,0 +1,4 @@ +[ + "end", + "start" +] diff --git a/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/lib/index.js b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/lib/index.js new file mode 100644 index 000000000000..60dc2fe8b012 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/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 label line anchor positions. +* +* @module @stdlib/plot/vega/transform/label/line-anchor-positions +* +* @example +* var labelLineAnchorPositions = require( '@stdlib/plot/vega/transform/label/line-anchor-positions' ); +* +* var out = labelLineAnchorPositions(); +* // returns [ 'end', 'start' ] +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/lib/main.js b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/lib/main.js new file mode 100644 index 000000000000..7735fbb38657 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/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 label line anchor positions. +* +* @returns {StringArray} list of label line anchor positions +* +* @example +* var out = labelLineAnchorPositions(); +* // returns [ 'end', 'start' ] +*/ +function labelLineAnchorPositions() { + return DATA.slice(); +} + + +// EXPORTS // + +module.exports = labelLineAnchorPositions; diff --git a/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/package.json b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/package.json new file mode 100644 index 000000000000..43d10a41d462 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/package.json @@ -0,0 +1,66 @@ +{ + "name": "@stdlib/plot/vega/transform/label/line-anchor-positions", + "version": "0.0.0", + "description": "List of supported Vega label transform line anchor positions.", + "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", + "label", + "line", + "anchor", + "position", + "utilities", + "utility", + "utils", + "util" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/test/test.js b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/test/test.js new file mode 100644 index 000000000000..2c3f31b77cfb --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/transform/label/line-anchor-positions/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 labelLineAnchorPositions = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof labelLineAnchorPositions, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function returns a list of label line anchor positions', function test( t ) { + var expected; + var actual; + + expected = [ + 'end', + 'start' + ]; + actual = labelLineAnchorPositions(); + + t.deepEqual( actual, expected, 'returns expected value' ); + t.end(); +});