Skip to content

feat!: refactor the stdlib plot API to build on top of Vega #7715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 267 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
267 commits
Select commit Hold shift + click to select a range
64b1f45
feat: add `plot/base/line2style2dasharray`
kgryte Jul 19, 2025
ca7b9fb
feat: add `plot/base/assert/is-line-style`
kgryte Jul 19, 2025
d594b02
feat: add initial `plot/vega/axis` implementation
kgryte Jul 19, 2025
65a4aaa
feat: add `plot/color-schemes-category10`
kgryte Jul 19, 2025
e68733e
feat: add `plot/color-schemes/category20`
kgryte Jul 19, 2025
5209655
docs: fix description
kgryte Jul 19, 2025
fa2bc23
docs: fix description
kgryte Jul 19, 2025
30ac387
feat: add `plot/color-schemes/category20b`
kgryte Jul 19, 2025
772fa1f
feat: add `plot/color-schemes/category20c`
kgryte Jul 19, 2025
593db5a
fix: ensure orientations are correctly matched with respective axes
kgryte Jul 19, 2025
91fcff1
feat: add `plot/vega/title-orientations`
kgryte Jul 19, 2025
df013b3
feat: add `plot/vega/base/assert/is-title-orientation`
kgryte Jul 19, 2025
30f0710
feat: add initial `plot/vega/title` implementation
kgryte Jul 19, 2025
8c6731f
fix: allow `undefined` for unsetting a configured value
kgryte Jul 19, 2025
78eda1c
feat: add `font` and `fontStyle` support
kgryte Jul 19, 2025
be69147
feat: add `plot/vega/anchor-positions`
kgryte Jul 19, 2025
9c428be
feat: add `vega/base/assert/is-anchor-position`
kgryte Jul 19, 2025
b362136
feat: add `plot/vega/vertical-baselines`
kgryte Jul 19, 2025
1979413
feat: add `plot/vega/base/assert/is-vertical-baseline`
kgryte Jul 19, 2025
c459f23
feat: add `align`, `anchor`, `angle`, and `baseline` support
kgryte Jul 19, 2025
7a07a80
style: reorder properties
kgryte Jul 19, 2025
5c8dcf1
docs: fix return types
kgryte Jul 19, 2025
906637c
feat: add `color`, `dx`, and `dy` support
kgryte Jul 19, 2025
9bb928a
feat: add `encode`, `fontSize`, and `fontWeight` support
kgryte Jul 19, 2025
079579a
feat: add `plot/vega/anchor-reference-frames`
kgryte Jul 19, 2025
7536a5e
feat: add `plot/vega/base/assert/is-anchor-reference-frame`
kgryte Jul 19, 2025
1ea66bd
feat: add `frame`, `limit`, `lineHeight`, `offset`, and `zindex` support
kgryte Jul 19, 2025
e0f794e
feat: add support for subtitle properties and fix text support
kgryte Jul 20, 2025
827446d
refactor: add logging
kgryte Jul 20, 2025
644f973
docs: add minimal example
kgryte Jul 20, 2025
7eca115
feat: add `plot/vega/scale-range-defaults`
kgryte Jul 20, 2025
d166d5c
feat: add `plot/vega/base/assert/is-scale-range-default`
kgryte Jul 20, 2025
039089b
feat: add `plot/vega/scale-range-interpolation-methods`
kgryte Jul 20, 2025
aebf0cd
feat: add `plot/vega/base/assert/is-scale-range-interpolation-method`
kgryte Jul 20, 2025
d650caf
feat: add initial `plot/vega/scale` implementation
kgryte Jul 20, 2025
aa3945e
fix: allow for inheritance
kgryte Jul 20, 2025
a4c902f
fix: allow for inheritance
kgryte Jul 20, 2025
78900f1
fix: allow for inheritance
kgryte Jul 20, 2025
92cb7e7
feat: add vendored Vega transpiled to ES5
kgryte Jul 20, 2025
92bcbbb
refactor!: move utilities to "base" namespace
kgryte Jul 20, 2025
b93d13e
refactor!: move utility to "base" namespace
kgryte Jul 20, 2025
a2eec29
feat: add initial `plot/vega/scale-quantitative` implementation
kgryte Jul 20, 2025
6167978
feat: add initial `plot/vega/scale-linear` implementation
kgryte Jul 20, 2025
7e6a1d8
refactor: guard against scale type mutation
kgryte Jul 20, 2025
4dd9528
refactor: avoid duplicate strings
kgryte Jul 20, 2025
9f71c23
refactor: avoid string duplication
kgryte Jul 20, 2025
8768842
feat: add `plot/vega/base/spec2svg` initial implementation
kgryte Jul 20, 2025
7a1d8ae
feat: add support for return scales of a specified kind
kgryte Jul 20, 2025
888d647
feat: add `plot/vega/base/assert/is-quantitative-scale-name`
kgryte Jul 20, 2025
9b01726
refactor!: rename package
kgryte Jul 20, 2025
aadf366
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into re…
kgryte Jul 20, 2025
31a608d
refactor: ensure only quantitative scale types are allowed
kgryte Jul 20, 2025
ec929c5
test: fix broken test
kgryte Jul 20, 2025
b05e2f3
feat: add `plot/vega/visualization` initial implementation
kgryte Jul 20, 2025
a0cd270
docs: explicitly document Signal instances
kgryte Jul 20, 2025
5df829b
docs: explicitly document Signal instances
kgryte Jul 20, 2025
2c298b1
feat: add constructor names
kgryte Jul 20, 2025
f3550b0
feat: add `plot/vega/base/assert/is-title`
kgryte Jul 20, 2025
fcd7110
refactor: improve heuristic
kgryte Jul 20, 2025
ff27ea2
feat: add `plot/vega/base/assert/is-scale`
kgryte Jul 20, 2025
19846e3
feat: add `plot/vega/base/assert/is-quantitative-scale`
kgryte Jul 20, 2025
f10a489
feat: add `plot/vega/base/assert/is-axis`
kgryte Jul 20, 2025
2422b27
feat: add `title` support
kgryte Jul 20, 2025
a8aa1fb
test: fix broken test
kgryte Jul 20, 2025
bbdef84
feat: add `plot/vega/base/assert/is-scale-array`
kgryte Jul 20, 2025
b86c909
feat: add `plot/vega/base/assert/is-axis-array`
kgryte Jul 20, 2025
fe91fd1
bench: fix import path
kgryte Jul 20, 2025
335e580
feat: add support for `axes` and `scales`
kgryte Jul 20, 2025
e28f414
refactor: normalize axis title and fix JSON serialization logic
kgryte Jul 20, 2025
feb422b
refactor: update default
kgryte Jul 20, 2025
55543af
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into re…
kgryte Jul 21, 2025
e444acf
refactor!: rename packages
kgryte Jul 21, 2025
11efee3
refactor: simplify call signature
kgryte Jul 21, 2025
27b2ebc
feat: add `plot/vega/named-scale` and `plot/vega/x-scale` implementat…
kgryte Jul 22, 2025
457fe04
feat: add `plot/vega/y-scale` initial implementation
kgryte Jul 22, 2025
a6d9051
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into re…
kgryte Jul 22, 2025
4f2edc7
feat: add `plot/vega/named-quantitative-scale` initial implementation
kgryte Jul 22, 2025
3600068
feat: add `plot/vega/x-quantitative-scale` initial implementation
kgryte Jul 22, 2025
9cf1ff6
feat: add `plot/vega/y-quantitative-scale` initial implementation
kgryte Jul 22, 2025
64e8a99
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into re…
kgryte Jul 22, 2025
3fee091
feat: add `plot/vega/base/autosize-types`
kgryte Jul 22, 2025
625db48
feat: add `plot/vega/base/assert/is-autosize-type`
kgryte Jul 22, 2025
7390563
feat: add `plot/vega/autosize` initial implementation
kgryte Jul 22, 2025
7d751a4
docs: update comments to reduce copy-paste errors
kgryte Jul 22, 2025
ca6a6c6
feat: add `plot/vega/base/assert/is-autosize`
kgryte Jul 22, 2025
d92a00c
feat: add `plot/vega/padding` initial implementation
kgryte Jul 22, 2025
2827f8a
feat: add `plot/vega/base/assert/is-padding`
kgryte Jul 22, 2025
399e924
feat: add `autosize` and `padding` support
kgryte Jul 22, 2025
d91fe61
docs: reduce risk of copy-paste mistakes
kgryte Jul 22, 2025
55fb37c
refactor: allow title `text` field to be optional
kgryte Jul 22, 2025
143ac44
fix: use correct field
kgryte Jul 22, 2025
3e2dfaf
feat: add initial `plot/base/view` implementation
kgryte Jul 23, 2025
7ab078a
feat: add stubs for remaining properties
kgryte Jul 23, 2025
04656cd
feat: add `$schema` property
kgryte Jul 23, 2025
c9d2906
refactor: ensure all properties have defaults and disallow `undefined`
kgryte Jul 23, 2025
58533d5
remove: remove `plot/base/ctor`
kgryte Jul 23, 2025
1771c47
feat: add `background` support
kgryte Jul 23, 2025
c25b8e8
feat: add initial `plot/charts/base/ctor` implementation
kgryte Jul 23, 2025
1700018
refactor: add missing `break`
kgryte Jul 24, 2025
36f2970
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into re…
kgryte Jul 24, 2025
06b7301
chore: update copyright years
kgryte Jul 24, 2025
30f2c11
refactor: add padding defaults and remove parent method override
kgryte Jul 24, 2025
b269d9e
feat: add initial `plot/charts/base/quantitative` implementation
kgryte Jul 24, 2025
e835bf4
feat: add initial `plot/vega/base/to-json` implementation
kgryte Jul 25, 2025
c969262
feat: add initial `plot/vega/base/transform-validation-message` imple…
kgryte Jul 25, 2025
30c6108
refactor: emit change object and use utilities
kgryte Jul 25, 2025
45dfa8e
feat: add initial `plot/vega/base/property2object` implementation
kgryte Jul 25, 2025
2f21ffb
refactor: reduce copy-paste errors by consolidating property names
kgryte Jul 25, 2025
0a2a5b3
refactor: use properties object and use utilities
kgryte Jul 25, 2025
58e419b
refactor: use properties object and use utilities
kgryte Jul 25, 2025
572f199
refactor: use properties object and use utilities
kgryte Jul 25, 2025
206f511
refactor: use properties object and use utilities
kgryte Jul 25, 2025
1d341c0
refactor: use properties object and use utilities
kgryte Jul 25, 2025
aca2d21
refactor: use property object and use utilities
kgryte Jul 25, 2025
f9a880c
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into re…
kgryte Jul 25, 2025
a64de32
feat: add initial `plot/vega/log-scale` implementation
kgryte Jul 25, 2025
e7bbc62
fix: update log namespace
kgryte Jul 25, 2025
2317160
feat: add initial `plot/vega/power-scale` implementation
kgryte Jul 25, 2025
fe5959a
feat: add initial `plot/vega/sqrt-scale` implementation
kgryte Jul 25, 2025
e8fff4d
docs: update description
kgryte Jul 25, 2025
f63458d
fix: ensure correct JSON serialization
kgryte Jul 25, 2025
cb301ea
fix: ensure correct JSON serialization
kgryte Jul 25, 2025
5c7a3fc
refactor: allow non-plain objects
kgryte Jul 25, 2025
9314600
refactor: allow non-plain objects
kgryte Jul 25, 2025
dce8a0d
refactor: allow non-plain objects
kgryte Jul 25, 2025
770c58a
refactor: allow non-plain objects
kgryte Jul 25, 2025
a8e2a23
refactor: allow non-plain objects
kgryte Jul 25, 2025
13e6e8c
fix: ensure correct JSON serialization
kgryte Jul 25, 2025
2ef5e06
refactor: allow non-plain objects
kgryte Jul 25, 2025
308a175
fix: ensure correct JSON serialization
kgryte Jul 25, 2025
b4481d3
refactor: allow non-plain objects
kgryte Jul 25, 2025
003656f
refactor: allow non-plain objects
kgryte Jul 25, 2025
7085304
refactor: allow non-plain objects
kgryte Jul 25, 2025
e260ceb
docs: order options in alphabetical order
kgryte Jul 25, 2025
389e289
feat: add initial `plot/vega/symmetric-log-scale` implementation
kgryte Jul 25, 2025
4d46474
feat: add initial `plot/vega/time-scale` implementation
kgryte Jul 25, 2025
fd41f5e
docs: fix supported types
kgryte Jul 25, 2025
962a6b4
feat: add initial `plot/vega/utc-scale` implementation
kgryte Jul 25, 2025
523d6f9
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into re…
kgryte Jul 25, 2025
a943492
fix: ensure private properties are always set
kgryte Jul 25, 2025
9c5c794
feat: add initial `plot/vega/scale-ctors` implementation
kgryte Jul 25, 2025
69b30dd
refactor!: require providing a default scale type and return a typed …
kgryte Jul 25, 2025
cb1e4be
refactor!: switch argument order and always return a scale of a parti…
kgryte Jul 25, 2025
12c5472
remove: remove `plot/vega/x-quantitative-scale`
kgryte Jul 25, 2025
a65cee5
remove: remove `plot/vega/y-quantitative-scale`
kgryte Jul 25, 2025
b1b05ab
feat: add initial `plot/vega/x-linear-scale` implementation
kgryte Jul 25, 2025
b110d85
feat: add initial `plot/vega/y-linear-scale` implementation
kgryte Jul 25, 2025
e60c56e
remove: remove `plot/vega/x-scale`
kgryte Jul 25, 2025
12b7057
remove: remove `plot/vega/y-scale`
kgryte Jul 25, 2025
6cc6a72
remove: remove `plot/vega/named-quantitative-scale`
kgryte Jul 25, 2025
b4bb7cc
feat: add a `properties` property for resolving the list of component…
kgryte Jul 25, 2025
fe56d73
feat: add `plot/vega/base/assert/is-scale-name-array`
kgryte Jul 25, 2025
3c1f3f3
docs: update description
kgryte Jul 25, 2025
5992440
docs: update description
kgryte Jul 25, 2025
2a13b22
docs: update description
kgryte Jul 25, 2025
284d152
feat: add initial `plot/vega/generalized-scale` implementation
kgryte Jul 26, 2025
c775292
feat: add initial `plot/vega/x-quantitative-scale` implementation
kgryte Jul 26, 2025
07b098b
feat: add initial `plot/vega/y-quantitative-scale` implementation
kgryte Jul 26, 2025
800ccfb
fix: ensure thrown error is informative
kgryte Jul 26, 2025
a3366ad
fix: update error message
kgryte Jul 26, 2025
17cc106
feat: add initial `plot/vega/ordinal-scale` implementation
kgryte Jul 26, 2025
18a1b98
feat: add `plot/vega/scale/base/ctor`
kgryte Jul 26, 2025
8f05bf4
refactor: update require paths
kgryte Jul 26, 2025
ff9d087
remove: remove `plot/vega/scale`
kgryte Jul 26, 2025
3cf3599
feat: add `plot/vega/scale/*` packages
kgryte Jul 26, 2025
deb5e6b
refactor: update paths
kgryte Jul 26, 2025
30e2b96
remove: remove top-level scale packages in favor of `plot/vega/scale/*`
kgryte Jul 26, 2025
0c28df6
feat: add `plot/vega/scale/names`
kgryte Jul 26, 2025
1c3a300
refactor: update require paths
kgryte Jul 26, 2025
da1a158
remove: remove `plot/vega/base/scales` in favor of `plot/vega/scale/n…
kgryte Jul 26, 2025
619c628
feat: add `plot/vega/scale/base/range-defaults`
kgryte Jul 26, 2025
bfb3e8d
refactor: update paths
kgryte Jul 26, 2025
0ff2b84
remove: remove `plot/vega/base/scale-range-defaults` in favor of `plo…
kgryte Jul 26, 2025
7a5c7ab
feat: add `plot/vega/scale/base/range-interpolation-methods`
kgryte Jul 26, 2025
28527fb
refactor: update paths
kgryte Jul 26, 2025
b5d08d5
remove: remove `plot/vega/base/scale-range-interpolation-methods` in …
kgryte Jul 26, 2025
d89ac19
feat: add `plot/vega/axis/ctor`
kgryte Jul 26, 2025
0863784
refactor: update paths
kgryte Jul 26, 2025
f1631cd
remove: remove `plot/vega/axis` in favor of `plot/vega/axis/ctor`
kgryte Jul 26, 2025
a77bc21
feat: add `plot/vega/axis/orientations`
kgryte Jul 26, 2025
b9d7ef6
refactor: update paths
kgryte Jul 26, 2025
8439c13
remove: remove `plot/vega/base/axis-orientations` in favor of `plot/v…
kgryte Jul 26, 2025
a454a56
feat: add `plot/vega/axis/x-orientations`
kgryte Jul 26, 2025
c3e608e
refactor: update paths
kgryte Jul 26, 2025
3222be8
remove: remove `plot/vega/base/x-axis-orientations` in favor of `plot…
kgryte Jul 26, 2025
7e4a6b8
feat: add `plot/vega/axis/y-orientations`
kgryte Jul 26, 2025
54c75a3
refactor: update paths
kgryte Jul 26, 2025
dee68ab
remove: remove `plot/vega/base/y-axis-orientations` in favor of `plot…
kgryte Jul 26, 2025
6f5aabe
feat: add `plot/vega/builder`
kgryte Jul 26, 2025
345d63c
refactor: update require path
kgryte Jul 26, 2025
43f7f03
remove: remove `plot/vega/visualization` in favor of `plot/vega/builder`
kgryte Jul 26, 2025
47d9e43
feat: add `plot/vega/autosize/ctor`
kgryte Jul 26, 2025
aa662ab
refactor: update paths
kgryte Jul 26, 2025
60ed1d6
refactor: update paths
kgryte Jul 26, 2025
f24eb0b
remove: remove `plot/vega/autosize` in favor of `plot/vega/autosize/c…
kgryte Jul 26, 2025
01e9565
feat: add `plot/vega/autosize/methods`
kgryte Jul 26, 2025
05de4a0
refactor: update paths and variable names
kgryte Jul 26, 2025
fe12167
remove: remove `plot/vega/base/autosize-size` in favor of `plot/vega/…
kgryte Jul 26, 2025
56800a0
feat: add `plot/vega/base/assert/is-autosize-method`
kgryte Jul 26, 2025
efc6d67
refactor: update paths
kgryte Jul 26, 2025
81bc529
remove: remove `plot/vega/base/assert/is-autosize-type` in favor of `…
kgryte Jul 26, 2025
0a3af3d
feat: add `plot/vega/title/ctor`
kgryte Jul 26, 2025
32444c5
refactor: update paths
kgryte Jul 26, 2025
2f2342b
remove: remove `plot/vega/title` in favor of `plot/vega/title/ctor`
kgryte Jul 26, 2025
66ec691
feat: add `plot/vega/title/orientations`
kgryte Jul 26, 2025
47a2621
refactor: update paths
kgryte Jul 26, 2025
2d3bb17
remove: remove `plot/vega/base/title-orientations` in favor of `plot/…
kgryte Jul 26, 2025
255b793
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into re…
kgryte Jul 26, 2025
104d03d
feat: add `plot/vega/padding/ctor`
kgryte Jul 26, 2025
c0399a0
refactor: update paths
kgryte Jul 26, 2025
aeb9b54
remove: remove `plot/vega/padding` in favor of `plot/vega/padding/ctor`
kgryte Jul 26, 2025
99c6d7d
refactor: update logging namespace
kgryte Jul 26, 2025
69df71a
feat: add initial `plot/vega/trigger` implementation
kgryte Jul 28, 2025
cd2d5be
fix: add missing `index.js` file
kgryte Jul 28, 2025
ba9a3e8
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into re…
kgryte Jul 28, 2025
bcb6f23
feat: add `plot/vega/base/assert/is-trigger`
kgryte Jul 28, 2025
acbb3cb
feat: add `plot/vega/base/assert/is-trigger-array`
kgryte Jul 28, 2025
b1e2f0a
feat: add initial `plot/vega/data/base/ctor` implementation
kgryte Jul 28, 2025
1dab157
feat: add initial `plot/vega/data/values` implementation
kgryte Jul 28, 2025
b6b39d7
refactor: use utility
kgryte Jul 28, 2025
db0d9ec
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into re…
kgryte Jul 28, 2025
4998263
fix: add missing `toJSON` method
kgryte Jul 28, 2025
23d0eda
fix: avoid explicit serialization of inlined values
kgryte Jul 28, 2025
f220119
feat: add initial `plot/vega/data/tidy/from-array` implementation
kgryte Jul 28, 2025
4974627
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into re…
kgryte Jul 28, 2025
9ceb3c1
docs: update description
kgryte Jul 28, 2025
e3d18a5
feat: add initial `plot/vega/data/tidy/from-nested-array` implementation
kgryte Jul 28, 2025
8359111
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into re…
kgryte Jul 29, 2025
5fef203
feat: add initial `plot/vega/tidy/from-arrays` implementation
kgryte Jul 29, 2025
72d2f44
feat: add initial `plot/vega/tidy/from-object-array` implementation
kgryte Jul 29, 2025
c4bc0f3
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into re…
kgryte Jul 29, 2025
44db454
feat: add initial `plot/vega/data/tidy/from-vectors` implementation
kgryte Jul 29, 2025
2a866dc
feat: add initial `plot/vega/data/type/from-vector` implementation
kgryte Jul 29, 2025
4c02999
refactor: allow the `mapping` argument to be optional
kgryte Jul 29, 2025
3279352
feat: add initial `plot/vega/data/tidy/split-on-key` implementation
kgryte Jul 29, 2025
8d39305
refactor!: update to accept a `DataSet` rather than an array of objects
kgryte Jul 29, 2025
3c4fc87
feat: add initial `plot/vega/data/tidy/from-matrix-columns` implement…
kgryte Jul 29, 2025
a81936f
chore: add TODOs
kgryte Jul 29, 2025
f4f234f
feat: add initial `plot/vega/data/tidy/from-nested-arrays` implementa…
kgryte Jul 29, 2025
b2ec9b1
feat: add initial `plot/vega/data/tidy/from-object-arrays` implementa…
kgryte Jul 29, 2025
6e4efd4
feat: add initial `plot/vega/data/tidy/from-paired-arrays` implementa…
kgryte Jul 29, 2025
8c4e426
feat: add initial `plot/vega/data/tidy/from-paired-vectors` implement…
kgryte Jul 29, 2025
c453a88
feat: add initial `plot/vega/data/tidy/from-paired-matrix-columns` im…
kgryte Jul 29, 2025
83511dc
feat: add initial `plot/vega/data/tidy/from-xy-arguments` implementation
kgryte Jul 31, 2025
c86bbc5
refactor: update argument handling and add support for `labels`
kgryte Jul 31, 2025
913e3b7
docs: update data types
kgryte Jul 31, 2025
908b7df
feat: add `plot/vega/base/assert/is-dataset`
kgryte Aug 1, 2025
1d10ed4
feat: add `plot/vega/base/assert/is-dataset-array`
kgryte Aug 1, 2025
6bc24cc
feat: add support for getting and setting data and add shorthand prop…
kgryte Aug 1, 2025
d4a0d8b
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into re…
kgryte Aug 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
119 changes: 119 additions & 0 deletions lib/node_modules/@stdlib/plot/base/assert/is-line-style/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<!--

@license Apache-2.0

Copyright (c) 2025 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.

-->

# isLineStyle

> Test if an input value is a supported [line style][@stdlib/plot/base/line-styles].

<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

<section class="intro">

</section>

<!-- /.intro -->

<!-- Package usage documentation. -->

<section class="usage">

## Usage

```javascript
var isLineStyle = require( '@stdlib/plot/base/assert/is-line-style' );
```

#### isLineStyle( value )

Tests if an input value is a supported [line style][@stdlib/plot/base/line-styles].

```javascript
var bool = isLineStyle( '-' );
// returns true

