From 522880c57d46ba392c58d94af8fb8e42b4021a79 Mon Sep 17 00:00:00 2001 From: orthodox-64 Date: Wed, 15 Apr 2026 03:05:02 +0530 Subject: [PATCH] feat: add plot/vega/mark/text --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../plot/vega/mark/text/examples/index.js | 27 + .../plot/vega/mark/text/lib/align/get.js | 43 ++ .../vega/mark/text/lib/align/properties.js | 33 + .../plot/vega/mark/text/lib/align/set.js | 63 ++ .../plot/vega/mark/text/lib/angle/get.js | 43 ++ .../vega/mark/text/lib/angle/properties.js | 33 + .../plot/vega/mark/text/lib/angle/set.js | 61 ++ .../plot/vega/mark/text/lib/baseline/get.js | 43 ++ .../vega/mark/text/lib/baseline/properties.js | 33 + .../plot/vega/mark/text/lib/baseline/set.js | 61 ++ .../plot/vega/mark/text/lib/change_event.js | 41 ++ .../plot/vega/mark/text/lib/defaults.js | 64 ++ .../plot/vega/mark/text/lib/dir/get.js | 43 ++ .../plot/vega/mark/text/lib/dir/properties.js | 33 + .../plot/vega/mark/text/lib/dir/set.js | 61 ++ .../@stdlib/plot/vega/mark/text/lib/dx/get.js | 43 ++ .../plot/vega/mark/text/lib/dx/properties.js | 33 + .../@stdlib/plot/vega/mark/text/lib/dx/set.js | 66 ++ .../@stdlib/plot/vega/mark/text/lib/dy/get.js | 43 ++ .../plot/vega/mark/text/lib/dy/properties.js | 33 + .../@stdlib/plot/vega/mark/text/lib/dy/set.js | 66 ++ .../plot/vega/mark/text/lib/ellipsis/get.js | 43 ++ .../vega/mark/text/lib/ellipsis/properties.js | 33 + .../plot/vega/mark/text/lib/ellipsis/set.js | 61 ++ .../plot/vega/mark/text/lib/font-size/get.js | 43 ++ .../mark/text/lib/font-size/properties.js | 33 + .../plot/vega/mark/text/lib/font-size/set.js | 66 ++ .../plot/vega/mark/text/lib/font-style/get.js | 43 ++ .../mark/text/lib/font-style/properties.js | 33 + .../plot/vega/mark/text/lib/font-style/set.js | 68 ++ .../vega/mark/text/lib/font-weight/get.js | 43 ++ .../mark/text/lib/font-weight/properties.js | 33 + .../vega/mark/text/lib/font-weight/set.js | 68 ++ .../plot/vega/mark/text/lib/font/get.js | 43 ++ .../vega/mark/text/lib/font/properties.js | 33 + .../plot/vega/mark/text/lib/font/set.js | 66 ++ .../@stdlib/plot/vega/mark/text/lib/index.js | 42 ++ .../plot/vega/mark/text/lib/limit/get.js | 43 ++ .../vega/mark/text/lib/limit/properties.js | 33 + .../plot/vega/mark/text/lib/limit/set.js | 61 ++ .../plot/vega/mark/text/lib/line-break/get.js | 43 ++ .../mark/text/lib/line-break/properties.js | 33 + .../plot/vega/mark/text/lib/line-break/set.js | 66 ++ .../vega/mark/text/lib/line-height/get.js | 43 ++ .../mark/text/lib/line-height/properties.js | 33 + .../vega/mark/text/lib/line-height/set.js | 66 ++ .../@stdlib/plot/vega/mark/text/lib/main.js | 580 ++++++++++++++++++ .../plot/vega/mark/text/lib/properties.json | 35 ++ .../plot/vega/mark/text/lib/properties/get.js | 41 ++ .../plot/vega/mark/text/lib/radius/get.js | 43 ++ .../vega/mark/text/lib/radius/properties.js | 33 + .../plot/vega/mark/text/lib/radius/set.js | 61 ++ .../plot/vega/mark/text/lib/text/get.js | 43 ++ .../vega/mark/text/lib/text/properties.js | 33 + .../plot/vega/mark/text/lib/text/set.js | 68 ++ .../plot/vega/mark/text/lib/theta/get.js | 43 ++ .../vega/mark/text/lib/theta/properties.js | 33 + .../plot/vega/mark/text/lib/theta/set.js | 61 ++ .../plot/vega/mark/text/lib/type/get.js | 38 ++ .../plot/vega/mark/text/lib/type/set.js | 46 ++ .../plot/vega/mark/text/lib/type/type.js | 23 + .../@stdlib/plot/vega/mark/text/package.json | 61 ++ 62 files changed, 3380 insertions(+) create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/examples/index.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/align/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/align/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/align/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/angle/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/angle/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/angle/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/baseline/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/baseline/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/baseline/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/change_event.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/defaults.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/dir/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/dir/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/dir/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/dx/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/dx/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/dx/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/dy/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/dy/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/dy/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/ellipsis/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/ellipsis/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/ellipsis/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-size/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-size/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-size/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-style/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-style/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-style/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-weight/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-weight/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-weight/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/font/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/font/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/font/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/index.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/limit/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/limit/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/limit/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-break/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-break/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-break/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-height/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-height/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-height/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/main.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/properties.json create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/properties/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/radius/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/radius/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/radius/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/text/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/text/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/text/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/theta/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/theta/properties.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/theta/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/type/get.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/type/set.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/lib/type/type.js create mode 100644 lib/node_modules/@stdlib/plot/vega/mark/text/package.json diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/examples/index.js b/lib/node_modules/@stdlib/plot/vega/mark/text/examples/index.js new file mode 100644 index 000000000000..c3e9ea4e3074 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/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 TextMark = require( './../lib' ); + +var mark = new TextMark({ + 'align': 'center' +}); + +console.log( mark.toJSON() ); diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/align/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/align/get.js new file mode 100644 index 000000000000..52228a1070ba --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/align/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the horizontal text alignment. +* +* @private +* @returns {string} horizontal text alignment +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/align/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/align/properties.js new file mode 100644 index 000000000000..d8b59b16570b --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/align/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'align' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/align/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/align/set.js new file mode 100644 index 000000000000..6a9a6086c355 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/align/set.js @@ -0,0 +1,63 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var contains = require( '@stdlib/array/base/assert/contains' ).factory; +var textAlignments = require( '@stdlib/plot/vega/base/text-alignments' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); +var isTextAlignment = contains( textAlignments() ); + + +// MAIN // + +/** +* Sets the horizontal text alignment. +* +* @private +* @param {string} value - input value +* @throws {TypeError} must be a supported text alignment +* @returns {void} +*/ +function set( value ) { + if ( !isTextAlignment( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a supported text alignment. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/angle/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/angle/get.js new file mode 100644 index 000000000000..3ebc4f78fa6f --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/angle/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the rotation angle in degrees. +* +* @private +* @returns {number} rotation angle +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/angle/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/angle/properties.js new file mode 100644 index 000000000000..5889ae58645a --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/angle/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'angle' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/angle/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/angle/set.js new file mode 100644 index 000000000000..7fbca421a597 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/angle/set.js @@ -0,0 +1,61 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the rotation angle in degrees. +* +* @private +* @param {number} value - input value +* @throws {TypeError} must be a number +* @returns {void} +*/ +function set( value ) { + if ( !isNumber( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a number. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/baseline/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/baseline/get.js new file mode 100644 index 000000000000..1f8674df31a7 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/baseline/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the vertical text baseline. +* +* @private +* @returns {string} vertical text baseline +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/baseline/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/baseline/properties.js new file mode 100644 index 000000000000..6111ff2bcd83 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/baseline/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'baseline' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/baseline/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/baseline/set.js new file mode 100644 index 000000000000..79bfc5495b6b --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/baseline/set.js @@ -0,0 +1,61 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isVerticalBaseline = require( '@stdlib/plot/vega/base/assert/is-vertical-baseline' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the vertical text baseline. +* +* @private +* @param {string} value - input value +* @throws {TypeError} must be a supported vertical baseline +* @returns {void} +*/ +function set( value ) { + if ( !isVerticalBaseline( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a supported vertical baseline. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/change_event.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/change_event.js new file mode 100644 index 000000000000..359afbfa206b --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/change_event.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'; + +// MAIN // + +/** +* Returns a new change event object. +* +* @private +* @param {string} property - property name +* @returns {Object} event object +*/ +function event( property ) { // eslint-disable-line stdlib/no-redeclare + return { + 'type': 'update', + 'source': 'mark', + 'property': property + }; +} + + +// EXPORTS // + +module.exports = event; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/defaults.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/defaults.js new file mode 100644 index 000000000000..a7535bb894f0 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/defaults.js @@ -0,0 +1,64 @@ +/** +* @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'; + +// MAIN // + +/** +* Returns defaults. +* +* @private +* @returns {Object} default options +* +* @example +* var o = defaults(); +* // returns {...} +*/ +function defaults() { + return { + // Horizontal text alignment: + 'align': 'left', + + // Rotation angle in degrees: + 'angle': 0, + + // Vertical text baseline: + 'baseline': 'alphabetic', + + // Text direction: + 'dir': 'ltr', + + // Ellipsis string for text truncation: + 'ellipsis': '\u2026', + + // Maximum length of the text mark in pixels (0 = no limit): + 'limit': 0, + + // Polar coordinate radial offset in pixels: + 'radius': 0, + + // Polar coordinate angle in radians: + 'theta': 0 + }; +} + + +// EXPORTS // + +module.exports = defaults; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dir/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dir/get.js new file mode 100644 index 000000000000..6a9c1277eaf4 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dir/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the text direction. +* +* @private +* @returns {string} text direction +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dir/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dir/properties.js new file mode 100644 index 000000000000..a0b155cf83ba --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dir/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'dir' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dir/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dir/set.js new file mode 100644 index 000000000000..599bb1206bf1 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dir/set.js @@ -0,0 +1,61 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the text direction. +* +* @private +* @param {string} value - input value +* @throws {TypeError} must be a string +* @returns {void} +*/ +function set( value ) { + if ( !isString( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dx/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dx/get.js new file mode 100644 index 000000000000..e4ac820f4700 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dx/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the horizontal offset in pixels. +* +* @private +* @returns {(number|void)} horizontal offset +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dx/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dx/properties.js new file mode 100644 index 000000000000..b86dcf4a62fd --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dx/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'dx' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dx/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dx/set.js new file mode 100644 index 000000000000..6d1d5ca8888a --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dx/set.js @@ -0,0 +1,66 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; +var isUndefined = require( '@stdlib/assert/is-undefined' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the horizontal offset (in pixels). +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(number|void)} value - input value +* @throws {TypeError} must be a number +* @returns {void} +*/ +function set( value ) { + if ( !isUndefined( value ) && !isNumber( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a number. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dy/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dy/get.js new file mode 100644 index 000000000000..7ddefae6818a --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dy/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the vertical offset in pixels. +* +* @private +* @returns {(number|void)} vertical offset +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dy/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dy/properties.js new file mode 100644 index 000000000000..724b9d0c8223 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dy/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'dy' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dy/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dy/set.js new file mode 100644 index 000000000000..152c327f1bb6 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/dy/set.js @@ -0,0 +1,66 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; +var isUndefined = require( '@stdlib/assert/is-undefined' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the vertical offset (in pixels). +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(number|void)} value - input value +* @throws {TypeError} must be a number +* @returns {void} +*/ +function set( value ) { + if ( !isUndefined( value ) && !isNumber( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a number. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/ellipsis/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/ellipsis/get.js new file mode 100644 index 000000000000..830c7348608e --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/ellipsis/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the ellipsis string for text truncation. +* +* @private +* @returns {string} ellipsis string +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/ellipsis/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/ellipsis/properties.js new file mode 100644 index 000000000000..c44e124f1bd9 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/ellipsis/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'ellipsis' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/ellipsis/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/ellipsis/set.js new file mode 100644 index 000000000000..f3f56d7cde1f --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/ellipsis/set.js @@ -0,0 +1,61 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the ellipsis string for text truncation. +* +* @private +* @param {string} value - input value +* @throws {TypeError} must be a string +* @returns {void} +*/ +function set( value ) { + if ( !isString( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-size/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-size/get.js new file mode 100644 index 000000000000..495f9e19fee8 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-size/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the font size (in pixels). +* +* @private +* @returns {(number|void)} font size +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-size/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-size/properties.js new file mode 100644 index 000000000000..114dd4e49704 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-size/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'fontSize' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-size/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-size/set.js new file mode 100644 index 000000000000..3b94b78215ef --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-size/set.js @@ -0,0 +1,66 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; +var isUndefined = require( '@stdlib/assert/is-undefined' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the font size in pixels. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(number|void)} value - input value +* @throws {TypeError} must be a number +* @returns {void} +*/ +function set( value ) { + if ( !isUndefined( value ) && !isNumber( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a number. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-style/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-style/get.js new file mode 100644 index 000000000000..aad3725466d8 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-style/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the font style. +* +* @private +* @returns {(string|void)} font style +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-style/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-style/properties.js new file mode 100644 index 000000000000..36557341fabc --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-style/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'fontStyle' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-style/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-style/set.js new file mode 100644 index 000000000000..f2b3c75c74bb --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-style/set.js @@ -0,0 +1,68 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isUndefined = require( '@stdlib/assert/is-undefined' ); +var contains = require( '@stdlib/array/base/assert/contains' ).factory; +var fontStyles = require( '@stdlib/plot/vega/base/font-styles' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); +var isFontStyle = contains( fontStyles() ); + + +// MAIN // + +/** +* Sets the font style. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(string|void)} value - input value +* @throws {TypeError} must be a supported font style +* @returns {void} +*/ +function set( value ) { + if ( !isUndefined( value ) && !isFontStyle( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a supported font style. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-weight/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-weight/get.js new file mode 100644 index 000000000000..fb268428285a --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-weight/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the font weight. +* +* @private +* @returns {(string|void)} font weight +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-weight/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-weight/properties.js new file mode 100644 index 000000000000..ff088da52898 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-weight/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'fontWeight' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-weight/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-weight/set.js new file mode 100644 index 000000000000..9c2534e23d22 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font-weight/set.js @@ -0,0 +1,68 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isUndefined = require( '@stdlib/assert/is-undefined' ); +var contains = require( '@stdlib/array/base/assert/contains' ).factory; +var fontWeights = require( '@stdlib/plot/vega/base/font-weights' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); +var isFontWeight = contains( fontWeights() ); + + +// MAIN // + +/** +* Sets the font weight. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(string|void)} value - input value +* @throws {TypeError} must be a supported font weight +* @returns {void} +*/ +function set( value ) { + if ( !isUndefined( value ) && !isFontWeight( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a supported font weight. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font/get.js new file mode 100644 index 000000000000..21786dc3073f --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the typeface. +* +* @private +* @returns {(string|void)} typeface +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font/properties.js new file mode 100644 index 000000000000..4cb2f7342c5e --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'font' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font/set.js new file mode 100644 index 000000000000..5575b18f31bc --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/font/set.js @@ -0,0 +1,66 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var isUndefined = require( '@stdlib/assert/is-undefined' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the typeface. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(string|void)} value - input value +* @throws {TypeError} must be a string +* @returns {void} +*/ +function set( value ) { + if ( !isUndefined( value ) && !isString( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/index.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/index.js new file mode 100644 index 000000000000..929264705862 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/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'; + +/** +* Text mark constructor. +* +* @module @stdlib/plot/vega/mark/text +* +* @example +* var TextMark = require( '@stdlib/plot/vega/mark/text' ); +* +* var mark = new TextMark({ +* 'align': 'center' +* }); +* // returns +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/limit/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/limit/get.js new file mode 100644 index 000000000000..c5f30e6d2d40 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/limit/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the maximum length of the text mark in pixels. +* +* @private +* @returns {number} maximum text length +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/limit/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/limit/properties.js new file mode 100644 index 000000000000..15435bbe5eaa --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/limit/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'limit' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/limit/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/limit/set.js new file mode 100644 index 000000000000..2a17eae1d789 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/limit/set.js @@ -0,0 +1,61 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the maximum length of the text mark in pixels. +* +* @private +* @param {NonNegativeNumber} value - input value +* @throws {TypeError} must be a non-negative number +* @returns {void} +*/ +function set( value ) { + if ( !isNonNegativeNumber( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a non-negative number. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-break/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-break/get.js new file mode 100644 index 000000000000..860ff9cab618 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-break/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the line break delimiter. +* +* @private +* @returns {(string|void)} line break delimiter +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-break/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-break/properties.js new file mode 100644 index 000000000000..ff9588ea7b47 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-break/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'lineBreak' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-break/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-break/set.js new file mode 100644 index 000000000000..ccfa4c3b19b6 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-break/set.js @@ -0,0 +1,66 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var isUndefined = require( '@stdlib/assert/is-undefined' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the line break delimiter. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(string|void)} value - input value +* @throws {TypeError} must be a string +* @returns {void} +*/ +function set( value ) { + if ( !isUndefined( value ) && !isString( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a string. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-height/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-height/get.js new file mode 100644 index 000000000000..f0f1323e3714 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-height/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the line height in pixels. +* +* @private +* @returns {(number|void)} line height +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-height/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-height/properties.js new file mode 100644 index 000000000000..e5561712999b --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-height/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'lineHeight' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-height/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-height/set.js new file mode 100644 index 000000000000..17d49f26b3a0 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/line-height/set.js @@ -0,0 +1,66 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; +var isUndefined = require( '@stdlib/assert/is-undefined' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the line height in pixels. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* +* @private +* @param {(number|void)} value - input value +* @throws {TypeError} must be a number +* @returns {void} +*/ +function set( value ) { + if ( !isUndefined( value ) && !isNumber( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a number. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/main.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/main.js new file mode 100644 index 000000000000..ed50eef759f1 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/main.js @@ -0,0 +1,580 @@ +/** +* @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. +*/ + +/* eslint-disable no-restricted-syntax, no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isObject = require( '@stdlib/assert/is-object' ); +var setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' ); +var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var setNonEnumerableReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' ); // eslint-disable-line id-length +var hasProp = require( '@stdlib/assert/has-property' ); +var inherit = require( '@stdlib/utils/inherit' ); +var objectKeys = require( '@stdlib/utils/keys' ); +var transformErrorMessage = require( '@stdlib/plot/vega/base/transform-validation-message' ); +var instance2json = require( '@stdlib/plot/vega/base/to-json' ); +var Mark = require( '@stdlib/plot/vega/mark/base/ctor' ); +var format = require( '@stdlib/string/format' ); +var properties = require( './properties.json' ); +var defaults = require( './defaults.js' ); + +// Note: keep the following in alphabetical order according to the `require` path... +var getAlign = require( './align/get.js' ); +var setAlign = require( './align/set.js' ); + +var getAngle = require( './angle/get.js' ); +var setAngle = require( './angle/set.js' ); + +var getBaseline = require( './baseline/get.js' ); +var setBaseline = require( './baseline/set.js' ); + +var getDir = require( './dir/get.js' ); +var setDir = require( './dir/set.js' ); + +var getDx = require( './dx/get.js' ); +var setDx = require( './dx/set.js' ); + +var getDy = require( './dy/get.js' ); +var setDy = require( './dy/set.js' ); + +var getEllipsis = require( './ellipsis/get.js' ); +var setEllipsis = require( './ellipsis/set.js' ); + +var getFont = require( './font/get.js' ); +var setFont = require( './font/set.js' ); + +var getFontSize = require( './font-size/get.js' ); +var setFontSize = require( './font-size/set.js' ); + +var getFontStyle = require( './font-style/get.js' ); +var setFontStyle = require( './font-style/set.js' ); + +var getFontWeight = require( './font-weight/get.js' ); +var setFontWeight = require( './font-weight/set.js' ); + +var getLimit = require( './limit/get.js' ); +var setLimit = require( './limit/set.js' ); + +var getLineBreak = require( './line-break/get.js' ); +var setLineBreak = require( './line-break/set.js' ); + +var getLineHeight = require( './line-height/get.js' ); +var setLineHeight = require( './line-height/set.js' ); + +var getProperties = require( './properties/get.js' ); + +var getRadius = require( './radius/get.js' ); +var setRadius = require( './radius/set.js' ); + +var getText = require( './text/get.js' ); +var setText = require( './text/set.js' ); + +var getTheta = require( './theta/get.js' ); +var setTheta = require( './theta/set.js' ); + +var getType = require( './type/get.js' ); +var setType = require( './type/set.js' ); + +var TYPE = require( './type/type.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:main' ); + + +// MAIN // + +/** +* Text mark constructor. +* +* @constructor +* @param {Options} [options] - constructor options +* @param {string} [options.align='left'] - horizontal text alignment +* @param {number} [options.angle=0] - rotation angle in degrees +* @param {boolean} [options.aria=true] - boolean indicating whether to include ARIA attributes in SVG output +* @param {string} [options.baseline='alphabetic'] - vertical text baseline +* @param {(boolean|Signal|Object)} [options.clip=false] - setting indicating whether to clip marks to a specified shape +* @param {string} [options.description] - text description of a mark for ARIA accessibility +* @param {string} [options.dir='ltr'] - text direction +* @param {number} [options.dx] - horizontal offset in pixels +* @param {number} [options.dy] - vertical offset in pixels +* @param {string} [options.ellipsis='\u2026'] - ellipsis string for text truncation +* @param {Object} [options.encode] - object containing visual encoding rules for mark properties +* @param {string} [options.font] - typeface +* @param {number} [options.fontSize] - font size in pixels +* @param {string} [options.fontStyle] - font style +* @param {string} [options.fontWeight] - font weight +* @param {Object} [options.from] - object describing the data a mark should visualize +* @param {boolean} [options.interactive=true] - boolean indicating whether a mark can serve as an input event source +* @param {(string|Object)} [options.key] - data field to use as a unique key for data binding +* @param {NonNegativeNumber} [options.limit=0] - maximum length of the text mark in pixels +* @param {string} [options.lineBreak] - delimiter for breaking text into multiple lines +* @param {number} [options.lineHeight] - height in pixels of each line in multi-line text +* @param {string} [options.name] - unique name +* @param {number} [options.radius=0] - polar coordinate radial offset in pixels +* @param {string} [options.role] - metadata string indicating the role of a mark +* @param {(string|Array)} [options.text] - text to display +* @param {number} [options.theta=0] - polar coordinate angle in radians +* @param {Array} [options.triggers=[]] - list of triggers for modifying mark properties in response to signal changes +* @param {Object} [options.sort] - comparator for sorting mark items +* @param {Array} [options.transforms=[]] - list of post-encoding transforms to apply after any "encode" blocks and which operate directly on mark scenegraph items +* @param {(string|Array)} [options.style] - custom styles to apply to a mark +* @param {number} [options.zindex=0] - integer z-index indicating the layering of a mark relative to other marks +* @throws {TypeError} options argument must be an object +* @throws {TypeError} `type` option, if provided, must be equal to "text" +* @throws {Error} must provide valid options +* @returns {TextMark} text mark instance +* +* @example +* var mark = new TextMark({ +* 'align': 'center' +* }); +* // returns +*/ +function TextMark( options ) { + var opts; + var keys; + var v; + var k; + var i; + if ( !( this instanceof TextMark ) ) { + if ( arguments.length === 0 ) { + return new TextMark( {} ); + } + return new TextMark( options ); + } + if ( arguments.length === 0 ) { + 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 ) ); + } + options.type = TYPE; + Mark.call( this, options ); + + // Resolve the default configuration: + opts = defaults(); + + // Set internal properties according to the default configuration... + keys = objectKeys( opts ); + for ( i = 0; i < keys.length; i++ ) { + k = keys[ i ]; + this[ '_'+k ] = opts[ k ]; + } + // Validate provided options by attempting to assign option values to corresponding fields... + for ( i = 0; i < properties.length; i++ ) { + k = properties[ i ]; + if ( !hasProp( options, k ) ) { + continue; + } + v = options[ k ]; + try { + this[ k ] = v; + } catch ( err ) { + debug( 'Encountered an error. Error: %s', err.message ); + + // FIXME: retain thrown error type + throw new Error( transformErrorMessage( err.message ) ); + } + } + this._type = TYPE; + return this; +} + +/* +* Inherit from a parent prototype. +*/ +inherit( TextMark, Mark ); + +/** +* Constructor name. +* +* @private +* @name name +* @memberof TextMark +* @readonly +* @type {string} +*/ +setNonEnumerableReadOnly( TextMark, 'name', 'TextMark' ); + +/** +* Horizontal text alignment. +* +* @name align +* @memberof TextMark.prototype +* @type {string} +* @default 'left' +* +* @example +* var mark = new TextMark({ +* 'align': 'center' +* }); +* +* var v = mark.align; +* // returns 'center' +*/ +setReadWriteAccessor( TextMark.prototype, 'align', getAlign, setAlign ); + +/** +* Rotation angle in degrees. +* +* @name angle +* @memberof TextMark.prototype +* @type {number} +* @default 0 +* +* @example +* var mark = new TextMark({ +* 'angle': 45 +* }); +* +* var v = mark.angle; +* // returns 45 +*/ +setReadWriteAccessor( TextMark.prototype, 'angle', getAngle, setAngle ); + +/** +* Vertical text baseline. +* +* @name baseline +* @memberof TextMark.prototype +* @type {string} +* @default 'alphabetic' +* +* @example +* var mark = new TextMark({ +* 'baseline': 'middle' +* }); +* +* var v = mark.baseline; +* // returns 'middle' +*/ +setReadWriteAccessor( TextMark.prototype, 'baseline', getBaseline, setBaseline ); + +/** +* Text direction. +* +* @name dir +* @memberof TextMark.prototype +* @type {string} +* @default 'ltr' +* +* @example +* var mark = new TextMark({ +* 'dir': 'rtl' +* }); +* +* var v = mark.dir; +* // returns 'rtl' +*/ +setReadWriteAccessor( TextMark.prototype, 'dir', getDir, setDir ); + +/** +* Horizontal offset in pixels. +* +* @name dx +* @memberof TextMark.prototype +* @type {(number|void)} +* +* @example +* var mark = new TextMark({ +* 'dx': 10 +* }); +* +* var v = mark.dx; +* // returns 10 +*/ +setReadWriteAccessor( TextMark.prototype, 'dx', getDx, setDx ); + +/** +* Vertical offset in pixels. +* +* @name dy +* @memberof TextMark.prototype +* @type {(number|void)} +* +* @example +* var mark = new TextMark({ +* 'dy': 5 +* }); +* +* var v = mark.dy; +* // returns 5 +*/ +setReadWriteAccessor( TextMark.prototype, 'dy', getDy, setDy ); + +/** +* Ellipsis string for text truncation. +* +* @name ellipsis +* @memberof TextMark.prototype +* @type {string} +* @default '\u2026' +* +* @example +* var mark = new TextMark({ +* 'ellipsis': '...' +* }); +* +* var v = mark.ellipsis; +* // returns '...' +*/ +setReadWriteAccessor( TextMark.prototype, 'ellipsis', getEllipsis, setEllipsis ); + +/** +* Typeface. +* +* @name font +* @memberof TextMark.prototype +* @type {(string|void)} +* +* @example +* var mark = new TextMark({ +* 'font': 'Helvetica Neue' +* }); +* +* var v = mark.font; +* // returns 'Helvetica Neue' +*/ +setReadWriteAccessor( TextMark.prototype, 'font', getFont, setFont ); + +/** +* Font size in pixels. +* +* @name fontSize +* @memberof TextMark.prototype +* @type {(number|void)} +* +* @example +* var mark = new TextMark({ +* 'fontSize': 14 +* }); +* +* var v = mark.fontSize; +* // returns 14 +*/ +setReadWriteAccessor( TextMark.prototype, 'fontSize', getFontSize, setFontSize ); + +/** +* Font style. +* +* @name fontStyle +* @memberof TextMark.prototype +* @type {(string|void)} +* +* @example +* var mark = new TextMark({ +* 'fontStyle': 'italic' +* }); +* +* var v = mark.fontStyle; +* // returns 'italic' +*/ +setReadWriteAccessor( TextMark.prototype, 'fontStyle', getFontStyle, setFontStyle ); + +/** +* Font weight. +* +* @name fontWeight +* @memberof TextMark.prototype +* @type {(string|void)} +* +* @example +* var mark = new TextMark({ +* 'fontWeight': 'bold' +* }); +* +* var v = mark.fontWeight; +* // returns 'bold' +*/ +setReadWriteAccessor( TextMark.prototype, 'fontWeight', getFontWeight, setFontWeight ); + +/** +* Maximum length of the text mark in pixels. +* +* @name limit +* @memberof TextMark.prototype +* @type {NonNegativeNumber} +* @default 0 +* +* @example +* var mark = new TextMark({ +* 'limit': 100 +* }); +* +* var v = mark.limit; +* // returns 100 +*/ +setReadWriteAccessor( TextMark.prototype, 'limit', getLimit, setLimit ); + +/** +* Line break delimiter. +* +* @name lineBreak +* @memberof TextMark.prototype +* @type {(string|void)} +* +* @example +* var mark = new TextMark({ +* 'lineBreak': '\n' +* }); +* +* var v = mark.lineBreak; +* // returns '\n' +*/ +setReadWriteAccessor( TextMark.prototype, 'lineBreak', getLineBreak, setLineBreak ); + +/** +* Line height in pixels. +* +* @name lineHeight +* @memberof TextMark.prototype +* @type {(number|void)} +* +* @example +* var mark = new TextMark({ +* 'lineHeight': 20 +* }); +* +* var v = mark.lineHeight; +* // returns 20 +*/ +setReadWriteAccessor( TextMark.prototype, 'lineHeight', getLineHeight, setLineHeight ); + +/** +* Mark properties. +* +* @name properties +* @memberof TextMark.prototype +* @type {Array} +* +* @example +* var mark = new TextMark({}); +* +* var v = mark.properties; +* // returns [...] +*/ +setNonEnumerableReadOnlyAccessor( TextMark.prototype, 'properties', getProperties ); + +/** +* Polar coordinate radial offset in pixels. +* +* @name radius +* @memberof TextMark.prototype +* @type {number} +* @default 0 +* +* @example +* var mark = new TextMark({ +* 'radius': 50 +* }); +* +* var v = mark.radius; +* // returns 50 +*/ +setReadWriteAccessor( TextMark.prototype, 'radius', getRadius, setRadius ); + +/** +* Text to display. +* +* @name text +* @memberof TextMark.prototype +* @type {(string|Array|void)} +* +* @example +* var mark = new TextMark({ +* 'text': 'Hello, World!' +* }); +* +* var v = mark.text; +* // returns 'Hello, World!' +*/ +setReadWriteAccessor( TextMark.prototype, 'text', getText, setText ); + +/** +* Polar coordinate angle in radians. +* +* @name theta +* @memberof TextMark.prototype +* @type {number} +* @default 0 +* +* @example +* var mark = new TextMark({ +* 'theta': 1.5708 +* }); +* +* var v = mark.theta; +* // returns 1.5708 +*/ +setReadWriteAccessor( TextMark.prototype, 'theta', getTheta, setTheta ); + +/** +* Mark type. +* +* @name type +* @memberof TextMark.prototype +* @type {string} +* @default 'text' +* +* @example +* var mark = new TextMark({ +* 'align': 'center' +* }); +* +* var v = mark.type; +* // returns 'text' +*/ +setReadWriteAccessor( TextMark.prototype, 'type', getType, setType ); + +/** +* Serializes an instance to a JSON object. +* +* ## Notes +* +* - This method is implicitly invoked by `JSON.stringify`. +* +* @name toJSON +* @memberof TextMark.prototype +* @type {Function} +* @returns {Object} JSON object +* +* @example +* var mark = new TextMark({ +* 'align': 'center' +* }); +* +* var v = mark.toJSON(); +* // returns {...} +*/ +setNonEnumerableReadOnly( TextMark.prototype, 'toJSON', function toJSON() { + return instance2json( this, properties ); +}); + + +// EXPORTS // + +module.exports = TextMark; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/properties.json b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/properties.json new file mode 100644 index 000000000000..67ed9e921417 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/properties.json @@ -0,0 +1,35 @@ +[ + "aria", + "clip", + "description", + "encode", + "from", + "interactive", + "key", + "name", + "role", + "sort", + "style", + "transform", + "triggers", + "type", + "zindex", + + "align", + "angle", + "baseline", + "dir", + "dx", + "dy", + "ellipsis", + "font", + "fontSize", + "fontStyle", + "fontWeight", + "limit", + "lineBreak", + "lineHeight", + "radius", + "text", + "theta" +] diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/properties/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/properties/get.js new file mode 100644 index 000000000000..f3cbb28454ea --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/properties/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 properties = require( './../properties.json' ); + + +// MAIN // + +/** +* Returns the list of enumerable properties. +* +* @private +* @returns {Array} properties +*/ +function get() { + return properties.slice(); +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/radius/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/radius/get.js new file mode 100644 index 000000000000..38e7e7610d10 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/radius/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the polar coordinate radial offset in pixels. +* +* @private +* @returns {number} radial offset +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/radius/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/radius/properties.js new file mode 100644 index 000000000000..c13195ef22ea --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/radius/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'radius' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/radius/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/radius/set.js new file mode 100644 index 000000000000..42d1f4cbc6a6 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/radius/set.js @@ -0,0 +1,61 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the polar coordinate radial offset in pixels. +* +* @private +* @param {number} value - input value +* @throws {TypeError} must be a number +* @returns {void} +*/ +function set( value ) { + if ( !isNumber( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a number. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/text/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/text/get.js new file mode 100644 index 000000000000..40e98ab92c4e --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/text/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the text to display. +* +* @private +* @returns {(string|Array|void)} text +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/text/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/text/properties.js new file mode 100644 index 000000000000..77ba80709f52 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/text/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'text' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/text/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/text/set.js new file mode 100644 index 000000000000..43ecd8b4d9c4 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/text/set.js @@ -0,0 +1,68 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives; +var isUndefined = require( '@stdlib/assert/is-undefined' ); +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the text to display. +* +* ## Notes +* +* - Providing `undefined` "unsets" the configured value. +* - A string array specifies multiple lines of text. +* +* @private +* @param {(string|Array|void)} value - input value +* @throws {TypeError} must be a string or an array of strings +* @returns {void} +*/ +function set( value ) { + if ( !isUndefined( value ) && !isString( value ) && !isStringArray( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a string or an array of strings. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/theta/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/theta/get.js new file mode 100644 index 000000000000..c4f7043c5609 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/theta/get.js @@ -0,0 +1,43 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var prop = require( './properties.js' ); + + +// MAIN // + +/** +* Returns the polar coordinate angle in radians. +* +* @private +* @returns {number} polar coordinate angle +*/ +function get() { + return this[ prop.private ]; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/theta/properties.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/theta/properties.js new file mode 100644 index 000000000000..28964b68b26a --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/theta/properties.js @@ -0,0 +1,33 @@ +/** +* @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 property2object = require( '@stdlib/plot/vega/base/property2object' ); + + +// MAIN // + +var obj = property2object( 'theta' ); + + +// EXPORTS // + +module.exports = obj; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/theta/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/theta/set.js new file mode 100644 index 000000000000..1bf6242a5f59 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/theta/set.js @@ -0,0 +1,61 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var changeEvent = require( './../change_event.js' ); +var prop = require( './properties.js' ); + + +// VARIABLES // + +var debug = logger( 'vega:text-mark:set:'+prop.name ); + + +// MAIN // + +/** +* Sets the polar coordinate angle in radians. +* +* @private +* @param {number} value - input value +* @throws {TypeError} must be a number +* @returns {void} +*/ +function set( value ) { + if ( !isNumber( value ) ) { + throw new TypeError( format( 'invalid assignment. `%s` must be a number. Value: `%s`.', prop.name, value ) ); + } + if ( value !== this[ prop.private ] ) { + debug( 'Current value: %s. New value: %s.', this[ prop.private ], value ); + this[ prop.private ] = value; + this.emit( 'change', changeEvent( prop.name ) ); + } +} + + +// EXPORTS // + +module.exports = set; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/type/get.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/type/get.js new file mode 100644 index 000000000000..30b406e3dbe5 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/type/get.js @@ -0,0 +1,38 @@ +/** +* @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. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MAIN // + +/** +* Returns the mark type. +* +* @private +* @returns {string} mark type +*/ +function get() { + return this._type; +} + + +// EXPORTS // + +module.exports = get; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/lib/type/set.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/type/set.js new file mode 100644 index 000000000000..9e06599a5a16 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/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 mark type. +* +* @private +* @param {string} value - input value +* @throws {TypeError} must be a valid mark type +* @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/mark/text/lib/type/type.js b/lib/node_modules/@stdlib/plot/vega/mark/text/lib/type/type.js new file mode 100644 index 000000000000..cee6fc4c6796 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/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 = 'text'; diff --git a/lib/node_modules/@stdlib/plot/vega/mark/text/package.json b/lib/node_modules/@stdlib/plot/vega/mark/text/package.json new file mode 100644 index 000000000000..abd98b118852 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/mark/text/package.json @@ -0,0 +1,61 @@ +{ + "name": "@stdlib/plot/vega/mark/text", + "version": "0.0.0", + "description": "Text mark 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", + "mark", + "text", + "constructor", + "ctor" + ], + "__stdlib__": {} +}