bool = isLineStyle( 'foo' );
// returns false
```

</section>

<!-- /.usage -->

<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="notes">

</section>

<!-- /.notes -->

<!-- Package usage examples. -->

<section class="examples">

## Examples

<!-- eslint no-undef: "error" -->

```javascript
var isLineStyle = require( '@stdlib/plot/base/assert/is-line-style' );

var bool = isLineStyle( '-' );
// returns true

bool = isLineStyle( '--' );
// returns true

bool = isLineStyle( '' );
// returns false

bool = isLineStyle( 'foo' );
// returns false
```

</section>

<!-- /.examples -->

<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="references">

</section>

<!-- /.references -->

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

<section class="related">

</section>

<!-- /.related -->

<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="links">

[@stdlib/plot/base/line-styles]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/plot/base/line-styles

</section>

<!-- /.links -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2025 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var bench = require( '@stdlib/bench' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var pkg = require( './../package.json' ).name;
var isLineStyle = require( './../lib' );


// MAIN //

bench( pkg, function benchmark( b ) {
var values;
var out;
var v;
var i;

values = [
'-',
'--',

'foo',
'bar',
'',
'beep',
'boop'
];

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
v = values[ i%values.length ];
out = isLineStyle( v );
if ( typeof out !== 'boolean' ) {
b.fail( 'should return a boolean' );
}
}
b.toc();
if ( !isBoolean( out ) ) {
b.fail( 'should return a boolean' );
}
b.pass( 'benchmark finished' );
b.end();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

{{alias}}( value )
Tests if an input value is a supported line style.

Parameters
----------
value: any
Value to test.

Returns
-------
bool: boolean
Boolean indicating if an input value is a supported line style.

Examples
--------
> var bool = {{alias}}( '-' )
true
> bool = {{alias}}( '--' )
true
> bool = {{alias}}( '' )
false
> bool = {{alias}}( 'beep' )
false

See Also
--------

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* @license Apache-2.0
*
* Copyright (c) 2025 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// TypeScript Version: 4.1

/**
* Tests whether an input value is a supported line style.
*
* @param v - value to test
* @returns boolean indicating whether an input value is a supported line style
*
* @example
* var bool = isLineStyle( '-' );
* // returns true
*
* bool = isLineStyle( '--' );
* // returns true
*
* bool = isLineStyle( 'bar' );
* // returns false
*
* bool = isLineStyle( 'foo' );
* // returns false
*/
declare function isLineStyle( v: any ): boolean;

Check warning on line 40 in lib/node_modules/@stdlib/plot/base/assert/is-line-style/docs/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type


// EXPORTS //

export = isLineStyle;
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* @license Apache-2.0
*
* Copyright (c) 2025 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import isLineStyle = require( './index' );


// TESTS //

// The function returns a boolean...
{
isLineStyle( '--' ); // $ExpectType boolean
isLineStyle( 'foo' ); // $ExpectType boolean
}

// The compiler throws an error if the function is provided an unsupported number of arguments...
{
isLineStyle(); // $ExpectError
isLineStyle( undefined, 123 ); // $ExpectError
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2025 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 isLineStyle = require( './../lib' );

var bool = isLineStyle( '-' );
console.log( bool );
// => true

bool = isLineStyle( '--' );
console.log( bool );
// => true

bool = isLineStyle( '' );
console.log( bool );
// => false

bool = isLineStyle( 'foo' );
console.log( bool );
// => false
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2025 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';

/**
* Test whether an input value is a supported line style.
*
* @module @stdlib/plot/base/assert/is-line-style
*
* @example
* var isLineStyle = require( '@stdlib/plot/base/assert/is-line-style' );
*
* var bool = isLineStyle( '-' );
* // returns true
*
* bool = isLineStyle( '--' );
* // returns true
*
* bool = isLineStyle( 'bar' );
* // returns false
*
* bool = isLineStyle( 'foo' );
* // returns false
*/

// MODULES //

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


// EXPORTS //

module.exports = main;
Loading
Loading